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.
Calculations
-
Ray and triangle
Whether a ray meets a triangle and at what distance t and barycentric u, v.
t = (e2 · (s × e1)) ÷ (e1 · (d × e2))
Ray hits against 32-bit triangle records compute/bvh-core.js32-bit in part- BimCraft
- ModelCraft
-
Ray and box slab test
The distance at which a ray enters a box, or Infinity.
t = (box − o) ÷ d, max of the near, min of the far
Ray hits against 32-bit triangle records compute/bvh-core.js64-bit- BimCraft
- ModelCraft
-
Instance inverse matrix
The world-to-object matrix of an instance as 12 numbers.
M⁻¹ = adj(M) ÷ det(M), translation = −M⁻¹ t
Ray hits against 32-bit triangle records compute/bvh-scene.js32-bit in part- BimCraft
- ModelCraft
-
Ray into object space of an instance
The ray origin and direction in an instance frame, and the triangle test that follows.
Ray hits against 32-bit triangle records compute/bvh-scene.js32-bit in part- BimCraft
- ModelCraft
-
Triangle records from world triangles
The 12-number triangle records the scatter ray tests use.
e1 = v1 − v0; e2 = v2 − v0
Ray hits against 32-bit triangle records rt/rt-scatter-ui.js32-bit in part- BimCraft
- ModelCraft
-
Ray against boxes
Calls back for every item whose box a ray passes through.
t₀ = max(nearₐ), t₁ = min(farₐ); hit if t₀ ≤ t₁
Box tree for picking and collisions m3d/bvh.js64-bit- CadCraft
- ModelCraft
- PartCraft
-
Boxes of point lists
The box of each item from its points, grown by a pad.
Box tree for picking and collisions m3d/bvh.js64-bit- CadCraft
- ModelCraft
- PartCraft
-
Accumulation buffer read back
The per-pixel sums of red, green, blue and sample count.
Path-traced picture sums and the saved file render/pt-gpu.js32-bit in part- BimCraft
- ModelCraft
-
Sum of an exact range of samples
The sum of samples s0 to s0 + spp − 1 for every pixel.
Path-traced picture sums and the saved file render/pt-gpu.js32-bit in part- BimCraft
- ModelCraft
-
Render elements read back
The per-pixel render elements and light-group sums.
Path-traced picture sums and the saved file render/pt-gpu.js32-bit in part- BimCraft
- ModelCraft
-
EXR channels from the sums
The mean (or raw sum) of each channel for the EXR and render file.
mean = Σ ÷ max(samples, 1)
Path-traced picture sums and the saved file render/pt-output.js32-bit in part- BimCraft
- ModelCraft
-
16-bit PNG
The picture as 16 bits per channel.
v₁₆ = round(clamp(v, 0, 1) × 65535)
Path-traced picture sums and the saved file render/pt-output.js32-bit in part- BimCraft
- ModelCraft
-
Reopening a render file
The sums and counts read back from the layers file.
Path-traced picture sums and the saved file render/pt-output.js32-bit in part- BimCraft
- ModelCraft
-
Save as 16-bit PNG
Chooses the 32-bit or the 8-bit path to write the 16-bit PNG.
Path-traced picture sums and the saved file render/render-ui.js32-bit in part- BimCraft
- ModelCraft
-
Material and band thicknesses
The thickness of each library sheet and edge band in millimeters and in inches.
Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/materials.jsExact- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Rules from the material picks
The thicknesses, groove and band thicknesses that the construction rules use.
groove = min(tback, 0.6 × tcarcass)
Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/materials.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Sheet size for a material
The sheet width and height a material is cut from.
in = round(mm ÷ 25.4 × 4) ÷ 4
Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/materials.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Hole positions in the drill XML
The x and y of each hole as written in the drill file.
x = round(x × 1000) ÷ 1000
Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/export.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
G-code scale and thickness
The unit scale and cut depth passed to the sheet G-code writer.
thickness_mm = thickness × scale
Cabinet material sizes, grooves and drill files addons/cabinetcraft/lib/export.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Vertices and loose edges
The point positions of a model definition and its loose edges.
Model points written to USD usd/m3d.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Mesh arrays
The point, normal, UV and color arrays of a mesh.
Model points written to USD usd/m3d.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Number to text
The text a number is written as, by type.
f32: text = shortest s with fround(+s) = fround(x)
Number text in USD files usd/usda-write.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Shortest digits
A number to p significant digits without trailing zeros.
Number text in USD files usd/usda-write.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Type name to number type
Which number type a USD type name uses (32-bit float, half or 64-bit double).
Number text in USD files usd/sdf.jsExact- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Inline values
A value that the file stores inside its 32-bit payload word.
Floats read from USD files usd/usdc-read.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Raw arrays
A packed array of numbers of one type.
Floats read from USD files usd/usdc-read.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Compressed float arrays
An array stored as whole numbers or as a lookup table and indexes.
Floats read from USD files usd/usdc-read.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Float text rounding
A float or half value read from .usda text.
Floats read from USD files usd/usda-read.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Arrays from text
A list of parsed numbers as a typed array of the right type.
Floats read from USD files usd/usda-read.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Half to float
The value of a 16-bit half float.
v = ± (1 + m ÷ 1024) × 2^(e − 15)
Half floats in USD usd/util.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Float to half
The 16-bit half closest to a number.
Half floats in USD usd/util.js32-bit in part- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Half to float
The value of a 16-bit half float.
v = ± (1 + m ÷ 1024) × 2^(e − 15)
Half floats in EXR exr/util.js32-bit in part- BimCraft
- ModelCraft
-
Float to half
The 16-bit half closest to a number.
Half floats in EXR exr/util.js32-bit in part- BimCraft
- ModelCraft
-
Measure to SI
A property value in meters, square meters or cubic meters.
area = v × L²; volume = v × L³
IFC measures in SI for USD usd/ifc.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
- PartCraft
-
Start editing a key
Saves the current points as the basis and shows the key at full strength.
point = basis + offset
Shape keys: offsets, editing and blending anim/shapes.js32-bit in part- ModelCraft
-
Finish editing a key
Turns the edited points into the key's offsets and puts the mesh back to its basis.
offset = edited − basis; point = basis
Shape keys: offsets, editing and blending anim/shapes.js32-bit in part- ModelCraft
-
Key from imported positions
Makes a key that moves the basis to a list of positions (glTF morph targets, USD blend shapes).
offset = position − basis point
Shape keys: offsets, editing and blending anim/shapes.js32-bit in part- ModelCraft
-
Blend of the keys
The points of a mesh with each key at its weight.
pᵢ = basisᵢ + Σ wₖ × offsetₖ,ᵢ
Shape keys: offsets, editing and blending anim/shapes.js32-bit in part- ModelCraft
-
Deformed copy of a mesh
The mesh moved by its shape keys and then its skin, which the view, picking and exports read.
points = blend of keys; then skin applied to the same array
Shape keys: offsets, editing and blending anim/deform.js32-bit in part- ModelCraft
-
Bone data for the card
Packs the bone matrices (or dual quaternions) for the kernel.
Skinning on the graphics card anim/skin-gpu.js32-bit, display only- ModelCraft
-
Skinned points read back
Runs one skin on the card and reads the points back.
Skinning on the graphics card anim/skin-gpu.js32-bit, display only- ModelCraft
-
Key time of a baked frame
The timeline time given to each baked frame.
t = round((from + f ÷ fps) × 1000) ÷ 1000
Baked physics key times anim/bake.js64-bit- ModelCraft
-
Time of day to seconds
Turns HH:MM text into seconds.
seconds = h × 3600 + m × 60
Shift calendar working time addons/flow/lib/calendar.jsExact- ModelCraft
-
Weekly on-intervals
The merged list of on-intervals in a week, with windows that pass midnight wrapped.
length = to − from (+ one day if the end is not after the start)
Shift calendar working time addons/flow/lib/calendar.jsExact- ModelCraft
-
On time between two instants
The total seconds the calendar is on between two times.
Σ (off − on) over the on-intervals inside [a, b]
Shift calendar working time addons/flow/lib/calendar.js64-bit- ModelCraft
-
Factor from text
A factor from a plain number, a percent of the size, or a percent change.
f = n; n ÷ 100; 1 ± n ÷ 100
Typed scale factors and shrinkage allowance scale-factors.js64-bit- ModelCraft
- PartCraft
-
Shrinkage allowance
The pattern factor for a casting that shrinks by a percentage.
add: 1 + s ÷ 100; exact: 1 ÷ (1 − s ÷ 100)
Typed scale factors and shrinkage allowance scale-factors.js64-bit- ModelCraft
- PartCraft
-
Meters per file unit
The conversion factor for each unit system a 3DM file can name.
meters = file value × factor
Units and tolerance read from a 3DM file io/3dm/read.js64-bit- ModelCraft
- PartCraft
-
Units and tolerance from the file settings
Reads the unit system, custom meters-per-unit and the tolerance from a file's settings record.
Units and tolerance read from a 3DM file io/3dm/read.js64-bit- ModelCraft
- PartCraft
-
Box and cylinder
A 20 mm cube and a 20 mm cylinder, standing on z = 0 and centered on the origin.
S = 0.02; R = S ÷ 2; box: S × S square pulled up by S; cylinder: 32-sided polygon of radius R pulled up by S
Beginner shapes, align and drop to ground beginner.js64-bit- ModelCraft
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.