@adatechnology/game-floorplan-structure 1.1.0 → 1.2.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/README.md CHANGED
@@ -12,6 +12,8 @@ plan.structure.parts // the parts that carry load, each with role, material, box
12
12
  plan.structure.supports // what each part rests on, down to 'ground'
13
13
  ```
14
14
 
15
+ A free-standing wall: `buildStructure(plan, { roof: false })` leaves the roof out, so a plan with one exterior wall stands as a house wall does (on the strip footing, with the bond beam on it). `wallPiece` of `game-floorplan-three` builds and draws such a wall; every wall of a scene or a game is made that way.
16
+
15
17
  Tall buildings: `buildTower()` builds a frame with continuous columns, a concrete core with stairs and elevator shafts, a glass curtain wall, a flat
16
18
  roof with its membrane and the mechanical floor (`addCore`, `addCurtainWall`, `addFlatRoof`, `addMechanicalFloor` add each one to any frame spec).
17
19
  Wind: `buildTower({ wind: { speed, terrain }, damper: true })` sizes the tower for the wind and adds a tuned mass damper (`addTunedMassDamper`, `DAMPER_DEFAULTS`)
package/dist/index.d.ts CHANGED
@@ -326,6 +326,8 @@ interface StructureOptions {
326
326
  /** Gable roofs as rafters of each side and a ridge beam (a side falls with the wall it rests on) instead of whole trusses. Default: when the detail is not `coarse`. */
327
327
  rafterRoof?: boolean;
328
328
  wallDetail?: WallDetail;
329
+ /** `false`: no roof (a free-standing wall, a garden wall). Default `true`. */
330
+ roof?: boolean;
329
331
  }
330
332
  /** What a construction builder and the tank get to see: the generated plan, its seed and the template. */
331
333
  interface PlanContext {
@@ -1320,7 +1320,7 @@ var GameFloorplanStructure = (() => {
1320
1320
  addPorchRoofs(context);
1321
1321
  addExteriorSteps(context);
1322
1322
  addStairs(context);
1323
- addRoof(context);
1323
+ if (options.roof !== false) addRoof(context);
1324
1324
  if (refined) addDoorLintels(context);
1325
1325
  addWaterTank(context);
1326
1326
  addChimney(context);
@@ -6237,13 +6237,14 @@ var GameFloorplanStructure = (() => {
6237
6237
  const crackLen = clamp22(0.03 + ratio * 0.2, 0.03, 0.8);
6238
6238
  let exitPoint;
6239
6239
  if (penetrated) {
6240
- exitPoint = vec.madd(entry2, d, Math.min(pathLen, effM + layersThickness(p.layers, face) / slant + layersThickness(p.layers, -face) / slant));
6240
+ const exitDist = p.spec.contains || p.spec.fill !== void 0 && p.spec.fill < 0.5 || p.thickness < pathLen * 0.5 ? pathLen : Math.min(pathLen, effM + layersThickness(p.layers, face) / slant + layersThickness(p.layers, -face) / slant);
6241
+ exitPoint = vec.madd(entry2, d, exitDist);
6241
6242
  const hole = addHole(o, p, entry2, n, caliber / 1e3 * (mat.ductility >= 0.3 ? 1 : 1.5), true, exitPoint, src);
6242
6243
  if (p.layers.length > 0) spallOuter(o, p, exitPoint, -face, vec.scale(n, -1), Math.max(0.03, caliber / 1e3 * 4), src);
6243
6244
  addBreach(o, p, entry2, Math.PI * (hole.diameter / 2) * (hole.diameter / 2), E, d, src);
6244
6245
  if (mat.ductility >= 0.5 && p.thickness <= THIN_SHEET_DISHING) addDent(o, p, entry2, n, Math.max(caliber * 3 / 1e3, 0.012), clamp22(E * 2e-5, 1e-3, 0.03), src);
6245
6246
  if (brittle && mat.fracture === "shatter") addCrack(o, p, entry2, n, crackLen, src);
6246
- if (p.spec.contains && (p.st.liters ?? 0) > 0) {
6247
+ if (p.spec.contains && (p.st.liters ?? 0) > 1e-4) {
6247
6248
  emit({
6248
6249
  ...base(o, src),
6249
6250
  type: "leak",