@willcgage/module-schematic 0.105.0 → 0.106.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 +22 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3182,7 +3182,29 @@ function moduleConversionReport(doc, library = BUILT_IN_TRACK_PARTS) {
|
|
|
3182
3182
|
const straight = placeableTurnoutParts(library, ["turnout"]);
|
|
3183
3183
|
const curved = placeableTurnoutParts(library, ["curved-turnout"]);
|
|
3184
3184
|
const blockers = [];
|
|
3185
|
+
const assemblyPart = /* @__PURE__ */ new Map();
|
|
3186
|
+
for (const t of doc.tracks ?? []) {
|
|
3187
|
+
if (t.role !== "crossover" || !t.crossoverPartId) continue;
|
|
3188
|
+
const part = library.find((p) => p.id === t.crossoverPartId);
|
|
3189
|
+
if (!part || part.kind !== "crossover" || partGeometryGap(part)) continue;
|
|
3190
|
+
for (const sw of doc.turnouts ?? [])
|
|
3191
|
+
if (sw.divergeTrack === t.id) assemblyPart.set(sw.id, part);
|
|
3192
|
+
}
|
|
3185
3193
|
const turnouts = (doc.turnouts ?? []).map((t) => {
|
|
3194
|
+
const asm = assemblyPart.get(t.id);
|
|
3195
|
+
if (asm)
|
|
3196
|
+
return {
|
|
3197
|
+
id: t.id,
|
|
3198
|
+
name: t.name,
|
|
3199
|
+
pos: t.pos,
|
|
3200
|
+
size: t.size,
|
|
3201
|
+
statedPartId: t.partId,
|
|
3202
|
+
partId: asm.id,
|
|
3203
|
+
from: "assembly",
|
|
3204
|
+
source: partGeometry(asm, library)?.source ?? null,
|
|
3205
|
+
why: null,
|
|
3206
|
+
candidates: []
|
|
3207
|
+
};
|
|
3186
3208
|
const wantCurved = t.curved === true;
|
|
3187
3209
|
const pool = wantCurved ? curved : straight;
|
|
3188
3210
|
const base = {
|