# Re: [rp-ml] algorithm&implementation for STL slicing

From: Wesley Brooks <wesbrooks_at_gmail.com>
Date: Wed Aug 23 2006 - 11:47:46 EEST

I'm currently doing a lot of work with STL files with VTK and python.

My understanding of thing is to view things on the screen of a computer at
some stage the file will be converted into a triangular facet file, and to
do any form of machining or scan path creation the contours created from the
slice/surface intersection will have to be represented as line elements.

While I can see the sense of keeping some form of mathematical
interpretation surface model of a file while it is edited and updated in a
CAD environment rather than keeping fixed resolution surface data, I can't
see the reasoning behind working with this format when slicing and preparing
data for machines of fixed resolution.

To get a usable slice from the mentioned mathematical models is it a case of
collecting a series of equations that describe the intersection of a
polynomial surface which you then have to work with a specific function
(dependant on the type or order of equation) to convert this equation into a
series of vectors/line elements?

What is not desirable about converting the whole surface file into a
triangular facet file (Not STL format, something a little more robust that
collects shared points, neigbours, etc.) whose resolution is what the
machine is capable of. With this approach collecting a series of triangle
surface intersections will give you a vectorised contour, whose direction
will tell you whether it is an internal or external contour.

As I currently understand it, what is presently lacking is really good
triangulation methods that adapt to best suit the geometry. Through the many
builds I've prepared for either DTM SLS machines or MCP's SLM machines I
have seen loads of bad triangulation, with my pet hate being the high aspect
ratio triangles. These were very long and narrow that normally appeared, or
where discovered during fixing, and caused no end of trouble when
offsetting, slicing, and hatching.

Would controlling the triangulation in this method rather than at a slice
level also give benifits to surface finish?

What I've said above is my understanding of things that I've been building
through recent work with manipulating triangular facet files and discussions
with another programmer who develops automatic machining path generation
software. I have little to no experiance with working with the NURBS and
polynomials but do intend to investigate them, starting with the CADCAM book
I have next to me on my shelf! If you know of online resources that I could
use to further my knowledge of these formats, or indeed current work on