Replies: 6 comments
-
Hi @kintel Did you try |
Beta Was this translation helpful? Give feedback.
-
Yes, but I'm missing a |
Beta Was this translation helpful? Give feedback.
-
In my plugin sometimes i add custom functions or classes (in this case ClipperUtils) maybe you can use the same way
|
Beta Was this translation helpful? Give feedback.
-
Thanks! It feels a bit expensive to perform a union just to convert, considering that the Paths64 already came straight from Clipper. In the meantime I'll look into writing my own simplification function, operating on PolyTrees.. |
Beta Was this translation helpful? Give feedback.
-
OK, looks like a PolyTree implementation is pretty easy, at least for closed curves:
|
Beta Was this translation helpful? Give feedback.
-
Closing as resolved: The above helper function works. If anything, this can be reopened as a Feature Request to offer SimplifyPolyTree() as a Clipper builtin. |
Beta Was this translation helpful? Give feedback.
-
We (OpenSCAD) are using Clipper2 to perform 2D polygon offset operations.
When offsetting, we prefer writing the result to a
PolyTree
structure, as that allows us to later walk the tree and easily identify holes as we go.However, we also want to perform the recommended simplification between offset operations, and I haven't found a convenient way of achieving that:
SimplifyPath()
doesn't accept a PolyTree parameter (only Path and Paths).BuildTree64()
, which converts from Paths to PolyTree, is private.Are there any recommended ways of obtaining a simplified PolyTree result from an offset result?
Barring a recommended way, what would be the best way forward, e.g. Add a new SimplifyPath() variant, make BuildTree64() public, or building a copy of one of those in user space?
Beta Was this translation helpful? Give feedback.
All reactions