Verification
Configuration Symbolic Math
Native configuration rows drive min, sqrt, round, floor, max and abs expressions
What this verifies
One box keeps derived dimensions native instead of baking the current Python values. Switching Small, Medium and Large changes one source parameter and SolidCraft recomputes several non-linear and quantized expressions.
scpf source
Complete primary source from the site branch; built revision below.
"""Configuration-driven native symbolic CAD math qualification."""
class ConfigurationSymbolicMath:
size = 70.0
limit = 80.0
offset = 20.0
grid = 7.5
pitch = 12.0
step = 1.0
wall = 4.0
bias = -3.0
def build(self):
span = cadmath.sqrt(
cadmath.min(self.size, self.limit) ** 2
- self.offset ** 2
)
grid_span = cadmath.round(self.size / self.grid) * self.grid
height = (
cadmath.floor(self.size / self.pitch) * self.step
+ cadmath.max(self.wall, cadmath.abs(self.bias))
)
body = Box(
span,
grid_span,
height,
anchor=Anchor.BOTTOM,
)
return Configure(
body,
active="Medium",
columns=(Param(self.size),),
rows={
"Small": ("60 mm",),
"Medium": ("70 mm",),
"Large": ("100 mm",),
},
)
ConfigurationSymbolicMath()
Engineering explanation
This case verifies that configuration rows can drive derived native CAD expressions, not only direct dimensions.
The model has one configured source parameter, size. Its box dimensions are
derived from ordinary Forge symbolic values:
- length:
sqrt(min(size, limit)^2 - offset^2); - width:
round(size / grid) * grid; - height:
floor(size / pitch) * step + max(wall, abs(bias)).
The active Medium row uses size = 70 mm. The saved SolidCraft design is
then reopened and switched to Small and Large. The body envelopes must
change to the dimensions recomputed by SolidCraft from those expressions.
Forge never calls pv() for these relationships and never substitutes the
current Python result into the feature command. The native feature inputs retain
the source parameter names, so configuration changes remain geometry-driving.
Generated command sequence — scpf (16)
parameters.add{ "command": "parameters.add", "params": { "expression": "70", "name": "size", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "80", "name": "limit", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "20", "name": "offset", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "7.5", "name": "grid", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "12", "name": "pitch", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "1", "name": "step", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "4", "name": "wall", "unit": "mm" } }parameters.add{ "command": "parameters.add", "params": { "expression": "-3", "name": "bias", "unit": "mm" } }solid.box{ "command": "solid.box", "params": { "body_name": "ConfigurationSymbolicMath", "corner": [ "-(sqrt(((min(size,limit)) ^ 2) - ((offset) ^ 2))) / 2", "-((round((size) / (grid))) * (grid)) / 2", 0 ], "height": "((floor((size) / (pitch))) * (step)) + (max(wall,abs(bias)))", "length": "sqrt(((min(size,limit)) ^ 2) - ((offset) ^ 2))", "width": "(round((size) / (grid))) * (grid)" } }config.configure{ "command": "config.configure", "params": { "params": [ "size" ] } }config.row{ "bind": { "$config_row_5263293fc202": { "field": "rows", "select": "id", "where": { "name": "Small" } } }, "command": "config.row", "params": { "name": "Default", "rename": "Small" } }config.row{ "command": "config.row", "params": { "name": "Small", "values": { "param:size": "60 mm" } } }config.row{ "bind": { "$config_row_8e588cd18774": { "field": "rows", "select": "id", "where": { "name": "Medium" } } }, "command": "config.row", "params": { "name": "Medium", "values": { "param:size": "70 mm" } } }config.row{ "bind": { "$config_row_ab80540d98d2": { "field": "rows", "select": "id", "where": { "name": "Large" } } }, "command": "config.row", "params": { "name": "Large", "values": { "param:size": "100 mm" } } }config.activate{ "command": "config.activate", "params": { "row": "$config_row_8e588cd18774" } }config.table{ "command": "config.table", "params": {} }
Reference code
No independent implementation is declared.
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 |
|---|---|---|---|
| Body envelopes / count | 1 | 1 | pass |
| Body 1 / min [mm] | -33.5410196625 × -33.75 × 0 | -33.5410196625 × -33.75 × 0 | — |
| Body 1 / max [mm] | 33.5410196625 × 33.75 × 9 | 33.5410196625 × 33.75 × 9 | — |
| SolidCraft parameters / size | 70 | 70 | pass |
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Body envelopes / count | 1 | 1 | pass |
| Body 1 / min [mm] | -28.2842712475 × -30 × 0 | -28.2842712475 × -30 × 0 | — |
| Body 1 / max [mm] | 28.2842712475 × 30 × 9 | 28.2842712475 × 30 × 9 | — |
| SolidCraft parameters / size | 60 | 60 | pass |
| Measurement | Expected | Measured | Check |
|---|---|---|---|
| Body envelopes / count | 1 | 1 | pass |
| Body 1 / min [mm] | -38.7298334621 × -48.75 × 0 | -38.7298334621 × -48.75 × 0 | — |
| Body 1 / max [mm] | 38.7298334621 × 48.75 × 12 | 38.7298334621 × 48.75 × 12 | — |
| SolidCraft parameters / size | 100 | 100 | pass |
Model stages
- Keep all source dimensions as native model parameters
- Derive length through min plus sqrt and squared symbolic expressions
- Derive width through round and grid spacing
- Derive height through floor plus max and abs
- Reopen the saved design and switch native configuration rows
Build and verification
- Primary implementation:
scpf - Build source:
1dead221b9ea2c31901da9a19a8c205d25272ec3 - Durable scope:
main
Implementations
- scpf — builder-scpf: build=pass, verification=pass · STL · SC · Preview · commands · verification · result
native: status=pass, adapter=solidcraft-model, runtime=ghcr.io/brainboxemb/cad-solidcraft:v0.3.6 · verification
scpf
native — expected versus measured evidence
Open published verification report
{
"checks": [
{
"artifacts": [
{
"kind": "file",
"path": "baseline/measurements.json",
"sha256": "7694427a5901c5ba5e5552e5076ae299563a85fe94302bc6dbeb9be273815ffd",
"size": 2652
}
],
"error": null,
"evidence": {
"body_envelopes": {
"actual_count": 1,
"expected_count": 1,
"kind": "body_envelopes",
"matched_pairs": [
{
"actual": {
"label": "ConfigurationSymbolicMath",
"max": [
33.54101966249684,
33.75,
9.0
],
"min": [
-33.54101966249684,
-33.75,
0.0
]
},
"expected": {
"label": null,
"max": [
33.5410196625,
33.75,
9.0
],
"min": [
-33.5410196625,
-33.75,
0.0
]
},
"max_delta": 3.154809746774845e-12
}
],
"pass": true,
"tolerance": 0.002,
"unmatched_actual": [],
"unmatched_expected": []
},
"parameters": {
"actual": {
"size": 70.0
},
"expected": {
"size": 70.0
},
"label": "SolidCraft parameters",
"pass": true
}
},
"id": "baseline",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "saved_designs/small/model.sc",
"sha256": "46eb2799a6e70a49d7d8edf217c07a451dc64806ebb5b4dc4ec2e658a0bce8ce",
"size": 4486
},
{
"kind": "file",
"path": "saved_designs/small/measurements.json",
"sha256": "1b4572a63509ee92412c65f721a4dcfd4da176f2ee167ecd06baf8476bd2cc88",
"size": 2662
}
],
"error": null,
"evidence": {
"body_envelopes": {
"actual_count": 1,
"expected_count": 1,
"kind": "body_envelopes",
"matched_pairs": [
{
"actual": {
"label": "ConfigurationSymbolicMath",
"max": [
28.284271247461902,
30.0,
9.0
],
"min": [
-28.284271247461902,
-30.0,
0.0
]
},
"expected": {
"label": null,
"max": [
28.2842712475,
30.0,
9.0
],
"min": [
-28.2842712475,
-30.0,
0.0
]
},
"max_delta": 3.809930149145657e-11
}
],
"pass": true,
"tolerance": 0.002,
"unmatched_actual": [],
"unmatched_expected": []
},
"parameters": {
"actual": {
"size": 60.0
},
"expected": {
"size": 60.0
},
"label": "SolidCraft parameters",
"pass": true
}
},
"id": "saved_design_small",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "saved_designs/large/model.sc",
"sha256": "666533384512dab6a63a63f6684fefb2700e4df6b86953d0d9b85ec852abe430",
"size": 4522
},
{
"kind": "file",
"path": "saved_designs/large/measurements.json",
"sha256": "97d5ccfd8d6144a74125c299d85dd0bb93b6a277766851a997d96cc15ed57c04",
"size": 2652
}
],
"error": null,
"evidence": {
"body_envelopes": {
"actual_count": 1,
"expected_count": 1,
"kind": "body_envelopes",
"matched_pairs": [
{
"actual": {
"label": "ConfigurationSymbolicMath",
"max": [
38.72983346207417,
48.75,
12.0
],
"min": [
-38.72983346207417,
-48.75,
0.0
]
},
"expected": {
"label": null,
"max": [
38.7298334621,
48.75,
12.0
],
"min": [
-38.7298334621,
-48.75,
0.0
]
},
"max_delta": 2.5828228444879642e-11
}
],
"pass": true,
"tolerance": 0.002,
"unmatched_actual": [],
"unmatched_expected": []
},
"parameters": {
"actual": {
"size": 100.0
},
"expected": {
"size": 100.0
},
"label": "SolidCraft parameters",
"pass": true
}
},
"id": "saved_design_large",
"reason": null,
"status": "pass"
},
{
"artifacts": [
{
"kind": "file",
"path": "inspections/table/results.json",
"sha256": "27bd0d3d333f8cec44be581b818e9cfed254ef21fac706df5bac5540cdefb0ad",
"size": 706
}
],
"error": null,
"evidence": {
"checks": [
{
"comparison": {
"actual": 3,
"expected": 3,
"label": "SolidCraft inspection check rows",
"pass": true
},
"id": "rows",
"path": [
0,
"rows"
]
},
{
"comparison": {
"actual": "Medium",
"expected": "Medium",
"label": "SolidCraft inspection check active",
"pass": true
},
"id": "active",
"path": [
0,
"active"
]
},
{
"comparison": {
"actual": true,
"expected": true,
"label": "SolidCraft inspection check matches",
"pass": true
},
"id": "matches",
"path": [
0,
"matches"
]
}
]
},
"id": "inspection_table",
"reason": null,
"status": "pass"
}
],
"input": "/output/models/configuration-symbolic-math/scpf/model.sc",
"metadata": {},
"schema": "cad-verification",
"schema_version": 1,
"status": "pass",
"verification_id": "configuration-symbolic-math"
}