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

  • Angle on the nearest turn

    Returns each solved angle on the turn closest to where it started, inside its limits.

    w = s₀ + ((val − s₀ + 180) mod 360) − 180

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Rank, mobility and conflicts

    Counts the independent conditions at the answer, how many values could still be set, and which loops did not close.

    mobility = unknowns − rank; conflict when max |r| of a loop > max(1000 × tol, 1e-6)

    Closed-loop joint solver assembly.js
    • PartCraft
    64-bit
  • Overlap volume of a pair

    The common volume of two placed parts and whether it counts as a clash.

    v = volume(A ∩ B); clash when v > 1e-6

    Interference between assembly parts assembly.js
    • PartCraft
    32-bit in part
  • Thread zones

    Tubes around each cosmetic thread, used to tell a bolt in a tapped hole from a real clash.

    r₀ = 0.97 × minor (default 0.8 × major); r₁ = 1.03 × major + 0.001; length = depth + 2 × max(0.05 × major, 0.001)

    Interference between assembly parts assembly.js
    • PartCraft
    64-bit
  • Motion check steps

    Steps one joint value from a start to an end and reports interference at each step.

    value_s = from + (to − from) × s ÷ steps, s = 0 … steps

    Interference between assembly parts assembly.js
    • PartCraft
    64-bit
  • Scale about a point

    The matrix that scales a body by three factors about a fixed point.

    p′ = c + diag(sx, sy, sz) × (p − c); translation = c × (1 − s)

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Smallest rotation between two directions

    The rotation that turns one unit direction onto another by the smallest angle.

    k = (a × b) ÷ |a × b|; θ = atan2(|a × b|, a · b)

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Rotation about an axis

    The 3 × 3 rotation about a unit axis by an angle in radians.

    R = cos θ I + sin θ [k]× + (1 − cos θ) k kᵀ

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Rigid motion about a point

    The 4 × 4 matrix of a rotation about a point followed by a translation.

    p′ = R (p − c) + c + t; offset = c − R c + t

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Pattern stations along a path

    The arc length at which each copy of a path pattern sits.

    equal: step = L ÷ count (closed) or room ÷ (count − 1) (open); s_i = s₀ ± step × i, wrapped into [0, L) on a closed path

    Body move, scale and path pattern arithmetic bodies.js
    • PartCraft
    64-bit
  • Nearest point on an edge

    The point of an edge closest to a given point, with the tangent there.

    circle: p = c + r × unit(radial part of (q − c)); other curves: minimize |C(t) − q|²

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Midpoint of an edge by length

    The point half way along an edge measured along the curve.

    length = Σ over 32 pieces of Σ₈ wᵢ |C′(tᵢ)| × h; bisect for length(t) = total ÷ 2

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Where an edge crosses a plane

    The points at which an edge passes through a plane.

    g(t) = (C(t) − o) · n; bisect each sign change of g between 400 samples

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Arc of a sweep path

    Turns a sketch arc into the three points OpenCascade builds the path arc from.

    r = |s − c|; mid = c + r × (cos, sin)((a₀ + a₁) ÷ 2), a₁ raised by 2π when a₁ ≤ a₀

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Chaining path pieces

    Decides which curve ends meet when pieces are joined into one path.

    same when |p − q| ≤ 1e-6 × max(1, largest |end point|)

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Sweep profile at the path's end

    Checks that the profile's plane passes through one end of the path, and which end.

    |(p − o) · n| ≤ 1e-6 × max(1, |path chord|)

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Extrude up to a face

    How far along the extrude direction each profile point is from the target plane.

    t = ((o − x) · n) ÷ (u · n); parallel target: depth = min t; otherwise depth = 1.02 × max t + 1, then cut back by the plane

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Through, offset and vertex extents

    The extrude depth for through-all cuts, an offset from a face, and up to a vertex.

    through: far + 1 + 0.01 × body range; offset: o = face − n × side × offset; vertex: b = (p − o) · u

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Picking the next face

    Chooses the first face of the body that the extrude meets.

    nearest face by its lowest vertex distance along u, ties (within 1e-7 × scale) by centroid distance

    Reference geometry, sweep paths and extrude extents brep-design.js
    • PartCraft
    64-bit
  • Points along a projected edge

    Turns one edge of a view into the points its line segments join.

    circle: n = max(8, ceil(|t₁ − t₀| ÷ (π ÷ 60))); other curves: n = 96; drop a sample within 1e-7 × size of the chord

    Drawing views of the exact solid brep-draw.js
    • PartCraft
    64-bit
  • Extent of a view

    The smallest box around a view's segments, used to place and scale it.

    u₀ = min, u₁ = max over segment ends (same for v)

    Drawing views of the exact solid brep-draw.js
    • PartCraft
    64-bit
  • Section plane position

    Places the cutting plane square to a view's direction and builds the box that removes the near half.

    o = center − d (center · d) + d × at; box side = 2 × (2 × diagonal + 10)

    Drawing views of the exact solid brep-draw.js
    • PartCraft
    64-bit
  • Faces in the cutting plane

    Finds the faces created by the cut, whose outlines bound the hatched area.

    ||n · d| − 1| ≤ 1e-9 and |(p − o) · d| ≤ 1e-6 × diagonal

    Drawing views of the exact solid brep-draw.js
    • PartCraft
    64-bit
  • Cutting-plane line in the neighboring view

    The point and direction of the line that shows where the section was cut.

    along = unit(d_section × d_view); p = (o · right, o · up); dir = (along · right, along · up)

    Drawing views of the exact solid brep-draw.js
    • PartCraft
    64-bit
  • Number of steps round a circle

    How many interpolation points a round direction gets, from its effective radius.

    h = (384 × DEV ÷ R)^¼; n = ceil(2π ÷ h) rounded up to a multiple of 4, between 32 and 720

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Cubic spline through the unit circle

    The poles of a periodic cubic B-spline that passes through the circle at every knot.

    pole i = k × (cos((i − 1)h), sin((i − 1)h)), k = 6 ÷ (4 + 2 cos h), err = h⁴ ÷ 384

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Largest stretch of the map

    The largest factor by which the scale lengthens any direction, used to size the deviation.

    σ = |M x| after 60 power iterations of x ← unit(Mᵀ M x)

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Image of a curve

    A line, circle, ellipse, Bézier or B-spline curve after the scale, as a B-spline in the same parameter.

    line, Bézier, B-spline: poles ↦ T × pole (exact); circle, ellipse: T × (c + r₁ x cos + r₂ y sin) at the spline's poles

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Image of a surface

    A plane, cylinder, cone, sphere, torus, extrusion, revolution or spline surface after the scale.

    plane ↦ plane with frame from T x, T x × T y; cylinder, cone: ring(u) × (R + v sin α) + v cos α Z; sphere, torus: ring(u) × (R₁ + R₂ cos v) + R₂ sin v Z

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Inverse of a placement

    Inverts a 3 × 4 placement matrix found in the shape.

    M⁻¹ = adj(M) ÷ det(M); t⁻¹ = −M⁻¹ t

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Parameter range of straight directions

    How far a line or the straight direction of a surface must extend to cover the body.

    t₀ = ((center − o) · d) ÷ |d|²; range = t₀ ± (1.02 × D ÷ |d| + 1)

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Raised shape tolerances

    The tolerance written on every vertex, edge and face of the scaled body.

    tol = max(old, max(1e-7, 3 × largest deviation + 1e-9))

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Numbers written to the shape text

    Turns each coordinate, weight and knot into the text OpenCascade reads back.

    text = String(v); −0 → 0

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Matching equal placements

    Decides when two uses of the same curve or surface share one mapped copy.

    key = entries rounded to 1e-12, joined

    Non-uniform scale of an exact body brep-gtrsf.js
    • PartCraft
    64-bit
  • Rib slab outline

    The flat region the rib is cut from: the sketch chain carried past both ends and offset to one side.

    E = 4 × max(1, diagonal + |box center − sketch origin|); ends ± E along the end directions; far side = + E × D

    Rib feature brep-rib.js
    • PartCraft
    64-bit
  • Choosing the rib piece

    Picks the piece of the trimmed slab that lies beside the sketch line and checks it is closed off by the body.

    distance(probe, piece) < 1e-6 × max(1, t); open when reach > 0.5 × E

    Rib feature brep-rib.js
    • PartCraft
    64-bit
  • Edge flange frame

    The axes a flange is built in: along the edge, out of the sheet's face, and out of its side.

    e = unit(B − A); square when |n_big · n_side| ≤ 1e-6; P = (A + B) ÷ 2 − v × t ÷ 2 must lie on the side face

    Sheet metal base and edge flanges brep-sheet.js
    • PartCraft
    64-bit
  • Flange cross-section

    The corner points of the bend and the leg in the plane square to the edge.

    C = (0, r); point(ρ, φ) = C + ρ (cos φ, sin φ); φ from −π ÷ 2 to −π ÷ 2 + θ; leg end = arc end + length × (−sin φ₁, cos φ₁)

    Sheet metal base and edge flanges brep-sheet.js
    • PartCraft
    64-bit
  • Bend relief slot

    The box cut beside an offset flange end so the bend can form.

    depth into the sheet = r + t; box length along u = (r + t) + 1e-3 × max(1, r + t); through 2 × t

    Sheet metal base and edge flanges brep-sheet.js
    • PartCraft
    64-bit
  • Side of the first bend

    Which side of an open profile the sheet's thickness goes on.

    turn = sign((p₁ − p₀) × (p₂ − p₁))

    Sheet metal base and edge flanges brep-sheet.js
    • PartCraft
    64-bit
  • Cone from its derivatives

    A cone's axis point, axis direction, radius and slope from the surface's derivatives at one point.

    ρ = |P_uu|; e = −P_uu ÷ ρ; z = P_v − (P_v · e) e; axis point = P − ρ e; slope k = (P_v · e) ÷ |z|

    Exact surface records for meshing brep-surf.js
    • PartCraft
    64-bit
  • Torus from its derivatives

    A torus's center, axis and two radii from the surface's derivatives at one point.

    ρ = |P_uu|; A = P − ρ e; d = unit(e × P_u); tube center M = P + P_vv; c = A + ((M − A) · d) d; R = |M − c|; r = |P_vv|

    Exact surface records for meshing brep-surf.js
    • PartCraft
    64-bit
  • Check against the kernel's face

    Confirms the record describes the same surface as the kernel's face before it is used.

    25 points on a 5 × 5 grid (2 % to 98 % of the parameter box); each within 1e-9 × size of the record's surface

    Exact surface records for meshing brep-surf.js
    • PartCraft
    64-bit
  • Closed loops with their curves

    Collects a sketch's curves into closed loops, keeping each curve's exact definition.

    tol = 1e-6 × max(1, extent); ends within 10 × tol share a node; arc mid = c + r (cos, sin)(a₀ + sweep ÷ 2)

    Sketch profiles for exact solids brep.js
    • PartCraft
    64-bit
  • Arc edge through three points

    Builds an arc of the profile in the kernel.

    arc through a (start node), mid, b (end node)

    Sketch profiles for exact solids brep.js
    • PartCraft
    64-bit
  • Loop orientation

    Whether a loop runs counterclockwise, from the sign of its area.

    A = ½ Σ (x_j y_i − x_i y_j)

    Sketch profiles for exact solids brep.js
    • PartCraft
    64-bit
  • Point just inside a loop

    A test point a small step inside the loop's longest edge, used to decide nesting.

    p = midpoint of longest edge + normal × 1e-6 × max(1, edge length)

    Sketch profiles for exact solids brep.js
    • PartCraft
    64-bit
  • Which loops are holes

    Counts how many other loops contain each loop; odd depth is a hole.

    depth_i = number of loops whose polygon contains innerPoint(loop_i); face when depth is even

    Sketch profiles for exact solids brep.js
    • PartCraft
    64-bit
  • Stored edge and face reference points

    The point saved with a picked edge or face so it can be found again after a rebuild.

    at = coordinates rounded to 6 decimals

    Sketch profiles for exact solids brep.js
    • PartCraft
    64-bit
  • Extrude depth and start

    Where an extrude starts and how far it runs for blind, mid-plane and through-all ends.

    blind: z₀ = 0 or −h; mid: z₀ = −h ÷ 2; through: h = far side + 1 + 0.01 × body range

    Exact-kernel feature dimensions brep.js
    • PartCraft
    64-bit

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.