Solution (source code)

= Solution

A <parallel surface> at signed distance $d$ from a design surface describes a constant-thickness skin, shell, coating or clearance envelope. A particularly important application is machining with a spherical cutter of radius $r$: when the cutter touches $P$ without penetration, its center lies at $P+r n$, where $n$ is the outward unit <normal vector>. Thus a tool-center path can be computed on the <surface offset> rather than on the desired contact surface. Positive and negative <surface offsets> also model material addition and removal, and pairs of offsets describe the two faces of a thin manufactured wall. \b[Offsets convert contact, thickness and clearance specifications into geometric surfaces which can be interrogated.]

The construction is initially local. Where the offset develops self-intersections or reaches a curvature radius, not every point of the raw <parallel surface> is a usable physical boundary. Tool paths and solid envelopes may require trimming those pieces and checking global collisions.