triangle and tolerance
triangle plane
Calculates intersection points between two meshes as point arrays (one array per polyline). Closed polylines have first point duplicated at end. Example: cube-sphere intersection → arrays of points defining intersection curves
first mesh, second mesh, and tolerance
array of intersection points
Calculates intersection polylines between two meshes by sorting segments into connected paths. Segments are joined end-to-end to form continuous or closed curves. Example: cube-sphere intersection → closed polyline loops where surfaces meet
first mesh, second mesh, and tolerance
array of intersection polylines
Calculates all intersection segments between two triangle meshes (pairwise triangle tests). Returns array of line segments where mesh surfaces intersect. Example: cube mesh intersecting with sphere mesh → multiple segments forming intersection curve
first mesh, second mesh, and tolerance
array of intersection segments
Calculates signed distance from a point to a plane (positive=above plane, negative=below). Example: point=[0,5,0], plane={normal:[0,1,0], d:0} → 5 (point is 5 units above XZ plane)
a point and a plane
signed distance
Calculates intersection segment of two triangles (line segment where they cross). Returns undefined if triangles don't intersect, are parallel, or are coplanar. Example: triangle1=[[0,0,0], [2,0,0], [1,2,0]], triangle2=[[1,-1,1], [1,1,1], [1,1,-1]] → [[1,0,0], [1,1,0]]
first triangle, second triangle, and tolerance
intersection segment or undefined if no intersection
Generated using TypeDoc
Calculates plane equation from triangle vertices (normal vector and distance from origin). Returns undefined if triangle is degenerate (zero area, collinear points). Example: triangle=[[0,0,0], [1,0,0], [0,1,0]] → {normal:[0,0,1], d:0} (XY plane)
traingle
triangle plane
false