@willcgage/module-schematic 0.21.0 → 0.22.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 +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -211,6 +211,10 @@ interface ModuleSchematicDoc {
|
|
|
211
211
|
* +y up). Stored as an open ring; renderers close it. Absent = derive an
|
|
212
212
|
* approximate band from the endplate widths. */
|
|
213
213
|
outline?: BenchworkPoint[];
|
|
214
|
+
/** Internal section joints — inches from endplate A where the module's boards
|
|
215
|
+
* split into sections. Operationally one unit; these mark construction/transport
|
|
216
|
+
* seams (exempt from the end-interface standards). Empty/absent = one section. */
|
|
217
|
+
sectionBreaks?: number[];
|
|
214
218
|
/** @deprecated pre-grouping flat signals; read for back-compat. */
|
|
215
219
|
signals?: SchematicSignal[];
|
|
216
220
|
/** Authored mainline centre-line (module-local inches, open path with arcs).
|
|
@@ -438,6 +442,9 @@ interface EditorState {
|
|
|
438
442
|
* (endplate A's track point at the origin, mainline +x, perpendicular +y up).
|
|
439
443
|
* Empty = no authored outline (fall back to the endplate-width band). */
|
|
440
444
|
outline: BenchworkPoint[];
|
|
445
|
+
/** Internal section joints — inches from endplate A where the boards split
|
|
446
|
+
* into sections. Empty = a single section (#48). */
|
|
447
|
+
sectionBreaks: number[];
|
|
441
448
|
controlPoints: EditorControlPoint[];
|
|
442
449
|
/** Rail-served industries — car-spot spans on a track (#industries). */
|
|
443
450
|
industries: EditorIndustry[];
|
package/dist/index.d.ts
CHANGED
|
@@ -211,6 +211,10 @@ interface ModuleSchematicDoc {
|
|
|
211
211
|
* +y up). Stored as an open ring; renderers close it. Absent = derive an
|
|
212
212
|
* approximate band from the endplate widths. */
|
|
213
213
|
outline?: BenchworkPoint[];
|
|
214
|
+
/** Internal section joints — inches from endplate A where the module's boards
|
|
215
|
+
* split into sections. Operationally one unit; these mark construction/transport
|
|
216
|
+
* seams (exempt from the end-interface standards). Empty/absent = one section. */
|
|
217
|
+
sectionBreaks?: number[];
|
|
214
218
|
/** @deprecated pre-grouping flat signals; read for back-compat. */
|
|
215
219
|
signals?: SchematicSignal[];
|
|
216
220
|
/** Authored mainline centre-line (module-local inches, open path with arcs).
|
|
@@ -438,6 +442,9 @@ interface EditorState {
|
|
|
438
442
|
* (endplate A's track point at the origin, mainline +x, perpendicular +y up).
|
|
439
443
|
* Empty = no authored outline (fall back to the endplate-width band). */
|
|
440
444
|
outline: BenchworkPoint[];
|
|
445
|
+
/** Internal section joints — inches from endplate A where the boards split
|
|
446
|
+
* into sections. Empty = a single section (#48). */
|
|
447
|
+
sectionBreaks: number[];
|
|
441
448
|
controlPoints: EditorControlPoint[];
|
|
442
449
|
/** Rail-served industries — car-spot spans on a track (#industries). */
|
|
443
450
|
industries: EditorIndustry[];
|
package/dist/index.js
CHANGED
|
@@ -214,6 +214,7 @@ function emptyEditorState(lengthInches) {
|
|
|
214
214
|
poseOverrides: {},
|
|
215
215
|
endplateWidths: {},
|
|
216
216
|
outline: [],
|
|
217
|
+
sectionBreaks: [],
|
|
217
218
|
controlPoints: [],
|
|
218
219
|
industries: [],
|
|
219
220
|
mainPath: []
|
|
@@ -407,6 +408,8 @@ function stateToDoc(state, recordNumber) {
|
|
|
407
408
|
// Benchwork footprint outline (module-local inches); only when it's a real
|
|
408
409
|
// ring (≥ 3 vertices).
|
|
409
410
|
...state.outline.length >= 3 ? { outline: state.outline } : {},
|
|
411
|
+
// Internal section joints (inches from A), when the module has more than one.
|
|
412
|
+
...state.sectionBreaks.length ? { sectionBreaks: state.sectionBreaks } : {},
|
|
410
413
|
// Authored mainline path (module-local inches); only when it's a real path.
|
|
411
414
|
...state.mainPath.length >= 2 ? { mainPath: state.mainPath } : {}
|
|
412
415
|
};
|
|
@@ -506,6 +509,7 @@ function docToState(doc, fallbackLength, moduleTracks = []) {
|
|
|
506
509
|
poseOverrides,
|
|
507
510
|
endplateWidths,
|
|
508
511
|
outline,
|
|
512
|
+
sectionBreaks: (d.sectionBreaks ?? []).filter((n) => Number.isFinite(n)).map((n) => sc(n)),
|
|
509
513
|
mainPath,
|
|
510
514
|
crossings: (d.crossings ?? []).map((x) => ({
|
|
511
515
|
id: x.id,
|