v2 SimplifyPaths vs. v1 CleanPolygons & SimplifyPolygons #685
-
Thanks @AngusJohnson for all the work on this library -- and to anyone in the community who helps other users. I'm porting my program from Clipper1 to Clipper2. I use Clipper to calculate projected areas of 3d meshes. To do this, I rotate the 3D model such that the X-direction is aligned with the desired projection direction. I then smash all the triangles into the YZ plane. I use Clipper to take the Union of all those tris. In a typical case, there can easily be tens or hundreds of thousands of tris. The result is a polygon around the perimeter of the projected area. Sometimes, part of the boundary is a straight line, but because of the process I take to get there, it is usually made up of a large number of segments. With v1, I would call
After my big Union operation. This would do a nice job of cleaning up the result to a minimum number of segments. What is the best way to achieve similar results in Clipper2? Should I use I see I just found I've also found If I use Thanks for any suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Make sure that your
This function is mostly useful when offsetting.
Again, this function is similar to
OK. (As you can see I've only just now read this far 😜.)
Yep. Just use
As above, just use
It would probably be least confusing if you did your own scaling (ie use Clipper64 rather than using ClipperD). You shouldn't be getting collinear adjacent segments when |
Beta Was this translation helpful? Give feedback.
Make sure that your
Clipper64
object hasPreserveCollinear
= false.That should be all you need, though occasionally a repeat Union operation might further simplify your solutions.
This function is mostly useful when offsetting.
Nevertheless I guess it could also be u…