DiscussionsIssue archiveOther usage issues

Archived discussion

Build a BREP from array of Vertices

Other usage issuesWed, 07/21/2010 - 20:097 replies

Browse this forum
QuestionAuthor

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,
Author

Discussion

7 archived replies

Posts are displayed in their archived order.

01Commenter-1

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();

02Author

Thanks a lot, Commenter-1. I will give it a try.

Author

03Commenter-2

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.

04Commenter-2

By triangles, I meant your faces.

05Commenter-1

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.

06Commenter-2

Oops.

i meant BRepBuilderAPI_Sewing.

sorry for any inconvinience

07Author

Hi, Tilman:

Thanks a lot for your kind help.

Author