Hello,
I'm a newbie with DGK. I want to ask you a question: How can I extract coordinates of all the vertices of an object from a STEP file and input the result to a text file with name separately for each vertex (like vertex1 (3; 4; 5), vertex2 (1; 2; 3)?
I hope to receive your answers soon.
Chun
Locate all vertices of a part
Re: Locate all vertices of a part
Try IBRepShape_DG.GetSubShapes().
I did not compile that. Search for GetSubShapes in samples for a live example.
Regards
Code: Select all
IGeometry_DG iGeom = theEntity.GetGeometry();
IBRepGeometry_DG iBrepGeom = iGeom as IBRepGeometry_DG;
IBRepShape_DG iShape = iBrepGeom.GetShape();
IShapeArray_DG vertices = iShape.GetSubShapes(ShapeType_DG.eShTypeVertexDG);
int n = vertices.GetCount();
double x,y,z;
for (int i = 0; i < n; i++)
{
IBRepShape_DG shapeVert = vertices.GetAt(i);
IBRepVertex_DG vert = shapeVert as IBRepVertex_DG;
vert.GetPosition(out x, out y, out z)
//... do something
}
Regards
Re: Locate all vertices of a part
Thank you.
I see it working
I see it working