Skip to content

A Reduce-like interface to polyclip() #6

@thomasp85

Description

@thomasp85

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions