@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.cjs CHANGED
@@ -2372,15 +2372,21 @@ function deriveEndplatePoses(geo) {
2372
2372
  })
2373
2373
  );
2374
2374
  }
2375
+ const widthAt = (frac) => {
2376
+ const wa = endplateWidthFor(geo.endplateWidths, "A");
2377
+ const wb = endplateWidthFor(geo.endplateWidths, "B");
2378
+ return (wa * (1 - frac) + wb * frac) / 2;
2379
+ };
2375
2380
  for (const b of geo.branches ?? []) {
2376
2381
  const frac = L > 0 ? Math.min(1, Math.max(0, b.atPos / L)) : 0;
2377
2382
  const px = frac * L;
2378
2383
  const config = b.config === "double" ? "double" : "single";
2384
+ const depth = widthAt(frac);
2379
2385
  poses.push(
2380
2386
  withOverride({
2381
2387
  id: b.id,
2382
2388
  x: px,
2383
- y: 0,
2389
+ y: b.side === "down" ? -depth : depth,
2384
2390
  heading: b.side === "down" ? 270 : 90,
2385
2391
  trackConfig: config,
2386
2392
  trackOffsets: offsetsFor(config, half)