
Mon, 07/21/2025 - 23:46
Forums:
hi, I'm working on a Shaded with Edges version for displaying STL files in my program, but with sharp edges. My goal is to achieve edge display similar to CAD Assistant. I'm using the Open3D library, but my results aren't satisfactory. CAD Assistant - do you know how this is done? Maybe it uses an open-source library? Thank you Piotr
Tue, 07/22/2025 - 10:43
CAD Assistant purely based on OCCT CAD kernel. You can have similar results with OCCT.
Best regards, Dmitrii.
Tue, 07/22/2025 - 14:54
Thank you,
I'm working on a Shaded with Edges version for displaying STL files in my program, but with distinct edges.
Please tell me how to approach this task, what C++ objects from OpenCascade should I use to achieve a good result?
Maybe OCCT itself can do this well?
Pd
Thu, 07/24/2025 - 23:13
Hey Piotr.
You can explore the Edges of a Solid/Shape and render them by yourself on your renderer of choice, that is one option.
However STL files are Mesh-like and not B-REP, so I'm not sure exactly you can extract "hard edges" from a mesh.
Fri, 07/25/2025 - 13:27
Hey,
This isn't a simple task. In its simplest form, you can analyze triangles and angles to see if they're smaller than specified.
But there are exceptions, and these require significant work to eliminate unnecessary lines.
It would be best to rebuild the model's face structure and extract the edges.
CAD Assistant, based on Opencascade, does this excellently, but what libraries does it use?
Piotr
Fri, 07/25/2025 - 14:05
The tool
Poly_MergeNodesTool
merges/splits unstructured triangle nodes from STL file (which doesn't supports structured/indexed triangulation) by simple criteria of angle between triangles. It doesn't perform any advanced analysis of the model, but provides good results on many kinds of models.RWStl_Reader
relies on above-mentioned tool on reading STL files and can be configured viaRWStl_Reader::SetMergeAngle
property.Visualization relies on
StdPrs_ShadedShape::FillFaceBoundaries()
tool to collect sharp edges in trianglation - by sorting out triangle edges without neighbors.