tests/fixtures/paladin_plates.json: Paladin's 16 single-view plates from one Blender run of e688951's build, each decided by its agent's plane; the thigh shields as partners are refused (two polygons, not one plate mirrored); a frame's turn is held to 1e-5, what a float32 matrix keeps

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-12-03 09:06:31 +01:00
commit 643dc599ab
4 changed files with 34 additions and 1 deletions

View file

@ -917,7 +917,7 @@ def block_plate(views, plate, traces, parse, plane=None, share=0.1, tol=TOL):
F = np.array(frame, float)
except (TypeError, ValueError):
F = np.zeros(0)
if F.shape != (4, 4) or not np.isfinite(F).all() or np.abs(F[:3, :3].T @ F[:3, :3] - np.eye(3)).max() > 1e-6 or np.abs(F[3] - [0, 0, 0, 1]).max() > 1e-9:
if F.shape != (4, 4) or not np.isfinite(F).all() or np.abs(F[:3, :3].T @ F[:3, :3] - np.eye(3)).max() > 1e-5 or np.abs(F[3] - [0, 0, 0, 1]).max() > 1e-9:
raise ReferenceFitError(f"{where}.frame must be a 4 x 4 that only turns and moves the part: a scaled or sheared frame is not metres of the plate")
try:
line = np.array(trace.get("line"), float)

View file

@ -332,6 +332,9 @@ most from it, in four points; 0.05 s. A twisted pentagon 1.2 m across with sides
17.6 m off at 663 px: 39 and 52 mm from the truth at 60 degrees with traces 0.5 and 1.5 px off, every corner
decided by the views; 65 and 135 mm at 19 degrees, where the plane already has 0.30 to 0.38 of each corner. At
that range and lens two views 19 degrees apart do not decide a corner by this report's own line.
Paladin's 16 plates, each a polygon traced in one view with the plane its agent gave: every corner decided by the
plane, the crown within 1 mm of the one the harness had lifted. Its two thigh shields traced as partners are
refused, a side 19 px unexplained: the sheet draws two different polygons, not one plate and its reflection.
What it gives up. One outline loop a plate: a plate that wraps a corner is two plates, and creases inside the
outline are not blocked. A bend smaller than `tol` is built straight: the bowed pentagon's 56 mm bow reads under

File diff suppressed because one or more lines are too long

View file

@ -900,6 +900,35 @@ class BlockTests(unittest.TestCase):
self.assertEqual(out["sheet"]["mirror"], True)
self.assertEqual(out["sheet"]["poles"], [seam[0], seam[1], len(out["sheet"]["verts"]) - 1])
def test_paladin_plates_one_view_each(self):
"""block-paladin (tests/fixtures/paladin_plates.json). Paladin's 16 traced plates, each a polygon traced in
one view with the plane the agent gave it: every corner is decided by the plane (prior_share 1.00 to 2.13:
over 1 where the sight line leans on the plane), every side stays two points, and the crown is the one the
harness lifted onto that plane, within 1 mm (its fit_shell read 0.65 to 1.0 on the same plates). None of
the 16 planes stands over 66 degrees off its view at e688951 (ForearmL.Outer, 61.6, is the furthest): the
guard is claimed by test_a_plane_far_off_square_on_to_its_one_view_is_refused. The thigh shields as
partners, the left's polygon seen as the right's reflection in the left thigh's frame, are refused, a side
19.0 px unexplained at six points: the sheet's two polygons are not one plate mirrored (their lifted corners
stand 0.16 to 0.77 m apart), so no Paladin plate has a corner decided by a partner view here."""
fixture = json.loads((Path(__file__).resolve().parent / "fixtures" / "paladin_plates.json").read_text(encoding="utf-8"))
def block(name):
plate = fixture["plates"][name]
views = [(fixture["cameras"][trace["view"]], fixture["frames"][trace["frame"]]) for trace in plate["traces"]]
return plate, core.block_plate(views, plate["plate"], [{key: trace[key] for key in ("from", "to", "side", "line")} for trace in plate["traces"]], kit.sheet, plane=plate.get("plane"))
single = sorted(name for name in fixture["plates"] if name != "ThighShield.partners")
self.assertEqual(len(single), 16)
for name in single:
plate, out = block(name)
n = len(plate["plate"]["corners"])
self.assertEqual(({corner["decided_by"] for corner in out["corners"]}, [side["points"] for side in out["sides"]], out["plane"]["from"]), ({"plane"}, [2] * n, "given"), name)
self.assertGreater(min(corner["prior_share"] for corner in out["corners"]), 0.9, name)
crown, lifted = np.array(out["sheet"]["verts"])[:n], np.array(plate["reference"]["crown"]) # the harness turned some crowns to face out: the same ring from another corner, or the other way round
self.assertLess(min(float(np.abs(crown - np.roll(lifted[::way], turn, axis=0)).max()) for way in (1, -1) for turn in range(n)), 0.001, name)
with self.assertRaisesRegex(core.ReferenceFitError, r"^the side from 'c0' to 'c1' is not explained at 6 points, the most a side is given: traces\[0\] is not explained"):
block("ThighShield.partners")
def test_the_blocking_goes_to_the_parser_and_to_fit_shell(self):
"""block-then-fit without Blender (tests/live/reference_block.py builds it): the sheet is one the cage's
parser takes, fit_traces name each side as a run of authored vertices, and fit_sheet takes both. On the