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

  • Hole depth

    The depth of a drilled hole, including a through hole's length past the body.

    through: depth = extent on the drilling side + 1 + 0.01 × (max − min)

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Countersink cone height

    The height of a countersink from its diameter, the hole diameter and the included angle.

    h = (R − r) ÷ tan(angle × π ÷ 360)

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Thread zone of a tapped hole

    The inner and outer radius of a tapped hole's thread, used when parts are checked against each other.

    r₀ = min(drill, d − 1.082532 × p) ÷ 2; r₁ = d ÷ 2

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Circular pattern step

    The angle between copies of a circular pattern and the rotation applied to each copy.

    full turn: step = 360 ÷ count; otherwise step = angle ÷ (count − 1); copy i turned by step × i

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Extent of the body along a normal

    How far the body reaches in front of and behind a sketch plane, for through-all cuts and through holes.

    range = min and max of (corner − o)·n over the 8 corners of the bounding box

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Reference stored for a picked flat face

    Chooses the stable face reference for a picked flat triangle, or stores a fixed plane when none matches.

    match: c.n·n > 1 − 1e-6 and |(p − c.o)·c.n| < 1e-4 × max(1, |p|); else o rounded to 9 decimals, n to 12

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Body mesh read back for named faces and edges

    Copies the current body's vertices and triangles so its faces and edges can be named and measured by later features.

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    32-bit in part
  • Fillet tangent points and arc

    Where a round of radius r touches the two faces of an edge, its center, and the points of its arc.

    s_A = ±r × (1 − n_A·n_B) ÷ (u_A·n_B); center = O + u_A × s_A ± n_A × r; angle = acos(v₀·v₁ ÷ r²)

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    32-bit in part
  • Chamfer distances

    The two setback distances of a chamfer, for equal, two-distance and distance-and-angle modes.

    θ = acos(u_a·u_b); angle mode: d_b = d × sin α ÷ sin(π − α − θ)

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    32-bit in part
  • Section and prism of a fillet or chamfer

    The cross-section that is extruded along the edge and cut from (or added to) the body.

    section pushed past both faces by 0.01 × size; prism length = edge length

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    32-bit in part
  • Shell by offsetting the body

    Hollows the body to a wall thickness, or thickens it outward, and opens the picked flat faces.

    inward: body − (body ⊖ ball(t)); outward: (body ⊕ ball(t)) − body

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Draft: new normal and hinge line

    The plane a drafted face turns to, and the line where the face meets the neutral plane.

    n₂ = unit(n_perp × cos a + pull × sin a); q = n × (d₁ − d₂ n·m) ÷ (1 − (n·m)²) + m × (d₂ − d₁ n·m) ÷ (1 − (n·m)²)

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Draft: outline of the face

    The outline of the drafted face, extruded into the prism that is trimmed by the old and new planes.

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    32-bit in part
  • Thread: extent of the round face

    Where a picked cylinder face starts and ends along its axis and whether it is a shaft or a bore, which set the thread's start, length and callout.

    t₀, t₁ = min and max of (p − o)·d over the face's vertices; full length = t₁ − t₀

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    32-bit in part
  • Mesh body from an imported file

    Scales an imported mesh to millimeters, turns it Y up and makes it a solid body.

    (x, y, z) → (x × s, z × s, −y × s) for a Z-up file; s = unit factor

    Fillet, chamfer, draft, thread and mesh bodies on the mesh kernel kernel.js
    • PartCraft
    32-bit in part
  • Matching tolerance and chord sag

    The distance within which a triangle's corners count as lying on a surface.

    sag = 1.5 × (1 − cos(π ÷ max(8, segments))); tol = 2e-6 × diagonal + 1e-7

    Named faces and edges from the body mesh meshfaces.js
    • PartCraft
    64-bit
  • Triangle on a surface

    Decides whether a triangle lies on a plane, cylinder, cone, sphere, torus or thread zone.

    plane: |(p − o)·n| ≤ tol; cylinder: −(tol + sag × r) ≤ ρ − r ≤ tol + 1e-6 × r

    Named faces and edges from the body mesh meshfaces.js
    • PartCraft
    64-bit
  • Face area and center

    The area of each named face and its area-weighted center.

    area = Σ |(b − a) × (c − a)| ÷ 2; center = Σ (triangle center × area) ÷ area

    Named faces and edges from the body mesh meshfaces.js
    • PartCraft
    32-bit in part
  • Edge length, ends and middle

    The length of an edge between two faces, its two ends and its middle point.

    len = Σ |pᵢ − pᵢ₋₁|; middle = the point at len ÷ 2 along the polyline

    Named faces and edges from the body mesh meshfaces.js
    • PartCraft
    32-bit in part
  • Straight edge or circle

    Classifies an edge as a line, a circle or a curve and gives a circle its center, axis and radius.

    line: every point within 10 × tol of the chord; circle: every point at one radius and one height about a round face's axis

    Named faces and edges from the body mesh meshfaces.js
    • PartCraft
    32-bit in part
  • Circle edge points put on the circle

    Moves a circular edge's ends and middle exactly onto its circle.

    p′ = c + r × w ÷ |w|, w = (p − c) − n × ((p − c)·n); closed circle: middle = 2c − a

    Named faces and edges from the body mesh meshfaces.js
    • PartCraft
    32-bit in part
  • Surfaces of pattern and mirror copies

    Moves a tool's named planes, axes and centers with the matrix of a pattern or mirror copy.

    point′ = M × point; direction′ = unit(linear part of M × direction)

    Named faces and edges from the body mesh meshfaces.js
    • PartCraft
    64-bit
  • Circle of an edge

    Center, radius and axis of a circular edge from its two ends and its middle point.

    c = A + ((n × ab) |ac|² + (ac × n) |ab|²) ÷ (2 |n|²), n = ab × ac; full circle: c = (a + middle) ÷ 2, r = |a − middle| ÷ 2

    Measuring and mass properties in 3D measure.js
    • PartCraft
    64-bit
  • Area of a picked group of facets

    The area and normal of a picked face when no face table is available.

    area = Σ |(b − a) × (c − a)| ÷ 2; plane if |Σ cross| > 0.999 × 2 × area

    Measuring and mass properties in 3D measure.js
    • PartCraft
    32-bit in part
  • Closest point on a triangle

    The point of a facet nearest to a given point, for the fallback distance.

    Measuring and mass properties in 3D measure.js
    • PartCraft
    64-bit
  • Closest points of two segments

    The nearest pair of points on two mesh edges, for the fallback distance.

    s = (b·f − c·e) ÷ (a·e − b²), t = (b·s + f) ÷ e, clamped to 0…1

    Measuring and mass properties in 3D measure.js
    • PartCraft
    64-bit
  • Minimum distance over the facets

    The smallest distance between two picked entities when the exact kernel's distance is not available.

    min over point–point, point–triangle, point–segment and segment–segment pairs

    Measuring and mass properties in 3D measure.js
    • PartCraft
    32-bit in part
  • Distance, angle and gaps between two picks

    Point-to-point distance, the angle between planes, lines or axes, the gap between parallel planes and the distance between centers or parallel axes.

    angle = acos(clamp(d₁·d₂)) in degrees; plane gap = |(o₂ − o₁)·n|; axis gap = |w − d (w·d)|

    Measuring and mass properties in 3D measure.js
    • PartCraft
    64-bit
  • Volume, center of mass and inertia from the mesh

    Mass properties of a closed triangle mesh at density 1.

    V = Σ a·(b × c) ÷ 6; ∫xxᵀ dV = Σ V_t ÷ 20 × (Σ pᵢpᵢᵀ + (Σpᵢ)(Σpᵢ)ᵀ); about the center: C − V g gᵀ

    Measuring and mass properties in 3D measure.js
    • PartCraft
    32-bit in part
  • Mass properties of a placed part

    Mass in grams and the inertia tensor in world axes for one placed part.

    I_world = (density ÷ 1000) × R I Rᵀ; center_world = M × center

    Measuring and mass properties in 3D measure.js
    • PartCraft
    64-bit
  • Mass properties of several parts together

    Total mass, combined center of mass and inertia tensor of an assembly.

    center = Σ mᵢ cᵢ ÷ Σ mᵢ; I = Σ (Iᵢ + mᵢ (|dᵢ|² E − dᵢ dᵢᵀ)), dᵢ = cᵢ − center

    Measuring and mass properties in 3D measure.js
    • PartCraft
    64-bit
  • Principal moments and axes

    The eigenvalues and eigenvectors of the inertia tensor.

    cyclic Jacobi rotations: t = sign(θ) ÷ (|θ| + √(θ² + 1)), θ = (a_qq − a_pp) ÷ (2 a_pq)

    Measuring and mass properties in 3D measure.js
    • PartCraft
    64-bit
  • Exact minimum distance

    The minimum distance between two picked faces, edges, points or bodies and the two closest points.

    Measuring and mass properties in 3D measure-brep.js
    • PartCraft
    64-bit
  • Exact volume, area, center and inertia

    Mass properties of the part's exact body at density 1.

    I_xy = I((x + y) ÷ √2) − (I_xx + I_yy) ÷ 2, and the same for yz and xz

    Measuring and mass properties in 3D measure-brep.js
    • PartCraft
    64-bit
  • Curved edges of an assembly drawing view

    Turns each visible or hidden curve of a hidden-line view into the line segments the drawing keeps.

    n = clamp(⌈span ÷ size × 160⌉, 8, 240) equal parameter steps

    Measuring and mass properties in 3D measure-brep.js
    • PartCraft
    64-bit
  • Sketch plane from a picked flat face

    The plane reference stored when a sketch is put on a picked flat face that has no stable name.

    o = each coordinate rounded to 9 decimals; n = each component rounded to 12 decimals

    Values stored from picks in the workspace partcraft.js
    • PartCraft
    64-bit
  • Mate plane from a picked face of an instance

    The plane stored in an assembly mate when a flat face of a placed part is picked.

    o rounded to 9 decimals, n to 12 decimals, when the face has no stable name

    Values stored from picks in the workspace partcraft.js
    • PartCraft
    64-bit
  • Anchor point on a drawing view

    The point in a view's own coordinates where a note, dimension or detail view is attached.

    u = u₀ + (x − x_view) ÷ scale, snapped to the nearest drawn line within 2.5 ÷ scale, then rounded to 4 decimals

    Values stored from picks in the workspace partcraft.js
    • PartCraft
    64-bit
  • Default section plane offset

    The offset of a new section view's cutting plane: the middle of the part's bounding box along the view direction.

    offset = dir · (min + max) ÷ 2, rounded to 4 decimals

    Values stored from picks in the workspace partcraft.js
    • PartCraft
    64-bit
  • Arc through three points

    Center, radius, start angle and signed sweep of an outline arc given by its start, middle and end.

    c_x = (|a|²(m_y − b_y) + |m|²(b_y − a_y) + |b|²(a_y − m_y)) ÷ d, d = 2 (a_x(m_y − b_y) + m_x(b_y − a_y) + b_x(a_y − m_y))

    Circuit board outline, holes and part boxes kicad.js
    • PartCraft
    64-bit
  • Arc as straight segments

    The points that replace an arc or circle of the board outline.

    steps = max(2, ⌈|sweep| ÷ 7.5°⌉); pₖ = c + r (cos aₖ, sin aₖ), aₖ = a₀ + sweep × k ÷ steps

    Circuit board outline, holes and part boxes kicad.js
    • PartCraft
    64-bit
  • Joining outline pieces into loops

    Chains lines and arcs of the edge layer into closed outlines.

    Circuit board outline, holes and part boxes kicad.js
    • PartCraft
    64-bit
  • Footprint point on the board

    Moves a point of a footprint (a pad, a corner of its box) to board coordinates.

    x = at_x + l_x cos a − l_y sin a; y = −at_y + l_x sin a + l_y cos a; l_y = −p_y, a = rotation × π ÷ 180

    Circuit board outline, holes and part boxes kicad.js
    • PartCraft
    64-bit
  • Board thickness parameter

    The part parameter that drives the board's extrusion depth.

    board_t = thickness rounded to 4 decimals

    Circuit board outline, holes and part boxes kicad.js
    • PartCraft
    64-bit
  • Binary STL coordinates

    Reads the corner coordinates of each triangle from a binary STL file.

    Mesh import, repair and storage meshimport.js
    • PartCraft
    64-bit
  • 3MF vertex placement

    Applies the unit of each model file and the chain of build and component transforms to every vertex.

    p′ = [x s, y s, z s, 1] × M (row vectors, 4 × 3); s = unit of the part file ÷ unit of the root file

    Mesh import, repair and storage meshimport.js
    • PartCraft
    64-bit
  • Welding coincident points

    Merges points that lie within a tolerance of each other and maps every index to the point that is kept.

    merge when (Δx² + Δy² + Δz²) ≤ tol²; the earliest point is kept

    Mesh import, repair and storage meshimport.js
    • PartCraft
    64-bit
  • Repair tolerances from the mesh size

    Sets the weld distance, the gap-closing distance and the smallest triangle area kept, then welds and cleans.

    exact = 1e-7 × size; gap = 1e-3 × size; area limit = 1e-14 × size²; size = bounding-box diagonal

    Mesh import, repair and storage meshimport.js
    • PartCraft
    64-bit
  • Closing small gaps

    Merges boundary points that lie within the gap distance of another boundary point.

    Mesh import, repair and storage meshimport.js
    • PartCraft
    64-bit
  • Outward orientation by signed volume

    Turns each closed shell so that it encloses positive volume.

    6 V = Σ (a − o)·((b − o) × (c − o)), o = the shell's first point

    Mesh import, repair and storage meshimport.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.