apps/examples/src/examples/editor-api/custom-clipping-shape/README.md
This example demonstrates the extensible clipping system in tldraw, showing how to create custom shapes that can clip their children with any polygon geometry.
The clipping system uses two methods in the ShapeUtil base class:
// Returns the clip path polygon in local coordinates
getClipPath(shape: Shape): Vec[] | undefined
// Determines which children should be clipped
shouldClipChild(child: TLShape): boolean
The CircleClipShapeUtil demonstrates:
shouldClipChild method can be used to selectively exclude certain shapes from clipping if needed.