@willcgage/module-schematic 0.22.0 → 0.24.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
@@ -94,6 +94,10 @@ interface SchematicTurnout {
94
94
  address?: string | null;
95
95
  /** Frog number ("size") — #4, #6, #8, etc. Governs the diverging angle. */
96
96
  size?: number | null;
97
+ /** A curved turnout — the diverging route bows into an arc (both routes curve
98
+ * the same way) instead of leaving as a straight diagonal. Physical-render
99
+ * only; the operations view stays topological. */
100
+ curved?: boolean | null;
97
101
  }
98
102
  interface SchematicSignal {
99
103
  id: string;
@@ -359,6 +363,9 @@ interface EditorTurnout {
359
363
  kind: TurnoutKind;
360
364
  /** Frog number ("size") — #4, #6, #8, etc. Governs the diverging angle. */
361
365
  size?: number;
366
+ /** A curved turnout — the diverging route bows into an arc rather than a
367
+ * straight diagonal. Physical-render only (the operations view is topological). */
368
+ curved?: boolean;
362
369
  }
363
370
  interface EditorCpSignal {
364
371
  id: string;
package/dist/index.d.ts CHANGED
@@ -94,6 +94,10 @@ interface SchematicTurnout {
94
94
  address?: string | null;
95
95
  /** Frog number ("size") — #4, #6, #8, etc. Governs the diverging angle. */
96
96
  size?: number | null;
97
+ /** A curved turnout — the diverging route bows into an arc (both routes curve
98
+ * the same way) instead of leaving as a straight diagonal. Physical-render
99
+ * only; the operations view stays topological. */
100
+ curved?: boolean | null;
97
101
  }
98
102
  interface SchematicSignal {
99
103
  id: string;
@@ -359,6 +363,9 @@ interface EditorTurnout {
359
363
  kind: TurnoutKind;
360
364
  /** Frog number ("size") — #4, #6, #8, etc. Governs the diverging angle. */
361
365
  size?: number;
366
+ /** A curved turnout — the diverging route bows into an arc rather than a
367
+ * straight diagonal. Physical-render only (the operations view is topological). */
368
+ curved?: boolean;
362
369
  }
363
370
  interface EditorCpSignal {
364
371
  id: string;
package/dist/index.js CHANGED
@@ -106,6 +106,7 @@ var DEG_FP = Math.PI / 180;
106
106
  function moduleCenterline(input) {
107
107
  const drawn = trackPath(input.mainPath);
108
108
  if (drawn) return samplePath(drawn);
109
+ if (!input.geometryType) return [];
109
110
  const L = input.lengthInches > 0 ? input.lengthInches : 24;
110
111
  const gt = input.geometryType;
111
112
  if (gt === "dead_end") return [{ x: 0, y: 0 }];
@@ -365,7 +366,8 @@ function stateToDoc(state, recordNumber) {
365
366
  divergeTrack: t.divergeTrack,
366
367
  kind: t.kind,
367
368
  name: t.name || void 0,
368
- ...t.size ? { size: t.size } : {}
369
+ ...t.size ? { size: t.size } : {},
370
+ ...t.curved ? { curved: true } : {}
369
371
  })),
370
372
  ...state.crossings.length > 0 ? {
371
373
  crossings: state.crossings.map((x) => ({
@@ -526,7 +528,8 @@ function docToState(doc, fallbackLength, moduleTracks = []) {
526
528
  onTrack: t.onTrack,
527
529
  divergeTrack: t.divergeTrack,
528
530
  kind: t.kind ?? "right",
529
- ...t.size ? { size: t.size } : {}
531
+ ...t.size ? { size: t.size } : {},
532
+ ...t.curved ? { curved: true } : {}
530
533
  })),
531
534
  controlPoints: readControlPoints(d, sc),
532
535
  industries: (d.industries ?? []).map((ind) => ({