Files
support-fins/tests/layout_pins.test.js
T
matthewtrahan d0b51d8021 engine: a free edge's end row moves out flush instead of adding one -- #143 doubled every free edge (cube X20-30 and lowledge 3 -> 5 walls)
#143 put a wall flush at each free edge under a near-flat underside but kept
the mid-strip rows, so each free edge got two walls ~6 mm apart. Matthew: the
end walls are right, the count isn't. Now the outermost row moves out to the
free edge (PROP.edgeInset) and the rows spread evenly between the ends: the
same count, the end ones flush. A single row keeps its place mid-strip and the
free ends get their own (one row can't stand at both ends). A spread gap wider
than both the old pitch and 2 x maxUnsupportedSpan gets another row instead
(two rows moved out to tshape X25's 60 mm ends left 59 mm bare).

An edge whose underside is under PROP.minHeightSquat rests on the bed: not
free (a cube at X20's low edge got a flush wall almost no height tall).

Layout pins: cube X25 5 -> 3, arch X25 6 -> 4 (both their pre-#143 counts).

Sweep (NOCHECK, 864 cases) vs main: mean coverage 86.3 -> 86.4%, -61 g, 0
unserved. 8 cases lose 3-4 pts (cube35 X60, arch/lbracket/ushape/wedge X25,
hub_corner X45): same walls as before #143, moved out, and an edge not
parallel to the rows is served less by the moved-out wall. Matthew accepted
the trade 2026-10-01.
2026-10-01 17:13:28 -05:00

31 lines
1.6 KiB
JavaScript

// HOW MANY WALLS the reference parts get. The rest of the suite pins what makes
// a wall right (closed, clear of the part, gripping), not where walls go -- so a
// placement change can add two walls to a plain cube with every test green (#143:
// Matthew saw it in the test build first). A change that moves walls on purpose
// updates these numbers in the same PR, where review sees it; one that didn't
// mean to fails here. Wall COUNTS only: tine counts shift with float noise
// (plugins/shared/ENGINE-SENSITIVITY.md). Auto, bed pad, default coverage.
import { loadModel, analyze, fins, rotX, rotY, assert } from './_util.js';
const PINS = [
// model, pose, rotation, walls
['cube', 'X25', rotX(25), 3], // the end rows move out flush to the free edges, same count (#143 had added two)
['cube', 'X35', rotX(35), 3],
['cube', 'X60', rotX(60), 3],
['cube', 'Y35', rotY(35), 3],
['lbracket', 'X35', rotX(35), 4], // the plugins' reference part (plugins/*/tests pin its tines too)
['lbracket', 'Y35', rotY(35), 4],
['ramp', 'X45', rotX(45), 0],
['wedge', 'X45', rotX(45), 0],
['tube', 'X25', rotX(25), 4],
['arch', 'X25', rotX(25), 4], // likewise (#143 had 6)
];
for (const [name, pose, rot, want] of PINS) {
Deno.test(`layout: ${name} ${pose} gets ${want} walls`, () => {
const topo = loadModel(name), res = analyze(topo, 45, rot);
const got = fins.buildFins(topo, res, rot, { mode: 'auto', bedPad: true, tines: true, coverage: 0.5 }).props.length;
assert(got === want, `${name} ${pose}: ${got} walls, pinned ${want} -- if the change is meant, update the pin`);
});
}