aligning-parts-by-connector-constraints
A manual page or a person describes a build by its connections: this brick on those studs of that one, turned this way. Manual2Skill++ turns such connector statements into 6D part poses by aligning connector frames. For studs and tubes every connector frame is a lattice node with a vertical axis, so the alignment is exact integer arithmetic; this skill does that part.
Statements
{part, on, at: [i, j], rotation, part_stud: [a, b]}: part's stud
part_stud (default its stud (0, 0)) goes over the base's stud at, in the
base's own stud coordinates (u along its first size number, v along its
second), with the part turned rotation degrees (0, 90, 180, 270) about +z
relative to the base. on: "plate" (or plate.id) is the baseplate,
coordinates (0, 0) at its corner. size "AxB" (or in parts),
height_units 3 for a brick and 1 for a plate.
How it solves
- Read the statements; a part's size and height come from
parts, else from its first statement (a later different size is a conflict). - Repeatedly place every part whose bases are all placed (cycles and
unknown bases are reported): the part's stud (0, 0) goes to
base.stud(at - R_r(part_stud)), its rotation is the base's plusr, its bottom on the base's top (base z + base height). - Checks: at least
min_support(1) of its studs sit over the base's studs; the same cells and height (rotation modulo the brick's symmetry) from every statement that names it; no shared cell with a part whose height range overlaps; inside the plate's stud area. - Out: per part the plate cell of its footprint's corner (
cellx, y, layer, rotation), spans,z_units,height_units, kind, step; withplate.originthe footprint centre's world position and yaw (cells to metres by the pitch, 8 mm LEGO / 16 mm DUPLO);steps_jsonis one step per part in solve order, in planning-brick-assembly-order's format.
Checked
No arm motion, no robot tools. Tests
(tests/bundles/test_aligning_parts_by_connector_constraints.py): a turned
brick on a brick, a part-stud anchor on a turned base, a bridge spelled from
both bases (agreeing and disagreeing), each inconsistency kind, one-stud
overhangs and min_support, world poses on a turned plate, plates stacking
by their own height, and two LDraw models round-tripped: the hub's brick
plans for pyramid.ldr (13 bricks) and the 1869 South African Flag (82
bricks) re-written as connector statements (each brick on the plate or on a
brick under it, at that base's stud of its own stud (0, 0)) and solved back -
every brick's cells and height identical to the plan - then fed to
planning-brick-assembly-order, which places all of them (finger check off).
Limits
- Stud-to-tube connections only (no SNOT, Technic pins, hinges, jumper half-stud offsets).
- The statements must already be in stud coordinates; turning a manual page
into them is a VLM's job (extracting-a-subassembly-tree-from-manual-pages
or a prompt), and its mistakes come out as
constraints_inconsistentonly when they are inconsistent. - No stability analysis (checking-design-connectivity-and-collisions).
Provenance
The connector-alignment idea is Manual2Skill++'s (Tie et al., ICRA 2026). Its repository has no licence, so nothing was copied; for LEGO the solver is a few lines of lattice arithmetic written here. The lattice and cell conventions are computing-brick-pose-from-stud-grid's and planning-brick-assembly-order's.


