Skip to content
Development version. Forge is under active development and testing. APIs, behaviour, coverage and verification results may be incomplete or change without notice; published PASS results are not a support guarantee or production-readiness claim.

Examples

Parent Configuration → Child Feature

A root table suppresses one explicitly exported feature inside a reusable child definition

Verified scpf Small width=30 suppressed; Medium width=40 suppressed; Large width=40 present

What this model makes

Two separately constructed FeatureCoupler occurrences reuse one component definition and one parent-driven width parameter. The child explicitly exports its panel-pin cut as Forge API identity. Small and Medium suppress that child feature while Large enables it, without exposing a SolidCraft history id or rebuilding Python geometry.

Expected setup

Parent Configuration → Child Feature expected setup diagram

Published scpf baseline: declared expected body envelopes. Conceptual projection, not verification output.

scpf source

Complete primary source from the site branch; built revision below.

scpf/model.py
"""Parent configuration controls one feature exported by a reusable child."""

@component(include=("width",))
class FeatureCoupler:
    width = 40.0
    DEPTH = 24.0
    HEIGHT = 12.0

    def build(self):
        body = Box(
            self.width,
            self.DEPTH,
            self.HEIGHT,
            anchor=Anchor.BOTTOM,
        )
        panel_pin = (
            Hole(d=5)
            .at(0, 0, self.HEIGHT)
            .export_feature("panel_pin")
        )
        return body - panel_pin


class ConfigurationChildFeature:
    coupler_width = 40.0

    def build(self):
        left = FeatureCoupler(
            width=self.coupler_width,
            name="left",
            placement=Placement(x=-50),
        )
        right = FeatureCoupler(
            width=self.coupler_width,
            name="right",
            placement=Placement(x=50),
        )

        return Configure(
            left + right,
            active="Medium",
            columns=(
                Param(self.coupler_width),
                Suppress(right.feature("panel_pin")),
            ),
            rows={
                "Small": ("30 mm", True),
                "Medium": ("40 mm", True),
                "Large": ("40 mm", False),
            },
        )


ConfigurationChildFeature()
Generated command sequence — scpf (14)

Open published command JSON

  1. parameters.add

    {
      "command": "parameters.add",
      "params": {
        "expression": "40",
        "name": "coupler_width",
        "unit": "mm"
      }
    }
  2. component.create

    {
      "bind": {
        "$left": "occurrence"
      },
      "command": "component.create",
      "params": {
        "grounded": true,
        "name": "FeatureCoupler"
      }
    }
  3. solid.box

    {
      "command": "solid.box",
      "params": {
        "body_name": "FeatureCoupler",
        "corner": [
          "-coupler_width / 2",
          -12.0,
          0
        ],
        "height": 12.0,
        "length": "coupler_width",
        "width": 24.0
      }
    }
  4. solid.hole

    {
      "bind": {
        "$config_name_2": "name"
      },
      "command": "solid.hole",
      "params": {
        "diameter": 5,
        "position": [
          0.0,
          0.0,
          12.0
        ],
        "targets": [
          "FeatureCoupler"
        ]
      }
    }
  5. component.activate

    {
      "command": "component.activate",
      "params": {
        "component": "root"
      }
    }
  6. occurrence.copy

    {
      "bind": {
        "$right": "occurrence"
      },
      "command": "occurrence.copy",
      "params": {
        "component": "FeatureCoupler",
        "translate": [
          50.0,
          0.0,
          0.0
        ]
      }
    }
  7. occurrence.move

    {
      "command": "occurrence.move",
      "params": {
        "move_grounded": true,
        "occurrence": "$left",
        "translate": [
          -50,
          0,
          0
        ]
      }
    }
  8. config.configure

    {
      "command": "config.configure",
      "params": {
        "features": [
          "$config_name_2"
        ],
        "params": [
          "coupler_width"
        ]
      }
    }
  9. config.row

    {
      "bind": {
        "$config_row_5263293fc202": {
          "field": "rows",
          "select": "id",
          "where": {
            "name": "Small"
          }
        }
      },
      "command": "config.row",
      "params": {
        "name": "Default",
        "rename": "Small"
      }
    }
  10. config.row

    {
      "command": "config.row",
      "params": {
        "name": "Small",
        "values": {
          "param:coupler_width": "30 mm",
          "suppress:$config_name_2": "true"
        }
      }
    }
  11. config.row

    {
      "bind": {
        "$config_row_8e588cd18774": {
          "field": "rows",
          "select": "id",
          "where": {
            "name": "Medium"
          }
        }
      },
      "command": "config.row",
      "params": {
        "name": "Medium",
        "values": {
          "param:coupler_width": "40 mm",
          "suppress:$config_name_2": "true"
        }
      }
    }
  12. config.row

    {
      "bind": {
        "$config_row_ab80540d98d2": {
          "field": "rows",
          "select": "id",
          "where": {
            "name": "Large"
          }
        }
      },
      "command": "config.row",
      "params": {
        "name": "Large",
        "values": {
          "param:coupler_width": "40 mm",
          "suppress:$config_name_2": "false"
        }
      }
    }
  13. config.activate

    {
      "command": "config.activate",
      "params": {
        "row": "$config_row_8e588cd18774"
      }
    }
  14. 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

native / baselinepass
MeasurementExpectedMeasuredCheck
SolidCraft body count22pass
Body envelopes / count22pass
Body 1 / min [mm]-70 × -12 × 0-70 × -12 × 0—
Body 1 / max [mm]-30 × 12 × 12-30 × 12 × 12—
Body 2 / min [mm]30 × -12 × 030 × -12 × 0—
Body 2 / max [mm]70 × 12 × 1270 × 12 × 12—
SolidCraft parameters / coupler_width4040pass
native / saved_design_smallpass
MeasurementExpectedMeasuredCheck
SolidCraft body count22pass
Body envelopes / count22pass
Body 1 / min [mm]-65 × -12 × 0-65 × -12 × 0—
Body 1 / max [mm]-35 × 12 × 12-35 × 12 × 12—
Body 2 / min [mm]35 × -12 × 035 × -12 × 0—
Body 2 / max [mm]65 × 12 × 1265 × 12 × 12—
SolidCraft parameters / coupler_width3030pass
native / saved_design_largepass
MeasurementExpectedMeasuredCheck
SolidCraft body count22pass
Body envelopes / count22pass
Body 1 / min [mm]-70 × -12 × 0-70 × -12 × 0—
Body 1 / max [mm]-30 × 12 × 12-30 × 12 × 12—
Body 2 / min [mm]30 × -12 × 030 × -12 × 0—
Body 2 / max [mm]70 × 12 × 1270 × 12 × 12—
SolidCraft parameters / coupler_width4040pass
native / inspection_tablepass

Model stages

  1. Build two separate occurrences of the same reusable child definition
  2. Publish one child width as a shared parent-driven native parameter
  3. Export the exact authored panel-pin feature from the child
  4. Reference that definition-level feature from the parent Configure table
  5. Reopen the saved design and switch Small, Medium and Large natively

Build and verification

  • Primary implementation: scpf
  • Build source: 1dead221b9ea2c31901da9a19a8c205d25272ec3
  • Durable scope: main

Implementations

scpf

native — expected versus measured evidence

Open published verification report

verification.json
{
  "checks": [
    {
      "artifacts": [
        {
          "kind": "file",
          "path": "baseline/measurements.json",
          "sha256": "57fd46befda5c1e918849b3808f61caf929acfb9352ccd29c092cadc0d1e2c78",
          "size": 2395
        }
      ],
      "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": "FeatureCoupler",
                "max": [
                  -30.0,
                  12.0,
                  12.0
                ],
                "min": [
                  -70.0,
                  -12.0,
                  0.0
                ]
              },
              "expected": {
                "label": null,
                "max": [
                  -30.0,
                  12.0,
                  12.0
                ],
                "min": [
                  -70.0,
                  -12.0,
                  0.0
                ]
              },
              "max_delta": 0.0
            },
            {
              "actual": {
                "label": "FeatureCoupler (FeatureCoupler:2)",
                "max": [
                  70.0,
                  12.0,
                  12.0
                ],
                "min": [
                  30.0,
                  -12.0,
                  0.0
                ]
              },
              "expected": {
                "label": null,
                "max": [
                  70.0,
                  12.0,
                  12.0
                ],
                "min": [
                  30.0,
                  -12.0,
                  0.0
                ]
              },
              "max_delta": 0.0
            }
          ],
          "pass": true,
          "tolerance": 0.001,
          "unmatched_actual": [],
          "unmatched_expected": []
        },
        "parameters": {
          "actual": {
            "coupler_width": 40.0
          },
          "expected": {
            "coupler_width": 40.0
          },
          "label": "SolidCraft parameters",
          "pass": true
        }
      },
      "id": "baseline",
      "reason": null,
      "status": "pass"
    },
    {
      "artifacts": [
        {
          "kind": "file",
          "path": "saved_designs/small/model.sc",
          "sha256": "5de0a589f77a01f529dad2344b7f83fbb0320966bbd22e92783bcb7b875bd26c",
          "size": 4612
        },
        {
          "kind": "file",
          "path": "saved_designs/small/measurements.json",
          "sha256": "524af6c6730b68bb7687bf903bd6fa00d27aa78858828db4bda572ba7d54ef88",
          "size": 2383
        }
      ],
      "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": "FeatureCoupler",
                "max": [
                  -35.0,
                  12.0,
                  12.0
                ],
                "min": [
                  -65.0,
                  -12.0,
                  0.0
                ]
              },
              "expected": {
                "label": null,
                "max": [
                  -35.0,
                  12.0,
                  12.0
                ],
                "min": [
                  -65.0,
                  -12.0,
                  0.0
                ]
              },
              "max_delta": 0.0
            },
            {
              "actual": {
                "label": "FeatureCoupler (FeatureCoupler:2)",
                "max": [
                  65.0,
                  12.0,
                  12.0
                ],
                "min": [
                  35.0,
                  -12.0,
                  0.0
                ]
              },
              "expected": {
                "label": null,
                "max": [
                  65.0,
                  12.0,
                  12.0
                ],
                "min": [
                  35.0,
                  -12.0,
                  0.0
                ]
              },
              "max_delta": 0.0
            }
          ],
          "pass": true,
          "tolerance": 0.001,
          "unmatched_actual": [],
          "unmatched_expected": []
        },
        "parameters": {
          "actual": {
            "coupler_width": 30.0
          },
          "expected": {
            "coupler_width": 30.0
          },
          "label": "SolidCraft parameters",
          "pass": true
        }
      },
      "id": "saved_design_small",
      "reason": null,
      "status": "pass"
    },
    {
      "artifacts": [
        {
          "kind": "file",
          "path": "saved_designs/large/model.sc",
          "sha256": "0ca0bea094b6408e6e3a20d0ff8264bce9b494c5d819b91e723a3e7677f2ccaf",
          "size": 7891
        },
        {
          "kind": "file",
          "path": "saved_designs/large/measurements.json",
          "sha256": "a76b2454e7b4a525070456771f291ea364c33508582924d024e743d9ddc7806c",
          "size": 2548
        }
      ],
      "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": "FeatureCoupler",
                "max": [
                  -30.0,
                  12.0,
                  12.000000000000002
                ],
                "min": [
                  -70.0,
                  -12.0,
                  0.0
                ]
              },
              "expected": {
                "label": null,
                "max": [
                  -30.0,
                  12.0,
                  12.0
                ],
                "min": [
                  -70.0,
                  -12.0,
                  0.0
                ]
              },
              "max_delta": 1.7763568394002505e-15
            },
            {
              "actual": {
                "label": "FeatureCoupler (FeatureCoupler:2)",
                "max": [
                  70.0,
                  12.0,
                  12.000000000000002
                ],
                "min": [
                  30.0,
                  -12.0,
                  0.0
                ]
              },
              "expected": {
                "label": null,
                "max": [
                  70.0,
                  12.0,
                  12.0
                ],
                "min": [
                  30.0,
                  -12.0,
                  0.0
                ]
              },
              "max_delta": 1.7763568394002505e-15
            }
          ],
          "pass": true,
          "tolerance": 0.001,
          "unmatched_actual": [],
          "unmatched_expected": []
        },
        "changes": [
          {
            "comparison": {
              "actual": {
                "absolute_delta": 235.61944901923198,
                "baseline": 11519.999999999996,
                "mutated": 11284.380550980764
              },
              "expected": {
                "absolute_delta_gt": 1.0
              },
              "label": "SolidCraft saved design change child-feature-geometry",
              "pass": true
            },
            "id": "child-feature-geometry",
            "path": [
              "bodies",
              0,
              "volume_mm3"
            ]
          }
        ],
        "parameters": {
          "actual": {
            "coupler_width": 40.0
          },
          "expected": {
            "coupler_width": 40.0
          },
          "label": "SolidCraft parameters",
          "pass": true
        }
      },
      "id": "saved_design_large",
      "reason": null,
      "status": "pass"
    },
    {
      "artifacts": [
        {
          "kind": "file",
          "path": "inspections/table/results.json",
          "sha256": "8d1b27deaa47584bcdd46be252a63c89993d328f8e133f020d59d94b250f48f5",
          "size": 1040
        }
      ],
      "error": null,
      "evidence": {
        "checks": [
          {
            "comparison": {
              "actual": 3,
              "expected": 3,
              "label": "SolidCraft inspection check rows",
              "pass": true
            },
            "id": "rows",
            "path": [
              0,
              "rows"
            ]
          },
          {
            "comparison": {
              "actual": 2,
              "expected": 2,
              "label": "SolidCraft inspection check columns",
              "pass": true
            },
            "id": "columns",
            "path": [
              0,
              "columns"
            ]
          },
          {
            "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"
            ]
          },
          {
            "comparison": {
              "actual": "30 mm",
              "expected": "30 mm",
              "label": "SolidCraft inspection check small-width",
              "pass": true
            },
            "id": "small-width",
            "path": [
              0,
              "rows",
              0,
              "values",
              "param:coupler_width"
            ]
          },
          {
            "comparison": {
              "actual": "40 mm",
              "expected": "40 mm",
              "label": "SolidCraft inspection check medium-width",
              "pass": true
            },
            "id": "medium-width",
            "path": [
              0,
              "rows",
              1,
              "values",
              "param:coupler_width"
            ]
          },
          {
            "comparison": {
              "actual": "40 mm",
              "expected": "40 mm",
              "label": "SolidCraft inspection check large-width",
              "pass": true
            },
            "id": "large-width",
            "path": [
              0,
              "rows",
              2,
              "values",
              "param:coupler_width"
            ]
          },
          {
            "comparison": {
              "actual": "true",
              "expected": "true",
              "label": "SolidCraft inspection check small-suppression",
              "pass": true
            },
            "id": "small-suppression",
            "path": [
              0,
              "rows",
              0,
              "values",
              "suppress:Hole1"
            ]
          },
          {
            "comparison": {
              "actual": "true",
              "expected": "true",
              "label": "SolidCraft inspection check medium-suppression",
              "pass": true
            },
            "id": "medium-suppression",
            "path": [
              0,
              "rows",
              1,
              "values",
              "suppress:Hole1"
            ]
          },
          {
            "comparison": {
              "actual": "false",
              "expected": "false",
              "label": "SolidCraft inspection check large-suppression",
              "pass": true
            },
            "id": "large-suppression",
            "path": [
              0,
              "rows",
              2,
              "values",
              "suppress:Hole1"
            ]
          }
        ]
      },
      "id": "inspection_table",
      "reason": null,
      "status": "pass"
    }
  ],
  "input": "/output/models/configuration-child-feature/scpf/model.sc",
  "metadata": {},
  "schema": "cad-verification",
  "schema_version": 1,
  "status": "pass",
  "verification_id": "configuration-child-feature"
}

Published files