Clipper2 scale, what is the right value to use? #419
Replies: 3 comments
-
Hi Petras.
Could you please explain what you mean by failures. Anhow, the following seems to work as expected:
|
Beta Was this translation helpful? Give feedback.
-
The problem was that I was trying adding points to Clipper64 and Path64 that rounds up to integer. In that case ScalePaths functions does not have affect since points have already been added with rounded values. I changed to the code PathsD and ClipperD: Clipper2Lib::PathsD clipper_plate_outlines;
clipper_plate_outlines.emplace_back(std::vector<Clipper2Lib::PointD>());
clipper_plate_outlines.back().reserve(plate_outline.size() - 1);
for (int i = 0; i < plate_outline.size() - 1; i++)
clipper_plate_outlines.back().emplace_back((plate_outline[i].x()), (plate_outline[i].y()));
When using ClipperD, should I scale paths or Clipper is handling the scaling internally? |
Beta Was this translation helpful? Give feedback.
-
Hi again Petras. I'm afraid It's not clear to me what you're asking. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a question related to the tolerance when converting double values to Clipper integer values.
I can maximally scale points 1e8 times and sometimes get failures with this tolerance, so I use 1e6 or 1e7.
The points coordinates are not large they are between -1000 and 1000 units.
Is the code what I am doing wrote is correct regarding the logic of scaling?
I have a feeling that in Clipper1 the tolerance of scale was bigger:
Beta Was this translation helpful? Give feedback.
All reactions