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

  • 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
  • DXF insert record

    The numbers of one block placement in the DXF text.

    rotation in degrees = rot × 180 ÷ π

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

    The same faces, lines and inserts as objects for the DWG writer.

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

    How every coordinate, direction component and elevation is written.

    text = x rounded to 9 decimals

    Export to IFC m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Shared points

    The corner points of the faces, each written once.

    Export to IFC m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Is a placement rigid

    Decides whether a group is exported in its own coordinates with a placement, or in world coordinates.

    |column| = 1 ± 1e-9; columns square within 1e-9; determinant > 0

    Export to IFC m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Placement of an element

    Where each exported element sits relative to its level.

    location = (t_x, t_y, t_z − level elevation); axis = third column; ref direction = first column

    Export to IFC m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Level of an element

    Which level an element is listed under.

    the highest level with elevation ≤ z_min + 1e-6

    Export to IFC m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Precision stated in the file

    The precision value the IFC file declares for its geometry.

    Export to IFC m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Drawing unit factors

    The factor from the drawing's unit ($INSUNITS) to meters.

    in 0.0254; ft 0.3048; mi 1609.344; mm 0.001; cm 0.01; m 1; km 1000; yd 0.9144

    Import of DXF and DWG drawings into the 3D model m3d/io.js
    • CadCraft
    • ModelCraft
    Exact
  • Which unit factor is used

    Picks the factor for a drawing.

    Import of DXF and DWG drawings into the 3D model m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Mirrored entities

    How an entity drawn in a flipped coordinate system is read.

    x → −x when the extrusion direction's z is negative

    Import of DXF and DWG drawings into the 3D model m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Arc angles

    The start and end angles of a DXF arc.

    radians = degrees × π ÷ 180; mirrored: (a₀, a₁) → (π − a₁, π − a₀)

    Import of DXF and DWG drawings into the 3D model m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Placing and scaling a segment

    Moves each line segment by the block placements above it and converts it to meters.

    x′ = a·x + c·y + e; y′ = b·x + d·y + f; then × k

    Import of DXF and DWG drawings into the 3D model m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Arcs, circles and bulges as segments

    The points that stand for an arc, a circle or a polyline bulge.

    n = max(2, ⌈|sweep| ÷ (2π ÷ 48)⌉); pⱼ = c + r (cos aⱼ, sin aⱼ), aⱼ = a₀ + sweep × j ÷ n; bulge: sweep = 4 atan b

    Import of DXF and DWG drawings into the 3D model m3d/io.js
    • CadCraft
    • ModelCraft
    64-bit
  • Ellipse as segments

    The points that stand for an ellipse or an elliptical arc.

    p = c + major × cos t + minor × sin t, minor = major turned 90° × ratio

    Import of DXF and DWG drawings into the 3D model 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.