On Sun, 2016-01-03 at 04:39 -0500, Martin Owens wrote:
BTW, we should probably be moving our code to use lib2geom path operations.
You know what they say, if you can't code it, draw it. Here's the current function drawn out into a diagram:
https://inkscape.org/en/gallery/item/7226/
I didn't note the French comments that seem to turn into English half way through. But the structure and variables are there and you can get a sense for what's happening. (The Division code really is called `a bastard boolean operation` btw)
I believe the original author used French and that the English comments were added by later developers.
Here's hoping that drawing is a waste of time and Tav knows the 5 lines of code to replace it all! :-D
It will not be five lines of code but it could be done a lot cleaner. Here is a rough outline.
* Verify input paths. * Find top path, convert to proper 2geom path (if path effect, etc.) * Loop over other paths ** Store style info ** Convert to proper 2geom path ** Boolean op with top path (top path not destroyed; if union, union becomes top path) ** If not union, save new path(s) if needed with style info. ** Delete old path * End loop * If union, save top path, else delete.
Tav
Best Regards, Martin Owens