Bring your own STEP
This page walks from a STEP file to a verified, searched and replayed result with the commands of arena assembly: inspect, validate, verify, sweep, search, replay, report and export-meshes. It runs the walk on the two sample mechanisms in assets/step-samples/ and prints what each command printed. The result of a walk is a measurement of one gap at the poses that were checked. It is not a certification.
On both samples the walk shows the same thing. A sweep of four joint values reports no_failure_found. A seeded search over the same ranges finds poses that the kernel measures below the requirement, and replay measures the stored pose again and matches. The four-point sweep misses what the search finds, which is why the page runs both.
What was tested
- The samples
latch-hook.stepanddrawer-carriage.stepwere written by the build123d kernel (scripts/make_step_samples.py). No vendor-exported file was tested, and this page claims nothing about the STEP files of any CAD system. - Every printed line below comes from a run on build123d 0.13.0 with
cadquery-ocp-novtk8.0.1.1.0 and Python 3.12.11. The runs are recorded intests/data/byos_walk.json. tests/assembly/test_bring_your_own_step_native.pyruns every command of this page on the real kernel, each in its own process, inside an empty directory that holds a copy ofassets/step-samples/. It compares the printed lines and the numbers of this page with that run.tests/assembly/test_bring_your_own_step.pycompares the page with the recorded transcript without the kernel. A line or a number that no run printed fails one of them.
What repeats and what varies
Following this page on a clean checkout prints the same lines, except for the values listed here. These values are deterministic: the hashes of the sample files, every value of a sidecar, the volumes and boxes of the solids, the verdicts and exit statuses, the poses that the seeded search proposes (seed 42) and the counters of a search. The test compares decimal numbers to nine places, so a difference in the last digits of a kernel distance does not fail it. These values change from run to run and the test ignores them:
latency_s: the wall time of a search, in the output ofsearch.glb sha256: the digest of each exported glTF file, in the output ofexport-meshes. It depends on the kernel build.- The
size_bytesandsha256lines thatinspectprints forruns/byos/nested.step, a file that the kernel writes during the walk. - The run directory. The page writes to
runs/byos/, which git ignores. Deleteruns/byosbefore you repeat the walk.
How to read the blocks
A block that starts with $ shows a command, the lines it printed and, on the last line, [exit N], the exit status, which a shell does not print. A line [...] marks printed lines that the page leaves out. Every other line is a line that the run printed, in the order it printed it.
Set up
You need Python 3.12 and uv. From the root of the repository:
uv sync --locked
The commands below start with arena, the console script of the project environment (.venv/bin/arena). python is .venv/bin/python. Run every command from the repository root.
The walk on latch-hook
assets/step-samples/latch-hook.step holds two solids, arm and striker. The arm swings about the Z axis through the origin towards the striker pin. The requirement is a gap of at least 1.5 mm between the two.
Look inside the STEP file
inspect prints the unit that the file declares, its digest and every solid in file order, with its volume, bounding box and validity. It measures nothing.
$ arena assembly inspect assets/step-samples/latch-hook.step
file: latch-hook.step
size_bytes: 146160
sha256: 46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32
length_unit: millimetre (1 unit = 1 mm)
solids: 2
[0] name='arm' volume_mm3=7399.070109 bbox_min_mm=(-9, -9, 0) bbox_max_mm=(59.74038765, 16.48747522, 8) valid=yes
[1] name='striker' volume_mm3=1812.395331 bbox_min_mm=(25.75551254, 19.96244136, -9) bbox_max_mm=(50.84893178, 44.3163196, 12) valid=yes
[exit 0]
The part names come from the labels in the STEP file. The sha256 line is the digest that goes into the sidecar. A file that declares another unit than millimetre is converted or refused, as docs/assembly-sidecar.md lists.
Write the sidecar
The sidecar is a YAML file that names the parts, pins each STEP file by its digest and declares one joint, one deviation and one requirement. This is assets/step-samples/latch-hook.assembly.yaml:
# SPDX-License-Identifier: EUPL-1.2
# Sidecar for assets/step-samples/latch-hook.step. Paths are relative to this file; each sha256
# pins the bytes of its STEP file. The joint, deviation and requirement match latch-hook.truth.json.
schema_version: 1
units: {length: mm, angle: deg}
parts:
- id: arm
step: {file: latch-hook.step, sha256: 46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32, solid: arm}
- id: striker
step: {file: latch-hook.step, sha256: 46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32, solid: striker}
# The arm swings about +Z through the origin, from 0 to 30 degrees.
joint:
id: pivot
type: revolute
fixed_part: striker
moving_part: arm
axis: [0, 0, 1]
origin_mm: [0, 0, 0]
range: [0, 30]
# The arm may sit up to 0.6 mm off its nominal place along +X.
deviation:
id: arm_offset
part: arm
direction: [1, 0, 0]
range_mm: [-0.6, 0.6]
requirement:
id: hook_clearance
type: minimum_clearance
parts: [arm, striker]
minimum_mm: 1.5
parts: one entry per solid.fileis relative to the sidecar,sha256is the digest frominspectandsolidis the name of the solid or its index.joint: the moving part turns (revolute, degrees) or slides (prismatic, millimetres) alongaxisthroughorigin_mm, insiderange.deviation: one part may sit off its nominal place by up torange_mmalongdirection. The deviation is one scalar, calleddeltabelow.requirement: the smallest allowed gap between two parts.
The values of the two sample sidecars come from assets/step-samples/latch-hook.truth.json and assets/step-samples/drawer-carriage.truth.json (docs/assembly-step-samples.md). For a file of your own, they come from your drawing and from inspect.
Validate the sidecar
validate loads the sidecar and its STEP files, checks every field and prints what it loaded. It measures nothing.
$ arena assembly validate assets/step-samples/latch-hook.assembly.yaml
assembly: latch-hook.assembly
source: sidecar latch-hook.assembly.yaml sha256 ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e
parts:
arm: file=latch-hook.step sha256=46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32 unit=millimetre
[0] name='arm' volume_mm3=7399.070109 bbox_min_mm=(-9, -9, 0) bbox_max_mm=(59.74038765, 16.48747522, 8) valid=yes
striker: file=latch-hook.step sha256=46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32 unit=millimetre
[1] name='striker' volume_mm3=1812.395331 bbox_min_mm=(25.75551254, 19.96244136, -9) bbox_max_mm=(50.84893178, 44.3163196, 12) valid=yes
joint: pivot revolute fixed_part=striker moving_part=arm axis=(0, 0, 1) origin_mm=(0, 0, 0) range=(0, 30) deg
deviation: arm_offset part=arm direction=(1, 0, 0) range=(-0.6, 0.6) mm
requirement: hook_clearance minimum_clearance arm striker minimum=1.5 mm
Nothing was measured: this command checks that the sidecar and its STEP files load, not a clearance, a pose or a requirement.
[exit 0]
Verify one pose
verify places the parts at one joint value --q and one deviation --delta-mm, asks the kernel for the minimum distance between the two parts of the requirement and compares it with the minimum. A negative value is written --delta-mm=-0.5. The exit status is 0 for satisfied, 1 for violated and 2 for anything that is not a verdict.
$ arena assembly verify --sidecar assets/step-samples/latch-hook.assembly.yaml --q 0.0 --delta-mm=0
ToleranceArena assembly clearance check: arm vs striker
assembly: latch-hook.assembly
source: sidecar latch-hook.assembly.yaml sha256 ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e
requirement: arm-striker gap >= 1.5 mm
joint_value_deg: 0.0
deviation_mm: 0.0
native_gap_mm: 6.09010177977191
reference_gap_mm: 6.09010177977191
reference_source: remeasure
abs_difference_mm: 0.0
threshold_mm: 1.5
oracle_tolerance_mm: 1e-05
ambiguity_band_mm: 1e-05
relation: separated
verdict: satisfied
reason_codes: none
native_error: none
native_detail: none
checked_pair: arm, striker
scope: Checked the pair arm/striker at this one pose only. Nothing else was checked: no other pairs, poses, deviations or assemblies.
[exit 0]
reference_source: remeasure says that the reference number is a repeat of the same query in a second, independent kernel process. The repeat catches an unstable placement. It does not catch an error that both queries share, such as a wrong sidecar or a wrong model.
At the start of its travel and at the nominal deviation the arm clears the striker. The truth file lists a pose that violates the requirement, at the upper end of the deviation range. A file of your own has no truth file, so the next two sections find such a pose without knowing it.
$ arena assembly verify --sidecar assets/step-samples/latch-hook.assembly.yaml --q 26.7 --delta-mm=0.6
ToleranceArena assembly clearance check: arm vs striker
assembly: latch-hook.assembly
source: sidecar latch-hook.assembly.yaml sha256 ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e
requirement: arm-striker gap >= 1.5 mm
joint_value_deg: 26.7
deviation_mm: 0.6
native_gap_mm: 1.2928815135572953
reference_gap_mm: 1.2928815135572953
reference_source: remeasure
abs_difference_mm: 0.0
threshold_mm: 1.5
oracle_tolerance_mm: 1e-05
ambiguity_band_mm: 1e-05
relation: separated
verdict: violated
reason_codes: clearance_below_minimum
native_error: none
native_detail: none
checked_pair: arm, striker
scope: Checked the pair arm/striker at this one pose only. Nothing else was checked: no other pairs, poses, deviations or assemblies.
[exit 1]
The truth file gives 1.293007 mm for this pose, from a sampler that does not call the kernel's distance query. The kernel gives the number above. The two agree to better than 0.02 mm, which the native test checks.
Sweep a grid
sweep checks every combination of the joint values and deviations that it is given. --four-point cuts the joint range into three equal parts and so checks both ends and two interior values.
$ arena assembly sweep --sidecar assets/step-samples/latch-hook.assembly.yaml --four-point --delta-values=0.6
ToleranceArena assembly clearance sweep: arm vs striker
assembly: latch-hook.assembly
source: sidecar latch-hook.assembly.yaml sha256 ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e
points_evaluated: 4
q_values_deg: 0.0, 10.0, 20.0, 30.0 (spacing: 10.0, 10.0, 10.0)
delta_values_mm: 0.6 (spacing: none)
violated: 0
indeterminate: 0
satisfied: 4
minimum_measured_distance_mm: 2.0000000000004996
threshold_mm: 1.5
campaign_conclusion: no_failure_found
checked_pair: arm, striker
scope: Sampled grid only: 4 points (4 q values x 1 deviations), joint spacing 10, 10, 10 deg, deviation spacing single deviation for the pair arm/striker. This says nothing about joint values or deviations between grid points, other pairs or any other assembly.
points:
q=0.0 delta_mm=0.6 verdict=satisfied native_gap_mm=6.098421366587351 reasons=-
q=10.0 delta_mm=0.6 verdict=satisfied native_gap_mm=4.999999999999999 reasons=-
q=20.0 delta_mm=0.6 verdict=satisfied native_gap_mm=3.8875322422006158 reasons=-
q=30.0 delta_mm=0.6 verdict=satisfied native_gap_mm=2.0000000000004996 reasons=-
[exit 0]
no_failure_found means that these four joint values held at this deviation and nothing more. The violation above lies between two of the sampled values, and this grid does not see it.
Search
search spends a budget of evaluations over the joint range and the deviation range with a seeded generator and measures every candidate. With --output it writes the ledger and, when it finds a violation, an evidence bundle.
$ arena assembly search --sidecar assets/step-samples/latch-hook.assembly.yaml --output runs/byos/latch-hook
ToleranceArena bounded search: arm vs striker
source: sidecar latch-hook.assembly.yaml sha256 ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e
strategy: seeded
seed: 42
budget: 100
status: exhausted
stop_reason: evaluation_budget
execution: completed
conclusion: failure_found
evaluations: 100
credits_spent: 100
native_queries: 100
rejected_requests: 0
retries: 0
cache_hits: 0
confirmation_queries: 3
polishing_evaluations: 0
latency_s: 27.996957
findings: 3
q=27.378835180344616 delta_mm=0.44462228380412017 native_gap_mm=1.4795862980201766 verdict=violated
q=26.361656334695528 delta_mm=0.3979986352334153 native_gap_mm=1.4955426910486542 verdict=violated
q=26.340287976121218 delta_mm=0.536339334357593 native_gap_mm=1.3640300979238842 verdict=violated
checked_pair: arm, striker
scope: Bounded search only: 98 candidate scenarios proposed by seeded (seed 42) with 100 of 100 evaluation credits for the pair arm/striker. This says nothing about scenarios between or beyond the evaluated points, other occurrence pairs, or any assembly.
bundle: runs/byos/latch-hook
[exit 1]
Each line under findings is a pose that the kernel measured below the requirement and measured again to confirm. The bundle runs/byos/latch-hook holds the files that docs/assembly-sidecar.md lists, among them the provenance, which records the digest of the sidecar and of each STEP file. A search that finds nothing says nothing about the poses that it did not sample.
Replay
replay reads the bundle, checks the digests of the sidecar and of the STEP files against the record, opens the assembly again and measures the stored pose once more. It needs no key and no network.
$ arena assembly replay runs/byos/latch-hook
ToleranceArena assembly replay: latch-hook.assembly
replay: match
reason: match
stored_verdict: violated
replayed_verdict: violated
verdict_match: true
stored_distance_mm: 1.3640300979238842
replayed_distance_mm: 1.3640300979238842
distance_difference_mm: 0.0
distance_tolerance_mm: 1e-05
numerical_match: true
reference_source: remeasure
checked_pair: arm, striker
scope: Replayed the stored scenario for the pair arm/striker only. Nothing else was checked: no other pairs, poses, deviations or assemblies.
[exit 1]
A matching replay of a violated pose exits 1. The exit status carries the verdict, and replay: match says that the stored and the replayed numbers agree.
Report
report renders the bundle as one page. --format html --output FILE writes an HTML file instead. These are the lines of the Markdown page that carry the numbers:
$ arena assembly report runs/byos/latch-hook
# Assembly clearance report: arm vs striker
[...]
- scenario joint value \(deg\): 26.340287976121218
- scenario deviation \(mm\): 0.536339334357593
[...]
- measured distance \(mm\): 1.3640300979238842
[...]
- reference source: remeasure
[...]
- verdict: violated
[...]
- sidecar path: assets/step-samples/latch-hook.assembly.yaml
- sidecar sha256: ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e
- STEP file of part arm: latch-hook.step
- STEP sha256 of part arm: 46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32
- STEP file of part striker: latch-hook.step
- STEP sha256 of part striker: 46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32
[...]
[exit 0]
Look at the pose
export-meshes writes one glTF file per part at one pose, with a manifest that holds the joint value, the deviation, the requirement and the measured gap. The viewer in web/ reads that manifest (docs/assembly-viewer.md). The pose below is the lowest finding of the search.
$ arena assembly export-meshes --sidecar assets/step-samples/latch-hook.assembly.yaml --q 26.340287976121218 --delta-mm=0.536339334357593 --output runs/byos/latch-hook-pose
assembly: latch-hook.assembly
built from: sidecar latch-hook.assembly.yaml
source: sidecar latch-hook.assembly.yaml sha256 ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e
pose: q=26.34028798 deg delta_mm=0.5363393344
measured_gap_mm: 1.364030098
requirement: hook_clearance minimum_clearance arm striker minimum=1.5 mm
unit: mm; view unit: m, +Y up
cad_to_view: 0.001 * (x, z, -y), one 4 by 4 matrix in the manifest
wrote runs/byos/latch-hook-pose/arm.glb sha256=db0a691beb1dd10ec4d596fcaed4c363b46c0996902c8f117c4522e1910f42be
wrote runs/byos/latch-hook-pose/striker.glb sha256=48efcb7c895abc581b9d74cab93b8211c537fbec456980a38f06112ade8e1d2b
wrote runs/byos/latch-hook-pose/manifest.json
The gap is measured at this pose only: no verdict was computed and no other pose was measured.
[exit 0]
The walk on drawer-carriage
assets/step-samples/drawer-carriage.step holds carriage and bracket. The carriage slides along +X towards the bracket (a prismatic joint, in millimetres). The deviation moves the bracket along Y. The sidecar is assets/step-samples/drawer-carriage.assembly.yaml, and the commands are the same ones.
$ arena assembly inspect assets/step-samples/drawer-carriage.step
file: drawer-carriage.step
size_bytes: 250428
sha256: 14702f7dd79557461cf88b8b3fe0f84f85878eec5fb05643f3ad82f11709bed2
length_unit: millimetre (1 unit = 1 mm)
solids: 2
[0] name='carriage' volume_mm3=7115.591874 bbox_min_mm=(-4.440892099e-16, -12, 0) bbox_max_mm=(40, 18, 10) valid=yes
[1] name='bracket' volume_mm3=13663.31019 bbox_min_mm=(38, -16, -10) bbox_max_mm=(86, 30, 14) valid=yes
[exit 0]
$ arena assembly validate assets/step-samples/drawer-carriage.assembly.yaml
assembly: drawer-carriage.assembly
source: sidecar drawer-carriage.assembly.yaml sha256 a46a9bad4dbf602033ed4b5492ee7cff5959aae76626539e1c5910a9cf7107a2
[...]
carriage: file=drawer-carriage.step sha256=14702f7dd79557461cf88b8b3fe0f84f85878eec5fb05643f3ad82f11709bed2 unit=millimetre
[...]
bracket: file=drawer-carriage.step sha256=14702f7dd79557461cf88b8b3fe0f84f85878eec5fb05643f3ad82f11709bed2 unit=millimetre
[...]
joint: slide prismatic fixed_part=bracket moving_part=carriage axis=(1, 0, 0) origin_mm=(0, 0, 0) range=(0, 30) mm
deviation: bracket_offset part=bracket direction=(0, 1, 0) range=(-0.5, 0.5) mm
requirement: post_clearance minimum_clearance carriage bracket minimum=1.5 mm
[...]
[exit 0]
At the start of the travel the gap is large.
$ arena assembly verify --sidecar assets/step-samples/drawer-carriage.assembly.yaml --q 0.0 --delta-mm=0
[...]
joint_value_mm: 0.0
deviation_mm: 0.0
native_gap_mm: 6.0
[...]
reference_source: remeasure
[...]
verdict: satisfied
[...]
scope: Checked the pair carriage/bracket at this one pose only. Nothing else was checked: no other pairs, poses, deviations or assemblies.
[exit 0]
The truth file lists the pose at the end of the deviation range, half way along the stroke, as a violation.
$ arena assembly verify --sidecar assets/step-samples/drawer-carriage.assembly.yaml --q 15.0 --delta-mm=-0.5
[...]
joint_value_mm: 15.0
deviation_mm: -0.5
native_gap_mm: 1.1999999999999993
[...]
reference_source: remeasure
[...]
verdict: violated
reason_codes: clearance_below_minimum
[...]
[exit 1]
The truth file gives 1.201089 mm for this pose, and the kernel gives the number above.
$ arena assembly sweep --sidecar assets/step-samples/drawer-carriage.assembly.yaml --four-point --delta-values=-0.5
[...]
points_evaluated: 4
q_values_mm: 0.0, 10.0, 20.0, 30.0 (spacing: 10.0, 10.0, 10.0)
delta_values_mm: -0.5 (spacing: none)
violated: 0
[...]
satisfied: 4
minimum_measured_distance_mm: 2.0
[...]
campaign_conclusion: no_failure_found
[...]
q=0.0 delta_mm=-0.5 verdict=satisfied native_gap_mm=6.0 reasons=-
q=10.0 delta_mm=-0.5 verdict=satisfied native_gap_mm=2.6717096496837867 reasons=-
q=20.0 delta_mm=-0.5 verdict=satisfied native_gap_mm=2.671709649683791 reasons=-
q=30.0 delta_mm=-0.5 verdict=satisfied native_gap_mm=2.0 reasons=-
[exit 0]
The four joint values at this deviation read at least 2 mm. The violation lies between them.
$ arena assembly search --sidecar assets/step-samples/drawer-carriage.assembly.yaml --output runs/byos/drawer-carriage
[...]
seed: 42
budget: 100
[...]
conclusion: failure_found
[...]
credits_spent: 100
native_queries: 100
[...]
confirmation_queries: 3
[...]
findings: 3
q=15.0 delta_mm=-0.5 native_gap_mm=1.1999999999999993 verdict=violated
q=12.657654590558113 delta_mm=-0.47020278056192966 native_gap_mm=1.4165915973623222 verdict=violated
q=15.01758339150895 delta_mm=-0.32134811946986863 native_gap_mm=1.378651880530132 verdict=violated
[...]
bundle: runs/byos/drawer-carriage
[exit 1]
$ arena assembly replay runs/byos/drawer-carriage
[...]
replay: match
[...]
stored_verdict: violated
replayed_verdict: violated
[...]
stored_distance_mm: 1.1999999999999993
replayed_distance_mm: 1.1999999999999993
[...]
numerical_match: true
reference_source: remeasure
[...]
[exit 1]
$ arena assembly report runs/byos/drawer-carriage
# Assembly clearance report: carriage vs bracket
[...]
- scenario joint value \(mm\): 15
- scenario deviation \(mm\): -0.5
[...]
- measured distance \(mm\): 1.1999999999999993
[...]
- verdict: violated
[...]
- sidecar path: assets/step-samples/drawer-carriage.assembly.yaml
- sidecar sha256: a46a9bad4dbf602033ed4b5492ee7cff5959aae76626539e1c5910a9cf7107a2
[...]
[exit 0]
$ arena assembly export-meshes --sidecar assets/step-samples/drawer-carriage.assembly.yaml --q 15.0 --delta-mm=-0.5 --output runs/byos/drawer-carriage-pose
[...]
pose: q=15 mm delta_mm=-0.5
measured_gap_mm: 1.2
[...]
wrote runs/byos/drawer-carriage-pose/carriage.glb sha256=7a1dedf82b84a1842d202e0944ee03a389b43f5754b3e0504806cd112e747dac
wrote runs/byos/drawer-carriage-pose/bracket.glb sha256=59af8f4704aa47101a7e2244259d46528f75c2643bed71ece2c7df06de564674
wrote runs/byos/drawer-carriage-pose/manifest.json
[...]
[exit 0]
What you cannot do
The tool checks one pair of solids, one joint and one deviation. The limits below come from the code or from a run on this page:
- One joint. A sidecar declares one
joint, revolute or prismatic. A second joint, a chain of joints, a ball joint or a joint with a coupled motion cannot be expressed.docs/assembly-sidecar.mdlists a repeated or unknown key as a refusal. - One scalar deviation. A sidecar declares one
deviation: one part, one direction, one range. A tolerance stack of several features and a rotation of a part cannot be expressed. - One checked pair. A requirement is a minimum clearance between two named parts. The tool measures that pair and nothing else (
src/tolerance_arena/assembly/measure.py). A sidecar may list more parts, and the other parts are loaded and checked for validity, but no other pair is measured. Every printedscope:line says so. - Solids only. A part is one solid of a STEP file, chosen by name or index. The importer lists the solids of a file, and a file that holds none is refused.
- No nested assembly transforms. The importer does not apply the placement of a nested sub-assembly. The section below shows it on a file written by the build123d kernel.
- No datums and no form tolerances. The sidecar has no key for a datum, a flatness, a position or a profile tolerance, and it reads none from the STEP file. The requirement is a minimum distance and nothing else.
- The joint comes from the sidecar. The tool reads no mate, joint or constraint from the STEP file. A joint that the sidecar gets wrong is measured as written.
- A finite sample.
sweepandsearchmeasure the poses they are given or propose.no_failure_foundis a statement about those poses. - The reference shares the model. For a sidecar assembly the second number is a repeat in a second kernel process. A wrong sidecar, a wrong solid or a loader error gives the same wrong number twice.
- Not a certification. A result is a kernel measurement of one gap at the poses checked. It does not certify a design, a fit or a standard.
A nested placement is not applied
A STEP assembly can place a solid inside a sub-assembly and give the sub-assembly a transform. The importer reads each solid without the placement of the sub-assemblies that contain it. This script writes a file with one solid inside a sub-assembly that sits at x = 100, and then reads it back with the build123d reader:
from pathlib import Path
from build123d import Box, Compound, Location, export_step, import_step
Path("runs/byos").mkdir(parents=True, exist_ok=True)
inner = Box(10, 10, 10)
inner.label = "inner"
sub = Compound(children=[inner], label="sub")
sub.location = Location((100, 0, 0))
export_step(Compound(children=[sub], label="top"), "runs/byos/nested.step", timestamp="2026-01-01T00:00:00")
box = import_step("runs/byos/nested.step").bounding_box()
print(f"build123d import_step, x from {box.min.X:g} to {box.max.X:g}")
$ python nested.py
build123d import_step, x from 95 to 105
[exit 0]
The kernel's reader places the solid at x from 95 to 105. inspect lists the same solid at x from -5 to 5:
$ arena assembly inspect runs/byos/nested.step
file: nested.step
size_bytes: 18422
sha256: 1c22afb9c1f7ac7eea3d3134f39ecea129f4f600c9cd40ddaf4839e4e3e31a4d
length_unit: millimetre (1 unit = 1 mm)
solids: 1
[0] name='inner' volume_mm3=1000 bbox_min_mm=(-5, -5, -5) bbox_max_mm=(5, 5, 5) valid=yes
[exit 0]
The command exits 0 and prints no warning. The sidecar loader reads STEP files through the same importer (step_import.read_step), and this page did not run a sidecar over this file. Compare the bounding boxes that inspect prints with your CAD system before you trust a measurement. The test test_a_solid_inside_a_placed_sub_assembly_is_listed_without_its_placement in tests/assembly/test_bring_your_own_step_native.py pins this behavior, and it changes together with this section if the importer starts to apply the placement. The two samples are not affected: inspect lists their solids with the bounding boxes of their truth files, which test_inspect_lists_each_sample_solid_with_the_box_of_its_truth_file checks. The page makes no claim about how other CAD systems write their files.
What the tool refuses
A refusal exits 2, prints one line on standard error and measures nothing. These runs use copies of the latch-hook sidecar in runs/byos/refusals/, so the committed files stay as they are.
mkdir -p runs/byos/refusals
cp assets/step-samples/latch-hook.step runs/byos/refusals/
SRC=assets/step-samples/latch-hook.assembly.yaml
DIR=runs/byos/refusals
sed 's/sha256: 46faa42d/sha256: 00000000/' $SRC > $DIR/bad-hash.assembly.yaml
sed 's/solid: striker/solid: gear/' $SRC > $DIR/bad-solid.assembly.yaml
cp $SRC $DIR/datums.assembly.yaml && echo 'datums: []' >> $DIR/datums.assembly.yaml
sed 's/type: minimum_clearance/type: flatness/' $SRC > $DIR/flatness.assembly.yaml
sed 's/parts: \[arm, striker\]/parts: [arm, striker, striker]/' $SRC > $DIR/three-parts.assembly.yaml
cp $SRC $DIR/edited.assembly.yaml && echo '# edited' >> $DIR/edited.assembly.yaml
A pinned digest that does not match the file:
$ arena assembly validate runs/byos/refusals/bad-hash.assembly.yaml
refused: parts[0].step.sha256: does not match the file: the sidecar pins 00000000462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32, the file hashes to 46faa42d462b724ae395785864ce5cf45f748a47ba60731a8cd60b53c6e9ca32
[exit 2]
A part that names a solid the file does not hold. The message lists the names that it does hold:
$ arena assembly validate runs/byos/refusals/bad-solid.assembly.yaml
refused: parts[1].step.solid: the file has no solid named 'gear'; its names are 'arm', 'striker'
[exit 2]
A key that the schema does not have, here datums:
$ arena assembly validate runs/byos/refusals/datums.assembly.yaml
refused: datums: unknown key; the allowed keys are schema_version, units, parts, joint, deviation, requirement
[exit 2]
A requirement that is not a minimum clearance. A form tolerance cannot be written:
$ arena assembly validate runs/byos/refusals/flatness.assembly.yaml
refused: requirement.type: must be one of ('minimum_clearance',), got 'flatness'
[exit 2]
A requirement of more than two parts:
$ arena assembly validate runs/byos/refusals/three-parts.assembly.yaml
refused: requirement.parts: must name two parts, got ['arm', 'striker', 'striker']
[exit 2]
A joint value outside the declared range. The tool does not clamp it:
$ arena assembly verify --sidecar assets/step-samples/latch-hook.assembly.yaml --q 45 --delta-mm=0
invalid input: joint value 45 deg is outside the declared range 0 to 30 deg
[exit 2]
A sweep with no grid:
$ arena assembly sweep --sidecar assets/step-samples/latch-hook.assembly.yaml
invalid input: give --q-values or --four-point, not both and not neither
[exit 2]
A replay against a sidecar that changed after the search. --sidecar names the edited copy, and the bundle records the digest of the original:
$ arena assembly replay runs/byos/latch-hook --sidecar runs/byos/refusals/edited.assembly.yaml
invalid bundle: sidecar edited.assembly.yaml changed: recorded sha256 ecfba2808771f3d638e7fde19cf8340f240f6f9feaf88d1f26d39567eeadd77e, current fe61bc62e5005d306240c8a416fd0fd3ed1eba53e9ac6f362482473b5bf84107
[exit 2]
The loader also refuses a sidecar of more than 1 MiB, a symbolic link, an absolute or parent path, a file of more than 50,000,000 bytes, more than 16 parts, a boolean or non-finite number, a unit it does not know and a STEP file that declares no unit or two units. docs/assembly-sidecar.md lists each refusal and the field it names. This page ran none of those.
Limits of this page
- It ran two mechanisms written by the build123d kernel, one joint each. The values on this page are those of the two runs, and they carry no claim about a mechanism of your own.
- The STEP importer parses the file in the calling process. A crafted file can crash or stall the kernel (
docs/assembly-sidecar.md). - The sample sidecars are written by hand.
scripts/make_step_samples.pydoes not write them, and a test compares each one with its truth file and the bytes of its STEP file.