Resources Numerical accuracy

Calculations

Every calculation under our calculation policies: what it works out, its formula and the precision it runs at. Open one to see its code as it is in the released app.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

Calculations

  • Was a placement moved elsewhere

    Decides whether a placement's matrix in the file differs from the model's and takes the file's if so.

    moved if any |mₖ(file) − mₖ(own)| > 10⁻⁷ × max(1, |mₖ(own)|)

    USD save, open and import usd-modelcraft.js
    • ModelCraft
    64-bit
  • Placements through the stage's frame

    Brings a placement matrix from the file's units and up axis into meters with Z up.

    M′ = F · M · F⁻¹

    USD save, open and import usd-modelcraft.js
    • ModelCraft
    64-bit
  • Imported mesh points

    The points of an imported mesh in meters with Z up.

    p′ = F · p (rotation, scale and translation of the frame)

    USD save, open and import usd-modelcraft.js
    • ModelCraft
    64-bit
  • Lamp output from a USD light

    The lumens of an imported lamp when the file does not carry ModelCraft's own value.

    area = width × height × scale² or 4π·(radius × scale)²; lumens = intensity × 2^exposure × 683 × max(area, 10⁻⁶) × π

    USD save, open and import usd-modelcraft.js
    • ModelCraft
    64-bit
  • Round starting size

    Rounds a size to 1, 2, 5 or 10 times a power of ten.

    p = 10^⌊log₁₀ x⌋; m = x ÷ p; result = (1 if m < 1.5, 2 if m < 3.5, 5 if m < 7.5, else 10) × p

    Sizes for new curves and meshes, remesh grid ws-curve.js
    • ModelCraft
    64-bit
  • Text as a curve object

    The letters' outlines as closed flat splines, filled and given a thickness.

    extrude = height × 0.05; each outline point [x, y] becomes a spline point [x, y, 0]

    Sizes for new curves and meshes, remesh grid ws-curve.js
    • ModelCraft
    64-bit
  • Voxel remesh grid size

    Suggests a voxel size and counts the grid cells the typed size would need.

    suggested = niceSize(largest extent ÷ 40); cells = Π (⌈(extentₖ + 4·voxel) ÷ (voxel ÷ 2)⌉ + 1)

    Sizes for new curves and meshes, remesh grid ws-mesh.js
    • ModelCraft
    64-bit
  • Size of a new mesh shape

    The size given to a new plane, cube, cylinder, sphere or torus.

    s = niceSize(view height ÷ 5); radius = s ÷ 2; torus tube = s ÷ 8

    Sizes for new curves and meshes, remesh grid ws-mesh.js
    • ModelCraft
    64-bit
  • Volume and size of a placed solid

    The volume of a closed group or component and its width, depth and height as placed.

    k = ∛|det M₃ₓ₃|; volume = V × k × k × k; size_q = (max_q − min_q) × |column q|; retyped size → L ÷ |column q|

    Entity info: volume, size, angle and area modelcraft.js
    • ModelCraft
    64-bit
  • Volume and size of a placed mesh

    The volume of a closed mesh and its size as placed.

    k = ∛|det M₃ₓ₃|; volume = V × k³; size_q = (max_q − min_q) × |column q|

    Entity info: volume, size, angle and area modelcraft.js
    • ModelCraft
    64-bit
  • Arc angle

    The angle an arc sweeps, in degrees.

    shown = round(sweep × 180 ÷ π × 100) ÷ 100

    Entity info: volume, size, angle and area modelcraft.js
    • ModelCraft
    64-bit
  • Total area of selected faces

    The sum of the areas of the selected faces.

    total = Σ face area

    Entity info: volume, size, angle and area modelcraft.js
    • ModelCraft
    64-bit
  • Print check size and volume

    The size in millimeters and the volume in cubic centimeters shown after a print check.

    shown size = round(mm × 10) ÷ 10; shown volume = round(mm³ ÷ 1000 × 10) ÷ 10 cm³

    Entity info: volume, size, angle and area modelcraft.js
    • ModelCraft
    64-bit
  • Mirror plane for a flipped copy

    Puts the mirror plane on the far side of the selection's box so the copy lands beside the original.

    far = max over the box's 8 corners of (corner − c)·a; plane point = c + a × far

    Edits and settings from the main window modelcraft.js
    • ModelCraft
    64-bit
  • Curve object from a drawn curve

    Makes a curve object from a drawn arc, circle, polygon or curve, flat when all its points share a height.

    closed if |first − last| < 10⁻⁹; flat if every |z − z₀| < 10⁻⁹, then z ← 0 and the placement carries z₀; bevel depth = max(10⁻⁴, length ÷ 100)

    Edits and settings from the main window modelcraft.js
    • ModelCraft
    64-bit
  • Node meshes baked into the model

    Converts each baked mesh from millimeters to the model's meters.

    x_m = x_mm ÷ 1000

    Edits and settings from the main window modelcraft.js
    • ModelCraft
    64-bit
  • Guessing storey heights

    Proposes a storey for each different height the top-level groups and components stand on.

    height = round(box min z × 100) ÷ 100

    Edits and settings from the main window modelcraft.js
    • ModelCraft
    64-bit
  • Sun settings from the panel

    Reads month, day, hour, latitude, longitude and time zone from the Style panel into the model's sun.

    value = clamp(parseFloat(text), lo, hi); month, day = value | 0

    Edits and settings from the main window modelcraft.js
    • ModelCraft
    64-bit
  • Room handed to add-ons

    The room made by the selected floor face, as add-ons receive it: outline in millimeters, height and area.

    z = round(room height × 1000); area (mm²) = area (m²) × 10⁶

    Edits and settings from the main window modelcraft.js
    • ModelCraft
    64-bit
  • Scale of a photographed sketch

    Reads the 1 : n scale the person types for a sketch photo.

    n = round(Number(text)); accepted if 1 ≤ n ≤ 100 000

    Edits and settings from the main window modelcraft.js
    • ModelCraft
    64-bit
  • Point and normal under the pointer

    The clicked point and the face normal in the face's own coordinates, and where on the material's tile the point lies.

    p = M⁻¹ × hit; n = (b − a) × (c − a), made unit; tile uv = planar uv ÷ tile size

    Decal placement and size ws-shading.js
    • ModelCraft
    64-bit
  • Barycentric weights of a point in a triangle

    The three weights of a point against a triangle's corners and its distance from the triangle's plane.

    n = ab × ac; b = ((ap × ac) · n) ÷ |n|²; c = ((ab × ap) · n) ÷ |n|²; a = 1 − b − c; dist = |ap · n| ÷ |n|

    Decal placement and size ws-shading.js
    • ModelCraft
    64-bit
  • Size of a new decal

    The width and height a new decal and its material tile are stored with.

    height = round(width × (picture height ÷ picture width) × 1000) ÷ 1000

    Decal placement and size ws-shading.js
    • ModelCraft
    64-bit
  • Resize a decal

    A decal's new height and depth when its width is changed.

    h = round(w × size₁ ÷ size₀ × 1000) ÷ 1000; depth = max(0.01, min(w, h) ÷ 2)

    Decal placement and size ws-shading.js
    • ModelCraft
    64-bit
  • Turn a decal a quarter turn

    The decal's new width direction and swapped sizes after a quarter turn about its normal.

    u′ = n × u; size′ = [size₁, size₀]

    Decal placement and size ws-shading.js
    • ModelCraft
    64-bit
  • A placement's surface in world coordinates

    Every triangle corner of the selected object with its normal and UV, in world coordinates, for the bake.

    Texture bake inputs ws-shading.js
    • ModelCraft
    32-bit, display only
  • Bake ray distance and widths

    The ray distance, curvature width and cage distance handed to the bake.

    dist = given, or 0.25 × bounding box diagonal; width = percent ÷ 100; cage = percent ÷ 100

    Texture bake inputs ws-shading.js
    • ModelCraft
    32-bit, display only
  • Event order

    Decides which of two queued events runs first.

    earlier time first; equal times: lower priority number first; then lower sequence number

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Time-weighted mean and maximum

    The mean and maximum over time of a queue length, a count of busy servers or an on/off state.

    area = Σ value × (time it held); mean = (area + value × (now − last change)) ÷ (now − start)

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Rounding of reported statistics

    Rounds a statistic to 6 decimals before it goes into the results.

    r6(x) = round(x × 10⁶) ÷ 10⁶

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Load type by weight

    Picks the type of a new load in proportion to the types' weights.

    u = random × Σ weights; subtract each weight in turn until u < 0

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Throughput and lead time at a sink

    Counts finished loads and works out loads per hour and the mean and maximum time from creation to the sink.

    lead = now − born; per hour = n ÷ span × 3600; mean lead = Σ lead ÷ n

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Station utilization, blocking and waiting

    The share of server time spent busy, blocked and idle, the mean queue and the mean wait at a station.

    utilization = mean busy ÷ servers; blocked = mean blocked ÷ servers; idle = 1 − (mean busy + mean blocked) ÷ servers; wait = Σ wait ÷ starts

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Gate cycle phase

    Whether a cycling gate starts open and when it first switches.

    period = open + closed; phase = ((0 − offset) mod period + period) mod period; open when phase < open

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Position of a load on a belt

    Where the tail of a load is now, on an accumulating belt or on a belt that stops as a whole.

    accumulating: p = min(v × t + c, S); stopping belt: p = D(t) − D at entry, D(t) = D₀ + v × (t − t₀)

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • When the next load can get on a belt

    The time at which the last load has moved far enough for the next one to enter.

    pitch = load length + gap (or the fixed zone pitch); accumulating: t = (pitch − c_last) ÷ v; stopping belt: t = now + (pitch − gap so far) ÷ v

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • A load gets on a belt

    Sets the two numbers that describe the new load's motion: where it is held back and where it stops.

    empty belt: c = −v × now (or less, to keep the pitch behind the load that just left), S = length − L; else c = min(−v × now, c_last − pitch), S = S_last − pitch

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • When the head load reaches the end

    The time the first load's head arrives at the end of the belt.

    accumulating: t = (length − L − c) ÷ v; stopping belt: t = t₀ + (D at entry + length − L − D₀) ÷ v

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Loads close up when the head leaves

    Works out again, for every load left on the belt, where it is held back and where it stops.

    first: c = min(−v × entry, length − L_gone − v × now − pitch), S = length − L; others: c = min(−v × entry, c_front − pitch), S = S_front − pitch

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • A belt starts again after a breakdown

    Shifts every load's timeline by the time the belt stood still.

    dur = now − time it stopped; c = c − v × dur; entry = entry + dur

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Photo-eye covered by a load

    Whether a load is over a sensor placed a given distance along a belt.

    covered when p − 1e-7 ≤ at ≤ p + L + 1e-7

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Shortest vehicle routes

    The shortest path distance from one path node to every other, used to pick the nearest idle vehicle and its route.

    Dijkstra: dist(to) = min over edges of dist(from) + edge length

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Vehicle travel time on a segment

    When a vehicle that enters a path segment reaches its end.

    t₁ = now + length ÷ speed

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Vehicle time shares and distances

    For each vehicle: the share of time in each state, the distance driven loaded and empty, and how busy it was.

    share = time in state ÷ span; busy = 1 − idle share − down share

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Run results

    Throughput per hour and the lead time count, mean, minimum, median, 95th percentile and maximum for the whole run.

    per hour = done ÷ span × 3600; mean = Σ lead ÷ n; percentile p = sorted[min(n − 1, floor(p × n))]

    Material flow simulation addons/flow/lib/sim.js
    • ModelCraft
    64-bit
  • Seeds from a string

    Turns the seed and a stream key into four 32-bit seeds.

    Random numbers and time distributions for material flow addons/flow/lib/rng.js
    • ModelCraft
    Exact
  • Uniform random number

    One number from 0 up to, but not including, 1.

    next = (32-bit state output) ÷ 4294967296

    Random numbers and time distributions for material flow addons/flow/lib/rng.js
    • ModelCraft
    64-bit
  • One time from a distribution

    A time in seconds drawn from a constant, uniform, exponential, Erlang, normal or triangular distribution.

    exponential: −mean × ln(1 − u); Erlang: −(mean ÷ k) × ln(Π (1 − uᵢ)); normal: mean + sd × √(−2 ln u₁) × cos(2π u₂); triangular: a + √(u (b − a)(m − a)) or b − √((1 − u)(b − a)(b − m))

    Random numbers and time distributions for material flow addons/flow/lib/rng.js
    • ModelCraft
    64-bit
  • Mean of a distribution

    The mean time of a distribution, as the panel shows it.

    uniform: (a + b) ÷ 2; triangular: (a + m + b) ÷ 3; others: the stated mean

    Random numbers and time distributions for material flow addons/flow/lib/rng.js
    • ModelCraft
    64-bit
  • Center line of a conveyor

    The length of a straight, zoned, inclined or curved conveyor and the point and heading at a distance along it.

    incline: L = √(length² + rise²); curve: L = r × |angle|, point = (r sin θ, ± r (1 − cos θ)), θ = s ÷ r

    Material flow layout geometry addons/flow/lib/catalog.js
    • ModelCraft
    64-bit

A calculation is added only after its source was read. Each statement can be checked in the code shown on its policy's page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.