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
-
One dab of the weight brush
Raises, lowers, sets or smooths a bone's weight on the vertices under the brush, and scales the other bones' weights to share what is left.
falloff f = (1 − d² ÷ r²)² × strength; add: w + f (1 − w); subtract: w − f w; others scaled by max(0, 1 − w) ÷ their sum
Skin weights and skinning anim/weights.js32-bit in part- ModelCraft
-
Weights from packed joint layers
Turns the four joint numbers and weights per vertex read from a file into one weight layer per bone.
weight of bone b on vertex v = Σ of the packed weights that name b
Skin weights and skinning anim/weights.js32-bit in part- ModelCraft
-
Skin weights read from an FBX file
Keeps each control point's four strongest clusters and scales their weights to add up to 1.
w = w ÷ Σ of the four kept weights
Skin weights and skinning io/fbx-import.js32-bit in part- ModelCraft
-
One sample of a property
Reads one stored sample of a scalar or array property into a typed array.
Alembic import io/abc.js64-bit- ModelCraft
-
16-bit float to a number
Decodes a half-precision float.
subnormal: ± m × 2⁻²⁴; normal: ± (1 + m ÷ 1024) × 2^(e − 15)
Alembic import io/abc.js64-bit- ModelCraft
-
Which time sample is read
The index of the stored sample nearest a given time.
time of sample i = times[i mod n] + floor(i ÷ n) × time per cycle; nearest by |time − t|
Alembic import io/abc.js64-bit- ModelCraft
-
An object's transform
Builds an object's matrix from its list of scale, translate, rotate and matrix operations.
M = op₁ × op₂ × … (the first operation outermost)
Alembic import io/abc.js64-bit- ModelCraft
-
Rotation about an axis
The matrix of a turn by an angle in degrees about an axis.
a = deg × π ÷ 180; Rodrigues' formula with the axis made unit
Alembic import io/abc.js64-bit- ModelCraft
-
Mesh points into Z up
Copies the file's points into the model's coordinates.
(x, y, z) → (x, −z, y)
Alembic import io/abc.js64-bit- ModelCraft
-
Node matrix into Z up
Changes a node's matrix from Y up to Z up.
M′ = C × M × C⁻¹
Alembic import io/abc.js64-bit- ModelCraft
-
Which way the faces turn
Decides whether the file's faces must be turned round, by comparing each face's own normal with the file's normals.
Newell normal n = Σ (yₐ − y_b)(zₐ + z_b), …; agree when n · Σ file normals > 0
Alembic import io/abc.js64-bit- ModelCraft
-
Axes and unit
The matrix that takes the file's coordinates to Z up and meters.
k = UnitScaleFactor × 0.01; columns = ± k along the model axis each file axis maps to
FBX import: axes, units and transforms io/fbx-import.js64-bit- ModelCraft
-
Node matrices into the model's axes
Carries a node's matrix from the file's axes and unit into the model's.
M′ = A × M × A⁻¹
FBX import: axes, units and transforms io/fbx-import.js64-bit- ModelCraft
-
Euler angles to a matrix
The rotation matrix of three angles in degrees in the file's rotation order.
XYZ order: R = Rz × Ry × Rx, angles × π ÷ 180
FBX import: axes, units and transforms io/fbx-import.js64-bit- ModelCraft
-
An object's own matrix
Builds a model's local matrix from its translation, offsets, pivots, pre-, own and post-rotation, and scaling.
M = T × Roff × Rp × Rpre × R × Rpost⁻¹ × Rp⁻¹ × Soff × Sp × S × Sp⁻¹
FBX import: axes, units and transforms io/fbx-import.js64-bit- ModelCraft
-
Mesh points into the model
Carries each control point through the axis and unit matrix.
p′ = A × p
FBX import: axes, units and transforms io/fbx-import.js64-bit- ModelCraft
-
Lamps
A lamp's position, direction and brightness from an FBX light.
lumens = Intensity × 8; direction = the node's −Y, made unit
FBX import: axes, units and transforms io/fbx-import.js64-bit- ModelCraft
-
Cameras
A saved view's eye, target and field of view from an FBX camera.
target = eye + 10 × forward; parallel view height = OrthoZoom × 10
FBX import: axes, units and transforms io/fbx-import.js64-bit- ModelCraft
-
Reading an accessor
Reads one accessor's numbers, with its sparse part, into a typed array.
normalized: v ÷ 127, 255, 32767 or 65535 (signed values not below −1)
glTF import: reading numbers io/gltf-read.js64-bit- ModelCraft
-
Positions
Takes a primitive's positions as 32-bit floats and checks each is a sane number.
glTF import: reading numbers io/gltf-read.js64-bit- ModelCraft
-
Matrix from translation, rotation and scale
A node's 4×4 matrix from its translation, quaternion and scale.
quaternion made unit; rotation entries 1 − 2(y² + z²), 2(xy + zw), …, each column times its scale
glTF import: reading numbers io/gltf-read.js64-bit- ModelCraft
-
A node's local matrix
Uses the node's 16-number matrix as given, or builds it from translation, rotation and scale.
glTF import: reading numbers io/gltf-read.js64-bit- ModelCraft
-
Morph weights and the skin
A primitive's positions and normals as the scene shows them: morph targets added by their weights, then moved by the skin's joints.
morph: p += w × target; skin: p′ = Σ wᵢ (Jᵢ × IBMᵢ × p) ÷ Σ wᵢ
glTF import: meshes, skins and placements io/gltf-import.js32-bit in part- ModelCraft
-
Welding vertices
Makes one mesh vertex for every distinct point of a primitive and swaps the axes to Z up.
same vertex when x, y and z (and joints and weights) are equal as text; stored as (x, −z, y)
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Triangles with no area
Drops triangles that repeat a vertex or whose corners lie on one line.
kept when |(b − a) × (c − a)| > 1e-18
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Sharp edges
Marks an edge sharp where the file's normals break across it, or where the two faces bend.
with normals: sharp unless n₁ · n₂ > 0.9995 at both ends; without: sharp when the face normals' dot product < 0.99996
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Node matrix into Z up
Changes a node's matrix from Y up to Z up.
M′ = C × M × C⁻¹
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Instanced placements
One placement per instance from the file's per-instance translation, rotation and scale.
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Texture coordinate transform
Applies a texture's offset, rotation and scale to a UV pair.
u′ = cos r × u s_u + sin r × v s_v + o_u; v′ = −sin r × u s_u + cos r × v s_v + o_v
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Lamps
A lamp's position, direction, brightness and cone from a glTF light.
lumens = candela × 4π; spot angle (°) = 2 × outer cone × 180 ÷ π
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Cameras
A saved view's eye, target and field of view from a glTF camera.
target = eye + 10 × forward; field of view (°) = yfov × 180 ÷ π; parallel view height = 2 × |ymag|
glTF import: meshes, skins and placements io/gltf-import.js64-bit- ModelCraft
-
Vertex data of a primitive
Writes a primitive's positions, normals, texture coordinates, colors and indices.
glTF export io/gltf-write.js64-bit- ModelCraft
-
Bounds of the positions
The smallest and largest x, y and z written with the positions.
glTF export io/gltf-write.js64-bit- ModelCraft
-
Shared vertices
Gives corners with the same position, normal, UV and color one vertex.
key = x, y, z as numbers + normal to 5 decimals + UV + color
glTF export io/gltf-write.js64-bit- ModelCraft
-
Placement matrices
Writes a placement's matrix on its node.
entry = 0 when |entry| < 1e-15, else the entry
glTF export io/gltf-write.js64-bit- ModelCraft
-
Lamps
A lamp's intensity and cone as glTF writes them.
candela = lumens ÷ (4π); outer cone = min(π ÷ 2, angle × π ÷ 360)
glTF export io/gltf-write.js64-bit- ModelCraft
-
Saved views as cameras
A saved view's field of view or height as a glTF camera.
yfov = fov × π ÷ 180; xmag = ymag = height ÷ 2
glTF export io/gltf-write.js64-bit- ModelCraft
-
Node matrix for a lamp or camera
A matrix at a point whose −Z looks along a direction with +Y as near world up as it can be.
f = dir made unit; r = (f × up) made unit; u = r × f
glTF export io/gltf-write.js64-bit- ModelCraft
-
Reading a vertex
Parses the three coordinates of a 'v' line.
OBJ import and export io/obj.js64-bit- ModelCraft
-
Points into Z up
Copies an object's points into the model's coordinates.
(x, y, z) → (x, −z, y)
OBJ import and export io/obj.js64-bit- ModelCraft
-
Sharp edges
Marks an edge sharp where the file's normals break across it, where smoothing groups differ, or where the faces bend.
with normals: sharp unless n₁ · n₂ > 0.9995 at both ends; without normals or groups: sharp when the face normals' dot product < 0.99996
OBJ import and export io/obj.js64-bit- ModelCraft
-
Number format on export
Prints a number for the exported file.
text = the number rounded to 6 decimals, trailing zeros removed
OBJ import and export io/obj.js64-bit- ModelCraft
-
Exported points
Carries a mesh point to world coordinates and Y up for the file.
p′ = placement matrix × p; (x, y, z) → (x, z, −y)
OBJ import and export io/obj.js64-bit- ModelCraft
-
Texture coordinates with a map's scale and offset
Applies a material's map scale and offset to a texture coordinate on import.
u′ = u × scale_u + offset_u; v′ = v × scale_v + offset_v
OBJ import and export io/obj.js64-bit- ModelCraft
-
Reading one number
Reads a value of the type the header names, from text or from binary.
PLY import and export io/ply.js64-bit- ModelCraft
-
Imported positions
Stores each vertex's x, y and z.
PLY import and export io/ply.js64-bit- ModelCraft
-
Points and normals in world coordinates
Carries a point and a normal through a placement's matrix for export.
p′ = M × p; n′ = (M × n without translation), made unit
PLY import and export io/ply.js64-bit- ModelCraft
-
Exported positions
Writes each vertex's world position and normal into the file.
PLY import and export io/ply.js32-bit in part- ModelCraft
-
Shared vertices on export
Gives corners with the same position, normal, color and UV one vertex.
key = x, y, z as numbers + normal to 5 decimals + color + UV
PLY import and export io/ply.js64-bit- ModelCraft
-
Reading a binary file
Reads each triangle's nine coordinates and its color word.
STL import and export io/stl.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.