Alpha carving removes all points that can be swept out by a disk of radius alpha. A point is carved if some such disk covers it and the disk center can be moved in from the boundary without the disk colliding with the segment mesh.
The 3D analogue is like carving with an ice cream scoop: a radius-alpha ball can remove whatever volume it can reach from outside without intersecting the input. For a production 3D version, see CGAL’s 3D Alpha Wrapping, which shrink-wraps triangle soups or meshes into watertight surface meshes using alpha and offset parameters.
Compute Shader Structure
For each alpha value, the carving pipeline runs the following 5 compute passes:
- Compute clearance: how far each grid cell is from the nearest segment.
- Threshold by alpha: valid center = clearance >= alpha.
- Union-find: atomically unions neighboring valid centers; boundary-connected sets are marked reachable.
- Jump flood: starts with reachable centers as seeds and propagates the nearest reachable seed across the texture.
- Compose: a pixel is blue if its nearest reachable center is within alpha; otherwise it is red.
Interactive Demo
Click pairs of points on the canvas to add segments, then use the alpha slider to change the carving radius.