Create Hole in Face ?

Hello,

thanks to your help my first solid appears in a STEP file. It is created by a
Wire->Face->MakePrism.

Now I need to have holes in the plates. I have not found a way to substract these holes
as wire from the face, do I really need to make this on the solid level ?

Thanks Carsten

Patrik Mueller's picture

Hi,

you can add wires as holes when you create a face. Take a look at the doc for the "BRepBuilderAPI_MakeFace" class (esp. the "Add" method).

Patrik

Stephen Leary's picture

Simpler (but not completely accurate) answer....

create your outer face with mFace = BRepBuilderAPI_MakeFace(Wire)..

then you can add inner faces with mFace.Add(wire)

Orientations determine whether the added face is a hole or an island.

Hope this gets people moving on this.

Stephen

jelle's picture

If you're lazy you can also run ShapeFix_Shape to take care of orientation.

surf = BRep_Tool().Surface(_face)
pln = Handle_Geom_Plane().DownCast(surf).GetObject()
D2 = pln.Pln().Axis().Direction().Reversed()

MKF2 = BRepBuilderAPI_MakeFace()
MKF2.Init(surf,False)
MKF2.Add(_wire)
MKF2.Build()
FP = MKF2.Face()
BRepLib().BuildCurves3d(FP)

sfs = ShapeFix_Shape()
sfs.Init(FP)
sfs.Perform()
FP = TopoDS.TopoDS().Face(sfs.Shape())

MKP2 = BRepFeat_MakePrism(_shape,FP,_face,D2,0,True)
MKP2.PerformThruAll()