I' trying to triangulate and visualize some STEP models in the custom visualizer and I spotted an issue with normals of one specific model (model s1-tu-203 available at the https://www.cax-if.de/cax/cax_stepLib.php). I tried to visualize the same model using CAD Assistant and the normals seem to be correct there (see the attached images Custom_shaded.jpg and CADAssistant_shaded.jpg).
I also noticed that the triangulated mesh looks very different in the custom visualizer compared to the result produced by the CAD Assistant (see the attached images Custom_wireframe.jpg and CADAssistant_wireframe.jpg).
I performed triangulation using BRepMesh_IncrementalMesh class and then I used BRepLib::EnsureNormalConsistency to fix normals on the face edges. The described issue does not appear when I do not use BRepLib::EnsureNormalConsistency.
It looks like there's a problem with the resulting normal of the shared vertex between multiple triangles (in the center of the sphere) produced by BRepLib::EnsureNormalConsistency.
I tried to fiddle with the BRepMesh_IncrementalMesh parameters but the incorrect normals in the center of the sphere still remained even for the more detailed mesh.
- OCCT version: 7.4.0
- BRepLib::EnsureNormalConsistency parameters:
- AngTol: 0.001
- ForceComputeNormals: True
- BRepMesh_IncrementalMesh parameters (the rest was left to defaults):
- AngularDeflection: 0.296706 (17 deg)
- LinearDeflection: 0.3
- MinSize: 1e-7
- Relative: True
- AdaptiveMin: False
- InternalVerticesMode: True
- ControlSurfaceDeflection: True
- InParallel: True
My questions are:
- Is CAD Assistant using the same BRepMesh_IncrementalMesh algorithm for triangulation and also BRepLib::EnsureNormalConsistency for fixing normals on the edges?
- If yes, is there a possibility, that it may be caused by a different BRepMesh_IncrementalMesh or BRepLib::EnsureNormalConsistency parameter settings?
- If yes, would it be possible to share those settings?
Thanks in advance.