Resources Numerical accuracy Calculation policy

Pipe route clearance size

Turns the outside diameter of a pipe size from the spec table into millimeters for the route finder, and states the bend radius in millimeters.

How the precision is kept

The table gives the outside diameter in inches; it is multiplied by 25.4 in 64-bit before it is passed to the router. The bend radius shown in the properties panel is rounded to whole millimeters for display.

Calculations under this policy

1 calculation in 1 source file. The code is read from the released app when this page loads. It is the calculation people run, not a copy kept for this page.

addons/plant/main.js BimCraft 0.8.1 64-bit 1 calculation Reviewed

Tests None found by the review

Outside diameter handed to the router

64-bit

The pipe's outside diameter in millimeters for a route between two ports.

od = od in × 25.4

One 64-bit multiplication by 25.4, done twice (once for the router and once for the result). The route's length shown in the message is rounded to whole millimeters afterwards; the route itself is not.

  • addons/plant/main.js
  • lines 180 to 188
  • BimCraft 0.8.1
/** A route between two ports of the model (mep.ports(): storey plan mm), round the equipment of the table that is in the model. */
function findRoute(a, b, specId, size) {
  const spec = specs().find((x) => x.id === specId) || specs()[0];
  const ps = pipeSize(spec.material, spec.cls, size);
  if (!ps) return { ok: false, error: 'size' };
  const obstacles = equipment().filter((it) => it.guid).map((it) => placeEquip(makeEquipment(it.type, it.params), { x: it.x, y: it.y, z: it.z, rot: it.rot }).bbox);
  const r = route({ from: { p: a.at, out: a.out }, to: { p: b.at, out: b.out }, obstacles, od: ps.od * 25.4 });
  return r.ok ? { ...r, spec, size, od: ps.od * 25.4 } : r;
}

In detail

Method
od in mm = od in inches × 25.4.
Number types
64-bit numbers.
Limits
The route search itself is in lib/ and was not part of this review.

Approach: 64-bit, direct

Every value is a 64-bit number from input to result. Formulas are closed form or a direct solve, and every comparison uses a stated tolerance.

Every policy that takes this approach