@willcgage/module-schematic 0.68.0 → 0.70.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 +10 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -485,9 +485,10 @@ function moduleFootprint(input) {
|
|
|
485
485
|
return {
|
|
486
486
|
centerline,
|
|
487
487
|
band: benchworkBand(centerline, widthA, widthB, offA, offB),
|
|
488
|
-
//
|
|
489
|
-
//
|
|
490
|
-
|
|
488
|
+
// Only emit a face where the module actually presents one. A loop's
|
|
489
|
+
// centre-line ends at the THROAT, and an end of the line / pocket simply
|
|
490
|
+
// stops — a far face there is a plate the module hasn't got (#191).
|
|
491
|
+
endplateFaces: hasNoFarEndplate(input) ? endplateFaceSegments(centerline, widthA, widthB, offA, offB).slice(0, 1) : endplateFaceSegments(centerline, widthA, widthB, offA, offB),
|
|
491
492
|
outline: sectionOutlines.length || !authored ? null : sampleBenchworkOutline(authored),
|
|
492
493
|
// The donut hole, arc-sampled — only when there's a solid outline to punch it
|
|
493
494
|
// out of (a sectioned module isn't a donut). Renderers cut it from `outline`.
|
|
@@ -533,6 +534,9 @@ function endplateWidthFor(widths, id) {
|
|
|
533
534
|
const w = widths?.[id];
|
|
534
535
|
return typeof w === "number" && w > 0 ? w : FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES;
|
|
535
536
|
}
|
|
537
|
+
function hasNoFarEndplate(input) {
|
|
538
|
+
return input.geometryType === "dead_end" || input.loop === true || input.endplateConfigs?.[1] === "none";
|
|
539
|
+
}
|
|
536
540
|
function isLoopDoc(doc) {
|
|
537
541
|
return doc.loop === true;
|
|
538
542
|
}
|
|
@@ -1870,6 +1874,7 @@ function moduleFeatures(doc) {
|
|
|
1870
1874
|
crossings,
|
|
1871
1875
|
crossovers,
|
|
1872
1876
|
branchConnectors,
|
|
1877
|
+
hasEndplateB: doc.endplates.some((e) => e.id === "B"),
|
|
1873
1878
|
industries,
|
|
1874
1879
|
laneMin: Math.min(...allLanes),
|
|
1875
1880
|
laneMax: Math.max(...allLanes)
|
|
@@ -1992,7 +1997,7 @@ function deriveEndplatePoses(geo) {
|
|
|
1992
1997
|
trackOffsets: offsetsFor(cfg(0), half)
|
|
1993
1998
|
})
|
|
1994
1999
|
);
|
|
1995
|
-
const noB = geo
|
|
2000
|
+
const noB = hasNoFarEndplate(geo);
|
|
1996
2001
|
const end = sectionedEndPose({ sections: geo.sections });
|
|
1997
2002
|
if (!noB && end) {
|
|
1998
2003
|
poses.push(
|
|
@@ -2181,6 +2186,7 @@ exports.frogCasting = frogCasting;
|
|
|
2181
2186
|
exports.frogNumberFromName = frogNumberFromName;
|
|
2182
2187
|
exports.fromSectionRelative = fromSectionRelative;
|
|
2183
2188
|
exports.geometryTurnDegrees = geometryTurnDegrees;
|
|
2189
|
+
exports.hasNoFarEndplate = hasNoFarEndplate;
|
|
2184
2190
|
exports.importedPartToTrackPart = importedPartToTrackPart;
|
|
2185
2191
|
exports.inchesToScaleFeet = inchesToScaleFeet;
|
|
2186
2192
|
exports.isLoopDoc = isLoopDoc;
|