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
-
Point on a surface
The point of a NURBS surface at (u, v).
S(u, v) = Σᵢ Σⱼ Nᵢ(u)·Nⱼ(v)·wᵢⱼ·Pᵢⱼ ÷ Σᵢ Σⱼ Nᵢ(u)·Nⱼ(v)·wᵢⱼ
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Derivatives of a surface
The point and the partial derivatives up to total order d at (u, v).
S⁽ᵏˡ⁾ = (A⁽ᵏˡ⁾ − lower-order terms weighted by binomials and derivatives of w) ÷ w
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Surface normal
The unit normal at (u, v), including at poles and collapsed edges.
n = unit(S_u × S_v)
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Moving off a collapsed edge
Chooses where curvature is evaluated when the point asked for lies on a collapsed edge.
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Surface curvature
Gaussian and mean curvature, the two principal curvatures and their directions.
K = (LN − M²) ÷ (EG − F²); H = (EN − 2FM + GL) ÷ (2(EG − F²)); k₁,₂ = H ± √(H² − K)
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Normal curvature in a direction
The curvature of the surface along a given tangent direction.
a, b from t = a·S_u + b·S_v; κₙ = (L·a² + 2M·ab + N·b²) ÷ (E·a² + 2F·ab + G·b²)
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Iso-curve of a surface
The curve on a surface at a fixed u or v, as an exact NURBS curve.
row j = Σₐ Nₐ(t)·Pwₐⱼ in homogeneous coordinates
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Angle between two vectors
The angle between two vectors, 0 to π.
angle = atan2(|a × b|, a·b)
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/vec.js64-bit- ModelCraft
- PartCraft
-
Applying a 4 × 4 matrix
A point or a direction multiplied by a row-major affine matrix.
p′ᵢ = mᵢ₀·x + mᵢ₁·y + mᵢ₂·z + mᵢ₃·w
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/vec.js64-bit- ModelCraft
- PartCraft
-
Curvature maps
Gaussian, mean and largest principal curvature at every vertex of a surface's tessellation, with their ranges.
k_max = max(|H + d|, |H − d|), d = √(max(0, H² − K))
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/analysis.js64-bit- ModelCraft
- PartCraft
-
Curvature comb
Teeth along a curve whose length shows the curvature, and the largest curvature found.
u = a + (b − a)·i ÷ samples; q = p − scale·κN; max = largest |κN| at the samples
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs/analysis.js64-bit- ModelCraft
- PartCraft
-
Curvature range for the legend
The Gaussian curvature range that the curvature colors and their legend span.
max = largest |K| over all shown surfaces; range = [−max, max]
NURBS curves and surfaces: points, derivatives, normals and curvature nurbs-ui/display.js64-bit- ModelCraft
- PartCraft
-
Knot insertion
Adds a knot to a curve r times without changing its shape.
α = (u − U[L + i]) ÷ (U[i + k + 1] − U[L + i]); Q = α·R[i + 1] + (1 − α)·R[i]
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Tolerance in homogeneous space
Converts a distance tolerance into one for weighted control points.
TOL = tol·w_min ÷ (1 + max |P|)
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Knot removal
Removes copies of an interior knot while the curve moves no more than a tolerance.
candidates: (P[i] − (1 − α)·T[i − 1]) ÷ α and (P[j] − α·T[j + 1]) ÷ (1 − α); removed when they agree within TOL
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Bézier pieces
The curve as one Bézier piece per knot span.
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Degree elevation
Raises the degree of a curve by t.
Qᵢ = Σⱼ C(p, j)·C(t, i − j) ÷ C(p + t, i) · Pⱼ on each Bézier piece
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Degree reduction
Lowers the degree by one if the curve moves no more than a tolerance, and reports a bound on the change.
left and right reduced points blended by λ = i ÷ q; error = largest distance between the re-elevated and the original control points
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Splitting a curve
Cuts a curve in two at a parameter.
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Rescaling the parameter
Maps a curve's knots onto a new interval.
knot′ = a + (knot − c_a)·(b − a) ÷ (c_b − c_a)
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Reversing a curve
The same curve run the other way.
knot′ = a + b − knot, in reverse order
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Joining curves
Makes one curve from curves that meet end to end.
joint point = (end of one + start of the next) ÷ 2 in homogeneous coordinates; knot ranges in proportion to arc length
NURBS knot insertion and removal, degree change, split and join nurbs/curve.js64-bit- ModelCraft
- PartCraft
-
Rows back into a surface
Rebuilds a surface from its rows after a curve operation was applied to each row.
NURBS knot insertion and removal, degree change, split and join nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Degree elevation of a surface
Raises the degree of a surface in one direction.
NURBS knot insertion and removal, degree change, split and join nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Rescaling a surface's parameters
Maps the knots of one direction onto a new interval.
knot′ = a + (knot − k_a)·(b − a) ÷ (k_b − k_a)
NURBS knot insertion and removal, degree change, split and join nurbs/surface.js64-bit- ModelCraft
- PartCraft
-
Uniform knots for a curve from control points
The knot vector given to a curve drawn by its control points when none is supplied.
p + 1 zeros; i ÷ (n − p) for i = 1 … n − p − 1; p + 1 ones
NURBS knot insertion and removal, degree change, split and join nurbs/tools.js64-bit- ModelCraft
- PartCraft
-
Parameter from a fraction
The curve parameter for a command's position given as a fraction 0 to 1.
u = a + (b − a)·f
NURBS knot insertion and removal, degree change, split and join nurbs/tools.js64-bit- ModelCraft
- PartCraft
-
Merging knot lists
The list of distinct knots, each with its highest multiplicity, over several curves or surfaces.
key = round(u × 10¹²) ÷ 10¹²
Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js64-bit- ModelCraft
- PartCraft
-
Making curves compatible
Brings curves to one degree and one knot vector on 0…1.
Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js64-bit- ModelCraft
- PartCraft
-
Extrude
A surface from a curve pulled along a direction.
second row = P·w + dir·w in homogeneous coordinates
Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js64-bit- ModelCraft
- PartCraft
-
Revolve
A surface from a profile turned about an axis by an angle.
o = axis point + Z·((P − axis point)·Z); r = |P − o|; row = arc(o, X, Z × X, r, 0, angle)·w
Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js64-bit- ModelCraft
- PartCraft
-
Loft parameters
The v parameter of each section of a loft.
tₖ = mean over control-point columns of the chord-length parameter of section k; t₀ = 0, t(last) = 1
Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js64-bit- ModelCraft
- PartCraft
-
Loft
A surface that passes through each section curve at its parameter.
Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js64-bit- ModelCraft
- PartCraft
-
Sum of control nets
The control net a + b − c used by the Gordon and Coons surfaces.
Pᵢⱼ = aᵢⱼ + bᵢⱼ − cᵢⱼ
Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js64-bit- ModelCraft
- PartCraft
-
Parameters of the points
A parameter between 0 and 1 for each point to fit.
dᵢ = dᵢ₋₁ + |Qᵢ − Qᵢ₋₁| (or its square root, or 1); tᵢ = dᵢ ÷ d(last)
Curves through points nurbs/fit.js64-bit- ModelCraft
- PartCraft
-
Knots by averaging
A clamped knot vector for a given number of control points from the points' parameters.
equal counts: U(j + p) = (t(j) + … + t(j + p − 1)) ÷ p; more points than control points: U = (1 − α)·t(i − 1) + α·t(i), i = floor(j·d), α = j·d − i
Curves through points nurbs/fit.js64-bit- ModelCraft
- PartCraft
-
Interpolating curve
The curve of a given degree through every point.
Σⱼ Nⱼ(tᵢ)·Pⱼ = Qᵢ for every point; Σⱼ N′ⱼ(t)·Pⱼ = D at an end with a given derivative
Curves through points nurbs/fit.js64-bit- ModelCraft
- PartCraft
-
Interpolating many lists at once
Control points for several point lists that share parameters, used for the columns of a loft or a curve network.
Curves through points nurbs/fit.js64-bit- ModelCraft
- PartCraft
-
Linear solve
Solves A·x = B for several right-hand sides.
Gaussian elimination with partial pivoting, then back-substitution
Curves through points nurbs/vec.js64-bit- ModelCraft
- PartCraft
-
Placement matrix (classic files)
A component's placement as a 4 × 4 matrix from the file's 13 doubles.
rows of the 3 × 3 become columns; when w ≠ 1 every entry ÷ w
SKP import: placements, texture coordinates and face loops skp/legacy.js64-bit- ModelCraft
-
Texture coordinates (classic files)
The texture coordinates of each loop point of a textured face.
x_r = (−n_y, n_x, 0) ÷ |(n_x, n_y)|, y_r = n × x_r; (p_x, p_y) = (p·x_r, p·y_r); uv = (p_x, p_y, 1)·M⁻¹ ÷ q ÷ tile size
SKP import: placements, texture coordinates and face loops skp/legacy.js64-bit- ModelCraft
-
Loop normal
The Newell normal of a face loop, used to check which way round the loop runs.
n = Σ [(y_a − y_b)(z_a + z_b), (z_a − z_b)(x_a + x_b), (x_a − x_b)(y_a + y_b)]
SKP import: placements, texture coordinates and face loops skp/legacy.js64-bit- ModelCraft
-
Placement matrix (2021 and later files)
A component's placement as a 4 × 4 matrix from the file's 13 doubles.
k = 1 ÷ w; every rotation and translation entry × k
SKP import: placements, texture coordinates and face loops skp/vff.js64-bit- ModelCraft
-
Texture coordinates (2021 and later files)
The texture coordinates of a point on a textured face.
(p_x, p_y) = (p·x_r, p·y_r); without a placement: uv = (p_x ÷ tile width, p_y ÷ tile height); with one: (p_x, p_y, 1)·M⁻¹ ÷ q ÷ tile size
SKP import: placements, texture coordinates and face loops skp/vff.js64-bit- ModelCraft
-
Outer loop and loop direction
Chooses a face's outer loop and turns loops so that the outer runs counter-clockwise about the normal and holes clockwise.
area(loop) = Newell(loop)·unit normal ÷ 2; outer = loop with the largest |area|
SKP import: placements, texture coordinates and face loops skp/vff.js64-bit- ModelCraft
-
Inverse of a rigid transform
Inverts a rotation-plus-translation matrix.
R⁻¹ = Rᵀ; t⁻¹ = −Rᵀ t
Assembly joints and part placement assembly.js64-bit- PartCraft
-
Mate frame on a face
The frame a joint end uses: the face's axes, with the origin moved to where the chosen axis crosses the face.
o = a + d × ((f − a) · n) ÷ (d · n)
Assembly joints and part placement assembly.js64-bit- PartCraft
-
Joint value inside its limits
A joint's angle or distance, held between its minimum and maximum.
value = min(max, max(min, v))
Assembly joints and part placement assembly.js64-bit- PartCraft
-
Motion of a joint
The transform of part B relative to part A's mate frame, from the joint's angles and distances.
revolute, slider, cylindrical, rigid: T(0, 0, offset) × Rz(angle); planar: T(dx, dy, 0) × Rz; ball: Rx(tiltX) × Ry(tiltY) × Rz; pin-slot: T(s cos δ, s sin δ, 0) × Rz
Assembly joints and part placement assembly.js64-bit- PartCraft
-
Placement walk and loop mismatch
Places each part from one already placed through their joint, and measures how far a loop-closing joint is from closing.
W_B = W_A × F_A × motion × FLIP × F_B⁻¹; off = max |want − have| (rotation entries × 100)
Assembly joints and part placement assembly.js64-bit- 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.