def sort_edges_into_order(occedgelist, isclosed=False): from OCC.TopoDS import topods from OCC.TopExp import topexp from OCC.BRep import BRep_Tool from OCC.ShapeAnalysis import ShapeAnalysis_WireOrder from OCC.Precision import precision sawo_statusdict = { 0: "all edges are direct and in sequence", 1: "all edges are direct but some are not in sequence", 2: "unresolved gaps remain", -1: "some edges are reversed, but no gaps remain", -2: "some edges are reversed and some gaps remain", -10: "failure on reorder" } mode3d = True SAWO = ShapeAnalysis_WireOrder(mode3d, precision.PConfusion()) for occedge in occedgelist: V1 = topexp.FirstVertex(topods.Edge(occedge)) V2 = topexp.LastVertex(topods.Edge(occedge)) pnt1 = BRep_Tool().Pnt(V1) pnt2 = BRep_Tool().Pnt(V2) SAWO.Add(pnt1.XYZ(), pnt2.XYZ()) SAWO.SetKeepLoopsMode(True) SAWO.Perform(isclosed) #print "SAWO.Status()", SAWO.Status() if not SAWO.IsDone(): raise RuntimeError, "build wire: Unable to reorder edges: \n" + sawo_statusdict[ SAWO.Status()] else: if SAWO.Status() not in [0, -1]: pass # not critical, wirebuilder will handle this SAWO.SetChains(precision.PConfusion()) sorted_edge2dlist = [] #print "Number of chains: ", SAWO.NbChains() for i in range(SAWO.NbChains()): sorted_edges = [] estart, eend = SAWO.Chain(i + 1) #print "Number of edges in chain", i, ": ", eend - estart + 1 if (eend - estart + 1) == 0: continue for j in range(estart, eend + 1): idx = abs(SAWO.Ordered(j)) edge2w = occedgelist[idx - 1] if SAWO.Ordered(j) < 0: edge2w.Reverse() sorted_edges.append(edge2w) sorted_edge2dlist.append(sorted_edges) return sorted_edge2dlist
def color_the_edges(shp, display, color, width): shapeList = [] Ex = TopExp_Explorer(shp, TopAbs_EDGE) ctx = display.Context while Ex.More(): aEdge = topods.Edge(Ex.Current()) ais_shape = AIS_Shape(aEdge).GetHandle() ctx.SetColor(ais_shape, color, False) ctx.SetWidth(ais_shape, width, False) ctx.Display(ais_shape, False) Ex.Next()
def __call__(self, plane: gp.gp_Pln, vertex=None, edge_dict=None, **kwargs): splt = BRepFeat_SplitShape() if isinstance(self._base, TopoDS_Shape): base_shape = self._base else: base_shape = self._base.Shape() splt.Init(base_shape) sect = BRepAlgoAPI_Section(base_shape, plane, False) sect.ComputePCurveOn1(True) sect.Approximation(True) sect.Build() self.cutting_edge = sect.Shape() ancestors = set() new_faces = [] edge_iter = TopExp_Explorer(self.cutting_edge, TopAbs_EDGE) while edge_iter.More(): base_iter = TopExp_Explorer(base_shape, TopAbs_FACE) curr_edge = edge_iter.Current() while base_iter.More(): curr_face = base_iter.Current() if sect.HasAncestorFaceOn1(curr_edge, curr_face): k, v = hash(curr_face), hash(curr_edge) if (k, v) not in self.ancestors: ancestors.add((k, v)) e = topods.Edge(curr_edge) f = topods.Face(curr_face) splt.Add(e, f) # todo - only add the closest one !!!! new_faces.append(f) self.added.append(e) break # if sect.HasAncestorFaceOn2(curr_edge, curr_face): # print('has2', curr_edge, curr_face) # pass base_iter.Next() edge_iter.Next() # ------------------------------------- splt.Build() new_shape = splt.Shape() sect.Destroy() return new_shape
def split_solid(base, plane): splt = BRepFeat_SplitShape() splt.Init(base) sect = BRepAlgoAPI_Section(base, plane, False) sect.ComputePCurveOn1(True) sect.Approximation(True) sect.Build() edge = sect.Shape() rdict = set() # print(Topo(edge).number_of_edges()) Ex = TopExp_Explorer(edge, TopAbs_EDGE) while Ex.More(): # print('edge', Ex.Current()) base_iter = TopExp_Explorer(base, TopAbs_FACE) curr = Ex.Current() while base_iter.More(): # print('face', base_iter.Current()) bface = base_iter.Current() if sect.HasAncestorFaceOn1(curr, bface): # print('has1', curr, bface) k, v = hash(bface), hash(curr) if (k, v) not in rdict: rdict.add((k, v)) e = topods.Edge(curr) f = topods.Face(bface) splt.Add(e, f) if sect.HasAncestorFaceOn2(curr, bface): # print('has2', curr, bface) pass base_iter.Next() Ex.Next() splt.Build() return splt.Shape()
def createModel(self): # edges = makeEdgesFromPoints(self.points) # self.a1 = edge1 = BRepBuilderAPI_MakeEdge(getGpPt(self.a1), getGpPt(self.a2)) edge2 = BRepBuilderAPI_MakeEdge(getGpPt(self.a2), getGpPt(self.a3)) arc1 = GC_MakeArcOfCircle(getGpPt(self.a3), getGpPt(self.a4), getGpPt(self.a5)) edge3 = BRepBuilderAPI_MakeEdge(arc1.Value()) edge4 = BRepBuilderAPI_MakeEdge(getGpPt(self.a5), getGpPt(self.a6)) arc2 = GC_MakeArcOfCircle(getGpPt(self.a6), getGpPt(self.a7), getGpPt(self.a8)) edge5 = BRepBuilderAPI_MakeEdge(arc2.Value()) edge6 = BRepBuilderAPI_MakeEdge(getGpPt(self.a8), getGpPt(self.a9)) arc3 = GC_MakeArcOfCircle(getGpPt(self.a9), getGpPt(self.a10), getGpPt(self.a11)) edge7 = BRepBuilderAPI_MakeEdge(arc3.Value()) edge8 = BRepBuilderAPI_MakeEdge(getGpPt(self.a11), getGpPt(self.a12)) edge9 = BRepBuilderAPI_MakeEdge(getGpPt(self.a12), getGpPt(self.a1)) # wire = makeWireFromEdges(edge1,edge2,edge3,edge4,edge5,edge6,edge7,edge8,edge9) wire = BRepBuilderAPI_MakeWire(edge1.Edge(), edge2.Edge(), edge3.Edge(), edge4.Edge()) wire = BRepBuilderAPI_MakeWire(wire.Wire(), edge5.Edge()) wire = BRepBuilderAPI_MakeWire(wire.Wire(), edge6.Edge()) wire = BRepBuilderAPI_MakeWire(wire.Wire(), edge7.Edge()) wire = BRepBuilderAPI_MakeWire(wire.Wire(), edge8.Edge()) wire = BRepBuilderAPI_MakeWire(wire.Wire(), edge9.Edge()) aFace = makeFaceFromWire(wire.Wire()) extrudeDir = self.L * self.wDir # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) mkFillet = BRepFilletAPI_MakeFillet(prism) anEdgeExplorer = TopExp_Explorer(prism, TopAbs_EDGE) while anEdgeExplorer.More(): aEdge = topods.Edge(anEdgeExplorer.Current()) mkFillet.Add(self.T / 17., aEdge) anEdgeExplorer.Next() prism = mkFillet.Shape() return prism
def createModel(self): edges = makeEdgesFromPoints(self.points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = self.T * self.wDir # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) mkFillet = BRepFilletAPI_MakeFillet(prism) anEdgeExplorer = TopExp_Explorer(prism, TopAbs_EDGE) while anEdgeExplorer.More(): aEdge = topods.Edge(anEdgeExplorer.Current()) mkFillet.Add(self.T / 17. , aEdge) anEdgeExplorer.Next() prism = mkFillet.Shape() cylOrigin = self.secOrigin innerCyl = BRepPrimAPI_MakeCylinder(gp_Ax2(getGpPt(cylOrigin), getGpDir(self.wDir)), self.r1, self.H).Shape() result_shape = BRepAlgoAPI_Cut(prism, innerCyl).Shape() return result_shape
def createModel(self): edges = makeEdgesFromPoints(self.points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = -self.T * self.shaftDir # extrudeDir is a numpy array boltHead = makePrismFromFace(aFace, extrudeDir) mkFillet = BRepFilletAPI_MakeFillet(boltHead) anEdgeExplorer = TopExp_Explorer(boltHead, TopAbs_EDGE) while anEdgeExplorer.More(): aEdge = topods.Edge(anEdgeExplorer.Current()) mkFillet.Add(self.T / 17. , aEdge) anEdgeExplorer.Next() boltHead = mkFillet.Shape() cylOrigin = self.origin boltCylinder = BRepPrimAPI_MakeCylinder(gp_Ax2(getGpPt(cylOrigin), getGpDir(self.shaftDir)), self.r, self.H).Shape() whole_Bolt = BRepAlgoAPI_Fuse(boltHead,boltCylinder).Shape() mkFillet = BRepFilletAPI_MakeFillet(whole_Bolt) return whole_Bolt
mkWire.Add(aMirroredWire) myWireProfile = mkWire.Wire() # The face that we'll sweep to make the prism myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile) # We want to sweep the face along the Z axis to the height aPrismVec = gp_Vec(0, 0, height) myBody = BRepPrimAPI_MakePrism(myFaceProfile.Face(), aPrismVec) # Add fillets to all edges through the explorer mkFillet = BRepFilletAPI_MakeFillet(myBody.Shape()) anEdgeExplorer = TopExp_Explorer(myBody.Shape(), TopAbs_EDGE) while anEdgeExplorer.More(): anEdge = topods.Edge(anEdgeExplorer.Current()) mkFillet.Add(thickness / 12.0, anEdge) anEdgeExplorer.Next() myBody = mkFillet # Create the neck of the bottle neckLocation = gp_Pnt(0, 0, height) neckAxis = gp_DZ() neckAx2 = gp_Ax2(neckLocation, neckAxis) myNeckRadius = thickness / 4.0 myNeckHeight = height / 10.0 mkCylinder = BRepPrimAPI_MakeCylinder(neckAx2, myNeckRadius, myNeckHeight)
def FuselageLongitudinalGuideCurves(self, NoseLengthRatio, TailLengthRatio): """Internal function. Defines the four longitudinal curves that outline the fuselage (outer mould line).""" FSVU, FSVL = self.AirlinerFuselageSideView(NoseLengthRatio, TailLengthRatio) FSVUCurve = act.points_to_BezierCurve(FSVU) FSVLCurve = act.points_to_BezierCurve(FSVL) AFPVPort, NoseEndX, TailStartX = \ self.AirlinerFuselagePlanView(NoseLengthRatio, TailLengthRatio) # Generate plan view PlanPortCurve = act.points_to_BezierCurve(AFPVPort).GetHandle() # TODO: How wide is the fuselage (use bounding box) # Note: THIS DOESNT WORK AS OCC BOUNDING BOX ROUTINES INCLUDE CURVE # POLES. MAY BE ABLE TO WORKAROUND WITH TRIANGULATION # H_PlanPortCurve = PlanPortCurve.GetHandle() # Get handle of curve # PP_Edge = act.make_edge(H_PlanPortCurve) # (Xmin,Ymin,Zmin,Xmax,Ymax,Zmax) = act.ObjectsExtents([PP_Edge]) (Xmin, Ymin, Zmin) = np.min(AFPVPort, axis=0) (Xmax, Ymax, Zmax) = np.max(AFPVPort, axis=0) # # TODO: Generate a (slightly wider) projection surface # > This is legacy from Rhino # FSVMeanCurve = rs.MeanCurve(FSVUCurve, FSVLCurve) # RuleLinePort = rs.AddLine((0,0,0),(0,-1.1*abs(Ymax-Ymin),0)) # FSVMCEP = rs.CurveEndPoint(FSVMeanCurve) # AftLoftEdgePort = rs.CopyObject(RuleLinePort, FSVMCEP) # ParallelLoftEdgePort = rs.CopyObject(FSVMeanCurve,(0,-1.1*abs(Ymax-Ymin),0)) # LSPort = rs.AddSweep2((FSVMeanCurve,ParallelLoftEdgePort ),(RuleLinePort, AftLoftEdgePort )) # # Mean Curve: This is wrong! But no mean curve found in OCC FSVMean = (FSVU + FSVL) / 2. FSVMeanCurve = act.points_to_BezierCurve(FSVMean) FSVMeanEdge = act.make_edge(FSVMeanCurve.GetHandle()) self._MeanEdge = FSVMeanEdge RuleLinePort = act.make_edge(gp_Pnt(0., 0., 0.), gp_Pnt(0., -1.1 * abs(Ymax - Ymin), 0.)) FSVMCEP = FSVMeanCurve.EndPoint() MoveVec = gp_Vec(gp_Pnt(0, 0, 0), FSVMCEP) AftLoftEdgePort = topods.Edge( act.translate_topods_from_vector(RuleLinePort, MoveVec, copy=True)) # Make copy of the mean curve MoveVec = gp_Vec(gp_Pnt(0, 0, 0), gp_Pnt(0, -1.1 * abs(Ymax - Ymin), 0)) # Didnt need this to construct Port Edge of the loft surface in OCC # (Legacy from Rhino) - may experiment with this behaviour later: # ParallelLoftEdgePort = topods.Edge(act.translate_topods_from_vector( # FSVMeanEdge, # MoveVec, # copy=True)) # Mean Surface: # LSPort_edges = [RuleLinePort, FSVMeanEdge, AftLoftEdgePort, # ParallelLoftEdgePort] spine = act.make_wire(FSVMeanEdge) section1 = act.make_wire(RuleLinePort) section2 = act.make_wire(AftLoftEdgePort) # support = act.make_wire(ParallelLoftEdgePort) LSPort = act.make_pipe_shell(spine, [section1, section2]) self._LSPort = LSPort # # Project the plan view onto the mean surface HPortCurve = act.project_curve_to_surface(PlanPortCurve, LSPort, gp_Dir(0, 0, 100)) PortCurve = HPortCurve.GetObject() # # TODO: House-keeping # DeleteObjects([LSPort,PlanPortCurve,ParallelLoftEdgePort,RuleLinePort, # AftLoftEdgePort]) # TODO: Tidy up the mean curve # Tidy up the mean curve. This is necessary for a smooth result and # removing it can render the algorithm unstable. However, FitCurve # itself may sometimes be slightly unstable. # FLength = abs(Xmax-Xmin) # establish a reference length # PortCurveSimplified = rs.FitCurve(PortCurve, # distance_tolerance = FLength*0.001) # StarboardCurveSimplified = act.MirrorObjectXZ(PortCurveSimplified) # # rs.DeleteObject(PortCurve) # # # Compute the actual end points of the longitudinal curves # TODO: Compute end points of curves (Needed when mean curve has been # Changed by fitting curve) # (Xmin,Ymin,Zmin,Xmax1,Ymax,Zmax) =\ # act.ObjectsExtents(StarboardCurveSimplified) # (Xmin,Ymin,Zmin,Xmax2,Ymax,Zmax) =\ # act.ObjectsExtents(PortCurveSimplified) # (Xmin,Ymin,Zmin,Xmax3,Ymax,Zmax) = act.ObjectsExtents(FSVUCurve) # (Xmin,Ymin,Zmin,Xmax4,Ymax,Zmax) = act.ObjectsExtents(FSVLCurve) # EndX = min([Xmax1,Xmax2,Xmax3,Xmax4]) # PortCurveSimplified = PlanPortCurve # Seems easiest to mirror portcurve with handles? h = Handle_Geom_BSplineCurve() mirror_ax2 = gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)) c = PortCurve.Copy() c.GetObject().Mirror(mirror_ax2) HStarboardCurve = h.DownCast(c) # StarboardCurve = hSt.GetObject() EndX = Xmax # This is not correct: just trying to get it working return (HStarboardCurve, HPortCurve, FSVUCurve, FSVLCurve, FSVMeanCurve, NoseEndX, TailStartX, EndX)
def createModel(self): edges = makeEdgesFromPoints(self.points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = self.T * self.wDir # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) mkFillet = BRepFilletAPI_MakeFillet(prism) anEdgeExplorer = TopExp_Explorer(prism, TopAbs_EDGE) while anEdgeExplorer.More(): aEdge = topods.Edge(anEdgeExplorer.Current()) mkFillet.Add(self.T / 17., aEdge) anEdgeExplorer.Next() prism = mkFillet.Shape() cylOrigin = self.secOrigin # cylOrigin = self.secOrigin + self.T * self.wDir innerCyl = BRepPrimAPI_MakeCylinder( gp_Ax2(getGpPt(cylOrigin), getGpDir(self.wDir)), self.r1, self.H).Shape() # outerCyl = BRepPrimAPI_MakeCylinder(gp_Ax2(getGpPt(cylOrigin), getGpDir(self.wDir)), self.r2, self.H).Shape() # nutBody = BRepAlgoAPI_Fuse(prism, outerCyl).Shape() # my_cyl = BRepPrimAPI_MakeCylinder(9.0, 6.0).Shape() # result_shape = BRepAlgoAPI_Cut(nutBody, innerCyl).Shape() result_shape = BRepAlgoAPI_Cut(prism, innerCyl).Shape() # self.secOrigin = gp_Pnt(0 , 0 , 0) # neckNormal = gp_DZ() # # Threading : Create Surfaces # # nutAx2_bis = gp_Ax3(self.secOrigin , neckNormal) # aCyl1 = Geom_CylindricalSurface(nutAx2_bis , self.T * 0.99) # aCyl2 = Geom_CylindricalSurface(nutAx2_bis , self.T * 1.05) # #aCyl3 = Geom_CylindricalSurface(nutAx2_bis , self.T * 1.11) # aCyl1_handle = aCyl1.GetHandle() # aCyl2_handle = aCyl2.GetHandle() # #aCyl3_handle = aCyl3.GetHandle() # # # Threading : Define 2D Curves # aPnt = gp_Pnt2d(2. * math.pi , self.H / 2.) # aDir = gp_Dir2d(2. * math.pi , self.H / 4.) # aAx2d = gp_Ax2d(aPnt , aDir) # aMajor = 2. * math.pi # aMinor = self.H / 7. # anEllipse1 = Geom2d_Ellipse(aAx2d , aMajor , aMinor) # anEllipse2 = Geom2d_Ellipse(aAx2d , aMajor , aMinor / 4.) # anEllipse1_handle = anEllipse1.GetHandle() # anEllipse2_handle = anEllipse2.GetHandle() # aArc1 = Geom2d_TrimmedCurve(anEllipse1_handle, 0 , math.pi) # aArc2 = Geom2d_TrimmedCurve(anEllipse2_handle, 0 , math.pi) # aArc1_handle = aArc1.GetHandle() # aArc2_handle = aArc2.GetHandle() # anEllipsePnt1 = anEllipse1.Value(0) # anEllipsePnt2 = anEllipse1.Value(math.pi) # aSegment = GCE2d_MakeSegment(anEllipsePnt1 , anEllipsePnt2) # # # Threading : Build Edges and Wires # # aEdge1OnSurf1 = BRepBuilderAPI_MakeEdge( aArc1_handle , aCyl1_handle) # aEdge2OnSurf1 = BRepBuilderAPI_MakeEdge( aSegment.Value() , aCyl1_handle) # aEdge1OnSurf2 = BRepBuilderAPI_MakeEdge( aArc2_handle , aCyl2_handle) # aEdge2OnSurf2 = BRepBuilderAPI_MakeEdge( aSegment.Value() , aCyl2_handle) # threadingWire1 = BRepBuilderAPI_MakeWire(aEdge1OnSurf1.Edge() , aEdge2OnSurf1.Edge())#aEdge3OnSurf1.Edge()) # self.threading1 = threadingWire1 # threadingWire2 = BRepBuilderAPI_MakeWire(aEdge1OnSurf2.Edge() , aEdge2OnSurf2.Edge())#aEdge3OnSurf2.Edge()) # BRepLib.breplib.BuildCurves3d(threadingWire1.Shape()) # BRepLib.breplib.BuildCurves3d(threadingWire2.Shape()) # # # Create Threading # # aTool = BRepOffsetAPI_ThruSections(True) # aTool.AddWire(threadingWire1.Wire()) # aTool.AddWire(threadingWire2.Wire()) # aTool.CheckCompatibility(False) # myThreading = aTool.Shape() # # #Building the resulting compound # # aRes = TopoDS_Compound() # aBuilder = BRep.BRep_Builder() # aBuilder.MakeCompound(aRes) # aBuilder.Add(aRes, result_shape) # aBuilder.Add(aRes, myThreading) # final_shape = BRepAlgoAPI_Cut(result_shape, myThreading).Shape() return result_shape
def arrange_edges_2_wires(occedgelist, isclosed=False): from OCC.TopoDS import topods from OCC.TopExp import topexp from OCC.BRep import BRep_Tool from OCC.ShapeAnalysis import ShapeAnalysis_WireOrder from OCC.Precision import precision from OCC.BRepBuilderAPI import BRepBuilderAPI_WireDone, BRepBuilderAPI_EmptyWire, BRepBuilderAPI_DisconnectedWire, BRepBuilderAPI_NonManifoldWire wb_errdict = { BRepBuilderAPI_WireDone: "No error", BRepBuilderAPI_EmptyWire: "Empty wire", BRepBuilderAPI_DisconnectedWire: "disconnected wire", BRepBuilderAPI_NonManifoldWire: "non-manifold wire" } sawo_statusdict = { 0: "all edges are direct and in sequence", 1: "all edges are direct but some are not in sequence", 2: "unresolved gaps remain", -1: "some edges are reversed, but no gaps remain", -2: "some edges are reversed and some gaps remain", -10: "failure on reorder" } mode3d = True SAWO = ShapeAnalysis_WireOrder(mode3d, precision.PConfusion()) for edge in occedgelist: V1 = topexp.FirstVertex(topods.Edge(edge)) V2 = topexp.LastVertex(topods.Edge(edge)) pnt1 = BRep_Tool().Pnt(V1) pnt2 = BRep_Tool().Pnt(V2) SAWO.Add(pnt1.XYZ(), pnt2.XYZ()) SAWO.SetKeepLoopsMode(True) SAWO.Perform(isclosed) #print "SAWO.Status()", SAWO.Status() if not SAWO.IsDone(): raise RuntimeError, "build wire: Unable to reorder edges: \n" + sawo_statusdict[ SAWO.Status()] else: if SAWO.Status() not in [0, -1]: pass # not critical, wirebuilder will handle this SAWO.SetChains(precision.PConfusion()) wirelist = [] #print "Number of chains: ", SAWO.NbChains() for i in range(SAWO.NbChains()): wirebuilder = BRepBuilderAPI_MakeWire() estart, eend = SAWO.Chain(i + 1) #print "Number of edges in chain", i, ": ", eend - estart + 1 if (eend - estart + 1) == 0: continue for j in range(estart, eend + 1): idx = abs( SAWO.Ordered(j) ) # wirebuilder = s_addToWireBuilder(wirebuilder, edgelist[idx-1]) edge2w = occedgelist[idx - 1] wirebuilder.Add(edge2w) if wirebuilder is None: raise RuntimeError, " build wire: Error adding edge number " + str( j + 1) + " to Wire number " + str(i) err = wirebuilder.Error() if err != BRepBuilderAPI_WireDone: raise RuntimeError, "Overlay2D: build wire: Error adding edge number " + str( j + 1) + " to Wire number " + str( i) + ": \n" + wb_errdict[err] try: wirebuilder.Build() aWire = wirebuilder.Wire() wirelist.append(aWire) except Exception, err: raise RuntimeError, "Overlay2D: build wire: Creation of Wire number " + str( i) + " from edge(s) failed. \n" + str(err) wirebuilder.Build() aWire = wirebuilder.Wire() wirelist.append(aWire)
def create_model(self): ###################################################### edges = [] if self.R2 == 0.0 or self.R1 == 0.0: self.a3 = self.a4 = self.a5 edge1 = make_edge(getGpPt(self.a1), getGpPt(self.a2)) edges.append(edge1) edge2 = make_edge(getGpPt(self.a2), getGpPt(self.a3)) edges.append(edge2) edge3 = make_edge(getGpPt(self.a3), getGpPt(self.a6)) edges.append(edge3) # arc2 = GC_MakeArcOfCircle(getGpPt(self.a6), getGpPt(self.a7), getGpPt(self.a8)) # edge4 = make_edge(arc2.Value()) # edges.append(edge4) # edge5 = make_edge(getGpPt(self.a8), getGpPt(self.a9)) # edges.append(edge5) # edge6 = make_edge(getGpPt(self.a9), getGpPt(self.a12)) # edges.append(edge6) # edge7 = make_edge(getGpPt(self.a12), getGpPt(self.a1)) # edges.append(edge7) edge4 = make_edge(getGpPt(self.a6), getGpPt(self.a9)) edges.append(edge4) edge5 = make_edge(getGpPt(self.a9), getGpPt(self.a12)) edges.append(edge5) edge6 = make_edge(getGpPt(self.a12), getGpPt(self.a1)) edges.append(edge6) else: edge1 = make_edge(getGpPt(self.a1), getGpPt(self.a2)) edges.append(edge1) edge2 = make_edge(getGpPt(self.a2), getGpPt(self.a3)) edges.append(edge2) arc1 = GC_MakeArcOfCircle(getGpPt(self.a3), getGpPt(self.a4), getGpPt(self.a5)) edge3 = make_edge(arc1.Value()) edges.append(edge3) edge4 = make_edge(getGpPt(self.a5), getGpPt(self.a6)) edges.append(edge4) arc2 = GC_MakeArcOfCircle(getGpPt(self.a6), getGpPt(self.a7), getGpPt(self.a8)) edge5 = make_edge(arc2.Value()) edges.append(edge5) edge6 = make_edge(getGpPt(self.a8), getGpPt(self.a9)) edges.append(edge6) arc3 = GC_MakeArcOfCircle(getGpPt(self.a9), getGpPt(self.a10), getGpPt(self.a11)) edge7 = make_edge(arc3.Value()) edges.append(edge7) edge8 = make_edge(getGpPt(self.a11), getGpPt(self.a12)) edges.append(edge8) edge9 = make_edge(getGpPt(self.a12), getGpPt(self.a1)) edges.append(edge9) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = self.L * self.wDir # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) mkFillet = BRepFilletAPI_MakeFillet(prism) anEdgeExplorer = TopExp_Explorer(prism, TopAbs_EDGE) while anEdgeExplorer.More(): aEdge = topods.Edge(anEdgeExplorer.Current()) mkFillet.Add(self.T / 17., aEdge) anEdgeExplorer.Next() prism = mkFillet.Shape() return prism