This library consists of two folders. The idea is that one is for testing purposes and the other folder is the folder you drag into your project.
Make sure all input coordinates are normalized to range 0-1 to avoid floating point precision issues! Normalizing methods exists in HelpMethods. This is not always needed but if you notice that an algorithm doesn't work, try to normalize the input coordinates.
Some of these algorithms are available in tutorial form here: https://www.habrador.com/tutorials/math/
Point-triangle
Point-polygon. Suffers from floating point precision issues
Triangle-triangle
AABB-AABB
Line-line
Ray-plane
Line-plane
Plane-plane
Point-circle
Grid mesh
Mesh shapes: Arrow, circles, lines
*Jarvis March. Is also known as "Gift wrapping"
Triangulate convex polygon. Is working with colinear points
Triangulate points with "visible edge" algorithm. Is maybe working with colinear points
Triangulate points with "point-by-point" algorithm. Is working with colinear points (because Triangulate convex polygon is working with colinear points)
"point-by-point" method
"flip edges" method
Constrained triangulation
From a Delaunay triangulation
Greiner-Hormann method
Sutherland-Hodgman method
Is a triangle oriented clockwise?
Is a point left, on, or right of vector?
Is a point left, on, or right of a plane? Which is the same as the distance to the plane.
Is a quadrilateral convex?
Is a point between two other points on the same line?
Closest point on a line-segment?
- Dynamic constrained delaunay triangulation
- Convex hull: Quickhull from the Valve paper
- Convex hull: Graham scan
- Marching cubes
- Cut 3d mesh with plane
- Metaballs
- Voronoi with Fortune's algorithm
- Voronoi point-by-point
- Triangulation concave polygon by ear clipping
- Rectangle-rectangle with SAT
- Triangulate with marching squares
- Optimize Constrained Delaunay - there's a faster method to find edges that intersects with the constrained edge. I also think the method where triangles within the constrain is removed can be faster.
Follow me on Twitter for more Unity stuff: https://twitter.com/eriknordeus