@willcgage/module-schematic 0.96.0 → 0.97.1
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 +52 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +51 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1658,7 +1658,12 @@ interface TrackPart {
|
|
|
1658
1658
|
* {@link secondaryFrogAngle}, which no single turnout has, and
|
|
1659
1659
|
* {@link piecesPerAssembly} — because its lengths describe the HALF, not the
|
|
1660
1660
|
* finished crossover. */
|
|
1661
|
-
kind: "turnout" | "wye" | "curved-turnout" | "crossover" | "crossing" | "flex"
|
|
1661
|
+
kind: "turnout" | "wye" | "curved-turnout" | "crossover" | "crossing" | "flex"
|
|
1662
|
+
/** ⚠️ A SECTIONAL PIECE IS NOT FLEX CUT TO LENGTH, even though the rail ends
|
|
1663
|
+
* up in the same place. Its length belongs to the PART and cannot be
|
|
1664
|
+
* changed, because an owner has a box of them and cannot cut one — which is
|
|
1665
|
+
* the whole reason to model it separately from flex. */
|
|
1666
|
+
| "straight" | "curve" | "bumper";
|
|
1662
1667
|
/** Manufacturer part numbers by hand, where the part has a hand. */
|
|
1663
1668
|
partNumbers?: {
|
|
1664
1669
|
left?: string;
|
|
@@ -1728,6 +1733,23 @@ interface TrackPart {
|
|
|
1728
1733
|
divergingLength?: PartDimension;
|
|
1729
1734
|
/** Diverging route radius (straight turnouts). */
|
|
1730
1735
|
divergingRadius?: PartDimension;
|
|
1736
|
+
/**
|
|
1737
|
+
* SECTIONAL CURVE only: the radius it is built to.
|
|
1738
|
+
*
|
|
1739
|
+
* ⚠️ Distinct from {@link outerRadius}/{@link innerRadius}, which are the two
|
|
1740
|
+
* routes of a CURVED TURNOUT. A plain curve has one radius, and giving it the
|
|
1741
|
+
* "outer" one would say there is another.
|
|
1742
|
+
*/
|
|
1743
|
+
radius?: PartDimension;
|
|
1744
|
+
/**
|
|
1745
|
+
* SECTIONAL CURVE only: how much of a circle the piece covers, degrees.
|
|
1746
|
+
*
|
|
1747
|
+
* ⭐ Radius and arc are how curves are SOLD ("19″ radius, 10°"), so they are
|
|
1748
|
+
* what an owner can read off the box. The piece's length is the arc between
|
|
1749
|
+
* them and is never stored — a chord recorded as a length would quietly
|
|
1750
|
+
* shorten every curve on the module.
|
|
1751
|
+
*/
|
|
1752
|
+
arcDegrees?: number;
|
|
1731
1753
|
/** Curved turnouts: the two concentric radii. */
|
|
1732
1754
|
outerRadius?: PartDimension;
|
|
1733
1755
|
innerRadius?: PartDimension;
|
|
@@ -2304,6 +2326,9 @@ interface StoredTrackPart {
|
|
|
2304
2326
|
outerRadiusInches?: number | null;
|
|
2305
2327
|
innerRadiusInches?: number | null;
|
|
2306
2328
|
radiusSource?: string | null;
|
|
2329
|
+
/** Sectional curve: its single radius, and how far it turns. */
|
|
2330
|
+
radiusInches?: number | null;
|
|
2331
|
+
arcDegrees?: number | null;
|
|
2307
2332
|
actualAngleDeg?: number | null;
|
|
2308
2333
|
actualAngleSource?: string | null;
|
|
2309
2334
|
measurementNote?: string | null;
|
|
@@ -2627,7 +2652,19 @@ declare const JOINT_SNAP_INCHES = 0.01;
|
|
|
2627
2652
|
* scrap. A named product supplies its own `overallLength` and this stops
|
|
2628
2653
|
* applying.
|
|
2629
2654
|
*/
|
|
2655
|
+
/** Every kind of part the library can hold. Beside the type it mirrors, so a
|
|
2656
|
+
* new kind is one edit and not two. */
|
|
2657
|
+
declare const TRACK_PART_KINDS: TrackPart["kind"][];
|
|
2630
2658
|
declare const BUMPER_DRAWN_INCHES = 0.75;
|
|
2659
|
+
/**
|
|
2660
|
+
* How long a sectional curve's RAIL is — the arc, not the chord across it.
|
|
2661
|
+
*
|
|
2662
|
+
* ⚠️ Curves are sold as a radius and an arc, never as a length, and the chord is
|
|
2663
|
+
* always shorter. Recording one as the piece's length would put everything past
|
|
2664
|
+
* that curve closer to endplate A than it is — the same mistake the walk exists
|
|
2665
|
+
* to avoid, arriving through the parts library instead.
|
|
2666
|
+
*/
|
|
2667
|
+
declare function sectionalArcInches(part: TrackPart): number;
|
|
2631
2668
|
/**
|
|
2632
2669
|
* Where a bent run's far end lands, and which way it points — in the piece's own
|
|
2633
2670
|
* frame, starting at its origin heading +x.
|
|
@@ -3137,4 +3174,4 @@ declare function poseOverridesFromDoc(doc: ModuleSchematicDoc): Record<string, {
|
|
|
3137
3174
|
heading: number;
|
|
3138
3175
|
}>;
|
|
3139
3176
|
|
|
3140
|
-
export { ATLAS_CODE55_N, BUILT_IN_TRACK_PARTS, BUMPER_DRAWN_INCHES, type BenchworkPoint, type BranchConnector, CLEARANCE_SPACING_INCHES, CODE55_RAIL_HEIGHT_INCHES, DEFAULT_FLEX_PART_ID, type DimensionSource, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, ENDPLATE_FASCIA_CLEAR_INCHES, ENDPLATE_LEAD_INCHES, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplateEdge, type EndplateEdgePose, type EndplatePose, type EndplateTrackIssue, type EndplateWidthIssue, FAST_TRACKS_N_ME55, FAST_TRACKS_N_ME55_CROSSOVERS, FLEX_TRACK_PARTS, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_MAIN_MIN_RADIUS_INCHES, FREEMO_REVERSE_CURVE_STRAIGHT_INCHES, FREEMO_TRACK_SPACING_INCHES, type FlexPiece, type FlexPieceEnd, type FrogCasting, GENERIC_END_OF_TRACK, type GeometryType, type GraphAnchor, type GraphConflict, type GraphConnection, type GraphDocInput, type GraphDocResult, type GraphRoute, type GraphTurnout, type GraphWalk, type ImportedPart, type IndustryLabelMode, type IndustrySpot, JOINT_SNAP_INCHES, type LanePinch, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OccupiedSpan, type OutlineFace, PINCH_EASE_INCHES, type PartAngle, type PartDimension, type PartEnd, type PartExtent, type PartGeometry, type PartJoint, type PartJointRole, type PartSegment, type PieceSnap, type PlacedJoint, RAIL_GAUGE_INCHES, type ResolvedAnchor, type ReturnLoopGeometry, type ReturnLoopShape, type RouteSpan, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionEnd, type SectionEndAssessment, type SectionFootprint, type SectionJointAssessment, type SectionRelativePos, type SignalFacing, type SignalSide, type SpanOverhang, type StoredTrackPart, TIE_HALF_LENGTH_INCHES, TURNOUT_LEAD_INCHES_PER_FROG, type TrackConfig, type TrackGraph, type TrackPart, type TrackPiece, type TrackRole, type TurnoutClosure, type TurnoutKind, type UsableCapacity, WHOLE_MODULE_SECTION_ID, asModuleSchematic, assessSectionEnd, assessSectionJoint, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTrackGraph, buildTransition, carCapacity, checkEndplateWidth, clearancePointPastFrogInches, crossoverPinches, deriveEndplatePoses, deriveGraphDoc, divergeSideForHand, docToState, emptyEditorState, endplateCentreOffsetInches, endplateEdgePose, endplateFaceSegments, endplateLead, endplateTrackOffsetInches, endplateWidthInches, fitFlexBetween, flexPartFor, flexParts, flexPieces, flexRunEnd, flexUsage, frogCasting, frogNumberFromName, fromSectionRelative, geometryTurnDegrees, graphToDoc, hasNoFarEndplate, importedPartToTrackPart, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, laneOffsetAt, leadInchesForSize, maxFlexPieceInches, mergeImportedParts, mergeStoredParts, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, parseXtpLibrary, partExtent, partExtentForSize, partGeometry, partGeometryGap, partOutlineAtFrog, partsPlaceable, pastFrogInchesForSize, pathLengthInches, pieceHand, piecePartNumber, pieceRoutePaths, placedJoints, poseNeedsManual, poseOverridesFromDoc, remapPos, resizeFlexPiece, resolveGraphAnchor, returnLoop, sampleBenchworkOutline, samplePartSegments, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, snapPiece, spanOverhang, stateToDoc, storedPartToTrackPart, toSectionRelative, trackMeetsEndplateIssues, trackPart, trackPath, turnoutClosure, turnoutFacing, turnoutOccupiedSpan, turnoutPartForSize, usableCapacity, walkTrackGraph };
|
|
3177
|
+
export { ATLAS_CODE55_N, BUILT_IN_TRACK_PARTS, BUMPER_DRAWN_INCHES, type BenchworkPoint, type BranchConnector, CLEARANCE_SPACING_INCHES, CODE55_RAIL_HEIGHT_INCHES, DEFAULT_FLEX_PART_ID, type DimensionSource, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, ENDPLATE_FASCIA_CLEAR_INCHES, ENDPLATE_LEAD_INCHES, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplateEdge, type EndplateEdgePose, type EndplatePose, type EndplateTrackIssue, type EndplateWidthIssue, FAST_TRACKS_N_ME55, FAST_TRACKS_N_ME55_CROSSOVERS, FLEX_TRACK_PARTS, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_MAIN_MIN_RADIUS_INCHES, FREEMO_REVERSE_CURVE_STRAIGHT_INCHES, FREEMO_TRACK_SPACING_INCHES, type FlexPiece, type FlexPieceEnd, type FrogCasting, GENERIC_END_OF_TRACK, type GeometryType, type GraphAnchor, type GraphConflict, type GraphConnection, type GraphDocInput, type GraphDocResult, type GraphRoute, type GraphTurnout, type GraphWalk, type ImportedPart, type IndustryLabelMode, type IndustrySpot, JOINT_SNAP_INCHES, type LanePinch, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OccupiedSpan, type OutlineFace, PINCH_EASE_INCHES, type PartAngle, type PartDimension, type PartEnd, type PartExtent, type PartGeometry, type PartJoint, type PartJointRole, type PartSegment, type PieceSnap, type PlacedJoint, RAIL_GAUGE_INCHES, type ResolvedAnchor, type ReturnLoopGeometry, type ReturnLoopShape, type RouteSpan, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionEnd, type SectionEndAssessment, type SectionFootprint, type SectionJointAssessment, type SectionRelativePos, type SignalFacing, type SignalSide, type SpanOverhang, type StoredTrackPart, TIE_HALF_LENGTH_INCHES, TRACK_PART_KINDS, TURNOUT_LEAD_INCHES_PER_FROG, type TrackConfig, type TrackGraph, type TrackPart, type TrackPiece, type TrackRole, type TurnoutClosure, type TurnoutKind, type UsableCapacity, WHOLE_MODULE_SECTION_ID, asModuleSchematic, assessSectionEnd, assessSectionJoint, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTrackGraph, buildTransition, carCapacity, checkEndplateWidth, clearancePointPastFrogInches, crossoverPinches, deriveEndplatePoses, deriveGraphDoc, divergeSideForHand, docToState, emptyEditorState, endplateCentreOffsetInches, endplateEdgePose, endplateFaceSegments, endplateLead, endplateTrackOffsetInches, endplateWidthInches, fitFlexBetween, flexPartFor, flexParts, flexPieces, flexRunEnd, flexUsage, frogCasting, frogNumberFromName, fromSectionRelative, geometryTurnDegrees, graphToDoc, hasNoFarEndplate, importedPartToTrackPart, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, laneOffsetAt, leadInchesForSize, maxFlexPieceInches, mergeImportedParts, mergeStoredParts, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, parseXtpLibrary, partExtent, partExtentForSize, partGeometry, partGeometryGap, partOutlineAtFrog, partsPlaceable, pastFrogInchesForSize, pathLengthInches, pieceHand, piecePartNumber, pieceRoutePaths, placedJoints, poseNeedsManual, poseOverridesFromDoc, remapPos, resizeFlexPiece, resolveGraphAnchor, returnLoop, sampleBenchworkOutline, samplePartSegments, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionalArcInches, sectionedCenterline, sectionedEndPose, sliceCenterline, snapPiece, spanOverhang, stateToDoc, storedPartToTrackPart, toSectionRelative, trackMeetsEndplateIssues, trackPart, trackPath, turnoutClosure, turnoutFacing, turnoutOccupiedSpan, turnoutPartForSize, usableCapacity, walkTrackGraph };
|
package/dist/index.d.ts
CHANGED
|
@@ -1658,7 +1658,12 @@ interface TrackPart {
|
|
|
1658
1658
|
* {@link secondaryFrogAngle}, which no single turnout has, and
|
|
1659
1659
|
* {@link piecesPerAssembly} — because its lengths describe the HALF, not the
|
|
1660
1660
|
* finished crossover. */
|
|
1661
|
-
kind: "turnout" | "wye" | "curved-turnout" | "crossover" | "crossing" | "flex"
|
|
1661
|
+
kind: "turnout" | "wye" | "curved-turnout" | "crossover" | "crossing" | "flex"
|
|
1662
|
+
/** ⚠️ A SECTIONAL PIECE IS NOT FLEX CUT TO LENGTH, even though the rail ends
|
|
1663
|
+
* up in the same place. Its length belongs to the PART and cannot be
|
|
1664
|
+
* changed, because an owner has a box of them and cannot cut one — which is
|
|
1665
|
+
* the whole reason to model it separately from flex. */
|
|
1666
|
+
| "straight" | "curve" | "bumper";
|
|
1662
1667
|
/** Manufacturer part numbers by hand, where the part has a hand. */
|
|
1663
1668
|
partNumbers?: {
|
|
1664
1669
|
left?: string;
|
|
@@ -1728,6 +1733,23 @@ interface TrackPart {
|
|
|
1728
1733
|
divergingLength?: PartDimension;
|
|
1729
1734
|
/** Diverging route radius (straight turnouts). */
|
|
1730
1735
|
divergingRadius?: PartDimension;
|
|
1736
|
+
/**
|
|
1737
|
+
* SECTIONAL CURVE only: the radius it is built to.
|
|
1738
|
+
*
|
|
1739
|
+
* ⚠️ Distinct from {@link outerRadius}/{@link innerRadius}, which are the two
|
|
1740
|
+
* routes of a CURVED TURNOUT. A plain curve has one radius, and giving it the
|
|
1741
|
+
* "outer" one would say there is another.
|
|
1742
|
+
*/
|
|
1743
|
+
radius?: PartDimension;
|
|
1744
|
+
/**
|
|
1745
|
+
* SECTIONAL CURVE only: how much of a circle the piece covers, degrees.
|
|
1746
|
+
*
|
|
1747
|
+
* ⭐ Radius and arc are how curves are SOLD ("19″ radius, 10°"), so they are
|
|
1748
|
+
* what an owner can read off the box. The piece's length is the arc between
|
|
1749
|
+
* them and is never stored — a chord recorded as a length would quietly
|
|
1750
|
+
* shorten every curve on the module.
|
|
1751
|
+
*/
|
|
1752
|
+
arcDegrees?: number;
|
|
1731
1753
|
/** Curved turnouts: the two concentric radii. */
|
|
1732
1754
|
outerRadius?: PartDimension;
|
|
1733
1755
|
innerRadius?: PartDimension;
|
|
@@ -2304,6 +2326,9 @@ interface StoredTrackPart {
|
|
|
2304
2326
|
outerRadiusInches?: number | null;
|
|
2305
2327
|
innerRadiusInches?: number | null;
|
|
2306
2328
|
radiusSource?: string | null;
|
|
2329
|
+
/** Sectional curve: its single radius, and how far it turns. */
|
|
2330
|
+
radiusInches?: number | null;
|
|
2331
|
+
arcDegrees?: number | null;
|
|
2307
2332
|
actualAngleDeg?: number | null;
|
|
2308
2333
|
actualAngleSource?: string | null;
|
|
2309
2334
|
measurementNote?: string | null;
|
|
@@ -2627,7 +2652,19 @@ declare const JOINT_SNAP_INCHES = 0.01;
|
|
|
2627
2652
|
* scrap. A named product supplies its own `overallLength` and this stops
|
|
2628
2653
|
* applying.
|
|
2629
2654
|
*/
|
|
2655
|
+
/** Every kind of part the library can hold. Beside the type it mirrors, so a
|
|
2656
|
+
* new kind is one edit and not two. */
|
|
2657
|
+
declare const TRACK_PART_KINDS: TrackPart["kind"][];
|
|
2630
2658
|
declare const BUMPER_DRAWN_INCHES = 0.75;
|
|
2659
|
+
/**
|
|
2660
|
+
* How long a sectional curve's RAIL is — the arc, not the chord across it.
|
|
2661
|
+
*
|
|
2662
|
+
* ⚠️ Curves are sold as a radius and an arc, never as a length, and the chord is
|
|
2663
|
+
* always shorter. Recording one as the piece's length would put everything past
|
|
2664
|
+
* that curve closer to endplate A than it is — the same mistake the walk exists
|
|
2665
|
+
* to avoid, arriving through the parts library instead.
|
|
2666
|
+
*/
|
|
2667
|
+
declare function sectionalArcInches(part: TrackPart): number;
|
|
2631
2668
|
/**
|
|
2632
2669
|
* Where a bent run's far end lands, and which way it points — in the piece's own
|
|
2633
2670
|
* frame, starting at its origin heading +x.
|
|
@@ -3137,4 +3174,4 @@ declare function poseOverridesFromDoc(doc: ModuleSchematicDoc): Record<string, {
|
|
|
3137
3174
|
heading: number;
|
|
3138
3175
|
}>;
|
|
3139
3176
|
|
|
3140
|
-
export { ATLAS_CODE55_N, BUILT_IN_TRACK_PARTS, BUMPER_DRAWN_INCHES, type BenchworkPoint, type BranchConnector, CLEARANCE_SPACING_INCHES, CODE55_RAIL_HEIGHT_INCHES, DEFAULT_FLEX_PART_ID, type DimensionSource, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, ENDPLATE_FASCIA_CLEAR_INCHES, ENDPLATE_LEAD_INCHES, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplateEdge, type EndplateEdgePose, type EndplatePose, type EndplateTrackIssue, type EndplateWidthIssue, FAST_TRACKS_N_ME55, FAST_TRACKS_N_ME55_CROSSOVERS, FLEX_TRACK_PARTS, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_MAIN_MIN_RADIUS_INCHES, FREEMO_REVERSE_CURVE_STRAIGHT_INCHES, FREEMO_TRACK_SPACING_INCHES, type FlexPiece, type FlexPieceEnd, type FrogCasting, GENERIC_END_OF_TRACK, type GeometryType, type GraphAnchor, type GraphConflict, type GraphConnection, type GraphDocInput, type GraphDocResult, type GraphRoute, type GraphTurnout, type GraphWalk, type ImportedPart, type IndustryLabelMode, type IndustrySpot, JOINT_SNAP_INCHES, type LanePinch, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OccupiedSpan, type OutlineFace, PINCH_EASE_INCHES, type PartAngle, type PartDimension, type PartEnd, type PartExtent, type PartGeometry, type PartJoint, type PartJointRole, type PartSegment, type PieceSnap, type PlacedJoint, RAIL_GAUGE_INCHES, type ResolvedAnchor, type ReturnLoopGeometry, type ReturnLoopShape, type RouteSpan, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionEnd, type SectionEndAssessment, type SectionFootprint, type SectionJointAssessment, type SectionRelativePos, type SignalFacing, type SignalSide, type SpanOverhang, type StoredTrackPart, TIE_HALF_LENGTH_INCHES, TURNOUT_LEAD_INCHES_PER_FROG, type TrackConfig, type TrackGraph, type TrackPart, type TrackPiece, type TrackRole, type TurnoutClosure, type TurnoutKind, type UsableCapacity, WHOLE_MODULE_SECTION_ID, asModuleSchematic, assessSectionEnd, assessSectionJoint, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTrackGraph, buildTransition, carCapacity, checkEndplateWidth, clearancePointPastFrogInches, crossoverPinches, deriveEndplatePoses, deriveGraphDoc, divergeSideForHand, docToState, emptyEditorState, endplateCentreOffsetInches, endplateEdgePose, endplateFaceSegments, endplateLead, endplateTrackOffsetInches, endplateWidthInches, fitFlexBetween, flexPartFor, flexParts, flexPieces, flexRunEnd, flexUsage, frogCasting, frogNumberFromName, fromSectionRelative, geometryTurnDegrees, graphToDoc, hasNoFarEndplate, importedPartToTrackPart, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, laneOffsetAt, leadInchesForSize, maxFlexPieceInches, mergeImportedParts, mergeStoredParts, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, parseXtpLibrary, partExtent, partExtentForSize, partGeometry, partGeometryGap, partOutlineAtFrog, partsPlaceable, pastFrogInchesForSize, pathLengthInches, pieceHand, piecePartNumber, pieceRoutePaths, placedJoints, poseNeedsManual, poseOverridesFromDoc, remapPos, resizeFlexPiece, resolveGraphAnchor, returnLoop, sampleBenchworkOutline, samplePartSegments, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, snapPiece, spanOverhang, stateToDoc, storedPartToTrackPart, toSectionRelative, trackMeetsEndplateIssues, trackPart, trackPath, turnoutClosure, turnoutFacing, turnoutOccupiedSpan, turnoutPartForSize, usableCapacity, walkTrackGraph };
|
|
3177
|
+
export { ATLAS_CODE55_N, BUILT_IN_TRACK_PARTS, BUMPER_DRAWN_INCHES, type BenchworkPoint, type BranchConnector, CLEARANCE_SPACING_INCHES, CODE55_RAIL_HEIGHT_INCHES, DEFAULT_FLEX_PART_ID, type DimensionSource, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, ENDPLATE_FASCIA_CLEAR_INCHES, ENDPLATE_LEAD_INCHES, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplateEdge, type EndplateEdgePose, type EndplatePose, type EndplateTrackIssue, type EndplateWidthIssue, FAST_TRACKS_N_ME55, FAST_TRACKS_N_ME55_CROSSOVERS, FLEX_TRACK_PARTS, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_MAIN_MIN_RADIUS_INCHES, FREEMO_REVERSE_CURVE_STRAIGHT_INCHES, FREEMO_TRACK_SPACING_INCHES, type FlexPiece, type FlexPieceEnd, type FrogCasting, GENERIC_END_OF_TRACK, type GeometryType, type GraphAnchor, type GraphConflict, type GraphConnection, type GraphDocInput, type GraphDocResult, type GraphRoute, type GraphTurnout, type GraphWalk, type ImportedPart, type IndustryLabelMode, type IndustrySpot, JOINT_SNAP_INCHES, type LanePinch, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OccupiedSpan, type OutlineFace, PINCH_EASE_INCHES, type PartAngle, type PartDimension, type PartEnd, type PartExtent, type PartGeometry, type PartJoint, type PartJointRole, type PartSegment, type PieceSnap, type PlacedJoint, RAIL_GAUGE_INCHES, type ResolvedAnchor, type ReturnLoopGeometry, type ReturnLoopShape, type RouteSpan, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionEnd, type SectionEndAssessment, type SectionFootprint, type SectionJointAssessment, type SectionRelativePos, type SignalFacing, type SignalSide, type SpanOverhang, type StoredTrackPart, TIE_HALF_LENGTH_INCHES, TRACK_PART_KINDS, TURNOUT_LEAD_INCHES_PER_FROG, type TrackConfig, type TrackGraph, type TrackPart, type TrackPiece, type TrackRole, type TurnoutClosure, type TurnoutKind, type UsableCapacity, WHOLE_MODULE_SECTION_ID, asModuleSchematic, assessSectionEnd, assessSectionJoint, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTrackGraph, buildTransition, carCapacity, checkEndplateWidth, clearancePointPastFrogInches, crossoverPinches, deriveEndplatePoses, deriveGraphDoc, divergeSideForHand, docToState, emptyEditorState, endplateCentreOffsetInches, endplateEdgePose, endplateFaceSegments, endplateLead, endplateTrackOffsetInches, endplateWidthInches, fitFlexBetween, flexPartFor, flexParts, flexPieces, flexRunEnd, flexUsage, frogCasting, frogNumberFromName, fromSectionRelative, geometryTurnDegrees, graphToDoc, hasNoFarEndplate, importedPartToTrackPart, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, laneOffsetAt, leadInchesForSize, maxFlexPieceInches, mergeImportedParts, mergeStoredParts, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, parseXtpLibrary, partExtent, partExtentForSize, partGeometry, partGeometryGap, partOutlineAtFrog, partsPlaceable, pastFrogInchesForSize, pathLengthInches, pieceHand, piecePartNumber, pieceRoutePaths, placedJoints, poseNeedsManual, poseOverridesFromDoc, remapPos, resizeFlexPiece, resolveGraphAnchor, returnLoop, sampleBenchworkOutline, samplePartSegments, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionalArcInches, sectionedCenterline, sectionedEndPose, sliceCenterline, snapPiece, spanOverhang, stateToDoc, storedPartToTrackPart, toSectionRelative, trackMeetsEndplateIssues, trackPart, trackPath, turnoutClosure, turnoutFacing, turnoutOccupiedSpan, turnoutPartForSize, usableCapacity, walkTrackGraph };
|
package/dist/index.js
CHANGED
|
@@ -2017,14 +2017,14 @@ function storedPartToTrackPart(row) {
|
|
|
2017
2017
|
source: points.source === "measured" && frog.source === "measured" ? "measured" : "derived",
|
|
2018
2018
|
...note ? { note } : {}
|
|
2019
2019
|
} : dim(row.leadInches, row.leadSource);
|
|
2020
|
-
const kind = row.kind;
|
|
2020
|
+
const kind = TRACK_PART_KINDS.includes(row.kind) ? row.kind : "turnout";
|
|
2021
2021
|
const part = {
|
|
2022
2022
|
id: row.slug,
|
|
2023
2023
|
manufacturer: row.manufacturer,
|
|
2024
2024
|
line: row.line,
|
|
2025
2025
|
scale: "N",
|
|
2026
2026
|
name: row.name,
|
|
2027
|
-
kind
|
|
2027
|
+
kind
|
|
2028
2028
|
};
|
|
2029
2029
|
const numbers = {
|
|
2030
2030
|
...row.partNumberLeft ? { left: row.partNumberLeft } : {},
|
|
@@ -2059,6 +2059,9 @@ function storedPartToTrackPart(row) {
|
|
|
2059
2059
|
const inner = dim(row.innerRadiusInches, row.radiusSource);
|
|
2060
2060
|
if (outer) part.outerRadius = outer;
|
|
2061
2061
|
if (inner) part.innerRadius = inner;
|
|
2062
|
+
const radius = dim(row.radiusInches, row.radiusSource);
|
|
2063
|
+
if (radius) part.radius = radius;
|
|
2064
|
+
if (typeof row.arcDegrees === "number") part.arcDegrees = row.arcDegrees;
|
|
2062
2065
|
if (typeof row.actualAngleDeg === "number")
|
|
2063
2066
|
part.actualAngle = {
|
|
2064
2067
|
deg: row.actualAngleDeg,
|
|
@@ -2172,6 +2175,13 @@ function turnoutClosure(size, opts = {}) {
|
|
|
2172
2175
|
function partGeometryGap(part) {
|
|
2173
2176
|
if (part.kind === "flex") return null;
|
|
2174
2177
|
if (part.kind === "bumper") return null;
|
|
2178
|
+
if (part.kind === "straight")
|
|
2179
|
+
return part.overallLength ? null : "no overall length \u2014 a sectional straight IS its length";
|
|
2180
|
+
if (part.kind === "curve") {
|
|
2181
|
+
if (!part.radius) return "no radius \u2014 a sectional curve is a radius and an arc";
|
|
2182
|
+
if (part.arcDegrees == null) return "no arc \u2014 the radius alone does not say how far it turns";
|
|
2183
|
+
return null;
|
|
2184
|
+
}
|
|
2175
2185
|
if (part.kind === "crossover")
|
|
2176
2186
|
return "a crossover fixture builds one HALF of the assembly (piecesPerAssembly), so its published lengths describe a piece, not the finished part \u2014 the geometry of the whole crossover is not yet derivable from them";
|
|
2177
2187
|
if (part.kind === "crossing") return "crossing geometry is not modelled yet";
|
|
@@ -2185,6 +2195,18 @@ function partGeometryGap(part) {
|
|
|
2185
2195
|
}
|
|
2186
2196
|
function partGeometry(part, library = BUILT_IN_TRACK_PARTS) {
|
|
2187
2197
|
if (partGeometryGap(part)) return null;
|
|
2198
|
+
if (part.kind === "straight" || part.kind === "curve") {
|
|
2199
|
+
const end = part.kind === "curve" ? flexRunEnd(sectionalArcInches(part), part.radius.inches) : { x: part.overallLength.inches, y: 0, headingDeg: 0 };
|
|
2200
|
+
return {
|
|
2201
|
+
joints: [
|
|
2202
|
+
{ id: "a", role: "throat", x: 0, y: 0, angleDeg: 180 },
|
|
2203
|
+
{ id: "b", role: "through", x: end.x, y: end.y, angleDeg: end.headingDeg }
|
|
2204
|
+
],
|
|
2205
|
+
routes: [["a", "b"]],
|
|
2206
|
+
source: (part.kind === "curve" ? part.radius : part.overallLength)?.source ?? "unverified",
|
|
2207
|
+
divergingEndMeasured: false
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2188
2210
|
if (part.kind === "bumper") {
|
|
2189
2211
|
return {
|
|
2190
2212
|
joints: [{ id: "a", role: "throat", x: 0, y: 0, angleDeg: 180 }],
|
|
@@ -2289,6 +2311,16 @@ function pieceRoutePaths(piece, library = BUILT_IN_TRACK_PARTS) {
|
|
|
2289
2311
|
const len = part.overallLength?.inches ?? BUMPER_DRAWN_INCHES;
|
|
2290
2312
|
return [{ route: ["a", "a"], points: [{ x: at2.x, y: at2.y }, place(len, 0)] }];
|
|
2291
2313
|
}
|
|
2314
|
+
if (part.kind === "curve") {
|
|
2315
|
+
const a = joints.find((j) => j.joint === "a");
|
|
2316
|
+
const b = joints.find((j) => j.joint === "b");
|
|
2317
|
+
if (!a || !b) return out;
|
|
2318
|
+
const pts = flexRunPoints(sectionalArcInches(part), part.radius.inches).map(
|
|
2319
|
+
(q) => place(q.x, q.y)
|
|
2320
|
+
);
|
|
2321
|
+
pts[pts.length - 1] = { x: b.x, y: b.y };
|
|
2322
|
+
return [{ route: ["a", "b"], points: pts }];
|
|
2323
|
+
}
|
|
2292
2324
|
for (const route of geo.routes) {
|
|
2293
2325
|
const a = at(route[0]);
|
|
2294
2326
|
const b = at(route[1]);
|
|
@@ -2352,7 +2384,22 @@ function partsPlaceable(library = BUILT_IN_TRACK_PARTS) {
|
|
|
2352
2384
|
return { placeable, blocked };
|
|
2353
2385
|
}
|
|
2354
2386
|
var JOINT_SNAP_INCHES = 0.01;
|
|
2387
|
+
var TRACK_PART_KINDS = [
|
|
2388
|
+
"turnout",
|
|
2389
|
+
"wye",
|
|
2390
|
+
"curved-turnout",
|
|
2391
|
+
"crossover",
|
|
2392
|
+
"crossing",
|
|
2393
|
+
"flex",
|
|
2394
|
+
"straight",
|
|
2395
|
+
"curve",
|
|
2396
|
+
"bumper"
|
|
2397
|
+
];
|
|
2355
2398
|
var BUMPER_DRAWN_INCHES = 0.75;
|
|
2399
|
+
function sectionalArcInches(part) {
|
|
2400
|
+
if (part.kind !== "curve" || !part.radius || part.arcDegrees == null) return 0;
|
|
2401
|
+
return part.radius.inches * Math.abs(part.arcDegrees) * Math.PI / 180;
|
|
2402
|
+
}
|
|
2356
2403
|
function flexRunEnd(lengthInches, radiusInches) {
|
|
2357
2404
|
const L = lengthInches;
|
|
2358
2405
|
const R = radiusInches;
|
|
@@ -2528,6 +2575,7 @@ function walkTrackGraph(graph, pieces, startAt, library = BUILT_IN_TRACK_PARTS)
|
|
|
2528
2575
|
const piece = pieceById.get(a.piece);
|
|
2529
2576
|
const part = piece ? partOf(a.piece) : void 0;
|
|
2530
2577
|
if (piece && part?.kind === "flex") return piece.lengthInches ?? 0;
|
|
2578
|
+
if (part?.kind === "curve") return sectionalArcInches(part);
|
|
2531
2579
|
}
|
|
2532
2580
|
return Math.hypot(a.x - b.x, a.y - b.y);
|
|
2533
2581
|
};
|
|
@@ -3513,6 +3561,6 @@ function poseOverridesFromDoc(doc) {
|
|
|
3513
3561
|
return out;
|
|
3514
3562
|
}
|
|
3515
3563
|
|
|
3516
|
-
export { ATLAS_CODE55_N, BUILT_IN_TRACK_PARTS, BUMPER_DRAWN_INCHES, CLEARANCE_SPACING_INCHES, CODE55_RAIL_HEIGHT_INCHES, DEFAULT_FLEX_PART_ID, ENDPLATE_FASCIA_CLEAR_INCHES, ENDPLATE_LEAD_INCHES, FAST_TRACKS_N_ME55, FAST_TRACKS_N_ME55_CROSSOVERS, FLEX_TRACK_PARTS, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_MAIN_MIN_RADIUS_INCHES, FREEMO_REVERSE_CURVE_STRAIGHT_INCHES, FREEMO_TRACK_SPACING_INCHES, GENERIC_END_OF_TRACK, JOINT_SNAP_INCHES, MAIN2_TRACK_ID, MAIN_TRACK_ID, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, PINCH_EASE_INCHES, RAIL_GAUGE_INCHES, TIE_HALF_LENGTH_INCHES, TURNOUT_LEAD_INCHES_PER_FROG, WHOLE_MODULE_SECTION_ID, asModuleSchematic, assessSectionEnd, assessSectionJoint, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTrackGraph, buildTransition, carCapacity, checkEndplateWidth, clearancePointPastFrogInches, crossoverPinches, deriveEndplatePoses, deriveGraphDoc, divergeSideForHand, docToState, emptyEditorState, endplateCentreOffsetInches, endplateEdgePose, endplateFaceSegments, endplateLead, endplateTrackOffsetInches, endplateWidthInches, fitFlexBetween, flexPartFor, flexParts, flexPieces, flexRunEnd, flexUsage, frogCasting, frogNumberFromName, fromSectionRelative, geometryTurnDegrees, graphToDoc, hasNoFarEndplate, importedPartToTrackPart, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, laneOffsetAt, leadInchesForSize, maxFlexPieceInches, mergeImportedParts, mergeStoredParts, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, parseXtpLibrary, partExtent, partExtentForSize, partGeometry, partGeometryGap, partOutlineAtFrog, partsPlaceable, pastFrogInchesForSize, pathLengthInches, pieceHand, piecePartNumber, pieceRoutePaths, placedJoints, poseNeedsManual, poseOverridesFromDoc, remapPos, resizeFlexPiece, resolveGraphAnchor, returnLoop, sampleBenchworkOutline, samplePartSegments, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, snapPiece, spanOverhang, stateToDoc, storedPartToTrackPart, toSectionRelative, trackMeetsEndplateIssues, trackPart, trackPath, turnoutClosure, turnoutFacing, turnoutOccupiedSpan, turnoutPartForSize, usableCapacity, walkTrackGraph };
|
|
3564
|
+
export { ATLAS_CODE55_N, BUILT_IN_TRACK_PARTS, BUMPER_DRAWN_INCHES, CLEARANCE_SPACING_INCHES, CODE55_RAIL_HEIGHT_INCHES, DEFAULT_FLEX_PART_ID, ENDPLATE_FASCIA_CLEAR_INCHES, ENDPLATE_LEAD_INCHES, FAST_TRACKS_N_ME55, FAST_TRACKS_N_ME55_CROSSOVERS, FLEX_TRACK_PARTS, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_MAIN_MIN_RADIUS_INCHES, FREEMO_REVERSE_CURVE_STRAIGHT_INCHES, FREEMO_TRACK_SPACING_INCHES, GENERIC_END_OF_TRACK, JOINT_SNAP_INCHES, MAIN2_TRACK_ID, MAIN_TRACK_ID, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, PINCH_EASE_INCHES, RAIL_GAUGE_INCHES, TIE_HALF_LENGTH_INCHES, TRACK_PART_KINDS, TURNOUT_LEAD_INCHES_PER_FROG, WHOLE_MODULE_SECTION_ID, asModuleSchematic, assessSectionEnd, assessSectionJoint, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTrackGraph, buildTransition, carCapacity, checkEndplateWidth, clearancePointPastFrogInches, crossoverPinches, deriveEndplatePoses, deriveGraphDoc, divergeSideForHand, docToState, emptyEditorState, endplateCentreOffsetInches, endplateEdgePose, endplateFaceSegments, endplateLead, endplateTrackOffsetInches, endplateWidthInches, fitFlexBetween, flexPartFor, flexParts, flexPieces, flexRunEnd, flexUsage, frogCasting, frogNumberFromName, fromSectionRelative, geometryTurnDegrees, graphToDoc, hasNoFarEndplate, importedPartToTrackPart, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, laneOffsetAt, leadInchesForSize, maxFlexPieceInches, mergeImportedParts, mergeStoredParts, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, parseXtpLibrary, partExtent, partExtentForSize, partGeometry, partGeometryGap, partOutlineAtFrog, partsPlaceable, pastFrogInchesForSize, pathLengthInches, pieceHand, piecePartNumber, pieceRoutePaths, placedJoints, poseNeedsManual, poseOverridesFromDoc, remapPos, resizeFlexPiece, resolveGraphAnchor, returnLoop, sampleBenchworkOutline, samplePartSegments, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionalArcInches, sectionedCenterline, sectionedEndPose, sliceCenterline, snapPiece, spanOverhang, stateToDoc, storedPartToTrackPart, toSectionRelative, trackMeetsEndplateIssues, trackPart, trackPath, turnoutClosure, turnoutFacing, turnoutOccupiedSpan, turnoutPartForSize, usableCapacity, walkTrackGraph };
|
|
3517
3565
|
//# sourceMappingURL=index.js.map
|
|
3518
3566
|
//# sourceMappingURL=index.js.map
|