Testing Mike Bostock’s Sutherland-Hodgman clipping implementation.
The scissors implementation of a scissors-congruence between two polygons of equal area suffers from numerical instability in the clipping stage of the pipeline. The current implementation of clipping simply clips two collections of polygons against one another.
This example demonstrates areas where new vertices are created while highlighting areas where floating-point precision issues may arise.
Note that the clipping polygon must be convex for Sutherland-Hodgman to work correctly. Move the control points by dragging them.