agdturner / ccg-v3d

A modularised Java Euclidean (3D) geometry library.
Apache License 2.0
3 stars 1 forks source link

ccg-v3d

Description

A three-dimensional (3D) Euclidean geometry Java library. The library is modularised, based on openJDK 17, and has very few lightweight dependencies.

Point positions in space 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. Coordinates are either stored as BigRational numbers - a subset of rational numbers, or Math_BigRationalSqrt - that also support non-rational square roots. With these numbers, the precision of calculations is done to a user specified Order of Magnitude (OOM). Additionally, coordinates can also be stored in IEEE double precision and calculations are done as precisely as this allows often requiring an epsilon (a small value) to be specified to determine whether two vectors are the same or whether an intersection occurs.

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. This library is being developed to support large scale Earth Science applications, but may have other uses. Notes about the cartesian origin, and projections are also provided below.

Supporting both IEEE double precision floating point and more arbitrary precision numbers could be useful for exploring precision issues.

Latest versioned releases

<!-- https://mvnrepository.com/artifact/io.github.agdturner/ccg-v3d -->
<dependency>
    <groupId>io.github.agdturner</groupId>
    <artifactId>ccg-v3d</artifactId>
    <version>0.19</version>
</dependency>

JAR

<!-- https://mvnrepository.com/artifact/io.github.agdturner/ccg-v3d -->
<dependency>
    <groupId>io.github.agdturner</groupId>
    <artifactId>ccg-v3d</artifactId>
    <version>0.20-SNAPSHOT</version>
</dependency>

Sonatype SNAPSHOT Directory

Getting Started

Please fork the repository and create a clone. Using Maven is recommended (and your favourite Integrated Development Environment). The unit tests show how the library might be used for calculating things like the intersection of two geometries, or the minimum distance between two geometries. Another entry point is ccg-r3d - a rendering library for geometry visualisation.

Details

Lightweight Geometry

Geometry collections

Development plans and progress

Origins

The library began development in March 2020. The original idea was to create a simple gravitational model of our solar system and learn more about 3D modelling and to also think about how to calculate the volumes of ice on Earth.

Summary of changes

0.16 to 0.20

Changed to use BigRational directly and Math_BigRational for aditional arithmetic.

0.15 to 0.16

Contributions and supporting users

LICENCE

Acknowledgements and thanks

Notes

origin

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