@willcgage/module-schematic 0.76.0 → 0.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2132,6 +2132,10 @@ interface ModuleGeometryInput {
2132
2132
  y: number;
2133
2133
  heading: number;
2134
2134
  }>;
2135
+ /** Authored endplate FACE widths by id ("A"/"B"), inches — the board's depth.
2136
+ * Needed to place a branch endplate on the benchwork edge rather than on the
2137
+ * centre line; absent ends use the recommended default. */
2138
+ endplateWidths?: Record<string, number>;
2135
2139
  /** Half the spacing between the two tracks of a double endplate (Free-mo ≈ 1",
2136
2140
  * Free-moN ≈ 9/16"). */
2137
2141
  trackHalfSpacingInches?: number;
package/dist/index.d.ts CHANGED
@@ -2132,6 +2132,10 @@ interface ModuleGeometryInput {
2132
2132
  y: number;
2133
2133
  heading: number;
2134
2134
  }>;
2135
+ /** Authored endplate FACE widths by id ("A"/"B"), inches — the board's depth.
2136
+ * Needed to place a branch endplate on the benchwork edge rather than on the
2137
+ * centre line; absent ends use the recommended default. */
2138
+ endplateWidths?: Record<string, number>;
2135
2139
  /** Half the spacing between the two tracks of a double endplate (Free-mo ≈ 1",
2136
2140
  * Free-moN ≈ 9/16"). */
2137
2141
  trackHalfSpacingInches?: number;
package/dist/index.js CHANGED
@@ -2370,15 +2370,21 @@ function deriveEndplatePoses(geo) {
2370
2370
  })
2371
2371
  );
2372
2372
  }
2373
+ const widthAt = (frac) => {
2374
+ const wa = endplateWidthFor(geo.endplateWidths, "A");
2375
+ const wb = endplateWidthFor(geo.endplateWidths, "B");
2376
+ return (wa * (1 - frac) + wb * frac) / 2;
2377
+ };
2373
2378
  for (const b of geo.branches ?? []) {
2374
2379
  const frac = L > 0 ? Math.min(1, Math.max(0, b.atPos / L)) : 0;
2375
2380
  const px = frac * L;
2376
2381
  const config = b.config === "double" ? "double" : "single";
2382
+ const depth = widthAt(frac);
2377
2383
  poses.push(
2378
2384
  withOverride({
2379
2385
  id: b.id,
2380
2386
  x: px,
2381
- y: 0,
2387
+ y: b.side === "down" ? -depth : depth,
2382
2388
  heading: b.side === "down" ? 270 : 90,
2383
2389
  trackConfig: config,
2384
2390
  trackOffsets: offsetsFor(config, half)