(De)Triangulation of a shell

i have multiple coplanar (coincident) TopoDS_Face(s) forming a shell (triangulated). I would like to merge these coplanar faces into single faces on the shell.

Is there any way in opencascade to de/un triangulate a shell to a minimum set?

Stephen

Paul Jimenez's picture

I do not think there is such a thing in OCC.

If I am fully understanding your question, what you could do is map edges to faces (only of those faces that are both coplanar and connected), create a list of all edges that are not shared, then create a wire from them and, finally, create a face from that wire. You could even take it a little bit further and "merge" connected parallel edges before creating the final wire.

Stephen Leary's picture

Yes that sounds about what i had envisioned doing.

Wanted to check that nothing already exsisted before i started.

Stephen

P Dolbey's picture

Stephen,

I have a feeling that the Tetgen (not netgen!) does something similar for converting STL files to FE meshes. I think it first analyses the STL triangulation, merging coplanar faces into planar polygons before running the quality surface meshing, which is how the final mesh is not contrained by the original STL trangles. - You might find useful code there.

Pete