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

  • Making a curve family compatible

    Gives every profile (or every guide) the same degree and knots, exactly when possible and by fitting otherwise.

    exact: raise degree, merge knots; otherwise: cubic interpolation of C(r(s)), points doubled until error ≤ fitTol

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Boolean sum of the three surfaces

    Adds the surface through the profiles and the surface through the guides and subtracts the surface through the grid points.

    P = Lu + Lv − T, pole by pole

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Tangency to a plane along a boundary

    Makes the surface leave a boundary curve tangent to a plane and reports the angle it made with the plane before.

    second pole row: q ← a + (d − n × (d·n)), d = q − a; angle = asin(|d·n| ÷ |d|)

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Deviation from the input curves

    The largest distance between the finished surface and any profile or guide, shown in the panel.

    dev = max over 401 samples per curve of |S(s) − C(r(s))|

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Fold check

    Refuses a surface whose normal flips between neighboring sample points.

    n = (S(u + h, v) − S(u − h, v)) × (S(u, v + h) − S(u, v − h)), h = 1e-7; fold if n₁·n₂ < 0

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Point on the handle axis nearest the pointer ray

    How far along the handle's axis the pointer is, read from the pointer's ray.

    t = (b·e − c·d) ÷ (a·c − b²)

    Depth and angle set by dragging a handle handle-math.js
    • PartCraft
    64-bit
  • Dragged extrude depth

    The depth stored on the Extrude after a drag.

    depth = max(step, round((v₀ + scale × (t − t₀)) ÷ step) × step), step = max(0.01, 10^⌊log₁₀|v₀|⌋ ÷ 10)

    Depth and angle set by dragging a handle handle-math.js
    • PartCraft
    64-bit
  • Dragged revolve angle

    The angle stored on the Revolve after a drag.

    angle = atan2(q·w, q·u) in degrees, unwrapped toward the previous value, rounded to 1°, kept in 1…360

    Depth and angle set by dragging a handle handle-math.js
    • PartCraft
    64-bit
  • Hull mesh taken from the built part

    Copies the part's triangle mesh for the hull calculation.

    Hull hydrostatics and righting arms hydrostatics.js
    • PartCraft
    32-bit in part
  • Volume, moments and waterplane under a waterline

    Clips the mesh at the waterline and sums the wet volume, its first moments, the wetted area and the waterplane's boundary integrals.

    V = Σ a·(b × c) ÷ 6; ∫x dV = ½ ∮ x² nₓ dS; A = ½ Σ (pₓ q_z − qₓ p_z); ∫z² dA = Σ (p_z² + p_z q_z + q_z²)(pₓ q_z − qₓ p_z) ÷ 12

    Hull hydrostatics and righting arms hydrostatics.js
    • PartCraft
    32-bit in part
  • Hydrostatic properties at a draft

    Volume, displacement, KB, LCB, waterplane area and centroid, BM, KM, block and waterplane coefficients, and mass per unit immersion.

    V = V_skin + h × A ÷ 3; I_T = ∫z² dA − A × c_z²; BM = I ÷ V; KM = KB + BM; Δ = V × 1e-9 × ρ

    Hull hydrostatics and righting arms hydrostatics.js
    • PartCraft
    32-bit in part
  • Righting arms at fixed displacement

    The righting arm GZ at each heel angle, the metacentric height GM, the largest GZ and the angle where stability vanishes.

    GZ = z(B) − (keel + KG) × sin θ; GM = KM_T − KG; vanishing angle by linear interpolation between samples

    Hull hydrostatics and righting arms hydrostatics.js
    • PartCraft
    32-bit in part
  • Units and rounding of the answer

    Converts the hull results to meters, square meters, cubic meters and tonnes for the tool's answer.

    value_m = round(value_mm ÷ 1000 × 10⁴) ÷ 10⁴; volume_m³ = round(V ÷ 1e9 × 10⁴) ÷ 10⁴

    Hull hydrostatics and righting arms hydrostatics.js
    • PartCraft
    32-bit in part
  • Coordinate and direction text

    Formats a coordinate or a direction component as a STEP real.

    text = v.toFixed(digits), trailing zeros removed; digits = 6 for points, 12 for directions

    IFC export of parts, assemblies and library items ifc-export.js
    • PartCraft
    64-bit
  • Quantity and property value text

    Formats a volume, area, mass, length or parameter value as a STEP real.

    text = Number(v.toPrecision(12))

    IFC export of parts, assemblies and library items ifc-export.js
    • PartCraft
    64-bit
  • Triangulated body

    Writes the vertices and triangles of the built mesh as an IfcTriangulatedFaceSet.

    (x, y, z) → (x, −z, y), each written with 6 decimals

    IFC export of parts, assemblies and library items ifc-export.js
    • PartCraft
    32-bit in part
  • Volume, area, weight and overall size

    The quantity sets of an element: net volume in m³, net surface area in m², net weight in kg and the box dimensions in mm.

    V_m³ = V_mm³ × 1e-9; A_m² = A_mm² × 1e-6; weight_kg = V_mm³ × density_g/cm³ × 1e-6; size = |max − min|

    IFC export of parts, assemblies and library items ifc-export.js
    • PartCraft
    64-bit
  • Volume and area of a library item's body

    Volume, surface area and bounding box of a library item's mesh for its quantities.

    V = |Σ a·(b × c) ÷ 6|; A = Σ |(b − a) × (c − a)| ÷ 2

    IFC export of parts, assemblies and library items ifc-export.js
    • PartCraft
    64-bit
  • Placement of an assembly instance

    Turns an instance's 4 × 4 matrix into an IFC axis placement: location, local z axis and local x axis.

    location = C(column 3); Axis = C(column 1); RefDirection = C(column 0); C(x, y, z) = (x, −z, y)

    IFC export of parts, assemblies and library items ifc-export.js
    • PartCraft
    64-bit
  • Extrude height and start

    The height of the extruded tool and where it starts along the sketch normal, for blind, two-sided, mid-plane and through-all ends.

    two-sided: h = depth + depth₂; mid-plane: z₀ = −h ÷ 2; through all: h = extent + 1 + 0.01 × (max − min)

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Revolve profile in axis coordinates

    Turns each profile point into a radius from the axis and a height along it before the profile is revolved.

    r = max(0, d·n); z = d·u; d = p − a, u = unit axis, n = unit normal to the axis on the profile's side

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • Plane, cylinder or cone swept by a profile line

    Classifies the surface a straight profile line sweeps and, for a cone, finds its apex and slope.

    slope = (r₂ − r₁) ÷ (z₂ − z₁); apex height = z₁ − r₁ ÷ slope

    Feature tool dimensions on the mesh kernel kernel.js
    • PartCraft
    64-bit
  • 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

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.