Skip to main content

Module functions

Module functions 

Source
Expand description

Auto-generated module

🤖 Generated with SplitRS

Functions§

add3
Add two 3D vectors.
art_gallery_greedy
Greedy vertex-guard approximation for the art gallery problem.
ccw
Test if three 2D points are in counter-clockwise orientation.
check_full_coverage
Check if every vertex of a polygon is covered by the given set of guards.
circumcircle_2d
Circumcircle of three 2D points. Returns (center, radius²) or None if degenerate.
clip_polygon_by_edge
Clip a polygon against an infinite half-plane defined by the directed edge from edge_a to edge_b (the inside is to the left).
collinear
Test if three 2D points are collinear (within tolerance).
convex_hull_2d
Compute the 2D convex hull of a point set (Graham scan).
convex_hull_3d
Compute the 3D convex hull of a set of points using the incremental algorithm.
cross3
Cross product of two 3D vectors.
delaunay_2d
Bowyer-Watson incremental Delaunay triangulation for 2D points.
dot3
Dot product of two 3D vectors.
in_circumcircle_2d
Test if point p lies inside the circumcircle of triangle (a, b, c).
line_intersect_2d
Intersection point of two lines (if they are not parallel).
mag3
Magnitude of a 3D vector.
mag3_sq
Squared magnitude of a 3D vector.
minkowski_sum
Compute the Minkowski sum of two convex polygons P and Q.
normalize3
Normalize a 3D vector; returns the zero vector if the magnitude is too small.
point_in_convex_polygon
Test if point p lies inside a convex polygon (given in CCW order).
point_in_triangle
Test if point p lies inside the triangle (a, b, c) using barycentric coordinates.
polygon_area
Compute the area of a simple polygon (positive for CCW).
scale3
Scale a 3D vector.
sub3
Subtract two 3D points.
sutherland_hodgman
Clip a subject polygon against a convex clipping polygon using the Sutherland-Hodgman algorithm.
voronoi_from_delaunay
Compute the dual Voronoi diagram from a Delaunay triangulation.

Type Aliases§

FaceId
Index of a face in a HalfEdgeMesh.
HalfEdgeId
Index of a half-edge in a HalfEdgeMesh.
Point3
A point in 3D space represented as a plain array.
VertexId
Index of a vertex in a HalfEdgeMesh.