forked from 1b-agent/opencadstudio-upstream
OFFSET derived the side from the first segment alone: which half-plane of that edge's infinite line the pick fell on. For a closed loop that misreads a pick placed beside the shape — outside the loop yet on the inner side of the first edge's line — so a counter-clockwise rectangle (RECTANG's winding when dragged bottom-left to top-right) offset outward by a side pick collapsed inward instead. Decide the side for a closed polyline with a point-in-polygon test mapped through the loop winding (left normal points inward for a CCW loop): inside → inward, outside → outward, regardless of winding. Open paths keep the first-segment heuristic. Adds a regression test covering both windings and both directions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>