Indices of BrepFace vertices from original Brep.Vertices list for BTLx


I’m trying to represent a brep in BTLx Shape format, which uses a list of all the vertices in a Brep as points, and references them with a list of indices, separating each face with a separator symbol (-1). The format is described here on page 8. I can see that Brep has Vertices property and each vertex has a VertexIndex.

I’m trying to figure out the best way to get those vertex indices by face. BrepFace does not have a vertices property and when I extract the Brep from BrepFace, its vertices are different objects thatn those in the original vertices list. I can obviously compare the location of each BrepFace Brep Vertex to the location of the original Vertices list from the full Brep, but that seems very clunky.

Is there some built in or way to do this? Is the way that BTLx describes a Part standard and just needs the right call? There has to be a better way!


Hi @OBucklin ,
Lack of BrepFace.Vertices, you can bypass with following:

a) Get the indices of the BrepEdges that encompass a BrepFace:
b) For each ‘a’, get BrepEdge:
BrepEdge = brep.Edges[index]
c) For each ‘b’, get starting and ending BrepVertex:
BrepEdge.StartVertex; BrepEdge.EndVertex
d) For each ‘c’, get its index:

1 Like