Mon, 07/09/2018 - 17:45
Greetings,
I'm currently reading an stl file with:
RWStl::ReadAscii(OSD_Path(stlfilepath.c_str()));
In my Stl file, each facet is described by three poitns and a normal:
facet normal 0.000000e+00 -0.000000e+00 -1.000000e+00
outer loop
vertex 3.838308e-02 4.185656e-04 -9.486067e-02
vertex 3.838923e-02 4.216301e-04 -9.486067e-02
vertex 3.837746e-02 3.022011e-04 -9.486067e-02
endloop
endfacet
This file was also exported by OpenCascade.
How could I read the normals of each facet too?
Mon, 07/09/2018 - 18:03
Normals in STL file are meaningless in most cases - either they just define normal to triangle
(which can be trivially computed from triangle nodes) or haven't written at all (some STL exporters write zeros here).
I wouldn't rely on this information in STL file.
Tue, 07/10/2018 - 13:47
The normals can be trivially computed of course but, my problem is to distinguish between the inside and outside of the geometry. Thus, if the normals are facing outwards (by export from OpenCascade) or inwards, I could use that information. I'm currently using OCCT 7.2.0. Is there a way I could compute that information ?
Best Regards,
Pranav
Tue, 07/10/2018 - 08:56
Loop through the vertices and normals of each triangle in domain
of the STL mesh using StlMesh_Explorer class and its functions.
Tue, 07/10/2018 - 10:51
> of the STL mesh using StlMesh_Explorer class and its functions.
These are not part of Open CASCADE Technology since OCCT 7.2.0.