SDF boolean subtraction uses max(distance, -cutter) to carve one shape out of another
Just as min() merges (unions) two SDFs, max(a, -b) subtracts shape B from shape A. The negation of B’s SDF makes its interior positive; max then keeps only points outside B that are inside A. This is used for sculpting: to add a mouth cavity to a face, define an ellipsoid for the mouth and compute max(bodyDist, -mouthDist). The body survives everywhere except inside the mouth ellipsoid. A smooth variant produces a rounded carved edge.
Examples
float mouth = sdEllipsoid(p - mouthPos, mouthRad); float body = smin(torso, head, 0.1); float creature = max(body, -mouth);
Assessment
A student uses min(body, -mouth) instead of max(body, -mouth) for subtraction and gets unexpected results. Explain what they would see and why.