pyboxbuilder.paths.inset_rectilinear¶
- pyboxbuilder.paths.inset_rectilinear(path: Sequence[tuple[float, float]], distance: float) tuple[tuple[float, float], ...][source]¶
Pull a rectilinear outline inward by distance.
Every corner joins one horizontal and one vertical edge, so its new position is the old one moved by distance along each incident edge’s inward normal. That is exact for convex and reflex corners alike — an L stays an L, with all six of its sides moved in, which a centroid scale would not manage. A reflex corner correctly moves out into the notch, keeping the arm’s width right.
Which way is inward depends on the direction the outline is traversed, not on where a corner’s neighbours happen to sit, so the normals come from the directed edges: for a counter-clockwise ring, edge (dx, dy) points inward along (-dy, dx).