DiscussionsIssue archiveModeling Data and Algorithms

Archived discussion

Shaded with Edges - for STL

Modeling Data and AlgorithmsMon, 07/21/2025 - 23:465 replies

Browse this forum
QuestionAuthor

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 Author

Archived image: 001-Zrzut ekranu 2025-07-21 223912.pngArchived image: 002-Zrzut ekranu 2025-07-21 224040.png

Discussion

5 archived replies

Posts are displayed in their archived order.

01Commenter-1

CAD Assistant purely based on OCCT CAD kernel. You can have similar results with OCCT.

Best regards, Commenter-1.

02Author

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

03Commenter-2

Hey Author.

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.

04Author

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?

Author

05Commenter-3

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 via RWStl_Reader::SetMergeAngle property.

Visualization relies on StdPrs_ShadedShape::FillFaceBoundaries() tool to collect sharp edges in trianglation - by sorting out triangle edges without neighbors.