pyblenderSDIC.meshes.TriangleMesh3D.triangle_centroids#
- property TriangleMesh3D.triangle_centroids: ndarray | None#
Get the centroids of the triangles in the mesh.
The centroids are computed as the average position of the vertices of each triangle. The centroids are represented as a NumPy array of shape (M, 3), where M is the number of triangles.
See also
The method
compute_triangle_centroids
can be used to compute the centroids if they are not already computed.Warning
This property uses
numpy.asarray
on the internaltriangle_centroids
array. As a result, any modification to the returned or setted array directly affects the mesh data. To avoid unintentional updates, assign a copy instead.- Returns:
A NumPy array of shape (M, 3) representing the centroids of the triangles in the mesh. If not computed, returns None.
- Return type:
Optional[numpy.ndarray]