Function Reference: meshSection

csg-toolkit: cross_section = meshSection (v, f, point, normal)

Compute the sectioning points of triangular 3D mesh.

This function loads the vertices v and faces f of a triangular 3D Mesh along with a slicing plane defined by its normal and a point that lies on the slicing plane and it returns the intersection points of the face edges between the vertices that lie on opposite sides of the sectioning plane. Duplicate points due to adjacent faces are removed and the points are sorted according to the οrder of the faces.

v and f must be N×3 matrices containing the 3D coordinates and the vertex indices, respectively. normal and point must be defined as row vectors containing x,y,z coordinates in R3.

cross_section is an N×3 matrix, where N is the number of unique intersection points of the 3D mesh represented in v and f.

See also: meshArea, meshBarycenter, readObj

Source Code: meshSection