Skip to content
generated from agdturner/ccg-v2d

A modularised Java Euclidean (3D) geometry library.

License

Notifications You must be signed in to change notification settings

agdturner/ccg-v3d

Repository files navigation

Description

A modular three-dimensional (3D) Euclidean geometry Java library.

There are two main implementations in the library that are distinguished by the type of numbers used for calculations and to represent coordinates:

  1. Coordinates and calculations using Java double precision primitive numbers.
  2. Coordinates and calculations using a combination of BigRational and Math_BigRationalSqrt numbers.

Vectors are defined using cartesian coordinates with orthogonal X, Y and Z axes that meet at the origin - a point <x,y,z> where x=y=z=0. Geometry based on coordinates stored as Java double precision numbers typically use a small tollerance value (epsilon) to evaluate whether two vectors are the same. The accuracy of this geometry is variable which is due to the nature of floating point arithmetic. Coordinates stored using Math_BigRationalSqrt can have non-rational square root values and calculation can be done with these where the user can specify the Order of Magnitude (OOM) of the precision desired.

The coordinate system is "right handed", so: if X increases to the right of this page; and, Y increases towards the top of this page, then Z increases out from the page, (see Orientation and the note on the choice of right over left handedness for details of why this handedness was chosen.

The original intention was for this library to support large scale Earth Science applications.

The development of the library is aided by ccg-r3d - a rendering library for visualising 3D spatial geometry.

Details

Lightweight Geometry

Heavyweight Geometry

Geometry collections

  • There are rudimentary classes for: collections of collinear and coplanar points and line segments; Rectangle, coplanar convex hulls and polygon; coplanar and non-coplanar triangles; and tetrahedrons.

Development plans and progress

  • Translating (moving) geometries to new locations is supported.
  • Rotating geometries is supported.
  • Scaling and warping geometries is not yet supported.
  • Apache Commons Geometry (see also: Apache Commons Geometry GitHub Repository) appears to be developing some similar arbitrary precision geometrical functionality...
  • Intersections -- It would be useful to be able to distinguish between geometries that touch at a point, along a line or line_segment or over an area; and those that overlap (all or part of) another geometry. -- Geometry intersections calculations for triangular or simpler geometries are supported. -- Implementations of methods to calculate the intersection between tetrahedrons and simpler geometries are wanted.
  • Distances -- There are methods for calculating the minimum distance between geometries including triangles and simpler geometries. -- Implementations of methods to calulate distances between tetrahedrons and simpler geometries are wanted.
  • New geometries are wanted for surfaces.
  • Surface Areas, Perimeters and Volumes -- For some shapes there are implementations of methods for calculating these.

Contributions and collaboration

  • Please submit issues.

LICENCE

Acknowledgements and thanks

  • The University of Leeds and externally funded research projects supported the development of some of the library dependencies.
  • Thank you Eric for the BigMath library.

Notes

For a solar system model or a model of Earth, it is probably best to set the origin at the centre of mass (CoM).

Handedness

Handedness or chirality concerns the assignment of coordinate axes/directions. The choice of left-handed or right-handed is somewhat arbitrary, but this library uses a right-handed system as is more commonly used in much of geography and physics (video). Originally the library began using a left-handed system based on the logic of vertical viewing screens, graphs and zooming in and out by the viewer moving closer and further away from the screen.

Projections

References

Similar software for review

  • VTK-m - README - VTK-m GitHub Mirror
    • Languages: C/C++.
    • Uses floating point for the coordinate system.
  • VisIt
    • Open Source, interactive, scalable, visualization, animation and analysis tool.
    • Languages: C 75.8%, C++ 12.8%, Python 3.8%, Java 3.0%
    • Github repository
  • Fides
    • Fides enables complex scientific workflows to seamlessly integrate simulation and visualization. This is done by providing a data model in JSON that describes the mesh and fields in the data to be read. Using this data model, Fides maps ADIOS2 data arrays (from files or streams) to VTK-m datasets, enabling visualization of the data using shared- and distributed-memory parallel algorithms.
    • Can be used with Paraview
  • ParaView
    • Open source post-processing visualization engine.
    • Uses VTK - an open-source, freely available software system for 3D computer graphics, modeling, image processing, volume rendering, scientific visualization, and 2D plotting - VTK GitHub Mirror

About

A modularised Java Euclidean (3D) geometry library.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages