Fix severe performance drop while deflating polylines

Underscaled arc tolerance produced very small values so that changes
to this parameter were negligible when scaled internally, hence significant
performance drop (lots of intermediate points inserted in an arc). Now the
performance is mostly the same compared to other types of offsetting
(SQUARE, MITER).
This commit is contained in:
Andrii Doroshenko (Xrayez) 2019-12-03 15:43:59 +02:00
parent 2b824b4e45
commit 749d917424

View file

@ -1158,7 +1158,7 @@ Vector<Vector<Point2> > Geometry::_polypath_offset(const Vector<Point2> &p_polyp
case END_SQUARE: et = etOpenSquare; break; case END_SQUARE: et = etOpenSquare; break;
case END_ROUND: et = etOpenRound; break; case END_ROUND: et = etOpenRound; break;
} }
ClipperOffset co; ClipperOffset co(2.0, 0.25 * SCALE_FACTOR); // Defaults from ClipperOffset.
Path path; Path path;
// Need to scale points (Clipper's requirement for robust computation). // Need to scale points (Clipper's requirement for robust computation).