Verification
Editable distance between attached components
Attachment gap remains an editable native relationship parameter
What this verifies
A Block is attached to a Base with a symbolic gap so editing the saved SolidCraft design moves the attached component without rerunning Python.
scpf source
Complete primary source from the site branch; built revision below.
class Base:
def build(self):
return Box(40, 30, 10, anchor=Anchor.BOTTOM)
class Block:
def build(self):
return Box(20, 20, 10, anchor=Anchor.BOTTOM)
class ParametricAttach:
gap = 10.0
def build(self):
base = Base()
block = Block().attach(
base,
parent=Anchor.RIGHT,
child=Anchor.LEFT,
gap=self.gap,
)
return base + block
ParametricAttach()
Engineering explanation
Editable distance between attached components
Documentation provenance: the engineering text below is copied verbatim from the last canonical
qualification/cases.pysource before its removal, commitbe40b09e7454a90e87d83768a9e7453c52ba5d76. Machine verification lives inverification/solidcraft.py.
Legacy group: associativity
Saved-design required: true
Goal
Verify that distance along the attachment normal remains a native editable joint parameter.
Forge API
attach(…, gap=self.gap)
Forge model
Rigid Attachment with a symbolic gap expression; anchor identities are unchanged.
How Forge builds it in SolidCraft
The child receives a symbolic seed pose so a floating graph starts at the authored mating position; joint.create(type=‘rigid’, offset=‘gap’) remains the relationship and the gap remains a native expression in both places rather than a flattened number.
SolidCraft result
The child sits 10 mm away from the parent’s RIGHT face along the joint normal.
Saved-design test
Change gap from 10 to 30 mm in the saved .sc design; the child must move another 20 mm without rerunning Python.
Geometry evidence
Geometry-rationale provenance: copied verbatim from
qualification/geometry_contracts.pyat commitbe40b09e7454a90e87d83768a9e7453c52ba5d76.
Bounds sufficient: true
The two rectangular body bounds describe the baseline gap geometry. Saved joint recompute is proved separately by saved-design.
Reference notes
- BOSL2 — Conceptually similar to an attachment displacement along the local anchor normal rather than a world-axis translate.
Generated command sequence — scpf (10)
component.create{ "bind": { "$base": "occurrence" }, "command": "component.create", "params": { "grounded": true, "name": "Base" } }solid.box{ "command": "solid.box", "params": { "body_name": "Base", "corner": [ -20.0, -15.0, 0 ], "height": 10, "length": 40, "width": 30 } }component.activate{ "command": "component.activate", "params": { "component": "root" } }component.create{ "bind": { "$block": "occurrence" }, "command": "component.create", "params": { "grounded": false, "name": "Block" } }solid.box{ "command": "solid.box", "params": { "body_name": "Block", "corner": [ -10.0, -10.0, 0 ], "height": 10, "length": 20, "width": 20 } }component.activate{ "command": "component.activate", "params": { "component": "root" } }parameters.add{ "command": "parameters.add", "params": { "expression": "10 mm", "name": "gap" } }occurrence.move{ "command": "occurrence.move", "params": { "occurrence": "$block", "translate": [ "(gap + 20 mm) - -10 mm", 0, 0.0 ] } }joint.create{ "command": "joint.create", "params": { "a": { "face": [ 20.0, 0.0, 5.0 ], "occurrence": "$base" }, "b": { "face": [ 30.0, 0.0, 5.0 ], "occurrence": "$block" }, "name": "Attach Block to Base", "offset": "gap", "type": "rigid" } }browser.visibility{ "command": "browser.visibility", "params": { "folder": "joints", "visible": false } }
Reference code
cadquery source · pass
"""CadQuery reference for a right-side placement separated by a gap."""
import cadquery as cq
gap = 10.0
base_width = 40.0
child_width = 20.0
base = cq.Solid.makeBox(40, 30, 10, cq.Vector(-20, -15, 0))
block = cq.Solid.makeBox(20, 20, 10, cq.Vector(-10, -10, 0))
model = cq.Assembly()
model.add(base, name="base")
model.add(
block,
name="block",
loc=cq.Location((base_width / 2 + child_width / 2 + gap, 0, 0)),
)
build123d source · pass
"""build123d reference: a block attached to the right with a gap."""
from build123d import Align, Box, BuildPart, Locations
gap, base_width, child_width = 10.0, 40.0, 20.0
bottom = (Align.CENTER, Align.CENTER, Align.MIN)
with BuildPart() as model:
Box(base_width, 30, 10, align=bottom)
with Locations((base_width / 2 + child_width / 2 + gap, 0, 0)):
Box(child_width, 20, 10, align=bottom)
pythonscad source · pass
"""PythonSCAD geometry reference for a right-side attachment with a 10 mm gap."""
from pythonscad import *
gap = 10.0
base = cube([40, 30, 10], center=True).up(5)
block = cube([20, 20, 10], center=True).up(5).right(30 + gap)
model = base | block
pybosl2 source · pass
"""pyBOSL2 anchor reference for a right-side attachment with a gap.
pyBOSL2 calls the signed face separation overlap; a negative overlap is a gap.
Forge additionally qualifies saved SolidCraft parameter mutation of this value.
"""
from pybosl2 import Anchor, cuboid
gap = 10.0
base = cuboid([40, 30, 10]).up(5)
block = cuboid([20, 20, 10]).up(5)
model = base.attach(
Anchor.RIGHT,
block,
child_anchor=Anchor.LEFT,
overlap=-gap,
).realize()
Current visual verification — scpf
Each model-owned view is evaluated independently. Actual is the current native result; Goal is the declared expected profile; Overlay combines both; Diff compares the approved regression baseline.
front
passRegression: pass · expected shape: pass
right
passRegression: pass · expected shape: pass
iso
passRegression: pass · expected shape: pass
Image overview





Only images present in the published build are displayed. Presentation previews are not visual verification results.
Verification checks
scpf — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 50 × 15 × 10 | 50 × 15 × 10 | pass |
| Bounds / min | -20 × -15 × 0 | -20 × -15 × 0 | pass |
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Body envelopes / count | 2 | 2 | pass |
| Body 1 / min [mm] | -20 × -15 × 0 | -20 × -15 × 0 | — |
| Body 1 / max [mm] | 20 × 15 × 10 | 20 × 15 × 10 | — |
| Body 2 / min [mm] | 30 × -10 × 0 | 30 × -10 × 0 | — |
| Body 2 / max [mm] | 50 × 10 × 10 | 50 × 10 × 10 | — |
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Body envelopes / count | 2 | 2 | pass |
| Body 1 / min [mm] | -20 × -15 × 0 | -20 × -15 × 0 | — |
| Body 1 / max [mm] | 20 × 15 × 10 | 20 × 15 × 10 | — |
| Body 2 / min [mm] | 50 × -10 × 0 | 50 × -10 × 0 | — |
| Body 2 / max [mm] | 70 × 10 × 10 | 70 × 10 × 10 | — |
cadquery — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 50 × 15 × 10 | 50 × 15 × 10 | pass |
| Bounds / min | -20 × -15 × 0 | -20 × -15 × 0 | pass |
build123d — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 50 × 15 × 10 | 50 × 15 × 10 | pass |
| Bounds / min | -20 × -15 × 0 | -20 × -15 × 0 | pass |
pythonscad — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 50 × 15 × 10 | 50 × 15 × 10 | pass |
| Bounds / min | -20 × -15 × 0 | -20 × -15 × 0 | pass |
pybosl2 — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 50 × 15 × 10 | 50 × 15 × 10 | pass |
| Bounds / min | -20 × -15 × 0 | -20 × -15 × 0 | pass |
Model stages
- Create Base and Block components
- Attach Block with a symbolic normal gap
- Preserve gap as an editable native relationship value
Build and verification
- Primary implementation:
scpf - Build source:
1dead221b9ea2c31901da9a19a8c205d25272ec3 - Durable scope:
main
Implementations
- build123d — builder-build123d: build=pass, verification=pass · STL · Preview · verification · result
geometry: status=pass, adapter=mesh-geometry, runtime=ghcr.io/brainboxemb/cad-reference:v0.3.6 · verification
- cadquery — builder-cadquery: build=pass, verification=pass · STL · Preview · verification · result
geometry: status=pass, adapter=mesh-geometry, runtime=ghcr.io/brainboxemb/cad-reference:v0.3.6 · verification
- pybosl2 — builder-pybosl2: build=pass, verification=pass · STL · Preview · verification · result
geometry: status=pass, adapter=mesh-geometry, runtime=ghcr.io/brainboxemb/cad-reference:v0.3.6 · verification
- pythonscad — builder-pythonscad: build=pass, verification=pass · STL · Preview · verification · result
geometry: status=pass, adapter=mesh-geometry, runtime=ghcr.io/brainboxemb/cad-reference:v0.3.6 · verification
- scpf — builder-scpf: build=pass, verification=pass · STL · SC · Preview · commands · verification · result
geometry: status=pass, adapter=mesh-geometry, runtime=ghcr.io/brainboxemb/cad-reference:v0.3.6 · verificationnative: status=pass, adapter=solidcraft-model, runtime=ghcr.io/brainboxemb/cad-solidcraft:v0.3.6 · verificationvisual: status=pass, adapter=solidcraft-visual, runtime=ghcr.io/brainboxemb/cad-solidcraft:v0.3.6 · verification
scpf
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
50.0,
15.0,
10.0
],
"actual_min": [
-20.0,
-15.0,
0.0
],
"expected_max": [
50.0,
15.0,
10.0
],
"expected_min": [
-20.0,
-15.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parametric-attach/scpf/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parametric-attach-scpf-geometry"
}native — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [
{
"kind": "file",
"path": "baseline/measurements.json",
"sha256": "c6763233246a87bd474216409f479272257ffc4a47ebee101368c4cd9ed865cf",
"size": 2340
}
],
"error": null,
"evidence": {
"body_envelopes": {
"actual_count": 2,
"expected_count": 2,
"kind": "body_envelopes",
"matched_pairs": [
{
"actual": {
"label": "Base",
"max": [
20.0,
15.0,
10.0
],
"min": [
-20.0,
-15.0,
0.0
]
},
"expected": {
"label": null,
"max": [
20.0,
15.0,
10.0
],
"min": [
-20.0,
-15.0,
0.0
]
},
"max_delta": 0.0
},
{
"actual": {
"label": "Block",
"max": [
50.0,
10.0,
10.0
],
"min": [
30.0,
-10.0,
0.0
]
},
"expected": {
"label": null,
"max": [
50.0,
10.0,
10.0
],
"min": [
30.0,
-10.0,
0.0
]
},
"max_delta": 0.0
}
],
"pass": true,
"tolerance": 0.001,
"unmatched_actual": [],
"unmatched_expected": []
},
"named_bodies": [
{
"body_name": "Base",
"bounds": {
"actual_max": [
20.0,
15.0,
10.0
],
"actual_min": [
-20.0,
-15.0,
0.0
],
"deltas": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"expected_max": [
20.0,
15.0,
10.0
],
"expected_min": [
-20.0,
-15.0,
0.0
],
"kind": "bounds",
"label": "Base bounds",
"max_delta": 0.0,
"pass": true,
"tolerance": 0.001
},
"name_prefix": "Base"
},
{
"body_name": "Block",
"bounds": {
"actual_max": [
50.0,
10.0,
10.0
],
"actual_min": [
30.0,
-10.0,
0.0
],
"deltas": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"expected_max": [
50.0,
10.0,
10.0
],
"expected_min": [
30.0,
-10.0,
0.0
],
"kind": "bounds",
"label": "Block bounds",
"max_delta": 0.0,
"pass": true,
"tolerance": 0.001
},
"name_prefix": "Block"
}
]
},
"id": "baseline",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "saved_designs/gap_30/model.sc",
"sha256": "860832aae2d9656663a0e7bf6ac1abc58f31a753bf454eb13be23359a704fe1d",
"size": 6408
},
{
"kind": "file",
"path": "saved_designs/gap_30/measurements.json",
"sha256": "ed7eafcd0b878f698ceaeaadd3e0e578275a45ec3e65e502d13e2a7bd2c73c83",
"size": 2340
}
],
"error": null,
"evidence": {
"body_envelopes": {
"actual_count": 2,
"expected_count": 2,
"kind": "body_envelopes",
"matched_pairs": [
{
"actual": {
"label": "Base",
"max": [
20.0,
15.0,
10.0
],
"min": [
-20.0,
-15.0,
0.0
]
},
"expected": {
"label": null,
"max": [
20.0,
15.0,
10.0
],
"min": [
-20.0,
-15.0,
0.0
]
},
"max_delta": 0.0
},
{
"actual": {
"label": "Block",
"max": [
70.0,
10.0,
10.0
],
"min": [
50.0,
-10.0,
0.0
]
},
"expected": {
"label": null,
"max": [
70.0,
10.0,
10.0
],
"min": [
50.0,
-10.0,
0.0
]
},
"max_delta": 0.0
}
],
"pass": true,
"tolerance": 0.001,
"unmatched_actual": [],
"unmatched_expected": []
},
"named_bodies": [
{
"body_name": "Block",
"bounds": {
"actual_max": [
70.0,
10.0,
10.0
],
"actual_min": [
50.0,
-10.0,
0.0
],
"deltas": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"expected_max": [
70.0,
10.0,
10.0
],
"expected_min": [
50.0,
-10.0,
0.0
],
"kind": "bounds",
"label": "Block bounds",
"max_delta": 0.0,
"pass": true,
"tolerance": 0.001
},
"name_prefix": "Block"
}
]
},
"id": "saved_design_gap_30",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parametric-attach/scpf/model.sc",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parametric-attach"
}visual — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [
{
"kind": "file",
"path": "visual/front/camera.json",
"sha256": "356584b7996ffecb674d1a7550c8430b70952d79d1936e23df3ac27d2db592a6",
"size": 129
},
{
"kind": "file",
"path": "visual/front/actual.png",
"sha256": "1d54b637a4be2f16f6cc35c09d59c4fbe662fabb504b6fbb43759966f3021478",
"size": 9680
},
{
"kind": "file",
"path": "visual/front/goal.png",
"sha256": "029d10d7b17904f45b867a46f1e19db37fec16b5cc7034e5d47b450a2d93f44e",
"size": 1992
},
{
"kind": "file",
"path": "visual/front/overlay.png",
"sha256": "1d3d8b8128a827c230b1b0fef11365ed014a2ccc94eb4dd6258ebed8a136e531",
"size": 2800
},
{
"kind": "file",
"path": "visual/front/diff.png",
"sha256": "f2cae148275bd26c6543fcaf83baeb001fd0937fa09cb1ce055d37712fe63856",
"size": 670
}
],
"error": null,
"evidence": {
"actual_image": "visual/front/actual.png",
"baseline": "baselines/front.json",
"baseline_status": "pass",
"camera": "visual/front/camera.json",
"diff_image": "visual/front/diff.png",
"expected_shape_required": true,
"expected_shape_status": "pass",
"goal_image": "visual/front/goal.png",
"overlay_image": "visual/front/overlay.png",
"regression": {
"changed_pixel_fraction": 0.0,
"changed_pixel_threshold": 12,
"max_changed_fraction": 0.08,
"max_mean_difference": 6.0,
"mean_absolute_difference": 0.002315,
"pass": true
},
"regression_required": true,
"view": "front"
},
"id": "front",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "visual/right/camera.json",
"sha256": "88d44b8e72817edf2eb80f849628658d5c5d3802021b678d3fb0940f2c736931",
"size": 145
},
{
"kind": "file",
"path": "visual/right/actual.png",
"sha256": "0282d68a26962a7db5ef012a30792355096365625322cbed3daa86f457368ff5",
"size": 9539
},
{
"kind": "file",
"path": "visual/right/goal.png",
"sha256": "62ba36fae850a3604ce0a376d52ea325fd594a3bd75b672bf29bbfc646590997",
"size": 1998
},
{
"kind": "file",
"path": "visual/right/overlay.png",
"sha256": "782440d8d5777668cbf6152d725a3f6643b1e0891158a4309aaecd519b2976e0",
"size": 2706
},
{
"kind": "file",
"path": "visual/right/diff.png",
"sha256": "1b620bf55a18353707b897d18fcec2e3ae0307ba5304e3ebab900d2ef592ffb4",
"size": 509
}
],
"error": null,
"evidence": {
"actual_image": "visual/right/actual.png",
"baseline": "baselines/right.json",
"baseline_status": "pass",
"camera": "visual/right/camera.json",
"diff_image": "visual/right/diff.png",
"expected_shape_required": true,
"expected_shape_status": "pass",
"goal_image": "visual/right/goal.png",
"overlay_image": "visual/right/overlay.png",
"regression": {
"changed_pixel_fraction": 0.0,
"changed_pixel_threshold": 12,
"max_changed_fraction": 0.08,
"max_mean_difference": 6.0,
"mean_absolute_difference": 0.0,
"pass": true
},
"regression_required": true,
"view": "right"
},
"id": "right",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "visual/iso/camera.json",
"sha256": "e3cf71f910e539c0e0044817cd35f651c803d1b4ec86b9d6e4c979ada90a7edf",
"size": 160
},
{
"kind": "file",
"path": "visual/iso/actual.png",
"sha256": "2ce3a6f00f4274388532e5e3da808e68adcb9020b692549a71c8fb04f72b2765",
"size": 30234
},
{
"kind": "file",
"path": "visual/iso/goal.png",
"sha256": "09f2b30733ec7d24dd069293582c40fd31ee28028e50bda461f8c74e4f5b5e58",
"size": 4027
},
{
"kind": "file",
"path": "visual/iso/overlay.png",
"sha256": "1e562ae8a18f9301ee962e05f9717c005aaf2e48d1021dfa0077ae24185619c3",
"size": 18953
},
{
"kind": "file",
"path": "visual/iso/diff.png",
"sha256": "7d3f4f8466ce57defa4fee7ca6702cd08510f141bdff4f360a43c7d7935221bf",
"size": 2495
}
],
"error": null,
"evidence": {
"actual_image": "visual/iso/actual.png",
"baseline": "baselines/iso.json",
"baseline_status": "pass",
"camera": "visual/iso/camera.json",
"diff_image": "visual/iso/diff.png",
"expected_shape_required": true,
"expected_shape_status": "pass",
"goal_image": "visual/iso/goal.png",
"overlay_image": "visual/iso/overlay.png",
"regression": {
"changed_pixel_fraction": 0.0,
"changed_pixel_threshold": 12,
"max_changed_fraction": 0.08,
"max_mean_difference": 6.0,
"mean_absolute_difference": 0.001736,
"pass": true
},
"regression_required": true,
"view": "iso"
},
"id": "iso",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parametric-attach/scpf/model.sc",
"metadata": {
"baseline_provenance": {
"approval": "approved",
"historical_manifest_solidcraft_version": "0.30.1",
"migrated_from": "qualification/visual_baselines.json",
"migrated_without_reencoding": true,
"source_commit": "8acad149cdaaef729c2cd6f6929b9c73bf785ec8",
"verified_during_solidcraft_0_42_0_qualification": true
},
"kind": "solidcraft-visual",
"measurements": "measurements.json",
"visual_report": "visual.json"
},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parametric-attach-scpf-visual"
}cadquery
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
50.0,
15.0,
10.0
],
"actual_min": [
-20.0,
-15.0,
0.0
],
"expected_max": [
50.0,
15.0,
10.0
],
"expected_min": [
-20.0,
-15.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parametric-attach/cadquery/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parametric-attach-cadquery-geometry"
}build123d
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
50.0,
15.0,
10.0
],
"actual_min": [
-20.0,
-15.0,
0.0
],
"expected_max": [
50.0,
15.0,
10.0
],
"expected_min": [
-20.0,
-15.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parametric-attach/build123d/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parametric-attach-build123d-geometry"
}pythonscad
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
50.0,
15.0,
10.0
],
"actual_min": [
-20.0,
-15.0,
0.0
],
"expected_max": [
50.0,
15.0,
10.0
],
"expected_min": [
-20.0,
-15.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parametric-attach/pythonscad/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parametric-attach-pythonscad-geometry"
}pybosl2
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
50.0,
15.0,
10.0
],
"actual_min": [
-20.0,
-15.0,
0.0
],
"expected_max": [
50.0,
15.0,
10.0
],
"expected_min": [
-20.0,
-15.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parametric-attach/pybosl2/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parametric-attach-pybosl2-geometry"
}










