Offsetting a polygon looks like moving every vertex outward along its angle bisector. It is the first thing you would write, and it is wrong. At a sharp corner the bisector runs away toward infinity; at a concave corner the curve folds back through the shape. What you get is not at the distance you asked for — and in CAD or cutting, that distance is the point: it is the seam allowance, the tool radius, the kerf. The readout measures how far each method actually lands from the requested offset. Drag any vertex and move the slider.
neck preset and push the distance past −30.On the star at +68 the naive result misses the requested distance by more than 120 px at the points, while the robust one is exact. The yellow markers appear when the raw curve genuinely crosses itself. Everything here is plain JavaScript on a canvas — no geometry library.