DiscussionsIssue archiveOther usage issues

Archived discussion

planar face with hole

Other usage issuesWed, 12/03/2003 - 09:005 replies

Browse this forum
QuestionAuthor

Hello,

I build a planr Face from a Wire and I want to add an internal hole defined by an other Wire. How can I do that???

Thank's for answer(s)...

Discussion

5 archived replies

Posts are displayed in their archived order.

01Commenter-1

You have to add the internal wires to the face, see code:
TopoDS_Wire aWire = ....
//External wire
TopoDS_Face F = BRepBuilderAPI_MakeFace( aWire );
//Internal hole
TopoDS_Wire aHoleWire = ...
//Check that this wire have opposite orientation
// if not, use aHoleWire.Reverse();
//Add this hole to te face
F = BRepBuilderAPI_MakeFace( F, aHoleWire );

02Commenter-2

Thank you Francisco,

but this doesn't work !
this is my code :
// declarations
BRepBuilderAPI_MakeWire extWire;
BRepBuilderAPI_MakeWire intWire;
// 2 loops for adding edges
.
.
.
// getting the external TopoDS_Wire
TopoDS_Wire ew = extWire.Wire();
// creating the TopoDS_Face
TopoDS_Face face = BRepBuilderAPI_MakeFace(ew);
// getting the internal TopoDS_Wire
TopoDS_Wire iw = intWire.Wire();
// I now that internal wire have non-opposite orientation
iw.Reverse();
// modifying face with internal hole
face = BRepBuilderAPI_MakeFace(face, iw);

I get a Runtime Error !!!

03Commenter-1

I am using this code without problems. Perhaps the wires are not planar or the hole wire is not inside the external one.

04Author

Hello Francisco,

I have found the problem ! My internal Wire was "disconnected".
Thank you very much for your help ;-)
Best regards.
thm

05Commenter-2

Thank you Francisco,

but this doesn't work !
this is my code :
// declarations
BRepBuilderAPI_MakeWire extWire;
BRepBuilderAPI_MakeWire intWire;
// 2 loops for adding edges
.
.
.
// getting the external TopoDS_Wire
TopoDS_Wire ew = extWire.Wire();
// creating the TopoDS_Face
TopoDS_Face face = BRepBuilderAPI_MakeFace(ew);
// getting the internal TopoDS_Wire
TopoDS_Wire iw = intWire.Wire();
// I now that internal wire have non-opposite orientation
iw.Reverse();
// modifying face with internal hole
face = BRepBuilderAPI_MakeFace(face, iw);

I get a Runtime Error !!!