def make_prism(profile, vec): """ makes a finite prism """ pri = BRepPrimAPI_MakePrism(profile, vec, True) with assert_isdone(pri, 'failed building prism'): pri.Build() return pri.Shape()
def ExtrudeFace(face, vec=gp_Vec(1, 0, 0)): """Extrudes a face by input vector Parameters ---------- face : TopoDS_Face vec : OCC.gp.gp_Vec The offset vector to extrude through Returns ------- shape : TopoDS_Shape The extruded shape Notes ----- Uses BRepBuilderAPI_MakePrism """ from OCC.BRepPrimAPI import BRepPrimAPI_MakePrism builder = BRepPrimAPI_MakePrism(face, vec) builder.Build() return builder.Shape()