Draws one part with its holes, copes and section, and prints its dimensions, cut angles and weight.
How the precision is kept
The part's stored sizes are scaled to the sheet in 64-bit. The figures printed are rounded: dimensions and lengths to whole millimeters, mitre angles to 0.1 degree, weights to 0.1 kg. Each dimension of a chain is rounded on its own.
Calculations under this policy
5 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.
The number printed on a dimension line of the shop drawing.
figure = round(value)
Math.round to the whole millimeter, for the text and for the recorded value alike.
shop.js
lines 43 to 52
DetailCraft 0.8.1
/** Horizontal dimension between paper x1 and x2 at paper y; value in model mm. */
const dimH = (x1, x2, y, from, value, label = fmtLen(value)) => {
P([[x1, from], [x1, y - 1.5]], thin); P([[x2, from], [x2, y - 1.5]], thin);
P([[x1, y], [x2, y]], thin);
for (const x of [x1, x2]) P([[x - 0.9, y - 0.9], [x + 0.9, y + 0.9]], { w: 0.35 });
const tw = textWidth(label, 2.2);
const above = Math.abs(x2 - x1) >= tw + 1;
T(label, (x1 + x2) / 2, y + (above ? 0.8 : -3.2), 2.2, { align: 'center' });
dims.push({ dir: 'h', value: Math.round(value), label });
};
Hole stations along the part
64-bit
The chain of dimensions from the start of the part through each hole to its end.
step_i = x_i − x_{i−1}; overall = L
Stations closer than 0.5 mm are merged first. Each step is rounded on its own when printed, so the steps need not add up to the overall length printed below.
first n in the list with size ÷ n ≤ room; paper = X0 + x ÷ n
Scales come from a fixed list that includes 2.5. The length and depth can get different scales; both are named in the view title.
shop.js
lines 74 to 79
DetailCraft 0.8.1
let nx = pickScale(L, SHEET.w - 30 - 55 * k - 70);
if (H / nx > roomH) nx = pickScale(H, roomH); // a wide plate: its height decides
let ny = nx;
if (H / nx < 30 * Math.min(k, 1)) ny = pickScale(H, Math.min(60 * k, roomH));
const sx = 1 / nx, sy = 1 / ny;
const ex = (x) => X0 + x * sx, ey = (y) => Y0 + (y + H / 2) * sy;
Mitre cut angles
64-bit
The angle from square of each cut end, in the web's plane and across the flanges.
angle = atan(|k|) × 180 ÷ π, 1 decimal
Math.atan of the cut plane's slope, printed with toFixed(1).
shop.js
lines 177 to 178
DetailCraft 0.8.1
// mitre cuts (0.7.1 71.20): each cut end's angle from square, in the web's plane and across the flanges
const deg = (k) => (Math.atan(Math.abs(k)) * 180 / Math.PI).toFixed(1);
Weight in the title block
64-bit
The weight of one part and of the whole quantity.
total = weight × count
The total is the unrounded weight times the count, then rounded to 0.1 kg; it is not the rounded single weight times the count.
Hole stations sorted and merged within 0.5 mm, then dimensioned as a chain with the overall length below.
Number types
64-bit numbers; printed figures rounded.
Tolerances
Positions within 0.5 mm are one dimension.
Limits
A long part is drawn with the length and the depth at different scales when the depth would be too small to read; the sheet says so and dimensions govern.
Approach: 64-bit, stated limit
The arithmetic is 64-bit, but the method or the data sets the accuracy: a solver tolerance, a mesh, a step size, a datum shift, a table. The limit is stated where the result is shown.