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

  • 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
  • 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
  • Filling a hole

    Closes a boundary loop with triangles.

    Newell normal n = Σ ((a_y − b_y)(a_z + b_z), …); ear when cross(a, b, c) > 0 and no other point is inside

    Mesh import, repair and storage meshimport.js
    • PartCraft
    64-bit
  • Growing flat faces

    Joins neighboring triangles into one flat face when they share a plane.

    join when n_s·n_t ≥ cos 0.05° and every corner of t is within tol of s's plane; tol = 2e-6 × size + 1e-7

    Mesh import, repair and storage meshimport.js
    • PartCraft
    64-bit
  • Plane of a flat face

    The normal and origin of each flat face a sketch can sit on.

    n = unit(Σ n_t A_t); origin = Σ (triangle center × A_t) ÷ Σ A_t

    Mesh import, repair and storage meshimport.js
    • PartCraft
    32-bit in part
  • Mesh kept in the part file

    Packs the repaired mesh into the text the part file stores.

    vertices → Float32Array → base64

    Mesh import, repair and storage meshimport.js
    • PartCraft
    32-bit in part
  • Mesh read back from the part file

    Unpacks and checks the stored mesh when a part is opened or rebuilt.

    Mesh import, repair and storage meshimport.js
    • PartCraft
    32-bit in part
  • Motion laws

    How far along its travel the joint is at each fraction of the time.

    linear: s; ease: s²(3 − 2s); sine: ½ − ½ cos(πs); round trip: 2s or 2 − 2s; value = from + (to − from) × law(k ÷ steps)

    Motion study of an assembly motion.js
    • PartCraft
    64-bit
  • Default tracked point

    The middle of a part's bounding box, tracked when no point is given.

    center = (min + max) ÷ 2 per axis

    Motion study of an assembly motion.js
    • PartCraft
    32-bit in part
  • Solids for the clearance check

    Rebuilds each part as a solid so the gap between parts can be measured at every step.

    Motion study of an assembly motion.js
    • PartCraft
    32-bit in part
  • Velocity and acceleration

    The rate of the joint value and each tracked point's velocity, speed and acceleration.

    v_k = (p_(k+1) − p_(k−1)) ÷ (t_(k+1) − t_(k−1)); a_k = (p_(k−1) − 2p_k + p_(k+1)) ÷ Δt²

    Motion study of an assembly motion.js
    • PartCraft
    64-bit
  • Peak speed, peak acceleration and travel

    The largest speed and acceleration of each tracked point and the length of its path.

    travel = Σ |p_k − p_(k−1)|

    Motion study of an assembly motion.js
    • PartCraft
    64-bit
  • Numbers in the CSV export

    Formats each time, value, position, speed and gap written to the CSV file.

    text = value.toFixed(5), trailing zeros removed

    Motion study of an assembly motion.js
    • PartCraft
    64-bit
  • Bilinear material constants

    Shear modulus, bulk modulus and hardening modulus from E, ν, yield stress and tangent modulus.

    G = E ÷ (2(1 + ν)); K = E ÷ (3(1 − 2ν)); H = E × E_t ÷ (E − E_t)

    Nonlinear and contact stress study nonlinear.js
    • PartCraft
    64-bit
  • Stress update at a Gauss point

    The stress, the new plastic strain and the algorithmic tangent for a given total strain.

    q = √(1.5 s:s); f = q − (σ_y + H α); Δγ = f ÷ (3G + H); σ = p 1 + (1 − 3GΔγ ÷ q) s

    Nonlinear and contact stress study nonlinear.js
    • PartCraft
    64-bit
  • Element tangent and internal force

    Integrates each element's tangent stiffness and internal force over its four Gauss points.

    K_e = Σ w Bᵀ D_ep B; f_e = Σ w Bᵀ σ; w = weight × det J

    Nonlinear and contact stress study nonlinear.js
    • PartCraft
    64-bit
  • Load-stepped Newton solve

    Raises the load in steps and iterates each step to equilibrium.

    r = λ f − f_int(u) (− contact); converged when |r| ÷ (λ |f|) < tol

    Nonlinear and contact stress study nonlinear.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.