Resources Numerical accuracy Calculation policy

Points picked for surfaces

Hands points picked in the model to the surfaces library, converting meters to millimeters.

How the precision is kept

The model is in meters and the surfaces library in millimeters. Each picked coordinate is multiplied by 1000 and rounded to six decimals of a millimeter, so the points the library receives are on a grid of one millionth of a millimeter.

Calculations under this policy

1 calculation in 1 source file. The code is read from the released app when this page loads. It is the calculation people run, not a copy kept for this page.

surfaces-mc.js ModelCraft 0.8.1 64-bit 1 calculation Reviewed

Tests None found by the review

Picked points in millimeters

64-bit

The picked model points as the surfaces library receives them.

v_mm = round(v × 1000 × 10⁶) ÷ 10⁶

The value handed on is rounded to 1e-6 mm (one nanometer). The multiplication by 1000 and by 10⁶ are each rounded once in 64-bit before Math.round.

  • surfaces-mc.js
  • lines 94 to 95
  • ModelCraft 0.8.1
pickPoints: () => new Promise((resolve) => {
  tools.set('nurbspts', { hint: (n) => t('nurbs.ui.points.hint', { n }), done: (pts) => resolve(pts ? pts.map((p) => p.map((v) => Math.round(v * MM * 1e6) / 1e6)) : null) });

In detail

Method
v_mm = round(v × 1000 × 10⁶) ÷ 10⁶.
Number types
64-bit numbers.
Tolerances
Rounding step 1e-6 mm.

Approach: 64-bit, direct

Every value is a 64-bit number from input to result. Formulas are closed form or a direct solve, and every comparison uses a stated tolerance.

Every policy that takes this approach