fix(capture): drop first and last 6in from width samples

sampleWidths used floor(L/6)+1 stations from t=0, so tapered tips
dominated min/max. Sample only interior stations at 6, 12, … ≤ L−6.
When L≤12 there is no interior span: every6In stays empty and
min/max/avg stay 0. CAPTURE.md Widths bullet matches.

sqft, bdft, scale, and inventory PNG are unchanged.
This commit is contained in:
2026-09-15 03:20:28 +00:00
parent 11c8124674
commit eaedcb53dd
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -39,8 +39,9 @@ function maskAxisSegment(
};
}
// Sampled every 6 in along the wood axis; each sample is a line probe
// perpendicular to the axis, width = max run of slab px across the probe.
// Interior stations only (6, 12, … ≤ L−6). Tips dominate min/max on tapered
// boards, so the first and last 6 in are excluded. Each sample is a line
// probe perpendicular to the axis; width = max run of slab px across it.
function sampleWidths(
bitset: Uint8Array, w: number, h: number,
start: [number, number], ux: number, uy: number,
@@ -48,11 +49,10 @@ function sampleWidths(
): Eighths[] {
const px = -uy, py = ux;
const stepPx = 6 * scale;
const count = Math.max(1, Math.floor(lengthIn / 6) + 1);
const lastPx = lengthIn > 12 ? Math.floor((lengthIn - 6) / 6) * 6 * scale : 0;
const out: Eighths[] = [];
const half = Math.max(2, Math.round((w + h) / 4));
for (let i = 0; i < count; i++) {
const t = i * stepPx;
for (let t = stepPx; t <= lastPx; t += stepPx) {
const ox = start[0] + ux * t;
const oy = start[1] + uy * t;
let minP = Infinity, maxP = -Infinity;