@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.cjs CHANGED
@@ -108,6 +108,7 @@ var DEG_FP = Math.PI / 180;
108
108
  function moduleCenterline(input) {
109
109
  const drawn = trackPath(input.mainPath);
110
110
  if (drawn) return samplePath(drawn);
111
+ if (!input.geometryType) return [];
111
112
  const L = input.lengthInches > 0 ? input.lengthInches : 24;
112
113
  const gt = input.geometryType;
113
114
  if (gt === "dead_end") return [{ x: 0, y: 0 }];
@@ -367,7 +368,8 @@ function stateToDoc(state, recordNumber) {
367
368
  divergeTrack: t.divergeTrack,
368
369
  kind: t.kind,
369
370
  name: t.name || void 0,
370
- ...t.size ? { size: t.size } : {}
371
+ ...t.size ? { size: t.size } : {},
372
+ ...t.curved ? { curved: true } : {}
371
373
  })),
372
374
  ...state.crossings.length > 0 ? {
373
375
  crossings: state.crossings.map((x) => ({
@@ -528,7 +530,8 @@ function docToState(doc, fallbackLength, moduleTracks = []) {
528
530
  onTrack: t.onTrack,
529
531
  divergeTrack: t.divergeTrack,
530
532
  kind: t.kind ?? "right",
531
- ...t.size ? { size: t.size } : {}
533
+ ...t.size ? { size: t.size } : {},
534
+ ...t.curved ? { curved: true } : {}
532
535
  })),
533
536
  controlPoints: readControlPoints(d, sc),
534
537
  industries: (d.industries ?? []).map((ind) => ({