iShape-Rust / iOverlay

Boolean Operations for 2D Polygons: Supports intersection, union, difference, xor, and self-intersections for all polygon varieties.
https://ishape-rust.github.io/iShape-js/
MIT License
42 stars 4 forks source link

Output interpretation #3

Closed TarVK closed 4 months ago

TarVK commented 5 months ago

It isn't fully clear to me how to interpret the output of the algorithm. It's a Vec<Vec<Vec<F64Point>>>, and I understand it represents a set of polygons, that can have holes. I am not familiar with the convention for representing holes though. Is the following assumption correct:

I think it would be worth being very eplicit about this in the docs/comments, for people that are not familiar with the conventions.

But it's worth mentioning that overall this library looks really great!

NailxSharipov commented 5 months ago

That's absolutely correct. One more thing I can add is that all outer boundary paths have a clockwise order, and all holes have a counterclockwise order.

I agree that this part must be explained in the documentation. I will add this on my list to do.

Thanks for your feedback.

NailxSharipov commented 4 months ago

Added more detailed explanation to the API documentation.