neu_draw.layout¶
Arranging a set of objects: boxes (BBox) in, offsets
(Vec3) out. Knows nothing about drawables or renderers.
superimpose_offsets() sends every object’s anchor to one point;
arrange_offsets() lays them out on a row or grid. Both act only on the axes asked
for, so they compose without discarding coordinates that carry meaning, such as depth:
scene.superimpose(axes="z").arrange(along="x")
Spacing is either packed by each box’s real extent (spacing=None, the default) or a
fixed pitch in nm, for figures where uneven spacing would look meaningful.
Attributes¶
Functions¶
|
The point of |
|
Offsets laying the boxes out along |
|
|
|
Offsets putting every box's |
Module Contents¶
- neu_draw.layout.anchor_point(box: neu_lib.BBox, anchor: str = 'center') neu_lib.Vec3¶
The point of
boxa layout places.
- neu_draw.layout.arrange_offsets(boxes: Sequence[neu_lib.BBox], *, along: Any = 'x', anchor: str = 'center', spacing: float | None = None, gap: float = DEFAULT_GAP, wrap: int | None = None, down: Any = 'z', origin: Any = None, align_cross: bool = True) list[neu_lib.Vec3]¶
Offsets laying the boxes out along
along, wrapping todowneverywrap.spacingis a fixed pitch in nm. LeftNone, the boxes are packed by their own extents withgapbetween them (a fraction of the mean extent), so unequal sizes do not overlap.wrapturns the row into a grid.align_cross=Truealso lines the anchors up on the other axes, so a row reads as a row even for objects from different datasets;Falseleaves those axes untouched.originis where the first anchor lands, by default where it already is.
- neu_draw.layout.axis_index(axis: Any) int¶
"x"or2to an index into a zyx triple.
- neu_draw.layout.superimpose_offsets(boxes: Sequence[neu_lib.BBox], *, anchor: str = 'center', axes: Any = None, at: Any = None) list[neu_lib.Vec3]¶
Offsets putting every box’s
anchoron the same point.The point is
at, by default the first box’s anchor, so the first object stays put and the others move onto it.axesrestricts which axes move:axes="z"aligns depth and leaves the rest where the data put them.
- neu_draw.layout.ANCHORS = ('center', 'min', 'max')¶
- neu_draw.layout.AXES¶
- neu_draw.layout.DEFAULT_GAP = 0.1¶