Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculate the normal for the 'facet normal' in STL file format

Tags:

3d

cad

So I have my STL code and I have been putting the normal as 0 0 0 for each triangle, as you can imagine this means that only certain software can utilise the code.

What is the method for working out the normal

i.e. the vector maths

like image 880
Bob Bibby Avatar asked Nov 06 '13 11:11

Bob Bibby


People also ask

How do you calculate facet normal?

To compute the face normal of a face in a mesh you simply take the cross product of two edge vectors of the face.

What is the normal in a STL file?

An STL file represents a surface geometry using facets. The facets define the surface of a 3D object and is uniquely identified by a unit normal, which is a line perpendicular to the triangle with length of 1.0, and by three vertices.

What is STL format explain in detail?

STL is a file format commonly used for 3D printing and computer-aided design (CAD). The name STL is an acronym that stands for stereolithography — a popular 3D printing technology. You might also hear it referred to as Standard Triangle Language or Standard Tessellation Language.

How is normal calculated?

The normal to the plane is given by the cross product n=(r−b)×(s−b).


1 Answers

You should take vertices of the outer loop and calculate surface normal as described here.

like image 95
Andrey.Dankevich Avatar answered Oct 02 '22 02:10

Andrey.Dankevich