brokkr_kitbash.ram: a ram and linkage solver across a hinge: direct, four-bar, bell crank (cut kit-ram-core) #34

Merged
eureka merged 14 commits from nibu/kit-ram-core into main 2026-12-02 21:04:28 +00:00
Owner

Cut aetheria-release:cut_spec:cut-kit-ram-core.r1.

brokkr_kitbash/ram.py (numpy and the standard library, standalone) seats and checks a ram across one hinge: a direct ram, a four-bar (the excavator bucket linkage) and a bell crank. No action calls it in this PR; nothing in main changes behaviour.

  • pose, length, extension: pure functions of the mechanism record and the hinge angle. The linkage loop is solved in closed form on the rest pose's branch; rates (dphi/dtheta, dL/dtheta) are closed form.
  • fit: gates in order: assembly, stroke, toggle and arm, coupler pin load, clearance. A refusal is a RamError naming kind, gate, angle or pin. Transmission angles are reported, not gated.
  • clearance: a distance oracle distance(body, points), every member carried into every body's rest frame but its own; need = radius + gap + spacing / 2.
  • search, record / from_record, swept.

What the tests show (tests/test_ram.py, 31 tests, about 2.5 s)

  • R-3 knee, 0..-125: the four-bar behind the knee passes every gate before clearance and is refused on clearance: at -125 its barrel is inside the shin, the body it is not pinned to. Against the thigh and rocker alone it is clear, which is how the probe missed it.
  • The bell crank in front of the knee fits and clears the thigh, the shin, the rocker and the coupler bodies on both sides, at 251 angles; least clearance to the shin beyond radius and gap is 0.109 (the coupler at -125).
  • Ten mutants each died (M1 to M9, and M1 in both readings: the two bodies the ram spans, and parent and child only).

For the reviewer

  • tests/test_kitbash.py: one line, the package's pinned file list admits ram.py. PRs 32 and 33 edit the same line; whichever merges later takes all the names.
  • docs/kitbash.md: one hunk, a new section before "The actions".
  • Bodies in the tests are boxes and cylinders, not the R-3 meshes; the thigh bracket that carries the rocker's pivot and the shin horn that carries the coupler pin are not modelled. The mesh check belongs to the action that will call this.
  • The pin a clevis turns on must not be in the body the oracle answers for: the 0.4 e_b and 1.5 link_r exemptions are shorter than a pin's own clearance need.
  • Pin load on the four-bar reads 1.61 here; the spec quoted 1.73 from the probe, whose code does not print that figure.

🤖 Generated with Claude Code

🤖 Generated with Claude Code

Cut `aetheria-release:cut_spec:cut-kit-ram-core.r1`. `brokkr_kitbash/ram.py` (numpy and the standard library, standalone) seats and checks a ram across one hinge: a direct ram, a four-bar (the excavator bucket linkage) and a bell crank. No action calls it in this PR; nothing in main changes behaviour. - `pose`, `length`, `extension`: pure functions of the mechanism record and the hinge angle. The linkage loop is solved in closed form on the rest pose's branch; rates (dphi/dtheta, dL/dtheta) are closed form. - `fit`: gates in order: assembly, stroke, toggle and arm, coupler pin load, clearance. A refusal is a `RamError` naming kind, gate, angle or pin. Transmission angles are reported, not gated. - `clearance`: a distance oracle `distance(body, points)`, every member carried into every body's rest frame but its own; need = radius + gap + spacing / 2. - `search`, `record` / `from_record`, `swept`. ## What the tests show (tests/test_ram.py, 31 tests, about 2.5 s) - R-3 knee, 0..-125: the four-bar behind the knee passes every gate before clearance and is refused on clearance: at -125 its barrel is inside the shin, the body it is not pinned to. Against the thigh and rocker alone it is clear, which is how the probe missed it. - The bell crank in front of the knee fits and clears the thigh, the shin, the rocker and the coupler bodies on both sides, at 251 angles; least clearance to the shin beyond radius and gap is 0.109 (the coupler at -125). - Ten mutants each died (M1 to M9, and M1 in both readings: the two bodies the ram spans, and parent and child only). ## For the reviewer - `tests/test_kitbash.py`: one line, the package's pinned file list admits `ram.py`. PRs 32 and 33 edit the same line; whichever merges later takes all the names. - `docs/kitbash.md`: one hunk, a new section before "The actions". - Bodies in the tests are boxes and cylinders, not the R-3 meshes; the thigh bracket that carries the rocker's pivot and the shin horn that carries the coupler pin are not modelled. The mesh check belongs to the action that will call this. - The pin a clevis turns on must not be in the body the oracle answers for: the 0.4 e_b and 1.5 link_r exemptions are shorter than a pin's own clearance need. - Pin load on the four-bar reads 1.61 here; the spec quoted 1.73 from the probe, whose code does not print that figure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Every pose quantity is a pure function of the record and the hinge angle; rates are closed form; clearance is a
capped distance oracle met in every body's rest frame (cut kit-ram-core).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
test_kitbash's package file list admits ram.py, which puts it under the package's negative patterns.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
eureka force-pushed nibu/kit-ram-core from c19a12403f to e1682c3411 2026-12-02 17:24:45 +00:00 Compare
The record names parts (part -> body) and touch (member -> parts it may touch): the allowed-collision pairs are
skipped whole and every other member-part pair is checked. The end cuts (e_a, 0.4 e_b, 1.5 link_r) and the
own-body exemption are gone; every body owns a part or the gate refuses. Distances are signed, capped outside
only; nan is refused. search takes world(m) -> (parts, touch, distance), so a candidate's own brackets and
links are its parts; a candidate's eye stands at a's place along the axis. barrel_length derives the barrel;
record holds nothing derived, carries schema, version and a reserved compliance block, and from_record refuses
another version, an unknown key or a compliance block whole. Gate refusals name the angle and the pin.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
eureka force-pushed nibu/kit-ram-core from 7dd1de35fe to 941e146bc6 2026-12-02 19:35:14 +00:00 Compare
A zone's radius and depth are refused past the member's pin-to-pin length (by the pins alone) and its depth past
the member's eye on that pin (Ram.eye; at the gate and in from_record, so a world's answer too). Between samples
of which either is in a zone the segment is halved until the readings at its ends prove it holds -depth; at the
floor a part the axis is held outside reads as touched. Signed, three rays by majority, moves here from the
live test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
eureka merged commit 1c399a2c09 into main 2026-12-02 21:04:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Brokkr!34
No description provided.