ictdesigntools.geometry.packing¶
Gravity-style circle packing for cable cross-section diagrams.
Cables are dropped one at a time (largest first) to the lowest free spot, touching the container wall or other cables, so the picture looks like cables resting in a run. Containers decide what "inside" means: a round conduit bore or an open-top tray.
Coordinates are in inches with y pointing down, matching SVG.
RectContainer
dataclass
¶
An open-top box: floor at bottom, side walls at +-half_width, usable from top.
intersections ¶
Intersection points of two circles (0, 1 or 2 points).
Source code in src/ictdesigntools/geometry/packing.py
pack
cached
¶
pack(
container: CircleContainer | RectContainer,
radii: tuple[tuple[float, int], ...],
)
Pack (radius, line_index) items, largest first. Returns (placed, unplaced_count).