Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I have a face. Now I want to have the meshes from the face.
Ptr<MeshManager> meshMgr = face_ptr->meshManager();
Ptr<TriangleMeshList> meshList = meshMgr->displayMeshes();
Ptr<TriangleMesh> pmesh = meshList->bestMesh();
std::vector<Ptr<Point3D>> mesh_xyz = pmesh->nodeCoordinates();
int triangle_count = pmesh->triangleCount();
std::vector<int> triangle_index = pmesh->nodeIndices();
int face_count = triangle_count / 3;
Then I can access the triangles:
for (int i = 0; i < face_count; i++)
{
int idx0 = triangle_index[i * 3];
int idx1 = triangle_index[i * 3 + 1];
int idx2 = triangle_index[i * 3 + 2];
{
int idx0 = triangle_index[i * 3];
int idx1 = triangle_index[i * 3 + 1];
int idx2 = triangle_index[i * 3 + 2];
Is this the right way?
I need all the mesh xyz to do my calculations.
Thank you.
Regards
John
Solved! Go to Solution.