Thu, 05/02/2019 - 15:28

Forums:

Hi everyone,

I'm trying to make basic shape exploration with TopExp_Explorer and I can't understand why the value I got are wrong.

I import a basic cube in STL format, so i'm supposed to find 36 vertices according to the file description, and when I apply the import after the exploration I got 72.

I'm using the basic algorithm provided by the documentation, so there is an OCCT reason to give the double of vertices after an import ?

Thanks for reading

Attachments:

Thu, 05/02/2019 - 22:50

STL file defines triangles without connectivity information (e.g. all nodes shared in original geometry are just duplicated).

This kind of geometry has very limited usage scenarios when converted into BRep format without surface reconstruction.

Usually it is better preserving triangulation as is (

Poly_Triangulation, as returned byRWStl::ReadFile()),or even implementing

RWStl_Readerinterface at application level to decide yourself what to do with triangles read from STL file (and how to merge / not to merge nodes).Fri, 05/03/2019 - 10:54

Ok, thank you for the advice on RWStl !

On the number of vertices : I understand the duplication of nodes, but for a simple cube, the triangulation gives 12 faces (each face of the cube cut in 2 triangles), each triangle gives 3 vertices ==> 3x12 = 36 instead of 8 real vertices , still not explain 72 .

Thanks again for the quick answer !

Sun, 05/12/2019 - 16:08

On OCCT 7.3.0, read as Face per triangle (obsolete):

output:

and read as Poly_Triangulation:

output:

So far I don't see anything returning 72...

Probably you are counting all Vertices of each Edge of each Triangle, which are not unique but shared in BRep, which gives 12 Face (triangles) * 3 Edges * 2 Vertices = 72.