Update brep after replacing an old face with a new one

Hello guys !

I'm a newbee in OCC. My aim is to change the underlying geometry of a set of faces and update the brep. I have learned that in OCC, the topological shapes can only be replaced rather than modified, so what I have done is creating a set of TopoDS_Face with the new geometry (pre-defined) and using the methods in ShapeBuild_ReShapereplacing to replace the old faces . However, it seemed far from enough because the underlying geometry of related wires, edges and vertices is still old. I wonder if there are any usable approaches in OCC to directly recompute them, maybe in ShapeHealing ? Or can you please offer some suggestions for implementation ?

Thanks for your generous help !!!

Mikhail Sazonov's picture

If you want to change the surface of the face you need also update all edges of this face. If the changed surface does not deviate from the original one near the boundaries then you are lucky and you can use the existing 3D curves of edges to project them and make the new p-curves. In this case you can use the same edges, and ShapeFix must do restoration of p-curves for you.

Eric Tang's picture

Dear Mikhail,

Thanks for you reply and sorry for my replying late. My current dilemma is, suppose I want to do a direct modeling operation like changing the surface of a face (e.g. moving a planar face), and the curves of its edges as well as points of its vertices need be updated, what methods should I call? Actually, I have found several candidate choices: (1) methods in BRep_Builder, e.g. UpdateFace, UpdateEdge, UpdateVertex; (2) methods in ShapeBuild_ReShape. Please tell me which is the correct way to figure out it.

Thank you!!!

Eric