@willcgage/module-schematic 0.111.0 → 0.113.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
@@ -93,9 +93,24 @@ declare const FREEMO_ENDPLATE_WIDTH_MIN_INCHES = 12;
93
93
  * ("Endplates shall be 6 inches high and a minimum 12 inches wide"). 24″ is
94
94
  * simply a common real-world width. Don't present it as required. */
95
95
  declare const FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES = 24;
96
- /** Free-moN §2.0 **standard**: "Double track endplates must have a track spacing
96
+ /**
97
+ * Free-moN §2.0 **standard**: "Double track endplates must have a track spacing
97
98
  * of 1.125 inches (1 1/8 inches). Track spacing shall be measured along the
98
- * track center line." The one definition both apps read. */
99
+ * track center line." The one definition both apps read.
100
+ *
101
+ * ⚠️⚠️ **READ THE SCOPE, NOT JUST THE NUMBER.** This governs a **double-track
102
+ * ENDPLATE**, and reaches **4″ inboard** of it — §2.0's other standard is that
103
+ * track crossing an endplate be "perpendicular, straight, and level for at least
104
+ * 4 inches from the outside face". **Beyond those 4 inches the standard says
105
+ * nothing about how far apart the mains run**, and every real crossover draws
106
+ * them closer than this (the Fast Tracks N fixtures are 1.09″).
107
+ *
108
+ * ⛔ So this is a value to BUILD TO at an endplate, and **never a test to
109
+ * measure mid-module track against**. Used as one it amber-flagged ordinary,
110
+ * correctly built trackwork as departing from the standard (Will, 2026-07-28).
111
+ * It is also the default LANE PITCH for drawing parallel track, which is a
112
+ * separate job — a drawing convention, not a rule anything conforms to.
113
+ */
99
114
  declare const FREEMO_TRACK_SPACING_INCHES = 1.125;
100
115
  /** Free-moN §2.0 **standard**: track crossing an endplate must be "not less than
101
116
  * 4 inches from either fascia" (and perpendicular, straight and level for 4″). */
@@ -155,12 +170,17 @@ declare const PINCH_EASE_INCHES = 3;
155
170
  */
156
171
  declare function laneOffsetAt(lane: number, pos: number, pinches?: LanePinch[] | null, spacingInches?: number): number;
157
172
  /**
158
- * The pinches a document's crossovers impose — one per crossover connector that
159
- * names a part whose {@link TrackPart.trackSpacing} differs from the standard.
173
+ * The pinches a document's crossovers impose — one per crossover connector whose
174
+ * part is built to a different spacing from the mains either side of it.
175
+ *
176
+ * ⚠️ A PINCH IS GEOMETRY, NOT A FAULT. §2.0 fixes the 1.125″ spacing AT THE
177
+ * ENDPLATE; what the mains do in between is the builder's business, and every
178
+ * real crossover draws them closer. This says where the drawing must narrow, and
179
+ * nothing about conformance.
160
180
  *
161
- * A crossover with no part named, or one built to the standard spacing, imposes
162
- * nothing: an owner who hasn't said what they built gets the straight pair they
163
- * had before, which is the only honest default.
181
+ * A crossover with no part named, or one built to the same spacing as the mains,
182
+ * imposes nothing: an owner who hasn't said what they built gets the straight
183
+ * pair they had before, which is the only honest default.
164
184
  */
165
185
  declare function crossoverPinches(tracks: Array<{
166
186
  role?: string;
@@ -1773,14 +1793,19 @@ interface TrackPart {
1773
1793
  crossingAngleDeg?: number;
1774
1794
  /** Centre-to-centre distance of the two parallel tracks a {@link kind}
1775
1795
  * `crossover` joins. A crossover fixture is BUILT for one spacing — it is not
1776
- * adjustable — so this decides whether the part suits a given standard at all.
1796
+ * adjustable — so this is what the mains must pinch to where it sits.
1777
1797
  *
1778
- * ⚠️ READ {@link FREEMO_TRACK_SPACING_INCHES} ALONGSIDE THIS. Free-moN §2.0
1779
- * fixes double-track spacing at exactly 1.125″; the Fast Tracks N crossovers
1780
- * are built to 1.09″. That 0.035″ is small but it is REAL and it is not a
1781
- * tolerance the fixture cannot be built to another spacing. Recorded rather
1782
- * than reconciled: it is a fact about the product, and an owner deciding what
1783
- * to buy is better served by the true number than by a convenient one. */
1798
+ * ⚠️ **NOT A CONFORMANCE TEST.** {@link FREEMO_TRACK_SPACING_INCHES} is fixed
1799
+ * by §2.0 **at the endplate** "double track endplates must have a track
1800
+ * spacing of 1.125 inches", perpendicular, straight and level for 4″ from the
1801
+ * outside face. What the two mains do in between is the module builder's
1802
+ * business, and EVERY real crossover pinches them closer: the Fast Tracks N
1803
+ * fixtures are 1.09″. Earlier wording here said this "decides whether the part
1804
+ * suits a given standard at all", which is wrong and put an amber
1805
+ * non-conformance note on ordinary, correctly built trackwork.
1806
+ *
1807
+ * Recorded because it is a fact about the product an owner needs when buying,
1808
+ * and because the drawing has to pinch the mains to it. */
1784
1809
  trackSpacing?: PartDimension;
1785
1810
  /** The SECOND frog angle on a part that has two — the SCISSORS of a double
1786
1811
  * crossover, the X where its two opposite diverging routes meet and cross.
@@ -2576,13 +2601,23 @@ interface PartGeometry {
2576
2601
  * builder's business, and every real double crossover pinches them closer.
2577
2602
  *
2578
2603
  * The derivation:
2579
- * - **Length** is `overallLength × piecesPerAssembly`. Fast Tracks' figure is
2580
- * ONE HALF the fixture builds a symmetrical half you make twice and butt
2581
- * together after turning the second 180°.
2604
+ * - **Length IS `overallLength`.** ⚠️ `piecesPerAssembly` counts BUILDS, not
2605
+ * length: you make the fixture's half twice and turn the second 180°, and the
2606
+ * two diagonals then SUPERIMPOSE into the scissors — they occupy the same
2607
+ * stretch of track, they do not sit end to end. Multiplying by it gave a #6 a
2608
+ * 20.14″ body with **6.8″ of plain approach track moulded on each end**.
2609
+ * `minimumLength` settles it independently: the shortest #6 build is 9.31″,
2610
+ * which reads as "trim the approach to 1.38″" — and only reads that way if the
2611
+ * assembly is L. Under 2L a "minimum" would still carry a 6″ approach.
2582
2612
  * - **The crossing run** `W = spacing / tan θ` is how far along the track a route
2583
2613
  * takes to cross to the other one. The two point-sets on the SAME track are
2584
2614
  * therefore `W` apart — 6.54″ for a #6 at 1.09″, not the 2.5″ my own FMN-0078
2585
2615
  * fixture claimed.
2616
+ * - **The approach**, `(length − W) / 2`, is what is left over at each end: the
2617
+ * straight tie strip from the start of the moulding to the start of the points.
2618
+ * ⭐ Will named this as the measurement that has to be right (2026-07-28), and
2619
+ * it is where the through routes take their rail joints. 1.76″ on a #6, 2.45″
2620
+ * on a #8 — it grows with the frog, as it must.
2586
2621
  * - Both crossing routes are centred on the assembly, so they meet in the middle
2587
2622
  * at `2θ` — which is exactly the {@link TrackPart.secondaryFrogAngle} Fast
2588
2623
  * Tracks publish, an independent check that this reading is right.
@@ -2593,6 +2628,14 @@ declare function crossoverAssembly(part: TrackPart): {
2593
2628
  spacingInches: number;
2594
2629
  /** Along-track distance a crossing route takes to reach the other track. */
2595
2630
  crossingRunInches: number;
2631
+ /**
2632
+ * Start of the moulding → start of the points, at each end.
2633
+ *
2634
+ * ⭐ The measurement that has to be right for the drawing to read as track:
2635
+ * it is the plain tie strip a crossover begins and ends with, and therefore
2636
+ * where the through routes are jointed.
2637
+ */
2638
+ approachInches: number;
2596
2639
  /** Where the four point-sets sit along the assembly. */
2597
2640
  pointsAtInches: [number, number];
2598
2641
  /** The X where the two crossing routes meet — a real diamond in the middle. */
package/dist/index.d.ts CHANGED
@@ -93,9 +93,24 @@ declare const FREEMO_ENDPLATE_WIDTH_MIN_INCHES = 12;
93
93
  * ("Endplates shall be 6 inches high and a minimum 12 inches wide"). 24″ is
94
94
  * simply a common real-world width. Don't present it as required. */
95
95
  declare const FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES = 24;
96
- /** Free-moN §2.0 **standard**: "Double track endplates must have a track spacing
96
+ /**
97
+ * Free-moN §2.0 **standard**: "Double track endplates must have a track spacing
97
98
  * of 1.125 inches (1 1/8 inches). Track spacing shall be measured along the
98
- * track center line." The one definition both apps read. */
99
+ * track center line." The one definition both apps read.
100
+ *
101
+ * ⚠️⚠️ **READ THE SCOPE, NOT JUST THE NUMBER.** This governs a **double-track
102
+ * ENDPLATE**, and reaches **4″ inboard** of it — §2.0's other standard is that
103
+ * track crossing an endplate be "perpendicular, straight, and level for at least
104
+ * 4 inches from the outside face". **Beyond those 4 inches the standard says
105
+ * nothing about how far apart the mains run**, and every real crossover draws
106
+ * them closer than this (the Fast Tracks N fixtures are 1.09″).
107
+ *
108
+ * ⛔ So this is a value to BUILD TO at an endplate, and **never a test to
109
+ * measure mid-module track against**. Used as one it amber-flagged ordinary,
110
+ * correctly built trackwork as departing from the standard (Will, 2026-07-28).
111
+ * It is also the default LANE PITCH for drawing parallel track, which is a
112
+ * separate job — a drawing convention, not a rule anything conforms to.
113
+ */
99
114
  declare const FREEMO_TRACK_SPACING_INCHES = 1.125;
100
115
  /** Free-moN §2.0 **standard**: track crossing an endplate must be "not less than
101
116
  * 4 inches from either fascia" (and perpendicular, straight and level for 4″). */
@@ -155,12 +170,17 @@ declare const PINCH_EASE_INCHES = 3;
155
170
  */
156
171
  declare function laneOffsetAt(lane: number, pos: number, pinches?: LanePinch[] | null, spacingInches?: number): number;
157
172
  /**
158
- * The pinches a document's crossovers impose — one per crossover connector that
159
- * names a part whose {@link TrackPart.trackSpacing} differs from the standard.
173
+ * The pinches a document's crossovers impose — one per crossover connector whose
174
+ * part is built to a different spacing from the mains either side of it.
175
+ *
176
+ * ⚠️ A PINCH IS GEOMETRY, NOT A FAULT. §2.0 fixes the 1.125″ spacing AT THE
177
+ * ENDPLATE; what the mains do in between is the builder's business, and every
178
+ * real crossover draws them closer. This says where the drawing must narrow, and
179
+ * nothing about conformance.
160
180
  *
161
- * A crossover with no part named, or one built to the standard spacing, imposes
162
- * nothing: an owner who hasn't said what they built gets the straight pair they
163
- * had before, which is the only honest default.
181
+ * A crossover with no part named, or one built to the same spacing as the mains,
182
+ * imposes nothing: an owner who hasn't said what they built gets the straight
183
+ * pair they had before, which is the only honest default.
164
184
  */
165
185
  declare function crossoverPinches(tracks: Array<{
166
186
  role?: string;
@@ -1773,14 +1793,19 @@ interface TrackPart {
1773
1793
  crossingAngleDeg?: number;
1774
1794
  /** Centre-to-centre distance of the two parallel tracks a {@link kind}
1775
1795
  * `crossover` joins. A crossover fixture is BUILT for one spacing — it is not
1776
- * adjustable — so this decides whether the part suits a given standard at all.
1796
+ * adjustable — so this is what the mains must pinch to where it sits.
1777
1797
  *
1778
- * ⚠️ READ {@link FREEMO_TRACK_SPACING_INCHES} ALONGSIDE THIS. Free-moN §2.0
1779
- * fixes double-track spacing at exactly 1.125″; the Fast Tracks N crossovers
1780
- * are built to 1.09″. That 0.035″ is small but it is REAL and it is not a
1781
- * tolerance the fixture cannot be built to another spacing. Recorded rather
1782
- * than reconciled: it is a fact about the product, and an owner deciding what
1783
- * to buy is better served by the true number than by a convenient one. */
1798
+ * ⚠️ **NOT A CONFORMANCE TEST.** {@link FREEMO_TRACK_SPACING_INCHES} is fixed
1799
+ * by §2.0 **at the endplate** "double track endplates must have a track
1800
+ * spacing of 1.125 inches", perpendicular, straight and level for 4″ from the
1801
+ * outside face. What the two mains do in between is the module builder's
1802
+ * business, and EVERY real crossover pinches them closer: the Fast Tracks N
1803
+ * fixtures are 1.09″. Earlier wording here said this "decides whether the part
1804
+ * suits a given standard at all", which is wrong and put an amber
1805
+ * non-conformance note on ordinary, correctly built trackwork.
1806
+ *
1807
+ * Recorded because it is a fact about the product an owner needs when buying,
1808
+ * and because the drawing has to pinch the mains to it. */
1784
1809
  trackSpacing?: PartDimension;
1785
1810
  /** The SECOND frog angle on a part that has two — the SCISSORS of a double
1786
1811
  * crossover, the X where its two opposite diverging routes meet and cross.
@@ -2576,13 +2601,23 @@ interface PartGeometry {
2576
2601
  * builder's business, and every real double crossover pinches them closer.
2577
2602
  *
2578
2603
  * The derivation:
2579
- * - **Length** is `overallLength × piecesPerAssembly`. Fast Tracks' figure is
2580
- * ONE HALF the fixture builds a symmetrical half you make twice and butt
2581
- * together after turning the second 180°.
2604
+ * - **Length IS `overallLength`.** ⚠️ `piecesPerAssembly` counts BUILDS, not
2605
+ * length: you make the fixture's half twice and turn the second 180°, and the
2606
+ * two diagonals then SUPERIMPOSE into the scissors — they occupy the same
2607
+ * stretch of track, they do not sit end to end. Multiplying by it gave a #6 a
2608
+ * 20.14″ body with **6.8″ of plain approach track moulded on each end**.
2609
+ * `minimumLength` settles it independently: the shortest #6 build is 9.31″,
2610
+ * which reads as "trim the approach to 1.38″" — and only reads that way if the
2611
+ * assembly is L. Under 2L a "minimum" would still carry a 6″ approach.
2582
2612
  * - **The crossing run** `W = spacing / tan θ` is how far along the track a route
2583
2613
  * takes to cross to the other one. The two point-sets on the SAME track are
2584
2614
  * therefore `W` apart — 6.54″ for a #6 at 1.09″, not the 2.5″ my own FMN-0078
2585
2615
  * fixture claimed.
2616
+ * - **The approach**, `(length − W) / 2`, is what is left over at each end: the
2617
+ * straight tie strip from the start of the moulding to the start of the points.
2618
+ * ⭐ Will named this as the measurement that has to be right (2026-07-28), and
2619
+ * it is where the through routes take their rail joints. 1.76″ on a #6, 2.45″
2620
+ * on a #8 — it grows with the frog, as it must.
2586
2621
  * - Both crossing routes are centred on the assembly, so they meet in the middle
2587
2622
  * at `2θ` — which is exactly the {@link TrackPart.secondaryFrogAngle} Fast
2588
2623
  * Tracks publish, an independent check that this reading is right.
@@ -2593,6 +2628,14 @@ declare function crossoverAssembly(part: TrackPart): {
2593
2628
  spacingInches: number;
2594
2629
  /** Along-track distance a crossing route takes to reach the other track. */
2595
2630
  crossingRunInches: number;
2631
+ /**
2632
+ * Start of the moulding → start of the points, at each end.
2633
+ *
2634
+ * ⭐ The measurement that has to be right for the drawing to read as track:
2635
+ * it is the plain tie strip a crossover begins and ends with, and therefore
2636
+ * where the through routes are jointed.
2637
+ */
2638
+ approachInches: number;
2596
2639
  /** Where the four point-sets sit along the assembly. */
2597
2640
  pointsAtInches: [number, number];
2598
2641
  /** The X where the two crossing routes meet — a real diamond in the middle. */
package/dist/index.js CHANGED
@@ -2212,7 +2212,7 @@ function crossoverAssembly(part) {
2212
2212
  const spacing = part.trackSpacing?.inches;
2213
2213
  const n = part.frogNumber;
2214
2214
  if (!overall || !spacing || !n) return null;
2215
- const lengthInches = overall * (part.piecesPerAssembly ?? 1);
2215
+ const lengthInches = overall;
2216
2216
  const tan = part.actualAngle ? Math.tan(part.actualAngle.deg * Math.PI / 180) : 1 / n;
2217
2217
  if (!(tan > 0)) return null;
2218
2218
  const crossingRunInches = spacing / tan;
@@ -2222,6 +2222,7 @@ function crossoverAssembly(part) {
2222
2222
  lengthInches,
2223
2223
  spacingInches: spacing,
2224
2224
  crossingRunInches,
2225
+ approachInches: mid - half,
2225
2226
  pointsAtInches: [mid - half, mid + half],
2226
2227
  scissorsAtInches: mid
2227
2228
  };