So I am trying to access the edges that are obtained when I use the boolean operation Section on surfaces. My goal is to use those intersection edges to create a wire profile which I will then extrude to create another surface. Can anyone help with a code in PythonOCC?
Thanks
Below is a code I worked on. The first one create the sections which works fine but the second one which is supposed to create the edges keeps on failing
def section():
sections = []
for i in range(len(theBodies)):
# Computes Torus/Sphere section
section_shp = BRepAlgoAPI_Section(shp, theBodies[i], False)
section_shp.ComputePCurveOn1(True)
section_shp.Approximation(True)
section_shp.Build()
sections.append(section_shp)
#display.EraseAll()
#display.DisplayShape(shp)
#for section_ in sections:
#display.DisplayShape(section_.Shape())
#display.FitAll()
return sections
def sect_edges():
# Obtaining the intersecting edges
sectioning = section()
for i in range(len(sectioning)):
intersect_edges = sectioning[i].SectionEdges()
for intersect_edge in intersect_edges:
intersect_edge = TopoDS_Edge(intersect_edge)
anAisEdge = AIS_Shape(intersect_edge)
display.Context.Display(anAisEdge,True)
New contributor
Adjei Ameyaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.