From a570eb8478506f8fdd0346e68a6f38cceb140b0a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 3 Dec 2026 09:21:34 +0100 Subject: [PATCH] tests/live/reference_block.py: tolerances round this scene's own readings (a pixel is 5 mm there); its last run Co-Authored-By: Claude Fable 5.2 --- surfaces/blender/tests/live/reference_block.py | 14 +++++++------- .../blender/tests/live/reference_block.result.json | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/surfaces/blender/tests/live/reference_block.py b/surfaces/blender/tests/live/reference_block.py index 7af9c42..ce4f864 100644 --- a/surfaces/blender/tests/live/reference_block.py +++ b/surfaces/blender/tests/live/reference_block.py @@ -9,9 +9,9 @@ side is traced in both views where Blender's own projection draws the side as co built brokkr_kitbash.shell takes the sheet without refusal, and at one level Blender builds each crown side where core.crease_run says fit_shell with the returned fit_traces on the built plate: accepted, every trace explained, and no point - moved further than the unit test's reading allows (tests/test_reference.py - test_the_blocking_goes_to_the_parser_and_to_fit_shell: fairness holds a bowed side in, and - fit_shell's own prior lets it out) + moved over MOVED (fairness holds a bowed side in and fit_shell's own prior lets it out: + tests/test_reference.py test_the_blocking_goes_to_the_parser_and_to_fit_shell reads 74 mm of + it where a pixel is 27 mm; here a pixel is 5 mm) mirrored a mirrored plate with two seam corners, traced the same way: the seam stays on x = 0, brokkr_kitbash.shell builds both halves, and Blender builds the seam's side and a free side where core.crease_run says @@ -69,7 +69,7 @@ R = {"blender": bpy.app.version_string, "checks": [], "hostErrors": target.host_ COUNT = [0] T0 = time.time() WIDTH, HEIGHT = 1000, 800 -MOVED = 0.09 # metres fit_shell may move a point of the blocked bowed plate: the unit test's tolerance round its reading of 0.074 +MOVED, GAP, GAP_MIRRORED = 0.01, 0.01, 0.03 # metres, tolerances round this scene's readings (0.0048, 0.0027, 0.014; a pixel is 5 mm here): what fit_shell may move a point of the blocked plate, and how far the blocked crowns may stand from their truths def check(name, ok, detail=None): @@ -185,7 +185,7 @@ try: chains = chains_of(out) verts = np.array(out["sheet"]["verts"]) gap = max(float(core._off(built(verts[chain]), core.resampled(built(side), 400)).max()) for chain, side in zip(chains, sides)) - check("the blocked crown as built stands within 0.06 m of the truth's (the unit test's tolerance; fairness holds the bow in)", gap < 0.06, gap) + check(f"the blocked crown as built stands within {GAP:g} m of the truth's", gap < GAP, gap) worst = at_one_level("Blocked", out["sheet"], chains) check("brokkr_kitbash.shell takes the blocked sheet, and at one level Blender builds every crown side where core.crease_run says, within 1e-4 m", "Blocked" in bpy.data.objects and worst < 1e-4, worst) @@ -211,8 +211,8 @@ try: chains = chains_of(out) verts = np.array(out["sheet"]["verts"]) gap = max(float(core._off(built(verts[chain]), core.resampled(built(side), 400)).max()) for chain, side in zip(chains, sides)) - check("a mirrored plate: the seam's corners are decided by the mirror plane, its side stays on x = 0, and the crown as built stands within 0.06 m of the truth's", - [corner["decided_by"] for corner in out["corners"]][:2] == ["mirror", "mirror"] and float(np.abs(verts[chains[0], 0]).max()) == 0.0 and gap < 0.06, + check(f"a mirrored plate: the seam's corners are decided by the mirror plane, its side stays on x = 0, and the crown as built stands within {GAP_MIRRORED:g} m of the truth's", + [corner["decided_by"] for corner in out["corners"]][:2] == ["mirror", "mirror"] and float(np.abs(verts[chains[0], 0]).max()) == 0.0 and gap < GAP_MIRRORED, {"gap": gap, "sides": [side["points"] for side in out["sides"]], "corners": [corner["decided_by"] for corner in out["corners"]], "poles": out["sheet"]["poles"]}) worst = at_one_level("Mirrored", out["sheet"], chains, mirror=True) check("brokkr_kitbash.shell builds both halves of the mirrored sheet, and at one level Blender builds the seam's side and the free sides, on both halves, where core.crease_run says, within 1e-4 m", diff --git a/surfaces/blender/tests/live/reference_block.result.json b/surfaces/blender/tests/live/reference_block.result.json index 2d913ea..4c7503e 100644 --- a/surfaces/blender/tests/live/reference_block.result.json +++ b/surfaces/blender/tests/live/reference_block.result.json @@ -55,7 +55,7 @@ ] ], "rounds": 2, - "seconds": 0.236, + "seconds": 0.301, "chars": 7242 } }, @@ -65,7 +65,7 @@ "detail": null }, { - "name": "the blocked crown as built stands within 0.06 m of the truth's (the unit test's tolerance; fairness holds the bow in)", + "name": "the blocked crown as built stands within 0.01 m of the truth's", "ok": true, "detail": 0.002711610846938251 }, @@ -75,14 +75,14 @@ "detail": 1.1421151381392388e-07 }, { - "name": "fit_shell takes the returned fit_traces on the built plate: accepted, every trace explained, no point moved over 0.09 m", + "name": "fit_shell takes the returned fit_traces on the built plate: accepted, every trace explained, no point moved over 0.01 m", "ok": true, "detail": { "moved_m": 0.0048 } }, { - "name": "a mirrored plate: the seam's corners are decided by the mirror plane, its side stays on x = 0, and the crown as built stands within 0.06 m of the truth's", + "name": "a mirrored plate: the seam's corners are decided by the mirror plane, its side stays on x = 0, and the crown as built stands within 0.03 m of the truth's", "ok": true, "detail": { "gap": 0.013972102623404082,