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

  • 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
  • Distance from a point to a triangle

    The distance used to decide whether a point is inside a face's outline or on it.

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Midpoint of an edge

    The middle of an edge, offered as a snap point.

    m = (a + b) × 0.5

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

    The point of an edge nearest the cursor, offered when no end or midpoint is in reach.

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Point along an axis from the start point

    The point on a red, green or blue line (or one parallel or square to an edge) through the start point.

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Where an axis line meets an edge

    The point where the line from the start point along an axis meets the edge or guide under the cursor.

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Point on a locked direction

    The point kept on a line when a direction is locked with Shift or an arrow key.

    p = from + d × ((q − from) · d) ÷ (d · d)

    Snap points picked in the 3D view m3d/infer.js
    • CadCraft
    • ModelCraft
    64-bit
  • Distance along a line under the cursor

    The point on a line nearest the cursor and how far along it lies, used by push/pull and moves along an axis.

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

    The normal of a face with any number of corners; its length is twice the face's area.

    N = Σ ((y_a − y_b)(z_a + z_b), (z_a − z_b)(x_a + x_b), (x_a − x_b)(y_a + y_b))

    Polygon mesh: normals, areas, triangles and volume m3d/mesh.js
    • CadCraft
    • ModelCraft
    64-bit
  • Unit normal of a mesh face

    The direction a mesh face points.

    n = N ÷ |N|

    Polygon mesh: normals, areas, triangles and volume m3d/mesh.js
    • CadCraft
    • ModelCraft
    64-bit
  • Area of a mesh face

    The area of one mesh face.

    area = |N| ÷ 2

    Polygon mesh: normals, areas, triangles and volume m3d/mesh.js
    • CadCraft
    • ModelCraft
    64-bit
  • Center of a mesh face

    The point used as a face's middle.

    c = Σ pᵢ ÷ n

    Polygon mesh: normals, areas, triangles and volume m3d/mesh.js
    • CadCraft
    • ModelCraft
    64-bit
  • Is a mesh face flat

    Whether every corner of a face lies in one plane, which decides if it stays one face or becomes triangles.

    |(p − c) · n| ≤ tol, tol = 1e-6 m by default

    Polygon mesh: normals, areas, triangles and volume m3d/mesh.js
    • CadCraft
    • ModelCraft
    64-bit
  • Triangles of a mesh

    The triangles every face is cut into for area, volume, ray tests and drawing.

    Polygon mesh: normals, areas, triangles and volume m3d/mesh.js
    • CadCraft
    • ModelCraft
    64-bit
  • Area and volume of a mesh

    The surface area of a mesh and, when it is closed, the volume it encloses.

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

    Polygon mesh: normals, areas, triangles and volume m3d/mesh.js
    • CadCraft
    • ModelCraft
    64-bit
  • Adding a layer

    Creates a layer of 1 to 16 numbers per element.

    Polygon mesh: attribute layers (UV, color, crease, weights) m3d/mesh.js
    • CadCraft
    • ModelCraft
    32-bit in part
  • Storing a value in a layer

    Writes the values of one element of a layer.

    Polygon mesh: attribute layers (UV, color, crease, weights) m3d/mesh.js
    • CadCraft
    • ModelCraft
    32-bit in part
  • Blending corner values onto new faces

    The values new face corners get when faces are cut or joined, as a weighted mix of old corners.

    out = Σ wᵢ × valueᵢ

    Polygon mesh: attribute layers (UV, color, crease, weights) m3d/mesh.js
    • CadCraft
    • ModelCraft
    32-bit in part
  • Layers in the mesh file

    The layer data as it is written into the file.

    Polygon mesh: attribute layers (UV, color, crease, weights) m3d/mesh.js
    • CadCraft
    • ModelCraft
    32-bit in part
  • Normal per corner

    A unit normal for every corner of every face.

    n = normalize(Σ N_f) over the faces of a smooth group

    Polygon mesh: shading normals m3d/mesh.js
    • CadCraft
    • ModelCraft
    32-bit, display only
  • World triangles for export

    Every triangle of the model in world coordinates, with its normal.

    p_world = M · p; n = normalize((p₁ − p₀) × (p₂ − p₀))

    Export to glTF and STL m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • glTF vertex positions

    The vertex coordinates and normals stored in the binary part of a .glb file.

    Export to glTF and STL m3d/io.js
    • CadCraft
    • ModelCraft
    32-bit in part
  • glTF placement matrix

    The matrix that places each group or component in the .glb file.

    Export to glTF and STL m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • STL triangles in millimeters

    The triangles of a binary STL file.

    x_mm = x × 1000, stored as a 32-bit float

    Export to glTF and STL m3d/io.js
    • CadCraft
    • ModelCraft
    32-bit in part
  • OBJ number format

    How every coordinate and normal component is written in an OBJ file.

    text = x rounded to 6 decimals

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • OBJ vertex

    A vertex of the model as it goes into the OBJ file.

    (x, y, z) → M · p → (x, z, −y)

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • OBJ face normal

    The flat normal written for a face.

    N = Σ pᵢ × pᵢ₊₁, normalized

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • OBJ vertex and normal lines

    The lines that carry the numbers.

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Collada number format

    How every number is written in a Collada file.

    text = x rounded to 12 significant digits

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Collada positions and normals

    The vertex positions and face normals of each definition in the Collada file.

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Collada placement matrix

    The 4×4 matrix of each placement, written row by row.

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Is a face convex

    Decides whether a face is written as one polygon or as triangles in Collada.

    every turn (b − a) × (c − b) ≥ −1e-12 × size²

    Export to OBJ and Collada m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Unit factor for DXF and DWG

    The factor that turns the model's meters into the drawing unit of the export.

    inches: 1 ÷ 0.0254; mm: 1000; cm: 100; m: 1

    Export of the 3D model to DXF and DWG m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Exported point

    A vertex of the model in the export's unit.

    p′ = (M · p) × k

    Export of the 3D model to DXF and DWG m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Placement as a block insert

    The insertion point, scale, rotation and extrusion direction that stand for a placement matrix.

    scale = column lengths; n = third unit column; rot = atan2(r₀ · a_y, r₀ · a_x); insertion = (T · a_x, T · a_y, T · n)

    Export of the 3D model to DXF and DWG m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • DXF number format

    How every coordinate, scale and angle is written in the DXF text.

    text = x rounded to 15 significant digits

    Export of the 3D model to DXF and DWG m3d/io.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.