Skip to main content

Module functions

Module functions 

Source
Expand description

Auto-generated module

🤖 Generated with SplitRS

Functions§

check_manifold
Check whether a mesh is 2-manifold.
clip_polygon_2d
Clip a 2-D polygon (list of [x, y]) against a convex polygon (clipper).
clip_polygon_by_aabb
Clip a polygon against all six half-spaces of an AABB.
clip_polygon_by_plane
Clip a convex polygon against a half-space defined by plane.
line_line_intersect_2d
Compute the intersection of two infinite 2D lines (given as two points each).
offset_polygon_2d
Offset a 2D polygon outward by delta (positive) or inward by |delta| (negative).
point_in_polygon_2d
Test whether a 2D point is inside a (possibly non-convex) polygon.
point_inside_mesh
Test whether a point is inside a closed mesh using multiple ray casts.
polygon2d_area
Compute the unsigned area of a 2D polygon.
polygon2d_centroid
Compute the centroid of a 2D polygon.
polygon2d_difference
Compute the 2-D difference a \ b for convex polygons.
polygon2d_intersection
Compute the 2-D intersection of two convex polygons using Sutherland-Hodgman.
polygon2d_is_convex
Test whether a 2D polygon is convex.
polygon2d_perimeter
Compute the perimeter of a 2D polygon.
polygon2d_signed_area
Compute the signed area of a 2D polygon (positive for CCW winding).
polygon2d_union
Compute the 2-D union of two convex polygons.
polygon_intersection_points
Compute intersection points of two polygons.
ray_triangle_intersect
Möller-Trumbore ray-triangle intersection.
repair_winding
Repair the winding order of a triangle mesh so that all outward-facing normals point away from the centroid of the mesh.
segment_segment_intersect_2d
Compute the intersection of two 2D line segments.
split_polygon_by_plane
Split a polygon by a plane into front and back fragments.
triangle_area
Compute the area of a triangle.
triangle_centroid
Compute the centroid of a triangle.
triangle_normal
Compute the normal of a triangle (not normalised).
triangle_unit_normal
Compute the unit normal of a triangle.
triangles_intersect
Test whether two triangles in 3-D intersect.
weiler_atherton_clip
Clip a subject polygon against a convex clip polygon using the Weiler-Atherton algorithm (2D version).
winding_consistency_score
Check whether all triangles in a mesh have consistent outward normals (pointing away from the mesh centroid).
winding_number_3d
Compute the winding number of a closed triangle mesh around point p.
winding_number_inside
Test whether a point is strictly inside a closed mesh using the winding number.