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
-
Triangulating a cut cell
Triangles for a polygon left in a grid cell after cutting.
Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js64-bit- ModelCraft
- PartCraft
-
Area of the shown part
The area of a trimmed surface.
A = Σ |(b − a) × (c − a)| ÷ 2 over the triangles of the cut tessellation
Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js64-bit- ModelCraft
- PartCraft
-
Area in the parameter plane
The area of the shown part in (u, v).
outer loop's area (or the whole domain) + Σ holes' signed areas
Trimmed surfaces: loops, cut tessellation and area nurbs/trim.js64-bit- ModelCraft
- PartCraft
-
Finding the sheet
The four corners of the paper in the photo.
corners = the pixels of the largest bright region with the smallest and largest x + y and x − y; photo position = (pixel + 0.5) × reduction factor
Sketch photo to drawing: sheet, perspective and scale photosketch/photosketch.js64-bit- ModelCraft
- CivilCraft
-
Perspective transform from four points
The 3 × 3 matrix that takes four points to four others.
8 equations in h₁…h₈ with h₉ = 1, solved by Gauss–Jordan elimination
Sketch photo to drawing: sheet, perspective and scale photosketch/photosketch.js64-bit- ModelCraft
- CivilCraft
-
Applying the perspective transform
A point taken through the 3 × 3 matrix.
w = h₆x + h₇y + h₈; x′ = (h₀x + h₁y + h₂) ÷ w; y′ = (h₃x + h₄y + h₅) ÷ w
Sketch photo to drawing: sheet, perspective and scale photosketch/photosketch.js64-bit- ModelCraft
- CivilCraft
-
Sheet proportions
The long-to-short ratio of the straightened sheet.
w = mean of top and bottom lengths, h = mean of left and right; r = max ÷ min; replaced by the named paper's ratio, or by the nearest standard ratio within 8 %
Sketch photo to drawing: sheet, perspective and scale photosketch/photosketch.js64-bit- ModelCraft
- CivilCraft
-
Drawing units per pixel
The size of one pixel of the straightened sheet in drawing units, and the mapping from pixels to drawing coordinates.
mm per px = long side in mm ÷ long side in px; units per px = mm per px × scale ÷ unit in mm; x = origin_x + px·k, y = origin_y + (height − py)·k
Sketch photo to drawing: sheet, perspective and scale photosketch/photosketch.js64-bit- ModelCraft
- CivilCraft
-
Arcs and circles into the drawing
Converts each traced arc to drawing units as a circle or as an arc through its start, middle and end.
r = r_px × units per px; circle when a₁ − a₀ ≥ 2π − 1e-6; else arc through start, middle (at (a₀ + a₁) ÷ 2) and end
Sketch photo to drawing: sheet, perspective and scale photosketch/photosketch.js64-bit- ModelCraft
- CivilCraft
-
Arc through three points
The center, radius and end angles of the arc through three points.
d = 2·(a_x(b_y − c_y) + b_x(c_y − a_y) + c_x(a_y − b_y)); center from the sums of |p|²·(differences) ÷ d; r = |a − center|
Sketch photo to drawing: sheet, perspective and scale photosketch/paper.js64-bit- ModelCraft
- CivilCraft
-
Strength of connection between nodes
Decides which neighboring nodes are strongly coupled, from the Frobenius norms of their stiffness blocks.
strong when ‖A_IJ‖ > θ × √(‖A_II‖ × ‖A_JJ‖), θ = 0.08
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
Tentative prolongator by QR per aggregate
Orthonormalizes the near-null vectors (the rigid motions) restricted to each aggregate to form the columns of the prolongator.
q_j ← b_j − Σᵢ (qᵢ·b_j) qᵢ (twice); keep when ‖q_j‖ > 1e-10 × scale × √m
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
Largest eigenvalue of D⁻¹A
Estimates the largest eigenvalue used to set the prolongator smoothing weight.
λ ≈ 1.05 × ‖D⁻¹A x‖ ÷ ‖x‖ after 15 power iterations
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
Prolongator smoothing
Applies one damped Jacobi step to the tentative prolongator.
P = P̂ − ω D⁻¹ A P̂, ω = 4 ÷ (3 λmax)
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
Sparse matrix product
Multiplies two sparse matrices, used for A·P and Pᵀ·(A·P).
C_ij = Σ_r A_ir × B_rj
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
Dense Cholesky on the coarsest level
Factors the coarsest matrix and solves with it by forward and back substitution.
L Lᵀ = A_c; pivot = √s when s > 1e-12 × max diag, else √(1e-12 × max diag + |s|)
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
Gauss–Seidel sweep
One forward or backward relaxation sweep, the smoother of the V-cycle.
x_r = (b_r − Σ_{c≠r} A_rc x_c) ÷ A_rr
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
V-cycle
Applies the preconditioner: smooth, restrict the residual, solve the coarse problem, add the correction, smooth again.
x ← S(b); r = b − A x; x ← x + P × cycle(Pᵀ r); x ← Sᵀ(b)
Multigrid preconditioner for stress analysis amg.js64-bit- PartCraft
-
Rotation matrix to rotation vector
Turns the rotation part of a mismatch into an axis times an angle in radians.
θ = acos(clamp((trace − 1) ÷ 2, −1, 1)); w = (R − Rᵀ)ᵛ × θ ÷ (2 sin θ)
Closed-loop joint solver assembly.js64-bit- PartCraft
-
Loop residuals
For each loop-closing joint, how far its B end is from where the loop puts it.
D = have⁻¹ × want; r = (D_x, D_y, D_z, w_x L, w_y L, w_z L)
Closed-loop joint solver assembly.js64-bit- PartCraft
-
Jacobian by central differences
The rate of change of every residual with every unknown joint value.
J_qc = (r_q(x + h e_c) − r_q(x − h e_c)) ÷ 2h, h = 1e-6 × max(1, L)
Closed-loop joint solver assembly.js64-bit- PartCraft
-
Damped least-norm Newton step
Moves the joint values toward closing the loops while changing them as little as possible.
dx = Jᵀ (J Jᵀ + μ D)⁻¹ (−r); accept x + α dx when Σr² falls, α = 1, ½, ¼ …
Closed-loop joint solver assembly.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
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.js64-bit- PartCraft
-
Stress at the integration points
The six stress components at every integration point of every element, from the displacements.
σ = D (ε − α ΔT I) per point, by the element's own routine
Buckling load factors and thermal stress setup buckling.js64-bit- PartCraft
-
Geometric stiffness times a vector
Applies the stress-dependent stiffness Kσ to a vector, element by element.
y = s × Σ_elements G_e x_e on each of the three directions
Buckling load factors and thermal stress setup buckling.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.