DiscussionsIssue archiveModeling Data and Algorithms

Archived discussion

How to get data structure of triangulation?

Modeling Data and AlgorithmsMon, 08/02/2004 - 17:033 replies

Browse this forum
QuestionAuthor

Hello!

First we have a TopoDS_Shape then we call "BRepMesh::Mesh(result, 0.05).
After this, we call BRepTool::Triangulation(F,L) (F = TopoDS_Face, L = TopLoc_Location) in a loop for every face in the tree (with TopExp_Explorer...). Now we can get the triangulation data for every face. Is it possible to get all triangles from a compound solid at once without iterating over all its faces. We have to get a triangle strip of a compound solid for visualization.
Thanks,
Benjamin

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hi all,

Was there ever a follow-up to this? I would also like to get a triangulation of a solid all at once, and then a list of triangle strips (or some other compact representation), rather than having to iterate over the faces of shape and getting individual meshes. There is a certain amount of redundancy in the later approach, and a list of individual triangles uses more memory than is necessary (as opposed to a more compact data structure).

Thanks!

02Commenter-2

Hello,

There is no built-in way to do this. This is caused by fact that OCCT kernel tries to create a mesh for topologically invalid objects. As a result, triangle strips may not exist.

Commenter-2

03Commenter-3

Hi Benjamin, Here is an example how to get the triangulation of a shape: 

See: MeshFromShape

​Hope it helps?

Commenter-3