@willcgage/module-schematic 0.54.0 → 0.56.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 +39 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -37
- package/dist/index.d.ts +76 -37
- package/dist/index.js +39 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1113,6 +1113,11 @@ var ATLAS_CODE55_N = [
|
|
|
1113
1113
|
source: "measured",
|
|
1114
1114
|
note: "Will Gage, physical Atlas 2050 (#5 LH) \u2014 end of tie strip to point tips"
|
|
1115
1115
|
},
|
|
1116
|
+
frogOffset: {
|
|
1117
|
+
inches: 4.75,
|
|
1118
|
+
source: "measured",
|
|
1119
|
+
note: "Will Gage, physical Atlas 2050 (#5 LH) \u2014 tie end to the apex of the V"
|
|
1120
|
+
},
|
|
1116
1121
|
overallLength: {
|
|
1117
1122
|
inches: 6,
|
|
1118
1123
|
source: "measured",
|
|
@@ -1134,9 +1139,19 @@ var ATLAS_CODE55_N = [
|
|
|
1134
1139
|
partNumbers: { left: "2052", right: "2053" },
|
|
1135
1140
|
frogNumber: 7,
|
|
1136
1141
|
lead: {
|
|
1137
|
-
inches: 3.
|
|
1142
|
+
inches: 3.59375,
|
|
1143
|
+
source: "measured",
|
|
1144
|
+
note: "Will Gage, physical Atlas 2052 (#7), 3\xB9\u2079\u2044\u2083\u2082\u2033 points\u2192frog as a single span \u2014 and it matches his two positions exactly (4\u2077\u2044\u2083\u2082 \u2212 \u2075\u2044\u2088), so the reading is internally consistent. SUPERSEDES Steve Branton's 3\u215C\u2033 (#173), which was \u2077\u2044\u2083\u2082\u2033 short and was the library's founding measurement. \u26A0\uFE0F Steve's number was also the SOLE basis of TURNOUT_LEAD_INCHES_PER_FROG (3.375/7 = 0.482) \u2014 that constant is now baseless as well as refuted."
|
|
1145
|
+
},
|
|
1146
|
+
pointsOffset: {
|
|
1147
|
+
inches: 0.625,
|
|
1138
1148
|
source: "measured",
|
|
1139
|
-
note: "
|
|
1149
|
+
note: "Will Gage, physical Atlas 2052 (#7) \u2014 \xB9\u2070\u2044\u2081\u2086\u2033 tie end to point tips"
|
|
1150
|
+
},
|
|
1151
|
+
frogOffset: {
|
|
1152
|
+
inches: 4.21875,
|
|
1153
|
+
source: "measured",
|
|
1154
|
+
note: "Will Gage, physical Atlas 2052 (#7) \u2014 4\u2077\u2044\u2083\u2082\u2033, tie end to the apex of the V. Supersedes an initial 4\xB3\u2044\u2081\u2086\u2033. Worth noting for provenance: he was told beforehand that the clearance hypothesis predicted 4\xBC\u2033 and did NOT read 4\xBC\u2033 \u2014 so this number is not a confirmation artefact, and it sits \xB9\u2044\u2083\u2082\u2033 (one tape division) from the predicted value."
|
|
1140
1155
|
},
|
|
1141
1156
|
overallLength: {
|
|
1142
1157
|
inches: 6,
|
|
@@ -1159,15 +1174,20 @@ var ATLAS_CODE55_N = [
|
|
|
1159
1174
|
partNumbers: { left: "2054", right: "2055" },
|
|
1160
1175
|
frogNumber: 10,
|
|
1161
1176
|
lead: {
|
|
1162
|
-
inches: 4.
|
|
1177
|
+
inches: 4.9375,
|
|
1163
1178
|
source: "measured",
|
|
1164
|
-
note: "Will Gage, physical Atlas 2054 (#10):
|
|
1179
|
+
note: "Will Gage, physical Atlas 2054 (#10): 5.5\u2033 frog \u2212 9/16\u2033 points = 4\xB9\u2075\u2044\u2081\u2086\u2033. \u26A0\uFE0F CORRECTED from 4\xB3\u2044\u2081\u2086\u2033 (0.53.0\u20130.54.0), which used a 4.75\u2033 frog reading taken before we'd agreed the landmark. That earlier figure was the END OF THE FROG CASTING; a #10's V is shallow, so the apex is \xBE\u2033 back from it."
|
|
1165
1180
|
},
|
|
1166
1181
|
pointsOffset: {
|
|
1167
1182
|
inches: 0.5625,
|
|
1168
1183
|
source: "measured",
|
|
1169
1184
|
note: "Will Gage, physical Atlas 2054 (#10) \u2014 end of tie strip to point tips"
|
|
1170
1185
|
},
|
|
1186
|
+
frogOffset: {
|
|
1187
|
+
inches: 5.5,
|
|
1188
|
+
source: "measured",
|
|
1189
|
+
note: "Will Gage, physical Atlas 2054 (#10) \u2014 tie end to the apex of the V"
|
|
1190
|
+
},
|
|
1171
1191
|
overallLength: {
|
|
1172
1192
|
inches: 8,
|
|
1173
1193
|
source: "measured",
|
|
@@ -1217,10 +1237,24 @@ function turnoutPartForSize(size, library = BUILT_IN_TRACK_PARTS) {
|
|
|
1217
1237
|
(best, p) => Math.abs(p.frogNumber - size) < Math.abs(best.frogNumber - size) ? p : best
|
|
1218
1238
|
);
|
|
1219
1239
|
}
|
|
1240
|
+
function measuredLeadPoints(library) {
|
|
1241
|
+
return library.filter(
|
|
1242
|
+
(p) => p.kind === "turnout" && p.frogNumber != null && p.lead?.source === "measured"
|
|
1243
|
+
).map((p) => ({ n: p.frogNumber, lead: p.lead.inches })).sort((a, b) => a.n - b.n);
|
|
1244
|
+
}
|
|
1220
1245
|
function leadInchesForSize(size, library = BUILT_IN_TRACK_PARTS) {
|
|
1221
1246
|
const part = turnoutPartForSize(size, library);
|
|
1222
1247
|
if (part?.lead && part.frogNumber === size) return part.lead.inches;
|
|
1223
|
-
|
|
1248
|
+
const pts = measuredLeadPoints(library);
|
|
1249
|
+
if (!pts.length) return size * TURNOUT_LEAD_INCHES_PER_FROG;
|
|
1250
|
+
if (pts.length === 1) return size / pts[0].n * pts[0].lead;
|
|
1251
|
+
let i;
|
|
1252
|
+
if (size >= pts[pts.length - 1].n) i = pts.length - 2;
|
|
1253
|
+
else i = Math.max(0, pts.findIndex((p) => p.n >= size) - 1);
|
|
1254
|
+
const lo = pts[i];
|
|
1255
|
+
const hi = pts[i + 1];
|
|
1256
|
+
const t = (size - lo.n) / (hi.n - lo.n);
|
|
1257
|
+
return lo.lead + t * (hi.lead - lo.lead);
|
|
1224
1258
|
}
|
|
1225
1259
|
function parseXtpLibrary(text) {
|
|
1226
1260
|
const parts = [];
|