Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating PolyTree #14

Open
anlumo opened this issue Nov 18, 2020 · 5 comments
Open

Creating PolyTree #14

anlumo opened this issue Nov 18, 2020 · 5 comments

Comments

@anlumo
Copy link

anlumo commented Nov 18, 2020

There's a function polyTreeToPaths, but there is no reverse of this. However, most operations just use Paths, so I can't stay on PolyTrees. How can I create a PolyTree?

@xaviergonz
Copy link
Owner

did you check openPathsFromPolyTree ?

@LeoBLMitz
Copy link

There's a function polyTreeToPaths, but there is no reverse of this. However, most operations just use Paths, so I can't stay on PolyTrees. How can I create a PolyTree?

@PetterGs
Copy link

PetterGs commented Feb 27, 2023

It seems like the answer doesn't match the question. Would it be possible to get a different answer to this question?

I would surmise from this conversation that you wouldn't ever want to create polyTreeToPaths.

@xaviergonz
Copy link
Owner

xaviergonz commented Feb 27, 2023

It is possible to go from polyTree to paths since poly trees have more info than paths, but it is not possible to go back since that info would be missing. From the docs:

PolyTree is intended as a read-only data structure that should only be used to receive solutions from clipping and offsetting operations. It's an alternative to the Paths data structure which also receives these solutions. PolyTree's two major advantages over the Paths structure are: it properly represents the parent-child relationships of the returned polygons; it differentiates between open and closed paths. However, since PolyTree is a more complex structure than the Paths structure, and since it's more computationally expensive to process (the Execute method being roughly 5-10% slower), it should used only be when parent-child polygon relationships are needed, or when open paths are being 'clipped'.

So it is not that I don't want to, but that it can't be done

Repository owner deleted a comment from LeoBLMitz Mar 3, 2023
@anlumo
Copy link
Author

anlumo commented Mar 8, 2023

Can't that information be regenerated from the input? Like, check if a polygon is contained within another polygon to reconstruct the hierarchy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants