Home

Awesome

geometry4Sharp

Open-Source (Boost-license) C# library for geometric computing.

geometry4Sharp is a fork of geometry3sharp

[A Nuget Package is not aviable yet] . This package will be updated from the main branch.

Questions? Contact New Wheel Techology @NewWheelTech)

Credits

Ryan Schmidt for the orginal geometry3sharp @rms80

Many, many data structures and algorithms have been ported from the WildMagic5 and GTEngine C++ libraries, which are developed by David Eberly at Geometric Tools. WildMagic5 and GTEngine are distributed under the Boost license as well, available here. Any errors in code marked as ported from WildMagic5/GTEngine are most certainly ours!

The MeshSignedDistanceGrid class was implemented based on the C++ SDFGen code written by Christopher Batty and Robert Bridson.

Main Classes

Core

Math

Approximation

Solvers

Color

Distance Queries

Intersection Queries

Containment

Meshes

Mesh Selections

Mesh Operations

Spatial Data Structures

2D Curves

2D Computational Geometry

3D Curves

3D Solids

I/O

Misc

Unity Interop

geometry3Sharp supports transparent conversion with Unity types. To enable this, define G3_USING_UNITY in your Unity project, by adding this string to the Scripting Define Symbols box in the Player Settings.

Once enabled, code like this will work transparently:

Vector3 unityVec;
Vector3f g3Vec;
unityVec = g3vec;
g3vec = unityVec;

float->double types will work transparently, while double->float will require an explicit cast:

Vector3d g3vecd;
g3vecd = gameObject.transform.position;
gameObject.transform.position = (Vector3)g3vecd;

This will work for Vector2, Vector3, Quaterion, Ray, Color, and Bounds (w/ AxisAlignedBox3f) Note that these conversions will not work for equations, so to add a Vector3f and a Vector3, you will need to explicitly cast one to the other.