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
-
Level set of the samples
The distance at any point by blending the eight samples round it, handed to the library that builds the new mesh.
f(x, y, z) = −trilinear blend of the 8 samples; new mesh = level set of f at 0 with edge length = voxel
Voxel remesh and snapping onto a surface mesh/remesh.js32-bit in part- ModelCraft
-
Put vertices on a surface
Moves each listed vertex to the nearest point of a target surface.
Voxel remesh and snapping onto a surface mesh/remesh.js64-bit- ModelCraft
-
Brush falloff
How strongly a vertex follows the brush, from 1 at its middle to 0 at its edge.
w(x) = 1 − 3x² + 2x³ for 0 < x < 1; 1 for x ≤ 0; 0 for x ≥ 1
Sculpt brushes mesh/sculpt.js64-bit- ModelCraft
-
Vertex normals for sculpting
A unit normal per vertex from the triangles round it, weighted by triangle area.
N(v) = unit(Σ (b − a) × (c − a))
Sculpt brushes mesh/sculpt.js64-bit- ModelCraft
-
Vertices under the brush
The vertices within the brush radius of its center, each with its falloff weight.
d² = |P(v) − p|² ≤ r²; w = falloff(√d² ÷ r)
Sculpt brushes mesh/sculpt.js64-bit- ModelCraft
-
Brush plane
The normal and center of the surface under the brush, and the size of one step.
n = unit(Σ wᵢ·Nᵢ); c = Σ wᵢ·Pᵢ ÷ Σ wᵢ; step = 0.1·r·k, k = strength × pressure
Sculpt brushes mesh/sculpt.js64-bit- ModelCraft
-
Brush moves
The new position of each vertex under the brush for draw, inflate, flatten, clay, smooth, pinch and crease.
f = w·(1 − mask); draw: p + n·(±step·f); inflate: p + N(v)·(±step·f); flatten: p − n·dd·min(1, f·max(0.1, k)), dd = (p − plane)·n; smooth: p + (mean of neighbors − p)·min(1, f·max(0.1, k))
Sculpt brushes mesh/sculpt.js32-bit in part- ModelCraft
-
Grab
Moves the vertices that were under the brush at the start of the stroke by the pointer's move.
p = p₀ + δ·w·(1 − mask)
Sculpt brushes mesh/sculpt.js32-bit in part- ModelCraft
-
Painting the mask
Raises or lowers the mask of the vertices under the brush, between 0 and 1.
mask = clamp(mask ± w·k, 0, 1)
Sculpt brushes mesh/sculpt.js32-bit in part- ModelCraft
-
Split an edge at its middle
The new vertex when dynamic detail splits a long triangle edge.
mid = (P_a + P_b) ÷ 2
Sculpt brushes mesh/sculpt.js64-bit- ModelCraft
-
Brush radius in mesh units
Turns the brush's radius in pixels into a length in the mesh's own space at the point under the pointer.
r = px × pixel size at w ÷ scale, scale = |first column of the placement matrix|
Sculpt brushes mesh/sculpt-tool.js64-bit- ModelCraft
-
Dabs along a stroke
Places dabs a quarter of the brush radius apart between the last dab and the pointer.
step = 0.25·r; k = min(32, floor(d ÷ step)); pᵢ = last + (hit − last)·i ÷ k
Sculpt brushes mesh/sculpt-tool.js64-bit- ModelCraft
-
Sparse least squares (CGLS)
Finds the unknowns that minimize |Ax − b| for a sparse set of rows.
columns scaled by 1 ÷ |column|; stop when |Aᵀr|² ≤ tol²·max(1, |Aᵀr₀|²), tol = 1e-12
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
Conformal map (LSCM)
UV positions for the corners of an island from the 2D shape of each of its triangles, with two points pinned.
per triangle, with d = twice its signed area and s = 1 ÷ √|d|: Σⱼ Wⱼ·(uⱼ + i·vⱼ) = 0, W = s × the opposite edge vectors
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
Angle based flattening
Corner angles close to the surface's own that a flat triangulation can have.
minimize Σ (αᵢ − βᵢ)² ÷ βᵢ² subject to: each triangle sums to π, each inner wedge to 2π, Σ [ln sin α(next) − ln sin α(prev)] = 0 round each inner wedge
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
Preconditioned conjugate gradients
Solves the constraint system of each Newton step of the angle based method.
stop when r·r < 1e-14 × r₀·r₀
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
Corner angles of a triangle
The three corner angles of a triangle in 3D.
angle = acos(clamp(u·v ÷ (|u|·|v|), −1, 1))
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
A triangle's own 2D shape
A triangle laid flat: A at the origin, B on the x axis, C where its side lengths put it.
B = (|AB|, 0); C = (AC·x, AC·y), x = AB ÷ |AB|, y = unit((AB × AC) × AB)
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
A triangle's shape from its angles
A flat triangle with the given corner angles, sized by the law of sines.
A = (0, 0); B = (sin a₂, 0); C = (sin a₁·cos a₀, sin a₁·sin a₀)
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
Pinned points and first guess
Chooses the two corners to pin and a starting layout for the solver.
pins: the two ends along the longest box axis at (0, 0) and (d, 0), d = their distance in 3D
UV unwrap solvers mesh/uv.js64-bit- ModelCraft
-
Storing an unwrap
Checks which way up the flattened island came out and writes its UVs to the mesh.
signed = Σ over triangles of (u_b − u_a)(v_c − v_a) − (u_c − u_a)(v_b − v_a); u is negated when signed < 0
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Are two UVs the same
Decides whether two face corners share a UV point, which decides where UV islands end.
|u_a − u_b| ≤ 1e-7 and |v_a − v_b| ≤ 1e-7
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Box projection
Maps each face onto the side of a box its normal faces most.
u = (pᵢ − loᵢ) ÷ s, v = (pⱼ − loⱼ) ÷ s; u → 1 − u on the sides seen from behind
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Cylinder projection
u is the angle round an axis through the faces' center, v the height along it.
u = (atan2(p_j − c_j, p_i − c_i) ÷ 2π + 1) mod 1; v = (p_k − lo_k) ÷ height
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Sphere projection
u is the angle round the axis, v the latitude, seen from the faces' center.
d = p − c; u = (atan2(d_j, d_i) ÷ 2π + 1) mod 1; v = 1 − acos(clamp(d_k ÷ |d|, −1, 1)) ÷ π
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
View projection
UVs from where each corner appears on screen, fitted to the unit square.
s = max(1e-12, width, height); u = (x − x₀) ÷ s; v = 1 − (y − y₀) ÷ s
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Smallest bounding rectangle
The rotation that makes an island's bounding rectangle smallest.
for each hull edge: θ = −atan2(Δy, Δx); area = (x₁ − x₀)·(y₁ − y₀) of the rotated hull; keep the smallest
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js64-bit- ModelCraft
-
Packing: island scale
Scales each island so that its UV area matches its area on the mesh.
A₃ = Σ |(b − a) × (c − a)| ÷ 2; A₂ = Σ |UV triangle area|; k = √(A₃ ÷ A₂)
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Packing: placing the islands
Places the islands' rectangles on shelves and scales the whole layout into the unit square.
pad = margin·√(total area)·1.1; widths tried: max(widest, √(sum of areas)·(0.7 + 0.05·k)), k = 0…23; uv = (offset + pad + point) ÷ side
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Stretch per face
How much each face's UVs distort it, from 0 for none to 1 for a lot.
σ₁,₂ = √(tr ÷ 2 ± √(tr² ÷ 4 − det)); angle: 1 − σ₂ ÷ σ₁; area: min(1, |ln(σ₁·σ₂)| ÷ ln 4); per face: area-weighted mean over its triangles
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv.js32-bit in part- ModelCraft
-
Move, rotate and scale UVs
Moves, turns or scales the selected faces' UVs about their mean as the pointer moves in the UV editor.
move: (u + Δu, v + Δv); rotate by a = atan2(v₁ − c_v, u₁ − c_u) − atan2(v₀ − c_v, u₀ − c_u); scale by k = |p₁ − c| ÷ max(1e-9, |p₀ − c|)
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/uv-editor.js32-bit in part- ModelCraft
-
UVs and sharp edges of a primitive
Stores a new primitive's positions, its UVs per face corner and the flags of its sharp edges.
sharp when n₁·n₂ < cos(sharpDeg·π ÷ 180)
UV coordinates: unwrap result, projections, packing, stretch and editing mesh/primitives.js32-bit in part- ModelCraft
-
Rotation matrix
The matrix that turns geometry by an angle about an axis through a point.
R = c·I + s·[axis]ₓ + (1 − c)·axis·axisᵀ, c = cos(angle·π ÷ 180), s = sin(angle·π ÷ 180); t = p − R·p
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Scale matrix
The matrix that scales geometry by a factor about a center.
p′ = f·p + c·(1 − f)
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Applying a matrix to geometry
Moves a point, a curve, a surface, a mesh or a list of them by a 4 × 4 matrix.
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Divide, power and remainder
The Divide, Power, Smaller, Larger and Remainder nodes.
a ÷ b; aᵇ; remainder = a − b·floor(a ÷ b)
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Sine, cosine, tangent and angle
Trigonometry with angles in degrees.
sin(x·π ÷ 180), cos(x·π ÷ 180), tan(x·π ÷ 180); angle = atan2(y, x) ÷ (π ÷ 180)
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Series and range
A list of evenly stepped numbers, by step or between two ends.
series: start + k·step; range: start + (end − start)·k ÷ (n − 1)
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Sum of a list
Adds the numbers of a list.
Σ xᵢ
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Vector length and distance
The length of a vector and the distance between two points.
√(Δx² + Δy² + Δz²)
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Point on a circle
A point at a radius and an angle from a center, in the plane z = center z.
[c_x + r·cos(a·π ÷ 180), c_y + r·sin(a·π ÷ 180), c_z]
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Point on curve and divide curve
A point at a fraction of a curve, and the points that divide a curve into a number of parts.
u = u₀ + (u₁ − u₀)·t; divide: u = u₀ + (u₁ − u₀)·k ÷ n
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Array around an axis
Copies of geometry turned round an axis in equal steps of a full circle.
copy k: rotate by 360·k ÷ n degrees
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Surface to mesh
A triangle mesh of a surface within a tolerance.
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Point on a curve
The point of a NURBS curve at parameter u.
C(u) = Σ Nᵢ(u)·wᵢ·Pᵢ ÷ Σ Nᵢ(u)·wᵢ
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Derivatives of a curve
The point and the first d derivatives of a curve at u.
C⁽ʳ⁾ = (A⁽ʳ⁾ − Σᵢ₌₁..ᵣ C(r, i)·w⁽ⁱ⁾·C⁽ʳ⁻ⁱ⁾) ÷ w
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Curvature of a curve
The curvature at u.
κ = |C′ × C″| ÷ |C′|³
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Curvature vector
The vector that points to the center of curvature with length equal to the curvature.
κN = (C″ − t·(C″·t)) ÷ |C′|², t = C′ ÷ |C′|
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Torsion
The torsion of a curve at u.
τ = (C′ × C″)·C‴ ÷ |C′ × C″|²
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
From homogeneous points
Turns weighted (homogeneous) control points back into control points and weights.
P = (wx, wy, wz) ÷ w
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/curve.js64-bit- ModelCraft
- PartCraft
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.