wadi-mcp 0.1.32 → 0.1.36
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/server.mjs +22 -31
- package/package.json +1 -1
package/dist/server.mjs
CHANGED
|
@@ -370343,48 +370343,39 @@ function expandStaircaseBox(sc, slabThickness, floorBelowHeight, floorOwnHeight)
|
|
|
370343
370343
|
`staircase "${name}" doesn't fit its box across the stairs: the ${Math.floor(lateralExtent)}-unit side leaves no room for ${nLanes === 2 ? "two lanes" : "a flight"} past flight_gap ${gap}.`
|
|
370344
370344
|
);
|
|
370345
370345
|
}
|
|
370346
|
-
const
|
|
370347
|
-
const
|
|
370348
|
-
const
|
|
370349
|
-
const
|
|
370346
|
+
const base = Math.floor(totalSteps / numFlights);
|
|
370347
|
+
const rem = totalSteps - base * numFlights;
|
|
370348
|
+
const risersFor = (t) => base + (t < rem ? 1 : 0);
|
|
370349
|
+
const maxRun = (base + (rem > 0 ? 1 : 0) - 1) * tread;
|
|
370350
|
+
const nearOffset = (runBudget - maxRun) / 2;
|
|
370350
370351
|
const anti = sc.turn === "anticlockwise";
|
|
370351
370352
|
const laneA = anti ? stairWidth + gap : 0;
|
|
370352
370353
|
const laneB = anti ? 0 : stairWidth + gap;
|
|
370353
370354
|
const landingWidth = nLanes === 2 ? 2 * stairWidth + gap : stairWidth;
|
|
370354
370355
|
const items = [];
|
|
370355
370356
|
const stepFields = { step_rise: riser, step_tread: tread, step_width: stairWidth };
|
|
370356
|
-
let
|
|
370357
|
+
let bottomPos = nearOffset;
|
|
370358
|
+
let climbFar = true;
|
|
370359
|
+
let zc = 0;
|
|
370357
370360
|
for (let t = 0; t < numFlights; t++) {
|
|
370358
370361
|
const risers = risersFor(t);
|
|
370359
370362
|
if (risers <= 0) break;
|
|
370360
370363
|
const treads = Math.max(1, risers - 1);
|
|
370361
|
-
const even = t % 2 === 0;
|
|
370362
|
-
const lane = even ? laneA : laneB;
|
|
370363
370364
|
const run = treads * tread;
|
|
370364
|
-
|
|
370365
|
-
|
|
370366
|
-
|
|
370367
|
-
|
|
370368
|
-
|
|
370369
|
-
|
|
370370
|
-
}
|
|
370371
|
-
|
|
370372
|
-
|
|
370373
|
-
|
|
370374
|
-
|
|
370375
|
-
|
|
370376
|
-
|
|
370377
|
-
|
|
370378
|
-
items.push({
|
|
370379
|
-
isStair: true,
|
|
370380
|
-
o: even ? { type: "staircase", direction: "north", start_x: lane, start_y: nearOffset + run, num_steps: treads, ...stepFields, z_offset: zBottom } : { type: "staircase", direction: "south", start_x: lane, start_y: nearOffset + flightRun - run, num_steps: treads, ...stepFields, z_offset: zBottom }
|
|
370381
|
-
});
|
|
370382
|
-
{
|
|
370383
|
-
const ly = even ? nearOffset + flightRun : nearOffset - landingDepth;
|
|
370384
|
-
items.push({ isStair: false, o: { type: "floor_slab", x: 0, y: ly, width: landingWidth, length: landingDepth, thickness: landingThickness, z_offset: zBottom - landingThickness } });
|
|
370385
|
-
}
|
|
370386
|
-
zCur = zBottom;
|
|
370387
|
-
}
|
|
370365
|
+
const topPos = climbFar ? bottomPos + run : bottomPos - run;
|
|
370366
|
+
const lane = t % 2 === 0 ? laneA : laneB;
|
|
370367
|
+
const zFlightBottom = up ? zc : zc - risers * riser;
|
|
370368
|
+
const zFlightTop = zFlightBottom + risers * riser;
|
|
370369
|
+
items.push({
|
|
370370
|
+
isStair: true,
|
|
370371
|
+
o: { type: "staircase", direction: climbFar ? "south" : "north", start_x: lane, start_y: bottomPos, num_steps: treads, ...stepFields, z_offset: zFlightBottom }
|
|
370372
|
+
});
|
|
370373
|
+
const ldepth = climbFar ? runBudget - topPos : topPos;
|
|
370374
|
+
const ly = climbFar ? topPos : 0;
|
|
370375
|
+
items.push({ isStair: false, o: { type: "floor_slab", x: 0, y: ly, width: landingWidth, length: ldepth, thickness: landingThickness, z_offset: zFlightTop - landingThickness } });
|
|
370376
|
+
bottomPos = topPos;
|
|
370377
|
+
climbFar = !climbFar;
|
|
370378
|
+
zc = up ? zFlightTop : zFlightBottom;
|
|
370388
370379
|
}
|
|
370389
370380
|
const rotated = items.map((it) => ({ ...it, o: rotateObject(it.o, direction) }));
|
|
370390
370381
|
const R = ROT[direction];
|