i want to disassemble a shape, save it in three lists (a vertices list with coordinates, a edges list with numbers of vertices that refer to the vertices list, a wires list with numbers of edges that refer to the edges list) and rebuild the shape again afterwards.
It works fine for most of the shapes, but i have some trouble with openings: If my shape is a building block with an opening (e. g. a wall with space for a window), the opening will be closed (see attached picture, the left one is the original shape, the right one is the rebuilt shape). My algorithm builds a face of the four outer edges that will cover the opening and it also builds another face for the opening itself.
I tried to use BRepFeat.brepfeat.IsInside() and compare the rebuilt faces to each other. If the order was true, i tried to cut out the inner face via BRepBuilderAPI.MakeFace.Add(). I did not succeed in doing this because the result of BRepFeat.brepfeat.IsInside() is also True for some faces that are parallel to another face. Am i doing something wrong in using this function?
My current solution is to disassemble the shape again – this time in faces – after rebuilding it, calculate the distance between the faces with BRepExtrema_DistShapeShape and get a boolean for BRepExtrema_ExtFF.IsParallel. If it’s true and the distance equals 0, i cut out the face with the minor surface. It works, but it uses many process steps.
It might work better if i use the information about how Open CASCADE handles these cases internally (e. g. how it stores the information that the face has an opening and that another face is the opening itself). Maybe i could also save it in the wires list and directly build a shape with openings. Is it possible to implement this approach? Does anyone have an idea how to do so?
Thanks in advance