Verification
Child dimensions derived from parent parameters
A reusable child keeps half-size expressions from its parent
What this verifies
A parent block and child component preserve width and depth expressions so saved-design edits to the parent rebuild both bodies.
scpf source
Complete primary source from the site branch; built revision below.
"""Qualification: child dimensions intentionally derived from parent parameters."""
class ParentBlock:
width = 120.0
depth = 80.0
HEIGHT = 10.0
def build(self):
return Box(self.width, self.depth, self.HEIGHT, anchor=Anchor.BOTTOM)
class DerivedChild:
width = 60.0
depth = 40.0
HEIGHT = 6.0
Z_BOTTOM = 20.0
def build(self):
return Box(
self.width,
self.depth,
self.HEIGHT,
anchor=Anchor.BOTTOM,
).move(z=self.Z_BOTTOM)
class ParentDerivedChildSize:
base_width = 120.0
base_depth = 80.0
def build(self):
parent = ParentBlock(
width=self.base_width,
depth=self.base_depth,
name="parent",
)
child = DerivedChild(
width=half(self.base_width),
depth=half(self.base_depth),
name="child",
)
return parent + child
ParentDerivedChildSize()
Engineering explanation
Child dimensions derived from parent parameters
Documentation provenance: the engineering text below is copied verbatim from the last canonical
qualification/cases.pysource before its removal, commitbe40b09e7454a90e87d83768a9e7453c52ba5d76.
Legacy group: parameters
Saved-design required: true
Goal
Isolate one dependency contract: a reusable child receives width and depth expressions derived from parent parameters, and those child dimensions remain editable/associative in the saved SolidCraft design.
Forge API
DerivedChild(width=self.base_width / 2, depth=self.base_depth / 2)
Forge model
One ParentBlock and one DerivedChild. Only base_width and base_depth are published as document parameters; the child carries expressions that reference those existing parent parameters instead of receiving independent duplicated values.
How Forge builds it in SolidCraft
The parent and child sketch dimensions preserve base_width/base_depth expressions. Forge must not flatten base_width / 2 or base_depth / 2 to numeric constants when compiling the child component.
SolidCraft result
At 120x80 mm parent size, the child measures 60x40 mm. Its fixed height and fixed body layout are deliberately unrelated to this qualification.
Saved-design test
Change base_width/base_depth from 120x80 to 160x120 mm in the saved .sc design; without rerunning Python the child must rebuild from 60x40 to 80x60 mm.
Geometry evidence
Geometry-rationale provenance: copied verbatim from
qualification/geometry_contracts.pyat commitbe40b09e7454a90e87d83768a9e7453c52ba5d76.
Bounds sufficient: true
The geometry is two rectangular bodies whose declared sizes and positions are sufficient; the parent-to-child expression is proved by native mutation.
Reference notes
- SolidCraft — Native parameters and expressions must preserve the parent-to-child dimensional dependency after the Python compiler has finished.
- PythonSCAD — The Python model expresses the dependency with ordinary arithmetic rather than a special application-specific sizing API.
Generated command sequence — scpf (8)
parameters.add{ "command": "parameters.add", "params": { "expression": "120", "name": "base_width", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "80", "name": "base_depth", "unit": "mm" } }component.create{ "bind": { "$parent": "occurrence" }, "command": "component.create", "params": { "grounded": true, "name": "ParentBlock" } }solid.box{ "command": "solid.box", "params": { "body_name": "ParentBlock", "corner": [ "-base_width / 2", "-base_depth / 2", 0 ], "height": 10.0, "length": "base_width", "width": "base_depth" } }component.activate{ "command": "component.activate", "params": { "component": "root" } }component.create{ "bind": { "$child": "occurrence" }, "command": "component.create", "params": { "grounded": false, "name": "DerivedChild" } }solid.box{ "command": "solid.box", "params": { "body_name": "DerivedChild", "corner": [ "-((base_width / 2) / 2)", "-((base_depth / 2) / 2)", 20.0 ], "height": 6.0, "length": "base_width / 2", "operation": "new", "width": "base_depth / 2" } }component.activate{ "command": "component.activate", "params": { "component": "root" } }
Reference code
cadquery source · pass
"""CadQuery reference with child dimensions derived from parent values."""
import cadquery as cq
base_width = 120.0
base_depth = 80.0
parent = cq.Solid.makeBox(
base_width,
base_depth,
10,
cq.Vector(-base_width / 2, -base_depth / 2, 0),
)
child = cq.Solid.makeBox(
base_width / 2,
base_depth / 2,
6,
cq.Vector(-base_width / 4, -base_depth / 4, 20),
)
model = cq.Assembly()
model.add(parent, name="parent")
model.add(child, name="child")
build123d source · pass
"""build123d reference: a child's dimensions derive from its parent."""
from build123d import Align, Box, BuildPart, Locations
base_width, base_depth = 120.0, 80.0
bottom = (Align.CENTER, Align.CENTER, Align.MIN)
with BuildPart() as model:
Box(base_width, base_depth, 10, align=bottom)
with Locations((0, 0, 20)):
Box(base_width / 2, base_depth / 2, 6, align=bottom)
pythonscad source · pass
"""PythonSCAD reference: child dimensions are half the parent dimensions."""
from pythonscad import *
base_width = 120.0
base_depth = 80.0
parent = cube([base_width, base_depth, 10], center=True).up(5)
child = cube([base_width / 2, base_depth / 2, 6], center=True).up(23)
model = parent | child
pybosl2 source · pass
"""pyBOSL2 reference: child dimensions are derived from parent values."""
from pybosl2 import cuboid
base_width = 120.0
base_depth = 80.0
parent = cuboid([base_width, base_depth, 10]).up(5)
child = cuboid([base_width / 2, base_depth / 2, 6]).up(23)
model = parent | child
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 | 60 × 40 × 26 | 60 × 40 × 26 | pass |
| Bounds / min | -60 × -40 × 0 | -60 × -40 × 0 | pass |
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| SolidCraft body count | 2 | 2 | pass |
| Body envelopes / count | 2 | 2 | pass |
| Body 1 / min [mm] | -60 × -40 × 0 | -60 × -40 × 0 | — |
| Body 1 / max [mm] | 60 × 40 × 10 | 60 × 40 × 10 | — |
| Body 2 / min [mm] | -30 × -20 × 20 | -30 × -20 × 20 | — |
| Body 2 / max [mm] | 30 × 20 × 26 | 30 × 20 × 26 | — |
| SolidCraft parameters / base_depth | 80 | 80 | pass |
| SolidCraft parameters / base_width | 120 | 120 | pass |
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Body envelopes / count | 2 | 2 | pass |
| Body 1 / min [mm] | -80 × -60 × 0 | -80 × -60 × 0 | — |
| Body 1 / max [mm] | 80 × 60 × 10 | 80 × 60 × 10 | — |
| Body 2 / min [mm] | -40 × -30 × 20 | -40 × -30 × 20 | — |
| Body 2 / max [mm] | 40 × 30 × 26 | 40 × 30 × 26 | — |
| SolidCraft parameters / base_depth | 120 | 120 | pass |
| SolidCraft parameters / base_width | 160 | 160 | pass |
cadquery — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 60 × 40 × 26 | 60 × 40 × 26 | pass |
| Bounds / min | -60 × -40 × 0 | -60 × -40 × 0 | pass |
build123d — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 60 × 40 × 26 | 60 × 40 × 26 | pass |
| Bounds / min | -60 × -40 × 0 | -60 × -40 × 0 | pass |
pythonscad — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 60 × 40 × 26 | 60 × 40 × 26 | pass |
| Bounds / min | -60 × -40 × 0 | -60 × -40 × 0 | pass |
pybosl2 — pass
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Bounds / max | 60 × 40 × 26 | 60 × 40 × 26 | pass |
| Bounds / min | -60 × -40 × 0 | -60 × -40 × 0 | pass |
Model stages
- Publish parent base_width and base_depth parameters
- Create the parent body from those parameters
- Create the child from half-width and half-depth expressions
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": [
60.0,
40.0,
26.0
],
"actual_min": [
-60.0,
-40.0,
0.0
],
"expected_max": [
60.0,
40.0,
26.0
],
"expected_min": [
-60.0,
-40.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parent-derived-child-size/scpf/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parent-derived-child-size-scpf-geometry"
}native — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [
{
"kind": "file",
"path": "baseline/measurements.json",
"sha256": "9c742583ce7968ffe28354effd644978cd10f31dde81b91c6677d979a40a15c6",
"size": 2523
}
],
"error": null,
"evidence": {
"body_count": {
"actual": 2,
"expected": 2,
"label": "SolidCraft body count",
"pass": true
},
"body_envelopes": {
"actual_count": 2,
"expected_count": 2,
"kind": "body_envelopes",
"matched_pairs": [
{
"actual": {
"label": "ParentBlock",
"max": [
60.0,
40.0,
10.0
],
"min": [
-60.0,
-40.0,
0.0
]
},
"expected": {
"label": null,
"max": [
60.0,
40.0,
10.0
],
"min": [
-60.0,
-40.0,
0.0
]
},
"max_delta": 0.0
},
{
"actual": {
"label": "DerivedChild",
"max": [
30.0,
20.0,
26.0
],
"min": [
-30.0,
-20.0,
20.0
]
},
"expected": {
"label": null,
"max": [
30.0,
20.0,
26.0
],
"min": [
-30.0,
-20.0,
20.0
]
},
"max_delta": 0.0
}
],
"pass": true,
"tolerance": 0.001,
"unmatched_actual": [],
"unmatched_expected": []
},
"parameters": {
"actual": {
"base_depth": 80.0,
"base_width": 120.0
},
"expected": {
"base_depth": 80.0,
"base_width": 120.0
},
"label": "SolidCraft parameters",
"pass": true
}
},
"id": "baseline",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "saved_designs/size_160x120/model.sc",
"sha256": "f00806e30486cb723ca4ea3962bf5d14a1284a089635977dbe7c6eaf72f87e18",
"size": 6100
},
{
"kind": "file",
"path": "saved_designs/size_160x120/measurements.json",
"sha256": "53ad76653591de19e8a523be4045757d27a0412c66bcf7b0c8722cc09d5c0d07",
"size": 2606
}
],
"error": null,
"evidence": {
"body_envelopes": {
"actual_count": 2,
"expected_count": 2,
"kind": "body_envelopes",
"matched_pairs": [
{
"actual": {
"label": "ParentBlock",
"max": [
80.0,
60.0,
10.0
],
"min": [
-80.0,
-60.0,
0.0
]
},
"expected": {
"label": null,
"max": [
80.0,
60.0,
10.0
],
"min": [
-80.0,
-60.0,
0.0
]
},
"max_delta": 0.0
},
{
"actual": {
"label": "DerivedChild",
"max": [
40.0,
30.0,
26.0
],
"min": [
-40.0,
-30.0,
20.0
]
},
"expected": {
"label": null,
"max": [
40.0,
30.0,
26.0
],
"min": [
-40.0,
-30.0,
20.0
]
},
"max_delta": 0.0
}
],
"pass": true,
"tolerance": 0.001,
"unmatched_actual": [],
"unmatched_expected": []
},
"parameters": {
"actual": {
"base_depth": 120.0,
"base_width": 160.0
},
"expected": {
"base_depth": 120.0,
"base_width": 160.0
},
"label": "SolidCraft parameters",
"pass": true
}
},
"id": "saved_design_size_160x120",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parent-derived-child-size/scpf/model.sc",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parent-derived-child-size"
}visual — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [
{
"kind": "file",
"path": "visual/front/camera.json",
"sha256": "6cd8b61b666bebcbfe62d1f793de179e10c0b8a56d12d4b2dbb87d58c4fbb56c",
"size": 129
},
{
"kind": "file",
"path": "visual/front/actual.png",
"sha256": "9270acf96ea354cc586f7dd81434ac80818da53622ab749c02c41f85a51e92fc",
"size": 10058
},
{
"kind": "file",
"path": "visual/front/goal.png",
"sha256": "2544e7be0b7d3d95d9e28fe868af35976531ed0b6c2c6edc07c847d698cc1ece",
"size": 2007
},
{
"kind": "file",
"path": "visual/front/overlay.png",
"sha256": "0568893c19821efa43ec0cd1d9e1efed7609ddcf990891543f67431c9aea8e1c",
"size": 3058
},
{
"kind": "file",
"path": "visual/front/diff.png",
"sha256": "c93449b182fbd61c05d56cdaa8db897d0256223c0021af1ba0da69bf2a432d7e",
"size": 669
}
],
"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.01577,
"pass": true
},
"regression_required": true,
"view": "front"
},
"id": "front",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "visual/right/camera.json",
"sha256": "7308a73bd0cdc87e1a0432b24e085605c6e57e5f04a5d5900e36e075a2a7530a",
"size": 145
},
{
"kind": "file",
"path": "visual/right/actual.png",
"sha256": "b0a01306f07613981b887b67bc4f66920e17e77922a0f4d5405ed8b6a12e1660",
"size": 9705
},
{
"kind": "file",
"path": "visual/right/goal.png",
"sha256": "9f2e26a0455ef628666ab0fa6ef7263c738989538264e1a894515986be1e6fb7",
"size": 2008
},
{
"kind": "file",
"path": "visual/right/overlay.png",
"sha256": "fc6b936a50081b2a0db68351e6f69186712c1ee7a81ade6db0265ac31338194f",
"size": 2774
},
{
"kind": "file",
"path": "visual/right/diff.png",
"sha256": "e4a9189d6d86b7842c62906b1ffa52ef471196ddfb3df1ca3cbccfde9f009d16",
"size": 638
}
],
"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.007957,
"pass": true
},
"regression_required": true,
"view": "right"
},
"id": "right",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "visual/iso/camera.json",
"sha256": "72f1d90163c88e4cb618953a837f33e2bc0782a99e1ab507dfa63cda55113e03",
"size": 160
},
{
"kind": "file",
"path": "visual/iso/actual.png",
"sha256": "a703ef0c0b2a30a2fc8bd41a5e0af3aba92e7e052898d820f1c48d0ed62420e2",
"size": 41765
},
{
"kind": "file",
"path": "visual/iso/goal.png",
"sha256": "85b9f8c07e29fba346c4d8a0ec18a816c01b2cb1faffe3402fe145ad8d6bc14f",
"size": 4520
},
{
"kind": "file",
"path": "visual/iso/overlay.png",
"sha256": "1bf76555dfc1e8adad6105283f89b91f097b47496185a3d1cb51e27c8938d1d4",
"size": 25335
},
{
"kind": "file",
"path": "visual/iso/diff.png",
"sha256": "8cc7da7e81f0458cfd26bae116023cc36d65a0400875b4d91bcfbeea753b6791",
"size": 3302
}
],
"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.019676,
"pass": true
},
"regression_required": true,
"view": "iso"
},
"id": "iso",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parent-derived-child-size/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": "bc9561486459b9d8a245cd55f4a021be883b44bd",
"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": "parent-derived-child-size-scpf-visual"
}cadquery
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
60.0,
40.0,
26.0
],
"actual_min": [
-60.0,
-40.0,
0.0
],
"expected_max": [
60.0,
40.0,
26.0
],
"expected_min": [
-60.0,
-40.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parent-derived-child-size/cadquery/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parent-derived-child-size-cadquery-geometry"
}build123d
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
60.0,
40.0,
26.0
],
"actual_min": [
-60.0,
-40.0,
0.0
],
"expected_max": [
60.0,
40.0,
26.0
],
"expected_min": [
-60.0,
-40.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parent-derived-child-size/build123d/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parent-derived-child-size-build123d-geometry"
}pythonscad
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
60.0,
40.0,
26.0
],
"actual_min": [
-60.0,
-40.0,
0.0
],
"expected_max": [
60.0,
40.0,
26.0
],
"expected_min": [
-60.0,
-40.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parent-derived-child-size/pythonscad/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parent-derived-child-size-pythonscad-geometry"
}pybosl2
geometry — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [],
"error": null,
"evidence": {
"bounds": {
"actual_max": [
60.0,
40.0,
26.0
],
"actual_min": [
-60.0,
-40.0,
0.0
],
"expected_max": [
60.0,
40.0,
26.0
],
"expected_min": [
-60.0,
-40.0,
0.0
],
"max_delta_mm": 0.0,
"pass": true,
"tolerance_mm": 0.5
}
},
"id": "geometry",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/parent-derived-child-size/pybosl2/model.stl",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "parent-derived-child-size-pybosl2-geometry"
}










