alexrj/Slic3r — pull request #1386 by platsch (2013-08-12 13:08:03+00:00)
Title: Adaptive slicing

This is a first approach towards automatic layer height configuration.
The new Print Settings option "Adaptive slicing" determines the height of each individual layer by evaluating the objects surface at this region. It attempts to maintain the error caused by the stair-stepping-effect below the given cusp-value, basically as described in (e.g.) http://www-rp.me.vt.edu/bohn/projects/sabourin/thesis.pdf p.33ff, but with some modifications.

Some technical implementation details:
I've added a sub slice_adaptive in Object.pm which can be called instead of slice. Slice_adaptive makes use of some more or less generalized functions provided by AdaptiveSlicing.pm, where the surface evaluation stuff is stored.
The cusp-height algorithm needs min and max layer height capabilities for every extruder in use. This options are therefore added to the Extruder config in Printer Settings.
The first layer height is taken from the config. Subsequent layers are generated based on the normals of the facets crossing the $print_z layer and refined to match horizontal features and peaks/abrupt slopes.
Some basic testing is implemented in adaptive_slicing.t.

This is work in progress. Please give some feedback/opinion whether people are interested in this feature and about my implementation and integration into Slic3r. My experience in open source development is very limited and I'd like to avoid spending a lot of time on things no one will ever use :)

Next step would be implementing further control parameters for surface quality and overhanging areas and multi-extruder support to mix extruder diameters depending on the local structure of an object.

![adaptive_servo_gcode](https://f.cloud.github.com/assets/4190756/947271/60462648-034e-11e3-8938-f22a9af8e0ed.png)