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)...
francisco castillo Wed, 12/03/2003 - 09:28
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 );
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);
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);
Wed, 12/03/2003 - 09:28
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 );
Wed, 12/03/2003 - 10:30
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 !!!
Wed, 12/03/2003 - 10:37
I am using this code without problems. Perhaps the wires are not planar or the hole wire is not inside the external one.
Wed, 12/03/2003 - 11:51
Hello Francisco,
I have found the problem ! My internal Wire was "disconnected".
Thank you very much for your help ;-)
Best regards.
thm
Wed, 12/03/2003 - 10:30
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 !!!