Meshing Performance

I´m currently working on my project and do performance optimisation. In my programm I need to calculate the triangulation of a solid. I tried it with:
1) BRepMesh::Mesh(this->mSolid,TOLERANCE_3D_DISCRETISATION);
2) for (TopExp_Explorer lExplorer(this->mSolid,TopAbs_FACE); lExplorer.More(); lExplorer.Next())

The first way needs 520 milliseconds and the second one only 260 milliseconds! Can someone explain me why???

Roman Lygin's picture

Hi Stefan,

A few thoughts:
1. Run a few tests to see how time changes. Fractions of seconds is too short period to be reliable;
2. A possible root-cause can be that when trying to tesellate faces in the solid the algorithm tries to satisfy sample points along shared edges. This takes time but actually your mesh over solid can be slightly different than one produced using individual faces.
To check #2, try to break connectivity between faces. For instance, export to IGES and read back to get a compound of your faces (instead of a solid) and call 1) and 2) and see what will happen.

Hope this helps.
--- - the Open CASCADE blog - CAD Exchanger, your 3D data translator