Merging common edges in a model generated from code

I have developed a feature extraction and surface reconstruction algorithm which attempts to convert facet models into solid models with merged facets.

I have been using a cube to make sure the output is correct and I have noticed that when I open the output STEP file in FreeCAD, the 6 faces of the cube are individual objects and are not combined into model.

The 12 edges of the cube are being reused for the faces of the cube (so adjacent faces are using the same edge in the wire that is used to create the TopoDS_Face;AFAIK the same vertices are used for corners but I would need to check to be 100% certain)

I am using BRepBuilderAPI_Sewing to combine the TopoDS_Face s, I am not sure if this is the correct way, please advise me if there is a better way.

I have attached images describing the problem I am facing

S H's picture

I managed to fix the problem, it was an implementation bug in one of the algorithms which led to wires not being produced correctly. This had an additional effect on the planes being generated. I can now extract and reconstruct features of primitive facet models.

fan sizhe's picture

Hello, friend, how do you solve this problem, can you tell me how to solve it, because I am also experiencing this problem.thank you!