Hi, there.
I need to read face normals from an .stl. How can I read the normals of each facet?
Face normals from an .stl
-
- Posts: 1
- Joined: Wed Sep 04, 2024 4:34 am
Re: Face normals from an .stl
This should work:
Cheers
Code: Select all
myDgk.ModelPath = theStlPath;
IModle_DG model = myDgk.GetModel();
if (model.GetEntityCount() < 1) return;
IEntity_DG entity = model.GetEntityAt(0);
IMesh_DG mesh = entity.As<IMesh_DG>();
IList_DG simplexList = mesh.GetSimplexList();
uint posCurrentSimplex = simplexList.GetHeadPosition();
//..... Loop with:
simplexList.GetNext(ref posCurrentSimplex);
ISimplex_DG simplex = mesh.GetSimplex(posCurrentSimplex);
VectDg n = simplex.GetFaceNormal();