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

  • Closest point on a surface

    The (u, v), point and distance of the point of a surface nearest a given point.

    f = (S − P)·S_u, g = (S − P)·S_v; Newton on the 2 × 2 system with J = [S_u·S_u + r·S_uu, S_u·S_v + r·S_uv; ·, S_v·S_v + r·S_vv]

    NURBS lengths, areas, closest points and tessellation nurbs/surface.js
    • ModelCraft
    • PartCraft
    64-bit
  • Tessellation steps per knot span

    How many parameter steps each knot span gets so that the grid stays within the tolerance.

    n = ceil(h·√(M ÷ (4·tol))), 2 ≤ n ≤ maxPerSpan, M = largest |second derivative| at 5 × 7 sample points

    NURBS lengths, areas, closest points and tessellation nurbs/surface.js
    • ModelCraft
    • PartCraft
    64-bit
  • Surface to triangle grid

    A grid of points, normals and parameters on the surface with two triangles per cell.

    NURBS lengths, areas, closest points and tessellation nurbs/surface.js
    • ModelCraft
    • PartCraft
    64-bit
  • Deviation of points from a surface

    The largest, mean and root-mean-square distance of a set of points from a surface.

    dᵢ = closest-point distance; max; mean = Σ dᵢ ÷ n; rms = √(Σ dᵢ² ÷ n)

    NURBS lengths, areas, closest points and tessellation nurbs/analysis.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • Loft

    A surface that passes through each section curve at its parameter.

    Surfaces from curves: extrude, ruled, revolve and loft nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • Linear solve

    Solves A·x = B for several right-hand sides.

    Gaussian elimination with partial pivoting, then back-substitution

    Curves through points nurbs/vec.js
    • ModelCraft
    • PartCraft
    64-bit
  • Least-squares curve with given knots

    The curve with given knots that is closest to a set of points, with its ends on the first and last point.

    (NᵀN)·P = NᵀR, R = Q − N₀·Q₀ − Nₙ·Q(last)

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/fit.js
    • ModelCraft
    • PartCraft
    64-bit
  • Least squares for many lists

    The same fit for several point lists that share parameters and knots.

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/fit.js
    • ModelCraft
    • PartCraft
    64-bit
  • Fitting a curve to a function

    A curve within a tolerance of a parametric function, with as few control points as the refinement finds.

    deviation = max |C(s) − f(s)| at the midpoints between fitting samples; count ← ceil(1.5·count) + 1 until deviation ≤ tol

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/fit.js
    • ModelCraft
    • PartCraft
    64-bit
  • Fitting a surface to a function

    A surface within a tolerance of a function of (u, v).

    deviation = max of three sampled sets (between samples along u, along v, and at cell middles); the direction with the larger error gets ceil(1.5·n) + 1 control points

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/fit.js
    • ModelCraft
    • PartCraft
    64-bit
  • Rebuilding a curve

    A curve with a chosen number of control points and uniform knots that follows the original, with the deviation measured.

    samples = max(4·count, 32); deviation = closest-point distance of the points midway between samples

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/fit.js
    • ModelCraft
    • PartCraft
    64-bit
  • Deviation of points from a curve

    The largest and mean distance of a set of points from a curve.

    dᵢ = closest-point distance; max; mean = Σ dᵢ ÷ n

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/fit.js
    • ModelCraft
    • PartCraft
    64-bit
  • Frames along a rail

    A frame (origin, tangent and two cross directions) at each requested parameter of a rail, turning as little as possible.

    double reflection: r reflected in the chord, then in the difference of tangents; then made square to the tangent

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Placing a profile in a frame

    The profile's control points carried from the start frame to another frame, turned and scaled.

    (a, b, z) = (d·r₀, d·s₀, d·t₀); (a, b) rotated by the twist; P′ = o + r·a·scale + s·b·scale + t·z·scale

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Sweep refinement

    Lofts through placed sections and adds sections until the surface matches the true placement between them.

    deviation = max |S(u, v_mid) − section(u)| at 13 points on each middle section; sections doubled until deviation ≤ tol

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Frame between two rails

    The frame and the gap between two rails at a parameter, which place and scale the profile of a two-rail sweep.

    X = (B − A) ÷ d, d = |B − A|; Z = unit(T₁ + T₂ − X·((T₁ + T₂)·X)); scale = d ÷ d₀

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Where two curves come closest

    The parameters on two curves where they are nearest each other, and the distance there.

    f = (A − B)·A′, g = −(A − B)·B′; Newton on the 2 × 2 system

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Monotone cubic interpolation

    A smooth increasing map between a curve's own crossing parameters and the shared ones of a network.

    interior slope = (w₁ + w₂) ÷ (w₁ ÷ δ₁ + w₂ ÷ δ₂), 0 where δ changes sign; cubic Hermite between nodes

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Surface through a network of curves

    A Gordon surface through a grid of profile and guide curves.

    S = L_u + L_v − T

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Coons patch

    A surface filling four boundary curves that meet at their corners.

    S = ruled(a, b) + ruled(l, r) − bilinear(corners)

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Offset surface

    A surface at a distance from another along its normals.

    target(u, v) = S(u, v) + n(u, v)·d, fitted within tol

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Rebuilding a surface

    A surface with a chosen number of control points and uniform knots that follows the original, with the deviation measured.

    samples = max(4·n, 16) each way; deviation = max |S′ − S| at the cell middles

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Extending a surface

    Carries a surface on past an edge by a length measured across the edge at its middle.

    the last span's polynomial evaluated by de Casteljau at t = (1 + du − last) ÷ (1 − last) > 1; du by secant steps until |length found − length| ≤ 1e-10·length

    Fitted curves and surfaces: sweeps, networks, Coons patches, offsets, rebuilds and extensions nurbs/construct.js
    • ModelCraft
    • PartCraft
    64-bit
  • Continuity class

    Turns the measured gap, angle and curvature difference into G2, G1, G0 or none.

    gap ≤ g0 → G0; and angle ≤ g1 → G1; and (dk ≤ g2 or rel ≤ g2rel) → G2

    Continuity between curves and between surfaces nurbs/continuity.js
    • ModelCraft
    • PartCraft
    64-bit
  • Join of two curves

    The gap, the angle between tangents and the curvature difference where two curve ends meet.

    gap = |P_a − P_b|; angle = atan2(|t_a × t_b|, t_a·t_b)·180 ÷ π; dk = |κN_a − κN_b|; rel = dk ÷ max(κ_a, κ_b)

    Continuity between curves and between surfaces nurbs/continuity.js
    • ModelCraft
    • PartCraft
    64-bit
  • Shared edge of two surfaces

    Gap, normal angle and curvature difference at sample points along a shared edge, with the largest of each.

    per sample: gap = |p_A − p_B|; angle between n_A and n_B; dk = |κ_A − κ_B| in the direction n_A × edge tangent

    Continuity between curves and between surfaces nurbs/continuity.js
    • ModelCraft
    • PartCraft
    64-bit
  • Finding shared edges

    Finds pairs of surface edges that lie on each other.

    |L_A − L_B| ≤ max(10·tol, 0.05·max(L_A, L_B)); 7 points of A within tol of B

    Continuity between curves and between surfaces nurbs/continuity.js
    • ModelCraft
    • PartCraft
    64-bit
  • Values written into a problem

    Rounds the measured gap, angle or curvature difference for a problem's found value and its text.

    r4(x) = x rounded to 4 significant digits

    Continuity between curves and between surfaces nurbs/continuity.js
    • ModelCraft
    • PartCraft
    64-bit
  • Signed area of a loop

    The signed area of a loop in the (u, v) plane; its sign tells which way the loop runs.

    a = Σ (uᵢ·vᵢ₊₁ − uᵢ₊₁·vᵢ) ÷ 2

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Point inside a loop

    Decides whether a (u, v) point is inside a loop.

    count edges with (v_a > v) ≠ (v_b > v) and u < (u_b − u_a)·(v − v_a) ÷ (v_b − v_a) + u_a

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Do two segments cross

    Decides whether two loop segments properly cross.

    t, u = cross products ÷ d; crossing when 1e-12 < t < 1 − 1e-12 and 1e-12 < u < 1 − 1e-12

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Cleaning a loop

    Checks a loop's points, clamps them to the patch and drops repeats.

    refused when |area| < 1e-14·(u range)·(v range)

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Circle loop

    A circular trim loop given by a center and radius as shares of the parameter range.

    pointᵢ = [u_a + (u_b − u_a)·(u + r·cos aᵢ), v_a + (v_b − v_a)·(v + r·sin aᵢ)], aᵢ = 2π·i ÷ n

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Loop from a curve on the surface

    Projects a closed 3D curve into the surface's (u, v) plane as a trim loop.

    256 points of the curve, each → closest point (u, v) on the surface

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Moving loop points off grid lines

    Shifts loop points that fall on a tessellation grid line, and keeps all of them inside the patch.

    d = 1e-6 × parameter range; a point within d ÷ 2 of a grid line moves to line + d; every point is clamped to [start + d, end − d]

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Where a loop crosses the grid

    The points where a loop segment crosses the tessellation's parameter lines.

    t = (line − p) ÷ (q − p); point = p + t·(q − p)

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Triangulating a cut cell

    Triangles for a polygon left in a grid cell after cutting.

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Area of the shown part

    The area of a trimmed surface.

    A = Σ |(b − a) × (c − a)| ÷ 2 over the triangles of the cut tessellation

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Area in the parameter plane

    The area of the shown part in (u, v).

    outer loop's area (or the whole domain) + Σ holes' signed areas

    Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js
    • ModelCraft
    • PartCraft
    64-bit
  • Line buffer

    The positions of a polyline in the host's units, for drawing.

    Drawing NURBS curves and surfaces nurbs-ui/display.js
    • ModelCraft
    • PartCraft
    32-bit, display only

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.