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

  • Is a face still flat

    Whether every corner of a face lies in the face's plane after an edit.

    |n · p − d| ≤ 10 × EPS for every corner

    Push/pull, move, stretch, follow me and intersect m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Stretch to a new size

    Moves every vertex beyond a cut plane by a distance, as used by typed dimensions and sizes.

    p′ = p + d × δ for every vertex with p · d ≥ cut − 10 × EPS

    Push/pull, move, stretch, follow me and intersect m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Profile ring at a path corner

    Where each corner of a swept profile lands on the next miter plane of the path.

    q′ = q + d × (n · (o − q)) ÷ (n · d)

    Push/pull, move, stretch, follow me and intersect m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Where a line crosses a face

    The stretches of a line that lie inside a face, holes left out.

    c = P + (Q − P) × s_P ÷ (s_P − s_Q); t = (c − x₀) · u

    Push/pull, move, stretch, follow me and intersect m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Line where two faces cross

    The line shared by the planes of two faces, clipped to both.

    dir = n_a × n_b; x₀ = ((n_b·d_a − n_a·d_b) × dir) ÷ |dir|²

    Push/pull, move, stretch, follow me and intersect m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Mirror matrix

    The matrix that flips geometry through a plane.

    M = T(c) · (I − 2·n·nᵀ) · T(−c)

    Push/pull, move, stretch, follow me and intersect m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Corners of a circle or polygon

    The corner points of a circle or regular polygon with a given number of sides.

    pᵢ = c + u·r·cos aᵢ + v·r·sin aᵢ, aᵢ = (i ÷ sides) × 2π

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Corners of an arc

    The corner points of an arc from its center, radius, sweep and segment count.

    pᵢ = c + u·r·cos aᵢ + v·r·sin aᵢ, aᵢ = sweep × i ÷ segs

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • What a curve is

    The length, radius, center, normal and sweep reported for an arc, circle, polygon or smooth curve.

    length = Σ |segment|; center = circle through three corners; sweep = |Σ atan2((u₁ × u₂) · n, u₁ · u₂)|

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Give a curve a new radius

    Moves the corners of an arc, circle or polygon to a typed radius about its center.

    p′ = c + (p − c) × r ÷ r_old

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Equal division points

    Where the parts of an edge or curve divided into n equal parts meet.

    straight edge: a + (b − a) × (i + 1) ÷ n; arc: new corners at equal angles; other curve: equal lengths along its segments

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Dividing an edge or curve

    Adds the corners that divide an edge or curve into n equal parts.

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Points of a smooth curve

    The points of the smooth curve drawn through clicked points.

    centripetal Catmull–Rom: knot step = √|pᵢ₊₁ − pᵢ|, evaluated at k ÷ segs of each span

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Offset of a 2D outline

    The corners of an outline moved sideways by a distance.

    each segment line moved d along its left unit normal; corner = intersection of neighboring lines

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Do two outline segments cross

    The test that refuses an offset whose loops cross themselves or each other.

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Offset of a face's loops

    The offset outline of a face, back in 3D.

    p = u·x + v·y + n·h, h = p₀ · n

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Offset of a chain of edges

    The offset of a connected run of edges lying in one plane.

    Arcs, circles, smooth curves, divide and offset m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Vertex a dimension end attaches to

    Finds the vertex at a picked point so the dimension follows the geometry.

    |M · q − p| ≤ 100 × EPS

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Where a dimension end is now

    The current world position of a dimension's end.

    p = M · q

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Radius and center of a dimensioned curve

    The world center, radius and normal a radius or diameter dimension reads.

    C = M · c; r = |C − M · p₀|

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Typing a new value into a dimension

    Resizes the model so a dimension shows the typed length, radius or diameter.

    radius: r_local′ = r_local × want ÷ r_world; length: see resize between two ends

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Resize between two ends

    Moves one or both ends so the distance between them is the typed length.

    δ = L − |p_b − p_a|, applied along the unit direction from a to b

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Moving the end of a dimension

    Carries the move into the group that holds the moving end and stretches or moves the geometry there.

    d_local = M⁻¹ · d (direction); s = |d_local|; local move = δ × s

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Typing a new length for an edge

    Sets an edge to a typed length by moving one of its ends.

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Typing a new size for a group

    Sets a group's or component's size along one of its own axes.

    δ = size − (max − min) on that axis

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Bounding box

    The smallest axis-aligned box round a group and everything placed in it.

    min and max of M · p over every vertex

    Dimensions and typed sizes in 3D m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Length of a linear dimension

    The length a dimension between two points shows, and where its line is drawn.

    L = |p_b − p_a|

    Dimensions and typed sizes in 3D m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Value of a radius or diameter dimension

    The radius or diameter a dimension on an arc or circle shows.

    L = r, or 2 × r for a diameter

    Dimensions and typed sizes in 3D m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Value of an angle dimension

    The angle a dimension at a corner shows.

    θ = atan2(v · (n × u), v · u); the dimension shows θ or π − θ

    Dimensions and typed sizes in 3D m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Angle label

    The text of an angle dimension, in degrees.

    degrees = round(θ × 180 ÷ π × 10) ÷ 10

    Dimensions and typed sizes in 3D m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • World matrix of a nested placement

    The matrix that takes a group's own coordinates to the model's, through every group it sits in.

    M_world = M₁ · M₂ · … · Mₖ

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Editing context of an open group

    The world matrix of the group being edited and its inverse, used to take picked points into the group.

    M = M₁ · … · Mₖ; M⁻¹ by cofactors

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Making a group

    Moves the selected geometry into a new group whose origin is the lowest corner of its box.

    p_group = p − origin; placement = translation(origin)

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Exploding a group

    Puts a group's geometry back into its parent at the group's place.

    p_parent = M · p

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Flattening a group into a mesh

    Gathers a group and everything placed in it into one set of points before it becomes a mesh.

    key = round(x × 1e8), round(y × 1e8), round(z × 1e8)

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Numbers written to the model file

    The vertices, placement matrices and curve points as they go into the file.

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Vertices read from a file

    The check each vertex passes when a file is opened.

    finite and |x| < 1e7

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Level elevations

    The list of named levels and their heights.

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Light values as stored

    The brightness, cone angle, size and position kept for a lamp used in rendered pictures.

    lumens = round(clamp(x, 1, 200000)); angle = round(clamp(x, 5, 170)); size clamped to 0.02…20 m

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Drawing axes

    The frame set when the drawing axes are placed by three picks.

    X = x ÷ |x|; Y = (y − X (y · X)) normalized; Z = X × Y

    Groups, placements and the model file m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Faces from imported polygons

    Builds faces from the polygons of an imported file, sharing vertices between them.

    key = round(x × 1e5), round(y × 1e5), round(z × 1e5)

    Welding of imported geometry m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Edges from imported segments

    Builds plain edges from the line segments of an imported drawing.

    key = round(x × 1e5), round(y × 1e5), round(z × 1e5)

    Welding of imported geometry m3d/model.js
    • CadCraft
    • ModelCraft
    64-bit
  • Smooth shading normals

    The normal at each corner of faces joined by soft edges.

    n = normalize(Σ n_f × area_f) over the joined faces that meet at the corner

    Smooth shading and texture placement m3d/model.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Fitting a texture to a face

    The map from a point on a face to its place on an imported image.

    u = U · p + u₀, v = V · p + v₀, with U · n = 0 and V · n = 0

    Smooth shading and texture placement m3d/model.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Texture coefficients as stored

    The eight numbers of a texture's placement as they are kept in the face's paint.

    text = x rounded to 7 significant digits

    Smooth shading and texture placement m3d/model.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • Ray and triangle

    Where the cursor's ray meets one triangle of a face.

    det = e₁ · (d × e₂); u, v barycentric; t = e₂ · (s × e₁) ÷ det

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Point on the face under the cursor

    The nearest face the cursor's ray meets and the 3D point on it.

    o_L = M⁻¹ · o; d_L = M⁻¹ · d; p = o + d × t

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • World plane of a placed face

    The triangles, normal and plane of a face in model coordinates, used to draw on that face.

    n = normalize(M · n_local); d = n · (M · P)

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Center of a face

    The center point offered as a snap on the face under the cursor.

    c = Σ (a + b + d) × w ÷ 3 ÷ Σ w, w = |(b − a) × (d − a)|

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Is a point on a face

    Whether a snapped point lies on the face under the cursor, so a shape started there takes the face's plane.

    |n · p − d| ≤ tol and distance to a triangle ≤ tol, tol = 1e-6 × max(1, |x|, |y|, |z|)

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    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.