Build a BREP from array of Vertices

If I already have an array of Vertices, and an array of indices into Vertices array (for faces), which API could I use to build a BREP or SHELL?

Thanks a lot,
James

Göran Barz's picture

I once used BRepFill_Filling for a similar problem, but this does only work for simple structures. If the structure is to complex, an exception is thrown.

Some sample code:
BRepFill_Filling makeFilling(2);
for (size_t i = 1; i <= nLastEdgePoint; ++i)
{
BRepBuilderAPI_MakeEdge makeEdge(m_vecEdgePoints[i - 1],
m_vecEdgePoints[i]);
makeFilling.Add(makeEdge.Edge(), GeomAbs_C0);
}

for (size_t i = 0; i < m_vecFacePoints.size(); ++i)
{
makeFilling.Add(m_vecFacePoints[i]);
}

makeFilling.Build();
face = makeFilling.Face();

James Blackmon's picture

Thanks a lot, Göran Barz. I will give it a try.

James

Tilman Leune's picture

You could build TopoDS_Faces of each of your triangles, then sew them together using ShellFix_Sewing.

This should not have limitations to the structures creatabel by it other than your patience to wait and memory available.

Tilman Leune's picture

By triangles, I meant your faces.

Göran Barz's picture

I can't find ShellFix_Sewing, did you mean BRepBuilderAPI_Sewing or ShapeUpgrade_ShellSewing? These two classes leave the edge between the two sewn faces, which I don't want to have.

Tilman Leune's picture

Oops.

i meant BRepBuilderAPI_Sewing.

sorry for any inconvinience

James Blackmon's picture

Hi, Tilman:

Thanks a lot for your kind help.

James