Rebuilds a part from its feature history: extrudes, cuts, patterns and boolean operations.
How the precision is kept
Booleans run in manifold-3d 3.5.4, whose result is a closed, manifold solid by construction. Volume and surface area come straight from the kernel. The vertex positions read back for named faces, edges and the display are 32-bit.
Open item. Read positions back in 64-bit wherever a measurement uses them.
Calculations under this policy
2 calculations 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.
kernel.jsPartCraft 0.8.1 32-bit in part2 calculationsReviewed
Tests bin/test-partcraft.mjs
Volume, surface area and bounding box
64-bit
The measured properties of the finished body.
volume, area, genus and bounding box, asked of the kernel
These numbers are computed inside the kernel on its own solid and returned as 64-bit values. They do not pass through the 32-bit positions below.
The mesh that faces, edges and the display are built from.
positions = 32-bit copy of the kernel's vertices
The positions are copied into a 32-bit array. At 7 digits a part 1 m across is held to about a tenth of a micrometer; anything measured from these positions carries that limit.
kernel.js
lines 1043 to 1047
PartCraft 0.8.1
const gm = b.getMesh();
const np = gm.numProp;
const nv = gm.vertProperties.length / np;
const positions = new Float32Array(nv * 3);
for (let i = 0; i < nv; i++) for (let k = 0; k < 3; k++) positions[i * 3 + k] = gm.vertProperties[i * np + k];
In detail
Method
Each feature builds tools that are added to or cut from the body in order by manifold-3d 3.5.4, compiled to WebAssembly. Every triangle of the result knows which feature made it.
Number types
32-bit arrays for the vertex positions read back from the kernel, 32-bit integers for triangles. Volume and surface area are computed inside the kernel and returned as 64-bit numbers.
Checked by
The PartCraft test suite builds real parts with the same code the page runs.
Limits
This is a mesh kernel: curved faces are facets, and fillets, chamfers, shells and drafts are built approximately.
Approach: 32-bit step, flagged
One step stores or exchanges 32-bit values that reach a number a person reads. It is listed here with its open item, and the step is either moved to 64-bit or the app will warn where the number is read.