How to merge faces?

Hello, everyone!

Recently, I used the class  BRepOffsetAPI_ThruSections to generate a section from a cirle to a rounded wire. Then I  obtained a shape with 12 faces , 10 of which consist of the side surface. However, I only want one surface as the side surface. Does anyone has ideas? Thanks in advance.

Sincerely,

Qingsong

Mikhail Sazonov's picture

Use wire instead of face as start and end shapes.

Qingsong Wang's picture

Thanks for your reply. But I did use the wire as start and end shapes. My origin code is as following. Could you please help me check it? Thanks in advance.

Circle_h1=GCE2d_MakeArcOfCircle(gp_Circ2d(gp_Ax2d(neckLocation, gp_Dir2d()), D/2),-M_PI, 0).Value()
Circle_h2=GCE2d_MakeArcOfCircle(gp_Circ2d(gp_Ax2d(neckLocation, gp_Dir2d()), D/2),0, M_PI).Value()
ch1 = BRepBuilderAPI_MakeEdge(geomapi_To3d(Circle_h1, plane1)).Edge()
ch2= BRepBuilderAPI_MakeEdge(geomapi_To3d(Circle_h2, plane1)).Edge()
circle1= BRepBuilderAPI_MakeWire(ch1)
circle1.Add(ch2)

……

mkWire2 = BRepBuilderAPI_MakeWire(aEdge12)
mkWire2.Add(aEdge22)
mkWire2.Add(aEdge32)
mkWire2.Add(aEdge42)
mkWire2.Add(aEdge52)
mkWire2.Add(aEdge62)
mkWire2.Add(aEdge72)
mkWire2.Add(aEdge82)


generator2=BRepOffsetAPI_ThruSections(True)
generator2.AddWire(circle1.Wire())
generator2.AddWire(mkWire2.Wire())
ais2=AIS_Shape(generator2.Shape())
generator2.Build()
Mikhail Sazonov's picture

You are instructing the algorithm to make a solid using the first parameter of the constructor isSolid=true. In this case it inserts start and end covers.