Function Reference: meshBarycenter

csg-toolkit: centroid = meshBarycenter (v, f)

Compute the 3D coordinates of the polygon barycenter of a triangular 3D Mesh based on its vertices and faces provided as input arguments.

The function will only take two input arguments. The first argument should be an N×3 matrix containing the 3D coordinates of each vertex and the second argument should be an N×3 matrix with each row containing the three vertices that form each face of the triangular mesh. The face matrix should contain explicitly non-zero integers referring to the existing vertices present in the first input argument.

See also: meshArea, meshSection, readObj

Source Code: meshBarycenter