4

I'm looking to learn more about the process of slicing a mesh into gcode, a process that takes a 3d model and creates 2D slices of an object that a CNC machine or 3D printer can use.

What mathematical algorithms are used to perform this type of mesh decimation/slicing? Are there any libraries that have some of them implemented?

Tim
  • 71
  • 1
  • 4
  • This question is very interesting, but also a bit off-topic, since Stack Overflow's focus is programming issues rather than algorithms. Maybe you want to contact the authors of open source slicing programs out there, for example *skeinforge* and *Slic3r*, or inspect their source code. – leemes Mar 23 '13 at 03:04

2 Answers2

5

Think of the slicer as a tool path generator. Essentially you are compiling your STL mesh in to G-code that tells a tool where to go. This is a far better documented problem in CNC machines than it is in 3D printers.

If you were type in "slicing algorithms" in to google, you wouldn't get much. Now type in "tool path generation algorithms" and you get a lot more. A lot of what goes on in 3D printing is boot strapped off of CNC milling ideas.

While this paper isn't directly applicable to Slicing for 3D printers, it might give you an idea of the sort of thinking that goes in to tool paths for CNC: http://www.sciencedirect.com/science/article/pii/S001044859900024X

http://www.emeraldinsight.com/journals.htm?articleid=1538004 is also another excellent paper.

The source code for Slic3r isn't too hard to understand, so you might want to start by making a clone, if you'd like to learn the process.

MrSynAckSter
  • 1,681
  • 1
  • 18
  • 34
  • Is it correct to say the core of Slic3r's 3d->2d.layers is in https://github.com/alexrj/Slic3r/tree/master/xs/src/libslic3r ? In other words, it is a C++ library wrapped for Perl using the 'XS' system? – don bright Oct 28 '15 at 00:26
  • Another useful google search might be "Voxelization", there are tons and tons of papers on it. And, technically, if you can voxelize, you can eventually get to GCode. – don bright Oct 28 '15 at 01:40
0

If anyone would pass by, maybe it will be helpful for him to see my library:

https://github.com/yoavmil/amlib - this is a toolset for 3D slicing (that works with polygons, not raster).

I write slicers for a living.

Yomi1984
  • 165
  • 2
  • 10