mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Bugfix: Douglas-Peucker used perpendicular distance instead of shortest distance, thus clipping more than it should. #2474
This commit is contained in:
parent
69da8b0999
commit
d8be67c28b
7 changed files with 64 additions and 5 deletions
|
@ -90,6 +90,7 @@ MultiPoint::_douglas_peucker(const Points &points, const double tolerance)
|
|||
size_t index = 0;
|
||||
Line full(points.front(), points.back());
|
||||
for (Points::const_iterator it = points.begin() + 1; it != points.end(); ++it) {
|
||||
// we use shortest distance, not perpendicular distance
|
||||
double d = it->distance_to(full);
|
||||
if (d > dmax) {
|
||||
index = it - points.begin();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue