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.

Verification

Attached Polygon through-all cutter

Polygon2D works inside an explicit face-attached Sketch

Verified scpf 80 × 60 × 5 mm Box; 20 × 16 mm Polygon2D cutter

What this verifies

A face-attached explicit Sketch contains an authored Polygon2D profile and cuts through the parent Box with native THROUGH_ALL depth.

Expected setup

Attached Polygon through-all cutter 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
"""Attached Polygon2D THROUGH_ALL cut regression model."""


class AttachedThroughAll:
    width = 80.0
    depth = 60.0
    thickness = 5.0

    def build(self):
        body = Box(
            self.width,
            self.depth,
            self.thickness,
            anchor=Anchor.BOTTOM,
        )
        with Sketch(name="Through cut", on=body, parent=Anchor.TOP) as cut:
            Polygon2D([
                (-10, -8),
                (10, -8),
                (10, 8),
                (-10, 8),
            ])
        return body - cut.extrude(Depth.THROUGH_ALL)


AttachedThroughAll()

Engineering explanation

Attached Polygon through-all cutter

Group: features Saved-design required: false

Documentation provenance: Forge #785 promotes the released #747 regression fixture to public Verification.

Goal

Prove that authored Polygon2D coordinates lower correctly inside a named face-attached explicit Sketch and can drive native THROUGH_ALL cutting.

Forge API

Sketch(on=..., parent=...), Polygon2D(...), Sketch.extrude(Depth.THROUGH_ALL) and normal Boolean subtraction.

Forge model

An 80 × 60 × 5 mm bottom-anchored Box receives a 20 × 16 mm rectangular Polygon2D in a Sketch attached to its top face.

How Forge builds it in SolidCraft

Forge creates the parent Box, creates the attached native Sketch on the top face, authors the Polygon2D curves in that Sketch frame and lowers the extrusion as a native through-all cut against the parent.

SolidCraft result

One native Box body contains a named attached Sketch and one native through-all subtractive extrusion.

Saved-design test

No separate parameter mutation is required for this focused lowering case; the native attached Sketch/through-all command contract and model verification are the primary evidence.

Geometry evidence

Geometry-rationale provenance: Forge #785 / #747 public capability promotion. Bounds sufficient: true

The rectangular through-cut is fully characterized by the parent envelope and the resulting through opening for this focused case.

Reference notes

  • Native SolidCraft history — This case verifies Forge-to-SolidCraft attached-Sketch semantics; no fabricated external equivalent is required.
Generated command sequence — scpf (9)

Open published command JSON

  1. parameters.add

    {
      "command": "parameters.add",
      "params": {
        "expression": "80",
        "name": "width",
        "unit": "mm"
      }
    }
  2. parameters.add

    {
      "command": "parameters.add",
      "params": {
        "expression": "60",
        "name": "depth",
        "unit": "mm"
      }
    }
  3. parameters.add

    {
      "command": "parameters.add",
      "params": {
        "expression": "5",
        "name": "thickness",
        "unit": "mm"
      }
    }
  4. solid.box

    {
      "command": "solid.box",
      "params": {
        "body_name": "AttachedThroughAll",
        "corner": [
          "-width / 2",
          "-depth / 2",
          0
        ],
        "height": "thickness",
        "length": "width",
        "width": "depth"
      }
    }
  5. model.faces

    {
      "bind": {
        "$face_index_1": {
          "field": "faces",
          "max": "area",
          "select": "index",
          "where": {
            "plane_normal": [
              0,
              0,
              1
            ]
          }
        },
        "$face_point_1": {
          "field": "faces",
          "max": "area",
          "select": "point",
          "where": {
            "plane_normal": [
              0,
              0,
              1
            ]
          }
        }
      },
      "command": "model.faces",
      "params": {
        "body": "AttachedThroughAll"
      }
    }
  6. sketch.create

    {
      "command": "sketch.create",
      "params": {
        "name": "Through cut",
        "plane": {
          "body": "AttachedThroughAll",
          "face": "$face_point_1",
          "index": "$face_index_1"
        },
        "project_edges": false
      }
    }
  7. sketch.line

    {
      "command": "sketch.line",
      "params": {
        "closed": true,
        "ids": [
          "a",
          "b",
          "c",
          "d"
        ],
        "points": [
          [
            -10,
            -8
          ],
          [
            10,
            -8
          ],
          [
            10,
            8
          ],
          [
            -10,
            8
          ]
        ]
      }
    }
  8. sketch.finish

    {
      "command": "sketch.finish",
      "params": {}
    }
  9. solid.extrude

    {
      "command": "solid.extrude",
      "params": {
        "direction": "negative",
        "name": "Through cut",
        "operation": "cut",
        "targets": [
          "AttachedThroughAll"
        ],
        "through_all": true
      }
    }

Reference code

No independent implementation is declared.

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

pass

Regression: pass · expected shape: pass

Attached Polygon through-all cutter Actual visual verification
Actual
Attached Polygon through-all cutter Goal visual verification
Goal
Attached Polygon through-all cutter Overlay visual verification
Overlay
Attached Polygon through-all cutter Diff visual verification
Diff

right

pass

Regression: pass · expected shape: pass

Attached Polygon through-all cutter Actual visual verification
Actual
Attached Polygon through-all cutter Goal visual verification
Goal
Attached Polygon through-all cutter Overlay visual verification
Overlay
Attached Polygon through-all cutter Diff visual verification
Diff

iso

pass

Regression: pass · expected shape: pass

Attached Polygon through-all cutter Actual visual verification
Actual
Attached Polygon through-all cutter Goal visual verification
Goal
Attached Polygon through-all cutter Overlay visual verification
Overlay
Attached Polygon through-all cutter Diff visual verification
Diff

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 count11pass
Body envelopes / count11pass
Body 1 / min [mm]-40 × -30 × 0-40 × -30 × 0—
Body 1 / max [mm]40 × 30 × 540 × 30 × 5—
visual / frontpass
visual / rightpass
visual / isopass

Model stages

  1. Create the bottom-anchored Box
  2. Attach a named Sketch to the top face and add Polygon2D
  3. Cut the parent with native THROUGH_ALL extrusion

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
    • visual: status=pass, adapter=solidcraft-visual, runtime=ghcr.io/brainboxemb/cad-solidcraft:v0.3.6 · verification

scpf

native — expected versus measured evidence

Open published verification report

verification.json
{
  "checks": [
    {
      "artifacts": [
        {
          "kind": "file",
          "path": "baseline/measurements.json",
          "sha256": "e62ffdcf928335deaab9d83a7e5c72384417045cd611bac88ff18787ad74b221",
          "size": 2400
        }
      ],
      "error": null,
      "evidence": {
        "body_count": {
          "actual": 1,
          "expected": 1,
          "label": "SolidCraft body count",
          "pass": true
        },
        "body_envelopes": {
          "actual_count": 1,
          "expected_count": 1,
          "kind": "body_envelopes",
          "matched_pairs": [
            {
              "actual": {
                "label": "AttachedThroughAll",
                "max": [
                  40.0,
                  30.0,
                  5.0
                ],
                "min": [
                  -40.0,
                  -30.0,
                  0.0
                ]
              },
              "expected": {
                "label": null,
                "max": [
                  40.0,
                  30.0,
                  5.0
                ],
                "min": [
                  -40.0,
                  -30.0,
                  0.0
                ]
              },
              "max_delta": 0.0
            }
          ],
          "pass": true,
          "tolerance": 0.01,
          "unmatched_actual": [],
          "unmatched_expected": []
        },
        "named_bodies": [
          {
            "selector": "sole",
            "volume": {
              "actual": 22399.999999999996,
              "delta": 3.637978807091713e-12,
              "expected": 22400.0,
              "kind": "scalar",
              "label": "sole body volume",
              "pass": true,
              "tolerance": 0.5
            }
          }
        ]
      },
      "id": "baseline",
      "reason": null,
      "status": "pass"
    }
  ],
  "input": "/output/models/attached-through-all/scpf/model.sc",
  "metadata": {},
  "schema": "cad-verification",
  "schema_version": 1,
  "status": "pass",
  "verification_id": "attached-through-all"
}
visual — expected versus measured evidence

Open published verification report

verification.json
{
  "checks": [
    {
      "artifacts": [
        {
          "kind": "file",
          "path": "visual/front/camera.json",
          "sha256": "78f63cee75818ff0f951b195c6e2787baccca8545f33a80c5df4764fefce4774",
          "size": 128
        },
        {
          "kind": "file",
          "path": "visual/front/actual.png",
          "sha256": "6047d0ce1b6087e7ca2ec67867763e963c2d63161b5b4391bb8d38d590e46c46",
          "size": 9668
        },
        {
          "kind": "file",
          "path": "visual/front/goal.png",
          "sha256": "9857caba9d00e131901c56d5455559d4dbdc67138fd48d9453707ce84d446a4e",
          "size": 1986
        },
        {
          "kind": "file",
          "path": "visual/front/overlay.png",
          "sha256": "caeacf90f681bc7637aac697c63b2e270b9a883d6b412bffd7c495b7cb79f1df",
          "size": 2686
        },
        {
          "kind": "file",
          "path": "visual/front/diff.png",
          "sha256": "85c8fbb0bc616f83eb2267f05e4a83ced04c3c9b6ac488e918c89a67c2a50449",
          "size": 372
        }
      ],
      "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.0,
          "pass": true
        },
        "regression_required": true,
        "view": "front"
      },
      "id": "front",
      "reason": null,
      "status": "pass"
    },
    {
      "artifacts": [
        {
          "kind": "file",
          "path": "visual/right/camera.json",
          "sha256": "5ea62989c30e524ab87e728d48c376b546cf8595cfd28e9a21575dbf89ad5151",
          "size": 144
        },
        {
          "kind": "file",
          "path": "visual/right/actual.png",
          "sha256": "fd354768913923c7849bec934abe79fe71ea001e6d5ffcffc88ed64a580015fc",
          "size": 9608
        },
        {
          "kind": "file",
          "path": "visual/right/goal.png",
          "sha256": "2161b6b562e793d6e9007c6f116636dfee7754b2733b8d17cbf3dc64fa5bf6e9",
          "size": 1986
        },
        {
          "kind": "file",
          "path": "visual/right/overlay.png",
          "sha256": "4684f7af560730a6558fa841ed9bdcc13e8cacf5245029f5ba109199a96400e4",
          "size": 2630
        },
        {
          "kind": "file",
          "path": "visual/right/diff.png",
          "sha256": "cc3f3e7feaf3215d6b2fc88ce98a788af561f401569540db7252e8f995c472f5",
          "size": 378
        }
      ],
      "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": "21bfebfafaae8d42246ecaa754d2a75e2af7fc09e327f06178600e58fb27cd6b",
          "size": 159
        },
        {
          "kind": "file",
          "path": "visual/iso/actual.png",
          "sha256": "1d71e265633ad25c2ebc403d920f98ae6008810bdc85ea1009575f1ab19f6936",
          "size": 36772
        },
        {
          "kind": "file",
          "path": "visual/iso/goal.png",
          "sha256": "2069ad4f81f2787781138281a1cad1ae765364731960d9d586cedeeabe8934ed",
          "size": 3858
        },
        {
          "kind": "file",
          "path": "visual/iso/overlay.png",
          "sha256": "de567547584b5e307cecc8441061015ebf0de702685a147b6f9661e0916d3ec3",
          "size": 22328
        },
        {
          "kind": "file",
          "path": "visual/iso/diff.png",
          "sha256": "b7af52d403968245427236a27533472cd7d9cabefde27da950350e86f2b180e5",
          "size": 2812
        }
      ],
      "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.0,
          "pass": true
        },
        "regression_required": true,
        "view": "iso"
      },
      "id": "iso",
      "reason": null,
      "status": "pass"
    }
  ],
  "input": "/output/models/attached-through-all/scpf/model.sc",
  "metadata": {
    "baseline_provenance": {
      "approval": "approved",
      "runtime": "ghcr.io/brainboxemb/cad-solidcraft:v0.3.6",
      "solidcraft_version": "0.49.0",
      "source_commit": "90b7eba19227032766dc1309ae8d851c4cb09553",
      "workflow_run": 45873531238
    },
    "kind": "solidcraft-visual",
    "measurements": "measurements.json",
    "visual_report": "visual.json"
  },
  "schema": "cad-verification",
  "schema_version": 1,
  "status": "pass",
  "verification_id": "attached-through-all-scpf-visual"
}

Published files