Clipping intersecting meshes for boolean operations such as union, intersect and subtract.
This attribute wrangle running over points creates signed distance values by combing winding numbers with world distances. The windingnumber differentiates outside from inside by returning positive or negative values. xyzdist returns the world space distance to the other surface.
float accuracy = chf('accuracy');
float offset = chf('offset');
float wind = windingnumber(1, v@P, accuracy);
float dist = xyzdist(1, v@P);
float dist_sign = -dist * (wind - offset);
f@dist_sign = dist_sign;
Subdivided meshes can be cut to output shattered pieces, intersections, unions, subtracted pieces, and seam curves. Resulting surface boundaries are not connected to one another.