TriangleMesh::nodeCount() return value

TriangleMesh::nodeCount() return value

Anonymous
Not applicable
350 Views
1 Reply
Message 1 of 2

TriangleMesh::nodeCount() return value

Anonymous
Not applicable

Hello.

Just spotted, that the method TriangleMesh::nodeCount() returns the count of the vertices of the triangles, not of the points, as in contrast returned from PolygonMesh::nodeCount(). Is this slight inconsistency intentional? "Points" I mean the values of the vector of unique coordinates, returned by TriangleMesh::nodeCoordinates() / PolygonMesh::nodeCoordinates(), "triangle vertices" -- the values of the vector of references to the points, returned by TriangleMesh::nodeIndices() / PolygonMesh::triangleNodeIndices(). "Nodes" I hope are rather "points", not the "vertices"? In former case there is no other means to find out the amount of the points, than calculate the size of TriangleMesh::nodeCoordinates() (efficiency issue), when the amount of the vertices is just as trice as the amount of triangles TriangleMesh::triangleCount() (kind of duplication). Both meshes in my case are identical and returned from MeshBody::displayMesh() and MeshBody::mesh().

 

0 Likes
351 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor

I see the problem you've described and It's a bug and should be fixed.  The TriangleMesh.nodeCount property should be returning the number of points in the nodeCoordinates array.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes