pyboxbuilder.paths¶
Polygon helpers for the rectilinear outlines the packer produces.
Leftover space between axis-aligned boxes is always rectilinear — every edge runs along X or Y — which makes exact offsetting a few lines of arithmetic rather than a job for a general polygon-offset library. Both the spacer pass (clearance around a tray) and PathBox (a tray’s inner cavity) need it.
Functions
(min corner, max corner) of an outline. |
|
Pull a rectilinear outline inward by distance. |
|
Return True when every edge is axis-aligned. |
|
Find the largest axis-aligned inscribed rectangle in a simple polygon. |
|
Find the inscribed rectangle with the longest span (max(width, length)) in a simple polygon. |
|
Return True if point (x, y) is inside the polygon by ray casting. |
|
Shoelace area of a closed outline. |
|
Return indices of convex vertices (outer corners) of a closed polygon path. |
|
Return indices of two opposite convex corners (furthest apart) of a polygon. |
|
Twice the signed area — positive when the outline runs counter-clockwise. |