Resources Numerical accuracy
Equality comparisons
Where the code asks whether two decimal numbers are exactly equal. A floating-point result can differ from another in the last digit after a few transformations, so a mesh run through several of them can change the length of an edge, or miss a match. Compare with < or > where a range is meant, and with a documented epsilon where equality is.
Equality comparisons
These are places worth checking, not confirmed bugs. The scan reads how the code is written, not what it is meant to do, so some entries are fine as they are: a test against exactly 0 is often a deliberate guard against dividing by zero. It skips text, counts and indexes, and any comparison it cannot be sure involves decimal numbers, so there are likely more in the code than are listed here.
-
Two computed values usd/earcut.js:218 in equals CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
const equals = (p1, p2) => p1.x === p2.x && p1.y === p2.y;=== in
p1.x === p2.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/earcut.js:218 in equals CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
const equals = (p1, p2) => p1.x === p2.x && p1.y === p2.y;=== in
p1.y === p2.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/earcut.js:248 in middleInside CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) inside = !inside;!== in
p.next.y !== p.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/geom.js:92 in valueAt CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (!a || !b || a.t !== b.t || typeof a.v === 'string' || a.t.startsWith('quat') || a.t.includes('token') || a.t === 'bool') return a;!== in
a.t !== b.t. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: USD transforms and placement, USD mesh coordinates in saved and exported files. -
Two computed values view.js:363 in syncEntered CadCraft
if (b.cx !== vp.cx || b.cy !== vp.cy || b.s !== vp.s || b.tw !== (vp.tw || 0)) {!== in
b.cx !== vp.cx. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Picked points, object snaps and viewport views, 2D drawing on screen. -
Two computed values view.js:363 in syncEntered CadCraft
if (b.cx !== vp.cx || b.cy !== vp.cy || b.s !== vp.s || b.tw !== (vp.tw || 0)) {!== in
b.cy !== vp.cy. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Picked points, object snaps and viewport views, 2D drawing on screen.