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
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
Angle label
The text of an angle dimension, in degrees.
degrees = round(θ × 180 ÷ π × 10) ÷ 10
Dimensions and typed sizes in 3D m3d/infer.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
Level elevations
The list of named levels and their heights.
Groups, placements and the model file m3d/model.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
Unit normal of a mesh face
The direction a mesh face points.
n = N ÷ |N|
Polygon mesh: normals, areas, triangles and volume m3d/mesh.js64-bit- CadCraft
- ModelCraft
-
Area of a mesh face
The area of one mesh face.
area = |N| ÷ 2
Polygon mesh: normals, areas, triangles and volume m3d/mesh.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
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.js64-bit- CadCraft
- ModelCraft
-
Unit vector
A vector scaled to length 1.
n = a ÷ |a|; [0, 0, 0] when |a| ≤ 1e-15
3D vectors, planes and transforms m3d/vec.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
-
Polygon normal
The unit normal of a polygon given by its corner points.
N = Σ (pᵢ − pᵢ₊₁) × (pᵢ + pᵢ₊₁) taken per axis, then normalized
3D vectors, planes and transforms m3d/vec.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
-
Polygon area in 3D
The area of a flat polygon in space.
area = |Σ (pᵢ − pᵢ₊₁) × (pᵢ + pᵢ₊₁)| ÷ 2
3D vectors, planes and transforms m3d/vec.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
-
Plane through a point
A plane as a unit normal and an offset, with the normal's sign made canonical.
n·p = d; first component of n with |n| > 1e-9 is made positive
3D vectors, planes and transforms m3d/vec.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
-
Same plane test
Whether two planes are the same plane.
|n₁·n₂| > 1 − 1e-9 and |d₁ × sign(n₁·n₂) − d₂| ≤ 1e-6
3D vectors, planes and transforms m3d/vec.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
-
Closest points of a line and a segment
The nearest points between a ray's line and an edge.
den = (d·d)(u·u) − (d·u)²; t = (B·E − C·D) ÷ den; s = (A·E − B·D) ÷ den, clamped to [0, 1]
3D vectors, planes and transforms m3d/vec.js64-bit- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
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.