A Reduce-like interface to polyclip()
thomasp85 opened this issue · 1 comments
thomasp85 commented
I often need to combine multiple shapes, e.g. following a triangulation. With the current API it is only possible to combine two polygons in one go, and I'll end up writing something like
Reduce(function(a, b) {
polyclip(a, b, op = 'union')
}, polygons)
With many polygons to merge this loop will become a bottleneck and it would be nice if polyclip exposed this api more efficiently...
One idea would be to check if B
is NULL
and if that is the case then just perform the clipping operation successively on the elements of A
baddstats commented
I am now working on this. Sorry for delay.