Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 04:10AM
Looking here: [en.wikipedia.org]) I just realised that in addition to the three points specifying each of the triangles in the solid, the normal is also required. As stated in that wiki page, this can actually be calculated anyway, so it would seem superfluous, except as stated for shading effects. However, I'm not sure what a normal pointing inwards would mean anyway?

In order to check my understanding though, am I right in saying for the purposes of slicing, all the normal really means is what's 'inside', and what's 'outside'. Presumably you could specify any arbitrary polyhedron, with all the normals pointing 'inside', and that would curiously mean that what you're really specifying is everything around it being 'filled in'?

Or do the slicers just ignore normals completely, and simply fill the inside of the polygon defined by the intersection with the z-plane?
VDX
Re: Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 04:18AM
AFAIK this depends on the used software - often the normals are ignored (or not present, as with RAW formats).

Then the slicing software assumes, that the outmost found conture line defines the hull of a solid part and subsequent contours inside this area are holes in the object.

With intersecting contours this can cause some funny 'alternating' effects too ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 12:07PM
I wouldn't bet it's recalculated by the Slicer, they might, but I'd probaly assume what's written is accurate.
It's trivial to calculate it's just the cross product of any normalized edge pair, though there are issues if triangles in the model are degenerate or close to.
Re: Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 12:46PM
As polygonhell says it is trivial to calculate especially on a modern computer, might save a split second when loading a file since it won't have to calculate them before rendering. Do stl's save the vertices in order (such as clockwise around each triangle) , if not, then saving normals makes a lot of sense as it becomes nontrivial establishing their direction.
Re: Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 01:35PM
Every STL I've looked at has consistent face winding.
Re: Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 02:47PM
Thanks for the responses.

Appreciate what the normal is and how it can be calculated, from a 3D graphics perspective.

However, purely for slicing, is the normal actually needed? As Viktor says, you can assume the outermost polygon represents the transition from 'outside' the solid to 'inside'.

Marcos

Edited 1 time(s). Last edit at 12/19/2012 02:56PM by marcosscriven.
Re: Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 03:41PM
I think Skeinforge uses the winding order and ignores the normal. Not sure what other slicers do. It is redundant information in the STL file and I think it is often wrong.


[www.hydraraptor.blogspot.com]
Re: Is the normal to each triangle in the STL file important for slicing?
December 19, 2012 03:50PM
While it is very simple for a human to tell which side is inside or outside a shape, is it actually that simple for a computer? (assuming no ordering of vertices to define surface normal). If it's a complex shape with internal voids within voids I can imagine it's hard since an internal void looks like an enclosed shape and logically is therefore a solid. Maybe there is an efficient algorithm.
Re: Is the normal to each triangle in the STL file important for slicing?
December 20, 2012 08:46AM
Yes, there are alorithms doing this. First, find all neighbours and make them match. An attempt to calculate the volume will show which is the inside of the whole surface and which not.

Internal voids have no connection to the outside surface, so they can be handled like outer volumes. Check one vertex of an inner void to be inside another volume and you'll know wether the entire volume is a void or a different part.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Sorry, only registered users may post in this forum.

Click here to login