Fri, 01/07/2022 - 17:53
Forums:
Hello. There are 2 intersecting Wires (2 circles) lying in the same plane. How to get the result of combining them?
BRepAlgoAPI_Fuse.Shape() returns an object with all Edges separated by intersection points. But how to get only external (in this case) Edges / Wire?
Attachments:
Fri, 01/07/2022 - 20:40
Fusing a pair of TopoDS_Wire makes no sense in OCCT world. Until TopoDS_Wire defines boundaries for some TopoDS_Face - it is nothing but a list of connected Edges.
I'm not sure if OCCT provides a dedicated API for Boolean operations in 2D space, but it is possible to accomplish fuse operation on two TopoDS_Face instances lying on the same plane. The result will be, however, not a single Face, but a Compound of three Faces sharing common boundaries (see yellow edges on screenshot below)! Internal Edges will be shared between Faces, so that they could be classified in some way.
Maybe there is a simpler way to accomplish your task in OCCT...
Fri, 01/07/2022 - 22:12
Thanks. So aFreeEdges will contain green edges? How about Cut operation?
What does sewing do? I mean what is the equivalent of these commands in C++ code?
After Fuse on two faces (BRepBuilderAPI_MakeFace, BRep_Builder.Add(face, wire)) TopExp_Explorer returns two faces, not three. Do I need to create a Face bounded by Wire in a different way?
Sat, 01/08/2022 - 09:59
W W wrote:
"sewing" calls BRepBuilderAPI_Sewing, which makes TopoDS_Shell from Compound of Faces. This is not necessary in this particular case - just called it to verify that Faces produced by Boolean operation indeed share common boundaries. You can find source code of Draw Harness commands by grepping "sewing" (in quotes) in OCCT source code folder "src" or by using getsourcefile command in Draw Harness console.
The Wire should define a properly connected, oriented and closed boundary to define a proper valid Face. You may share your shapes (BRepTools::Write()) to see if there is something special in them.