luizbarboza / polyclip-ts

MIT License
28 stars 10 forks source link

How to calculate the area of the result of union, intersection, etc? #15

Open Dylan190774 opened 1 month ago

Dylan190774 commented 1 month ago

I want to calculate the total area of the result of the functions. I know there are other libraries for that, but it would be very useful to have it in this package, since every library uses its own data-structure and types.

Do I just need to iterate all Polygon's ? But the result can contain 'Ring's, too. What about them?

I can't figure out how a Ring works. Do I need to subtract the inner Ring from the outer Ring to get the right result? But how to distinguish between inner and outer Ring then?

A bit more documentation about the type structure that is used, would be very welcome.