Skip to content
AI-Ready Docs
/llms.txt/llms-mcp.txt

Rows file formats ​

Rows are JSON files a person supplies: in the studio's Library, or attached in the chat. Shop rows explains why, and what uses each kind.

The file ​

  • Its shape. A rows file is one of:

    • an array of rows;
    • an object with a rows array (not for fits or bend tables);
    • for fits, an object with a tables array.

    It holds 1 to 4,096 rows.

  • Limits. A file must be named .json and is at most 256 KiB. A conversation takes at most 32 files and 1 MiB in all.

  • Sources. Every row names its source, or is marked "estimate": true. Where a kind requires a source, an estimate isn't enough.

  • Units. Public length fields use millimetres, including fit and bearing deviations. Angles use degrees. Source labels keep the units printed by their source. The mount row fields are listed separately below.

  • Validation. A row is checked when it is loaded. A row with a missing or out-of-range value is refused, and the refusal says which row and why.

  • Provenance. Each loaded row keeps a receipt naming its file, its turn in the conversation and the file's SHA-256.

Row kinds ​

fastener-sizes ​

One row per metric thread size. It says how that size is drawn and holed.

FieldMeaning (mm unless noted)
idThe size, as M6
d, pitchNominal diameter (must match the id), coarse pitch
sHex across flats, for bolt heads and nuts
k, mHex bolt head height, nut height
dk, ks, socketSocket head diameter and height, hex key size
wd1, wd2, whWasher inside and outside diameters, thickness
cdk, ck, csocketCountersunk head diameter, height, socket size
lengths, capLengths, cskLengthsLengths offered, shortest first: hex bolts, cap screws, countersunk screws (overall)
clearanceClearance holes: fine, medium, coarse
tapTap drill for the internal thread
source or estimateWhere the row comes from
fieldSourcesWhere a field comes from, when not the row's source
uncheckedFields not cross-checked against a second source

fasteners ​

Bought screws, bolts, nuts and washers, as your supplier lists them:

  • id;
  • kind: hex-bolt, socket-screw, csk-screw, hex-nut or washer;
  • size, such as M6;
  • length, for screws and bolts;
  • optional designation, partNumber and supplier;
  • source or estimate.

casting-rules ​

Two shapes, each for die-casting or sand-casting:

  • A limit: id, process, key, value, unit, description, source, and optional page.
  • A pattern allowance table:
    • allowance: shrink (by alloy family, in inches per foot by size band) or machining (by class, in inches by size band);
    • with its label, bands and page.

A page is { url, read, label }: the address, the date read, and the page's own label for the value.

fits ​

Fit tables. Each table has an id, optional sources ({ id, label, url?, read?, note? }) and rows. Each row is:

  • class: an ISO 286 class such as H7 or g6;
  • over and upTo: the size range, over < size ≤ up to;
  • upper and lower: the deviations in mm;
  • and source or estimate.

If a source quotes a deviation in µm, divide it by 1000 before writing the row's mm value. Keep the source record.

bearings ​

  • id, optional designation;
  • bore, outside, width, optional chamfer;
  • the shoulder limits daMin, daMax, DaMax, raMax;
  • the deviations boreDeviation and outsideDeviation, each [upper, lower] in mm;
  • source or estimate.

orings ​

id, optional dash, insideDiameter, crossSection, and source or estimate.

rings ​

Retaining rings: id, optional designation, shaftDiameter, grooveDiameter, grooveWidth, and source or estimate.

drives ​

Belts, chains and couplings, by kind:

kindRequiredOptional
chainpitch, rollerDiameterinnerWidth, plateHeight
timing-beltpitch, pitchLineOffset, groovethickness
v-beltangle, datumWidth, aboveDatum, belowDatum, spacing, edgethickness
flat-beltwidth, thickness—
couplingbore, outside, lengthtype, boreStep, partNumber, supplier

Each also has an id, and source or estimate.

connectors ​

  • id, optional name;
  • opening: { shape, width, height, cornerRadius?, depth }, where shape is stadium, rect or round;
  • an optional mating body (the same section, with length);
  • an optional keepOut: { margin, depth };
  • source or estimate.

sections ​

Your frame section library: id, optional name, section, and source or estimate. The section is one of the typed sections that Frames and weldments lists (a rectangular or round tube, an angle, a channel, an I/H beam or a T-slot), by its dimensions.

mounts ​

How a motor, a servo or a bearing unit fixes to a flat face, one row per model from its datasheet.

FieldMeaning (mm; start in degrees)
id, type, designation?The row; type is motor, servo or bearing-unit
holesThe bolt pattern, with each hole's diameter: { pattern: "square", spacing }, { pattern: "rect", spacing: [along, across] }, or { pattern: "circle", pcd, count, start? }
pilot, pilotDepthThe register diameter on the mounting face, and how far it stands out
shaft, shaftOffset, shaftHeightThe shaft's diameter; where it stands from the pattern's centre, [along, across]; its axis above the face
bodyA servo's body cut-out sizes, [along, across], through the face. A servo requires it; other types may not have it
clearanceAdded all round to the pilot, shaft and body cut-outs
bearingFor a bearing unit, a bearings row id. Its bore must equal shaft
source or estimate, fieldSources, uncheckedAs for fastener sizes

The limits:

  • Sizes. A hole's diameter is 1 to 30 mm, clearance is 0 to 5 mm, a circle has 2 to 12 holes, and lengths are at most 2,000 mm.
  • Holes. They must be further apart than their diameter.
  • Pilot and shaft. A pilot must be wider than the shaft, and pilotDepth needs a pilot.
  • Clearance. The pilot's or shaft's cut, with its clearance, must stay clear of the holes.

Each refusal is [MOUNT_RANGE], and names the row and the field. A placed part uses the mount rows of the document it is placed in.

The shipped mount example keeps its estimates, unchecked fields and field sources. This check reads those existing rows; it does not supply a new hardware row:

mjs
const mounts = read('mounts.json');
for (const row of mounts.rows) assert.deepEqual(checkMountRow(row), []);
const motor = mounts.rows.find(row => row.id === 'nema17');
assert.deepEqual([motor.pilot, motor.pilotDepth, motor.shaftHeight], [22, 2, 0]); // mm
assert.equal(motor.estimate, true); // the shipped estimate remains an estimate
assert.ok(motor.unchecked.includes('pilot'));
assert.ok(motor.fieldSources.pilot.includes('estimate'));
const bearing = mounts.rows.find(row => row.id === 'ucp204');
assert.equal(bearing.holes.pcd, 95); // mm, pitch-circle diameter

stock ​

Stock for machining, each with a source:

  • a block: { id, kind: "block", size: [x, y, z] };
  • a bar: { id, kind: "bar", diameter, maxLength? }.

frame-stock ​

Stock lengths for frame members: id, length, optional count and section, and source.

bend ​

A sheet-metal bend table. It has an id, optional material and sources, and rows. Each row is:

  • thickness and radius, with optional angle;
  • one of kFactor, allowance or deduction;
  • source or estimate.

The shipped samples ​

@barocss/cad-model ships three samples, at samples/rows/:

  • fastener-sizes.json: M3 to M12;
  • casting-rules.json: die and sand casting;
  • mounts.json: mounts, described in Shop rows.

Each file has an about note and its rows. They are examples taken from the sources each row names, not a standard.

mjs
const sizes = read('fastener-sizes.json');           // { about, rows: [...] }
assert.deepEqual(sizes.rows.map(r => r.id), ['M3', 'M4', 'M5', 'M6', 'M8', 'M10', 'M12']);
for (const row of sizes.rows) assert.deepEqual(checkFastenerSizeRow(row), []);   // no problems
const m6 = sizes.rows.find(r => r.id === 'M6');
assert.deepEqual([m6.d, m6.pitch, m6.tap], [6, 1, 5]);   // mm

const casting = read('casting-rules.json');
for (const row of casting.rows) assert.deepEqual(checkCastingRuleRow(row), []);
assert.ok(casting.rows.every(r => r.page?.url));      // each rule names the page it was read from
mjs
assert.deepEqual(checkFastenerSizeRow({ id: '6mm' }),
  [{ code: 'FASTENER_SIZE_ROW', message: '[FASTENER_SIZE_ROW] a fastener size row\'s id is its thread size, as "M6"' }]);