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.
Calculations
-
Sketch curves as kernel edges
Turns the lines, arcs, circles and splines of a sketch into the kernel's edges for a loft.
arc: start, middle and end points c + r × (cos, sin) at a₀, a₀ + sweep ÷ 2, a₀ + sweep, then an arc through the three points
Surface features built with the kernel surface.js64-bit- PartCraft
-
Network surface as a kernel face
Hands the surface fitted through a network of curves to the kernel and sets the tolerance its seams are sewn with.
face tolerance 1e-9; sewing tolerance = max(1e-7, 1e-7 × size)
Surface features built with the kernel surface.js64-bit- PartCraft
-
Area of a surface body
The area of each surface body left after a rebuild.
area = Σ over the faces of OpenCascade's surface area
Surface features built with the kernel surface.js64-bit- PartCraft
-
Basis functions and derivatives
The B-spline basis functions and their derivatives at a parameter.
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Point and derivatives of a NURBS curve
A rational curve's point and first two derivatives at a parameter.
C = A ÷ w; C′ = (A′ − w′·C) ÷ w; C″ = (A″ − 2w′·C′ − w″·C) ÷ w
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Point and derivatives of a line, circle or ellipse
A profile curve's point and first two derivatives at a parameter.
circle and ellipse: C = c + a·cos t·x + b·sin t·y
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Point and derivatives of a B-spline surface
A B-spline surface's point and all derivatives up to second order at (u, v).
homogeneous sums A[k][l] = Σ Nᵤ⁽ᵏ⁾·Nᵥ⁽ˡ⁾·w·P; S[k][l] by the quotient rule with binomial factors 1, 2, 1
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Closest point on a sphere, torus or cone
The nearest point, the normal there and the distance, in closed form.
sphere: c + r·n̂, d = | |p − c| − r |; torus: tube center m = c + R·ê, then m + r·n̂; cone: τ = ((ρ − r₀)·k + t) ÷ (1 + k²)
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
One-dimensional Newton minimizer
Refines the parameter of the nearest point on a profile curve.
Δt = −f′ ÷ f″ (or one sample spacing downhill when f″ ≤ 0); stop when |Δt| ≤ 1e-15 × (|b − a| + |t|)
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Start points for the minimizer
Samples the distance along a curve and runs Newton from the two best samples.
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Closest point on a surface of revolution
The nearest point on a profile turned about an axis.
minimize ½((ρ(v) − ρ_p)² + (t(v) − t_p)²) over the profile parameter v
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Closest point on an extruded surface
The nearest point on a curve swept along a direction.
minimize ½ |across(p − C(u))|²; P = C(u) + ((p − C(u)) · d)·d
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Closest point on a B-spline surface
The nearest point on a B-spline face, kept inside the face's parameter box.
Newton on ∇½|S(u, v) − p|² = 0 with the Hessian [Sᵤ·Sᵤ + Sᵤᵤ·r, Sᵤ·Sᵥ + Sᵤᵥ·r; …]
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Smallest radius of curvature near a point
The radius of curvature the mesher uses to size elements on a curved face.
sphere, torus: r; cone: ρ × √(1 + k²); else 1 ÷ max |Δn| ÷ moved over three directions 60° apart
Exact surfaces for the tetrahedral mesher surfaces.js64-bit- PartCraft
-
Number formatter
Writes one number as macro text.
text = toPrecision(v, 15); |v| < 1e-14 → 0
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Millimeters to meters
Converts a length or a coordinate from millimeters to the meters the macro uses.
m = round(mm × 10⁶) ÷ 10⁹
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Degrees to radians
Converts an angle in degrees to the radians the macro uses.
rad = deg × π ÷ 180
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Unit-vector component
Writes a component of a sketch plane's normal or x direction.
u = round(v × 10¹²) ÷ 10¹²
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Sketch dimension value and text position
Works out the value of each sketch dimension in meters or radians and where its text sits.
length: value ÷ 1000; angle: value × π ÷ 180; arc radius = |start − center|
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Pick point on a face
Finds a point inside a face, used by the macro to select that face.
centroid of the largest triangle = (a + b + c) ÷ 3, moved onto the plane: p − ((p − o)·n) n
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Countersink depth and taper
The depth and half angle of the tapered cut that stands in for a countersink.
depth = (D − d) ÷ 2 ÷ tan(angle × π ÷ 360); taper = angle ÷ 2 × π ÷ 180
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Expected volume and box after each step
Writes the part's volume and bounding box after a feature, for the macro to compare with what it built.
volume in m³ = volume in mm³ × 10⁻⁹; box corners through the millimeter-to-meter conversion
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Body check tolerances in the macro
The comparison the macro makes between the body it built and the expected volume and box.
|v − vol| ≤ 10⁻⁴ × |vol| + 10⁻¹⁵; |box − expected| ≤ 10⁻⁵ m + 0.02 × diagonal
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Final volume comparison
Writes the finished part's volume into the macro and the test that reports whether the rebuilt part matches.
|v − vol| ≤ 10⁻⁴ × vol, v = reported volume × 10⁹ (mm³)
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
Numbers in equations
Writes a parameter expression as equation text for the macro, including its numeric constants.
constant → formatNumber(value); pow(a, b) → (a) ^ (b); log(x) → log(x) ÷ log(10)
Numbers written into the VBA macro export swmacro.js64-bit- PartCraft
-
64-point rule on the tetrahedron
Builds the integration points and weights used for mass and body loads.
x = u, y = v(1 − u), z = w(1 − u)(1 − v); weight = wₐ w_b w_c ÷ 8 × (1 − u)² (1 − v)
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Shape functions of the 10-node tetrahedron
The ten shape functions and their derivatives at a point of the element.
corner: N = L(2L − 1); midside: N = 4 LᵢLⱼ
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Jacobian and physical derivatives
The element's Jacobian determinant at a point and the shape-function derivatives in x, y and z.
J = Σ xₐ ∂Nₐ/∂ξ; det J by cofactors; ∂N/∂x = J⁻ᵀ ∂N/∂ξ
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Element stiffness
The 30 × 30 stiffness matrix of one element and its volume.
Kₑ = Σₚ wₚ det Jₚ E · Bᵀ D B; volume = Σₚ wₚ det Jₚ
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Element mass and shape-function integrals
The consistent mass matrix of one element and ∫N dV for each node, used for gravity.
Mₑ = Σₚ ρ wₚ det Jₚ NₐN_b; ∫Nₐ dV = Σₚ wₚ det Jₚ Nₐ
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Stress and strain at a Gauss point
The six strains and six stresses at one Gauss point from the element's displacements.
ε = B u; σ = E · D (ε − α ΔT [1 1 1 0 0 0])
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
6-point rule on a triangle face
The points and weights used to integrate loads, areas and heat exchange over boundary faces.
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Shape functions of the 6-node face
The six shape functions of a boundary face and their derivatives.
corner: N = L(2L − 1); midside: N = 4 LᵢLⱼ
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Integration over a boundary face
The area-weighted normal and position at each rule point of a curved boundary face.
n dA = (∂x/∂L₁ × ∂x/∂L₂) × w ÷ 2
Quadratic tetrahedron element matrices tetfea.js64-bit- PartCraft
-
Area element on a face for heat terms
The area weight at each rule point of a 6-node face, for heat exchange and heat loads.
dA = |∂x/∂L₁ × ∂x/∂L₂| × w ÷ 2
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Element conductivity matrix
The 10 × 10 heat conduction matrix of one element.
Kₑ = Σₚ wₚ det Jₚ k ∇Nₐ·∇N_b
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Element heat capacity
The heat capacity matrix of one element, or its lumped diagonal for transient runs.
M = Σₚ wₚ det Jₚ ρc NₐN_b; lumped: Mₐₐ × (ΣM ÷ Σ diagonal)
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Element heat generation load
The nodal heat input of a uniform internal heat source.
fₐ = Σₚ wₚ det Jₚ Q Nₐ
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Temperature gradient at the element center
The temperature gradient used for the heat flux of an element.
∇T = Σ ∇Nₐ Tₐ at L = (¼, ¼, ¼, ¼)
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Element thermal load
The nodal forces that a temperature rise produces in one element.
f = Σₚ wₚ det Jₚ E α ΔTₚ (D₀₀ + D₀₁ + D₀₂) ∇N
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Stresses at the four Gauss points
The stresses used to build the geometric stiffness of a buckling study.
σ = E · D (B u − α ΔT [1 1 1 0 0 0])
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Element geometric stiffness
The stress stiffness of one element for linear buckling.
Gₐ_b = Σₚ wₚ det Jₚ ∇Nₐᵀ σₚ ∇N_b
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Face areas and volume of the tetrahedral mesh
The area of every boundary face and the mesh volume handed to the heat and buckling routines.
area = Σ ∫Nₐ dA; volume = Σₑ Σₚ wₚ det Jₚ
Quadratic tetrahedron element matrices tet-elements.js64-bit- PartCraft
-
Stiffness and mass assembly
Adds every element's stiffness (and mass) into the model's sparse matrices and totals the volume.
K = Σₑ Kₑ; volume = Σₑ volumeₑ
Tetrahedral stress, vibration and buckling solve tetfea.js64-bit- PartCraft
-
Matrix times vector
Multiplies the symmetric stiffness, stored as its lower triangle, by a vector.
y = K x
Tetrahedral stress, vibration and buckling solve tetfea.js64-bit- PartCraft
-
Constrained stiffness
Builds the stiffness with supports applied.
K̃ = P K P + α (I − P)
Tetrahedral stress, vibration and buckling solve tetfea.js64-bit- PartCraft
-
Scale of the supported directions
The value α put on the diagonal for supported directions.
α = Σ Kᵢᵢ ÷ N
Tetrahedral stress, vibration and buckling solve tetfea.js64-bit- PartCraft
-
Incomplete Cholesky preconditioner
Factors the constrained stiffness on its own sparsity pattern to speed up the iteration.
L Lᵀ ≈ K̃ on the pattern of K̃
Tetrahedral stress, vibration and buckling solve tetfea.js64-bit- PartCraft
-
Conjugate-gradient solve for displacements
Solves the constrained system for the displacement of every node.
stop when ‖r‖ ÷ ‖P f‖ < tol
Tetrahedral stress, vibration and buckling solve tetfea.js64-bit- PartCraft
-
Loads on faces and gravity
Turns forces, pressures and gravity into nodal loads and totals them.
force: t = total ÷ A; pressure: t = −p n; f = Σ N t dA; gravity: f = ρ g ∫N dV
Tetrahedral stress, vibration and buckling solve tetfea.js64-bit- PartCraft
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.