CLIPPER_OFFSET_SCALE was made a power of two, the scaling functions

inside ClipperUtils are now using bit shifts instead of multiplication
by doubles, which makes the scaling precise.

Removed the scale parameter from all offset functions.

Modified the safety offset to calculate offset per polygon instead
of over all polygons at once. The old way was not safe and very slow,
sometimes this meant a kiss of death for supports for example.
This commit is contained in:
bubnikv 2016-11-28 17:33:17 +01:00
parent e93253e270
commit 695c92fb00
14 changed files with 214 additions and 152 deletions

View file

@ -610,7 +610,7 @@ Print::validate() const
// grow convex hull with the clearance margin
{
Polygons grown_hull;
offset(convex_hull, &grown_hull, scale_(this->config.extruder_clearance_radius.value)/2, 1, jtRound, scale_(0.1));
offset(convex_hull, &grown_hull, scale_(this->config.extruder_clearance_radius.value)/2, jtRound, scale_(0.1));
convex_hull = grown_hull.front();
}