diff --git a/.github/ISSUE_TEMPLATE/issue.md b/.github/ISSUE_TEMPLATE/issue.md index d6f03b24..1c9f7233 100644 --- a/.github/ISSUE_TEMPLATE/issue.md +++ b/.github/ISSUE_TEMPLATE/issue.md @@ -12,7 +12,7 @@ assignees: "" ## Area - + ## Reproduction diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b70e219..cc56eb3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,20 @@ user-facing notes live in [`docs/updates/`](docs/updates/) (English and ## Unreleased +### Removed (breaking) +- The FreeCAD, Fusion 360 and SolidWorks translators are no longer part of the SDK, and the SDK no longer maintains + them. Gone: the package `simplecadapi.translator` (and `simplecadapi.translator` as a lazy submodule), + `translate_model_json_to_*`, `translate_product_package_to_*`, `export_model_json_to_solidworks_step`, the + `FreeCADTranslator`, `Fusion360Translator` and `SolidWorksTranslator` classes, and the `fcstd`, `freecad-script`, + `fusion360-script` and `solidworks-script` formats and the `--freecad-cmd` and `--document-name` options of + `sca export`. They were used by few people and follow the operation-graph format closely, which may change a lot; the + translators now live in a separate private repository. +- Kept: `sca export` writes STEP, STL, OBJ and MJCF; the model JSON (`export_model_json`) and the operation graph stay the + contract for any out-of-tree consumer. `package_units` (the validated product-package units the exporters use) moves + to `simplecadapi.exporter.package_units`. +- The examples lose their FCStd export steps (`export_fcstd.py` and the FCStd parts of the `export.py` scripts), and the + skill pages `export-and-translation` are now `export`. + ### Added - `fillet_rsolid(..., strategy_auto_y_patch=True)`: the Y transition. Where a concave and a convex selected edge meet tangentially or nearly so (a post flush with a plate side, a wall a few degrees off it), two rolling-ball fillets cannot diff --git a/README.md b/README.md index 6e43950c..42b6bee6 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ The skill is how an agent learns the SDK. It is a router and a library of small | Rebuild from a mesh, point cloud or photos | scan reconstruction | | Rebuild from a vector-PDF drawing | drawing reconstruction | | Produce a GB engineering drawing (DXF) | engineering drawing from validated geometry | -| Hand the model to someone else | export and translation: STEP AP242, STL, FreeCAD, MJCF | +| Hand the model to someone else | export: STEP AP242, STL, OBJ, MJCF | **How it is organized** diff --git a/README.zh-CN.md b/README.zh-CN.md index 80608637..0f1060ec 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -69,7 +69,7 @@ Skill 是 agent 学会使用 SDK 的方式。它是一个路由页加一批小 | 从网格、点云或照片重建 | 扫描重建 | | 从矢量 PDF 图纸重建 | 图纸重建 | | 出国标工程图(DXF) | 由已验证的几何生成工程图 | -| 把模型交给别人 | 导出与转译:STEP AP242、STL、FreeCAD、MJCF | +| 把模型交给别人 | 导出:STEP AP242、STL、OBJ、MJCF | **怎么组织** diff --git a/docs/skill-design.md b/docs/skill-design.md index 1275295b..5fded312 100644 --- a/docs/skill-design.md +++ b/docs/skill-design.md @@ -101,7 +101,7 @@ references/workflows/ single-part-modeling.md outline, Role 5 (export), failure routes single-part-modeling/**role-1-requirements.md, requirements-template.md, role-2-plan.md, role-3-verifier.md, verifier-contract-patterns.md, role-4-build.md** - assembly-product-build.md step-reconstruction.md engineering-drawing.md export-and-translation.md + assembly-product-build.md step-reconstruction.md engineering-drawing.md export.md **scan-reconstruction.md** a mesh, point cloud or images as the source drawing-reconstruction.md outline drawing-reconstruction/**(role / stage pages, the owner chooses the names)** diff --git a/docs/skill/SKILL.md b/docs/skill/SKILL.md index 2a7312ad..f1318a55 100644 --- a/docs/skill/SKILL.md +++ b/docs/skill/SKILL.md @@ -1,6 +1,6 @@ --- name: simplecadapi -description: Build, assemble, inspect, reconstruct, and export parametric CAD models with the SimpleCADAPI Python SDK. Use for SimpleCAD geometry modeling, constrained sketches, parts and assemblies, standard gears and bearings, STEP/BREP inspection and reconstruction, mesh or image based reconstruction, vector-PDF drawing reconstruction, durable product packages, model JSON replay, and CAD backend translation. +description: Build, assemble, inspect, reconstruct, and export parametric CAD models with the SimpleCADAPI Python SDK. Use for SimpleCAD geometry modeling, constrained sketches, parts and assemblies, standard gears and bearings, STEP/BREP inspection and reconstruction, mesh or image based reconstruction, vector-PDF drawing reconstruction, durable product packages, model JSON replay, and export to STEP, STL, OBJ and MJCF. license: Apache-2.0 metadata: project: simplecadapi @@ -57,7 +57,7 @@ Each row's batch is the workflow page plus its `Read now` set (the workflow page | Rebuild a model from a mesh, point cloud or photos | `references/workflows/scan-reconstruction.md` | `references/workflows/scan-reconstruction.md` `references/domains/step-inspection.md` `references/domains/part-modeling.md` | | Rebuild a model from a vector-PDF drawing | `references/workflows/drawing-reconstruction.md` | `references/workflows/drawing-reconstruction.md` `references/workflows/drawing-reconstruction/role-1-drawing-confirmer.md` `references/domains/drawing-inspection.md` `references/domains/requirement-refinement.md` | | Produce a GB engineering drawing (DXF) from validated geometry | `references/workflows/engineering-drawing.md` | `references/workflows/engineering-drawing.md` `references/domains/engineering-drawing.md` `references/domains/requirement-refinement.md` | -| Export or translate a validated package | `references/workflows/export-and-translation.md` | `references/workflows/export-and-translation.md` `references/domains/export-and-translation.md` | +| Export a validated package | `references/workflows/export.md` | `references/workflows/export.md` `references/domains/export.md` | Routes without a workflow (no lifecycle, read the page and answer): diff --git a/docs/skill/references/README.md b/docs/skill/references/README.md index 58bd4efe..2c88b448 100644 --- a/docs/skill/references/README.md +++ b/docs/skill/references/README.md @@ -27,7 +27,7 @@ Load top-down and only what the task triggers; read each batch in one parallel r | `workflows/scan-reconstruction.md` | rebuild from a mesh, point cloud or photos: what the SDK supports and what it does not | | `workflows/drawing-reconstruction.md` | editable rebuild from vector-PDF dimensions (outline; stage pages in `workflows/drawing-reconstruction/`) | | `workflows/engineering-drawing.md` | GB engineering drawing (DXF) from validated geometry | -| `workflows/export-and-translation.md` | downstream formats from a validated package | +| `workflows/export.md` | downstream formats from a validated package | Stage and role pages of the long workflows: @@ -60,7 +60,7 @@ Stage and role pages of the long workflows: | `domains/editor-collaboration.md` | a person has the code-first editor open (`sca edit`) and you edit the same notebooks (a selection, a cell reference or a tuned value arrives). | | `domains/editor-gui-features.md` | a person made features with the editor's buttons (`# gui:` cells, `scad.ref` selections, workplanes, canvas sketches), or you run the same operations with `sca feature` / `sca sketch`. | | `domains/engineering-drawing.md` | a validated part or product needs a GB-standard drawing sheet (DXF + PNG). | -| `domains/export-and-translation.md` | a validated `.scadpkg` must be delivered as STEP, STL, OBJ, MJCF or an editable external CAD document. | +| `domains/export.md` | a validated `.scadpkg` must be delivered as STEP, STL, OBJ or MJCF. | | `domains/part-modeling.md` | the deliverable is one physical single-solid part, or an existing part source needs a geometry edit (Role 4 of `workflows/single-part-modeling.md`). | | `domains/requirement-refinement.md` | every task starts here: any modeling, assembly, reconstruction, or export request is refined into a brief first, and whenever inputs conflict, are ambiguous, or mix modalities. | | `domains/sketch-and-features.md` | the part's controlling dimensions are geometric constraints, or an editable, constraint-driven profile is requested (sketch tier profiles and paths). | @@ -109,4 +109,4 @@ Stage and role pages of the long workflows: - Every workflow has `Read now`, `Read when` and `Unattended mode`, with one unattended row for every gate that asks a person. - Every path written in a page must exist in the packaged skill. - Reading an API page is an action with an output: note the signature, return type and documented failures before the - first call. Non-SDK dependencies (Gmsh, CalculiX, VTK, FreeCAD scripting) are not covered by SDK pages. + first call. Non-SDK dependencies (Gmsh, CalculiX, VTK) are not covered by SDK pages. diff --git a/docs/skill/references/discipline/core-rules.md b/docs/skill/references/discipline/core-rules.md index c005d5ab..98273d02 100644 --- a/docs/skill/references/discipline/core-rules.md +++ b/docs/skill/references/discipline/core-rules.md @@ -17,7 +17,7 @@ consumes them. Cell boundaries, `_private` names and `var()` follow `discipline/ and the mandatory header `# ---- feature: () ----` follow `discipline/feature-tree-convention.md`. Read both before writing any cell. The one exception is a task that itself asks for a single script (`python model.py --output part.step`, an unattended batch): that is a plain script, see "One-shot script" in -`domains/export-and-translation.md`; the notebook rules do not apply to it. +`domains/export.md`; the notebook rules do not apply to it. **R4. Sketch first.** 2D profiles and planar paths go through the sketch API; primitives only when the shape is entirely the basic form. diff --git a/docs/skill/references/discipline/failure-and-repair.md b/docs/skill/references/discipline/failure-and-repair.md index 5b523493..9b6e083d 100644 --- a/docs/skill/references/discipline/failure-and-repair.md +++ b/docs/skill/references/discipline/failure-and-repair.md @@ -148,10 +148,9 @@ Repeated non-improvement changes the feature hypothesis instead of tuning the same parameters again. Stop only per the acceptance hierarchy — and record the evidence for the stop. -### Export/translation failure +### Export failure -Missing external backend (FreeCAD/FreeCADCmd) → report; offer the neutral -fallback explicitly. Over-coarse tessellation → tighten deflection +Over-coarse tessellation → tighten deflection parameters and re-export. Missing joints in MJCF → the assembly lacked explicit constraints; fix the source, never the exported file. diff --git a/docs/skill/references/discipline/feature-tree-convention.md b/docs/skill/references/discipline/feature-tree-convention.md index 85d000a7..d6754bb0 100644 --- a/docs/skill/references/discipline/feature-tree-convention.md +++ b/docs/skill/references/discipline/feature-tree-convention.md @@ -4,8 +4,8 @@ Part sources are block-structured feature chains: every block is one feature in the sense of a commercial CAD feature tree (Onshape / SolidWorks / -Fusion 360), readable by humans and LLMs, and translatable by the package -translators. This convention is mandatory for every part source authored in +Fusion 360), readable by humans and LLMs, and recorded as a replayable +operation graph. This convention is mandatory for every part source authored in any workflow. A model is a marimo notebook (`docs/guides/notebook-runtime.md`), and each @@ -99,7 +99,7 @@ wires at the point of use. Annotate `path=sketch`. `modify` blocks select through QL selectors — predicates plus cardinality (`.take(n).exactly(n)`) — or tags. Bare topology enumeration does not exist (plural getters are index-only); selections that escape the graph -capture kernel artifacts and do not translate. Indexed picks are reserved +capture kernel artifacts and do not replay. Indexed picks are reserved for intentional, named choices. ## Ordering and failure @@ -152,7 +152,7 @@ the source itself: A builder never caches; each call builds afresh. How the calling cell is cached is in `docs/guides/notebook-composition-and-cache.md`. -**Delivered sources state the anchor explicitly.** A translator-emitted +**Delivered sources state the anchor explicitly.** A generated or standalone `.ftc.py` passes `project_root=Path(__file__).parent` explicitly so the anchor is legible from the source itself — even though it matches the default, the corpus states it rather than relying on diff --git a/docs/skill/references/discipline/manufacturing-boundaries.md b/docs/skill/references/discipline/manufacturing-boundaries.md index f187c789..82a956bd 100644 --- a/docs/skill/references/discipline/manufacturing-boundaries.md +++ b/docs/skill/references/discipline/manufacturing-boundaries.md @@ -72,7 +72,7 @@ judgment, not a table: ## Format responsibilities Each export target carries only its own contract -(`../domains/export-and-translation.md`): +(`../domains/export.md`): - `.scadpkg` is the editable, replayable SimpleCAD boundary — never treat STL or OBJ as an editable CAD source. diff --git a/docs/skill/references/docs/api/FreeCADTranslator.md b/docs/skill/references/docs/api/FreeCADTranslator.md deleted file mode 100644 index 954748b7..00000000 --- a/docs/skill/references/docs/api/FreeCADTranslator.md +++ /dev/null @@ -1,17 +0,0 @@ -# FreeCADTranslator - -## Class Definition - -```python -class FreeCADTranslator(document_name: str = 'SimpleCADProduct') -``` - -*Source: translator/freecad_translator/translator.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.freecad_translator import FreeCADTranslator` - -## Description - -Translate validated `.scadpkg` products into FreeCAD scripts. diff --git a/docs/skill/references/docs/api/Fusion360Translator.md b/docs/skill/references/docs/api/Fusion360Translator.md deleted file mode 100644 index 5c206436..00000000 --- a/docs/skill/references/docs/api/Fusion360Translator.md +++ /dev/null @@ -1,17 +0,0 @@ -# Fusion360Translator - -## Class Definition - -```python -class Fusion360Translator(document_name: str = 'SimpleCADProduct', *, selection_mode: str = 'gsm', source_kernel_fallback: bool = False) -``` - -*Source: translator/fusion360_translator/translator.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.fusion360_translator import Fusion360Translator` - -## Description - -Translate validated `.scadpkg` products into Fusion 360 scripts. diff --git a/docs/skill/references/docs/api/README.md b/docs/skill/references/docs/api/README.md index ce804f8e..83453ebc 100644 --- a/docs/skill/references/docs/api/README.md +++ b/docs/skill/references/docs/api/README.md @@ -8,7 +8,6 @@ This index includes generated docs for the public SimpleCAD API surface, includi - Entries marked `submodule` are public through the listed submodule, such as `simplecadapi.ql`. - Entries marked `inspection namespace` are available through `simplecadapi.inspect.brep` and cannot run inside `GraphSession`. - Entries marked `drawing-inspection namespace` are available through `simplecadapi.inspect.drawing` and cannot run inside `GraphSession`. -- Entries marked `translator backend` are public only through `simplecadapi.translator.`. - Entries marked `reverse-engineering evaluator` are available through `simplecadapi.inverse_engineer.brep`; their acceptance inputs and reports belong to the trusted harness, not participant code. ## Basic Creation @@ -119,21 +118,6 @@ This index includes generated docs for the public SimpleCAD API surface, includi - [export_product_package_to_step](export_product_package_to_step.md) *(from exporter/step.py)* `exporter namespace` - [export_product_package_to_stl](export_product_package_to_stl.md) *(from exporter/stl.py)* `exporter namespace` -## Translator Backends - -- [FreeCADTranslator](FreeCADTranslator.md) *(from translator/freecad_translator/translator.py)* `translator backend` -- [Fusion360Translator](Fusion360Translator.md) *(from translator/fusion360_translator/translator.py)* `translator backend` -- [SolidWorksTranslator](SolidWorksTranslator.md) *(from translator/solidworks_translator/translator.py)* `translator backend` -- [export_model_json_to_solidworks_step](export_model_json_to_solidworks_step.md) *(from translator/solidworks_translator/api.py)* `translator backend` -- [make_interpolated_bspline_edge](make_interpolated_bspline_edge.md) *(from translator/solidworks_translator/translator.py)* `translator backend` -- [translate_model_json_to_fcstd](translate_model_json_to_fcstd.md) *(from translator/freecad_translator/api.py)* `translator backend` -- [translate_model_json_to_freecad_script](translate_model_json_to_freecad_script.md) *(from translator/freecad_translator/api.py)* `translator backend` -- [translate_model_json_to_solidworks_script](translate_model_json_to_solidworks_script.md) *(from translator/solidworks_translator/api.py)* `translator backend` -- [translate_product_package_to_fcstd](translate_product_package_to_fcstd.md) *(from translator/freecad_translator/api.py)* `translator backend` -- [translate_product_package_to_freecad_script](translate_product_package_to_freecad_script.md) *(from translator/freecad_translator/api.py)* `translator backend` -- [translate_product_package_to_fusion360_script](translate_product_package_to_fusion360_script.md) *(from translator/fusion360_translator/api.py)* `translator backend` -- [translate_product_package_to_solidworks_script](translate_product_package_to_solidworks_script.md) *(from translator/solidworks_translator/api.py)* `translator backend` - ## Math Helpers - [BSplineFitResult](BSplineFitResult.md) *(from math.py)* `top-level` diff --git a/docs/skill/references/docs/api/SolidWorksTranslator.md b/docs/skill/references/docs/api/SolidWorksTranslator.md deleted file mode 100644 index 94fb0a18..00000000 --- a/docs/skill/references/docs/api/SolidWorksTranslator.md +++ /dev/null @@ -1,17 +0,0 @@ -# SolidWorksTranslator - -## Class Definition - -```python -class SolidWorksTranslator(document_name: str = 'SimpleCADModel', *, output_path: Optional[str] = None, visible: bool = False, solidworks_version: str = '2025') -``` - -*Source: translator/solidworks_translator/translator.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.solidworks_translator import SolidWorksTranslator` - -## Description - -Public, stateless facade for SolidWorks script translation. diff --git a/docs/skill/references/docs/api/capture.md b/docs/skill/references/docs/api/capture.md index 4e43ef42..f068f40a 100644 --- a/docs/skill/references/docs/api/capture.md +++ b/docs/skill/references/docs/api/capture.md @@ -17,5 +17,5 @@ def capture(result: Any, path: str | Path, /, *, include_scene: bool = True) -> Capture a durable product and write its canonical `.scadpkg`. ``include_scene=False`` skips the optional Scene projection (tessellated -geometry/entity assets). STEP, MJCF, and FreeCAD exports read meshes and +geometry/entity assets). STEP and MJCF exports read meshes and feature graphs from the definition closure, so they do not need it. diff --git a/docs/skill/references/docs/api/export_model_json_to_solidworks_step.md b/docs/skill/references/docs/api/export_model_json_to_solidworks_step.md deleted file mode 100644 index b7aba8e3..00000000 --- a/docs/skill/references/docs/api/export_model_json_to_solidworks_step.md +++ /dev/null @@ -1,17 +0,0 @@ -# export_model_json_to_solidworks_step - -## API Definition - -```python -def export_model_json_to_solidworks_step(json_str: str, output_path: str, *, document_name: str = 'SimpleCADModel', visible: bool = False, solidworks_version: str = '2025', python_exe: Optional[str] = None) -> str -``` - -*Source: translator/solidworks_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.solidworks_translator import export_model_json_to_solidworks_step` - -## Description - -Execute SolidWorks COM automation and export a STEP file. diff --git a/docs/skill/references/docs/api/make_interpolated_bspline_edge.md b/docs/skill/references/docs/api/make_interpolated_bspline_edge.md deleted file mode 100644 index 92035a82..00000000 --- a/docs/skill/references/docs/api/make_interpolated_bspline_edge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_interpolated_bspline_edge - -## API Definition - -```python -def make_interpolated_bspline_edge(points: Any, *, periodic: bool = False, tolerance: float = 1e-06) -> Any -``` - -*Source: translator/solidworks_translator/translator.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.solidworks_translator import make_interpolated_bspline_edge` - -## Description - -An interpolating B-spline edge on the active backend. diff --git a/docs/skill/references/docs/api/translate_model_json_to_fcstd.md b/docs/skill/references/docs/api/translate_model_json_to_fcstd.md deleted file mode 100644 index d46f06ac..00000000 --- a/docs/skill/references/docs/api/translate_model_json_to_fcstd.md +++ /dev/null @@ -1,17 +0,0 @@ -# translate_model_json_to_fcstd - -## API Definition - -```python -def translate_model_json_to_fcstd(json_str: str, output_path: str, *, document_name: str = 'SimpleCADModel', freecad_cmd: Optional[str] = None) -> str -``` - -*Source: translator/freecad_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.freecad_translator import translate_model_json_to_fcstd` - -## Description - -Translate canonical model JSON to `.FCStd` via FreeCADCmd/FreeCAD. diff --git a/docs/skill/references/docs/api/translate_model_json_to_freecad_script.md b/docs/skill/references/docs/api/translate_model_json_to_freecad_script.md deleted file mode 100644 index 53d60c5d..00000000 --- a/docs/skill/references/docs/api/translate_model_json_to_freecad_script.md +++ /dev/null @@ -1,17 +0,0 @@ -# translate_model_json_to_freecad_script - -## API Definition - -```python -def translate_model_json_to_freecad_script(json_str: str, document_name: str = 'SimpleCADModel') -> str -``` - -*Source: translator/freecad_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.freecad_translator import translate_model_json_to_freecad_script` - -## Description - -Translate canonical model JSON into a FreeCAD Python script. diff --git a/docs/skill/references/docs/api/translate_model_json_to_solidworks_script.md b/docs/skill/references/docs/api/translate_model_json_to_solidworks_script.md deleted file mode 100644 index 3bec0cdd..00000000 --- a/docs/skill/references/docs/api/translate_model_json_to_solidworks_script.md +++ /dev/null @@ -1,21 +0,0 @@ -# translate_model_json_to_solidworks_script - -## API Definition - -```python -def translate_model_json_to_solidworks_script(json_str: str, document_name: str = 'SimpleCADModel', *, output_path: Optional[str] = None, visible: bool = False, solidworks_version: str = '2025') -> str -``` - -*Source: translator/solidworks_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.solidworks_translator import translate_model_json_to_solidworks_script` - -## Description - -Translate canonical model JSON into a SolidWorks automation script. - -The generated script contains one ``runtime.emit_node(...)`` call per -canonical graph node and drives SolidWorks through its COM automation -API, mirroring the FreeCAD backend's generated-script layout. diff --git a/docs/skill/references/docs/api/translate_product_package_to_fcstd.md b/docs/skill/references/docs/api/translate_product_package_to_fcstd.md deleted file mode 100644 index 7dc48cf1..00000000 --- a/docs/skill/references/docs/api/translate_product_package_to_fcstd.md +++ /dev/null @@ -1,17 +0,0 @@ -# translate_product_package_to_fcstd - -## API Definition - -```python -def translate_product_package_to_fcstd(data: ProductPackageInput, output_path: str, *, document_name: str = 'SimpleCADProduct', freecad_cmd: Optional[str] = None) -> str -``` - -*Source: translator/freecad_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.freecad_translator import translate_product_package_to_fcstd` - -## Description - -Translate one validated `.scadpkg` closure into an editable `.FCStd`. diff --git a/docs/skill/references/docs/api/translate_product_package_to_freecad_script.md b/docs/skill/references/docs/api/translate_product_package_to_freecad_script.md deleted file mode 100644 index b4c82c63..00000000 --- a/docs/skill/references/docs/api/translate_product_package_to_freecad_script.md +++ /dev/null @@ -1,17 +0,0 @@ -# translate_product_package_to_freecad_script - -## API Definition - -```python -def translate_product_package_to_freecad_script(data: ProductPackageInput, document_name: str = 'SimpleCADProduct') -> str -``` - -*Source: translator/freecad_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.freecad_translator import translate_product_package_to_freecad_script` - -## Description - -Translate one validated `.scadpkg` closure into a FreeCAD script. diff --git a/docs/skill/references/docs/api/translate_product_package_to_fusion360_script.md b/docs/skill/references/docs/api/translate_product_package_to_fusion360_script.md deleted file mode 100644 index 5ed70116..00000000 --- a/docs/skill/references/docs/api/translate_product_package_to_fusion360_script.md +++ /dev/null @@ -1,17 +0,0 @@ -# translate_product_package_to_fusion360_script - -## API Definition - -```python -def translate_product_package_to_fusion360_script(data: ProductPackageInput, document_name: str = 'SimpleCADProduct', *, selection_mode: str = 'gsm', source_kernel_fallback: bool = False) -> str -``` - -*Source: translator/fusion360_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.fusion360_translator import translate_product_package_to_fusion360_script` - -## Description - -Translate one validated `.scadpkg` closure into a Fusion 360 script. diff --git a/docs/skill/references/docs/api/translate_product_package_to_solidworks_script.md b/docs/skill/references/docs/api/translate_product_package_to_solidworks_script.md deleted file mode 100644 index c2cfe191..00000000 --- a/docs/skill/references/docs/api/translate_product_package_to_solidworks_script.md +++ /dev/null @@ -1,17 +0,0 @@ -# translate_product_package_to_solidworks_script - -## API Definition - -```python -def translate_product_package_to_solidworks_script(data, document_name: str = 'SimpleCADProduct', *, output_path: Optional[str] = None, visible: bool = False, solidworks_version: str = '2025') -> str -``` - -*Source: translator/solidworks_translator/api.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.solidworks_translator import translate_product_package_to_solidworks_script` - -## Description - -Translate one validated `.scadpkg` closure into SolidWorks automation. diff --git a/docs/skill/references/docs/core/declarative_constraints.md b/docs/skill/references/docs/core/declarative_constraints.md index cec8dd52..58afbd39 100644 --- a/docs/skill/references/docs/core/declarative_constraints.md +++ b/docs/skill/references/docs/core/declarative_constraints.md @@ -40,8 +40,6 @@ register_sketch_solver_backend(MyBackend()) set_default_sketch_solver_backend("my-solver") ``` -In `.FCStd` translation, sketch promotion is represented by a visible `Sketcher::SketchObject`. `make_face_from_sketch_rface(...)` does not create a separate face bridge object in the graph path; downstream FreeCAD operations such as `Part::Extrusion` use the promoted Sketcher object as their base. FreeCAD Sketcher constraints are validated as they are added: constraints that are unsupported, crash-risky, or rejected as redundant by FreeCAD are recorded in `SimpleCADSketchConstraints.skipped` instead of being emitted in a way that would make the sketch unsolvable or force a synthetic base object. - # Assembly Constraint Status Assembly containers, explicit part transforms, and declarative assembly constraints are temporarily removed from the public/support surface while the assembly system is redesigned. diff --git a/docs/skill/references/docs/core/dimension-tolerance-chains.md b/docs/skill/references/docs/core/dimension-tolerance-chains.md index 81bff63c..f5ae4a3f 100644 --- a/docs/skill/references/docs/core/dimension-tolerance-chains.md +++ b/docs/skill/references/docs/core/dimension-tolerance-chains.md @@ -161,7 +161,6 @@ Automatic validation occurs when: 1. `validate_tolerances(raise_on_failure=True)` is called. 2. A session or model JSON payload is exported. 3. A model JSON payload is imported or replayed. -4. A model is translated to FreeCAD through the model importer. A failed requirement raises `ToleranceValidationError` at the tolerance layer. Model import, export, and replay expose it through the existing structured `SimpleCADError` harness where applicable. @@ -222,16 +221,6 @@ unitless expressions and import with an empty tolerance graph when it is absent. Nominal geometry replay still uses the numeric snapshots in operation-node `params`. Tolerance validation does not sample or regenerate worst-case geometry. -## FreeCAD Translation - -FreeCAD translation keeps the full tolerance graph as document metadata. The -`SimpleCADExpressions` spreadsheet stores lower/upper deviations in columns E/F, -nominal unit in G, tolerance unit in H, and inferred dimension in I. Spreadsheet -values and formulas use canonical CAD values so inch/radian declarations remain -consistent with operation-node snapshots. The translator preserves tolerance -intent but does not convert it into FreeCAD geometric-tolerance objects or -statistical solvers. - ## Failure Conditions Tolerance analysis fails explicitly for: diff --git a/docs/skill/references/docs/core/operation_graph_json_spec.md b/docs/skill/references/docs/core/operation_graph_json_spec.md index f703e88f..bfb3305b 100644 --- a/docs/skill/references/docs/core/operation_graph_json_spec.md +++ b/docs/skill/references/docs/core/operation_graph_json_spec.md @@ -69,7 +69,6 @@ source API 名字不等于 canonical graph op 名字。Composite source API 可 - 必须限制在冻结的 canonical op set 内 - 不能泄漏 convenience-only 或 macro-only op - composite builtin 可以内部构造表达式和 low-level 调用,但最终写入图中的节点只能是 low-level op -- FreeCAD translator 可以对安全的单消费者 transform 做 lowering 优化,例如把 `make_translate_rshape` 折叠进上游 `Part::Extrusion.Placement`,但 canonical graph 节点仍然保留,并在 `.FCStd` 对象的 `SimpleCADFoldedOps` 中记录 evidence 典型结果: diff --git a/docs/skill/references/docs/core/physical-units.md b/docs/skill/references/docs/core/physical-units.md index 82ae2055..d4d7cd9d 100644 --- a/docs/skill/references/docs/core/physical-units.md +++ b/docs/skill/references/docs/core/physical-units.md @@ -2,8 +2,7 @@ SimpleCADAPI attaches physical meaning at `Var` declarations and infers the dimension of every derived scalar expression. This catches invalid formulas before -they reach geometry, tolerance analysis, model export, replay, or FreeCAD -translation. +they reach geometry, tolerance analysis, model export, or replay. ## Canonical CAD Units @@ -184,7 +183,7 @@ Unit and dimension validation runs when: 2. An expression is directly evaluated. 3. An expression is registered or imported through `ExpressionGraph`. 4. A tolerance is analyzed or a requirement is declared. -5. Session/model JSON is imported, exported, replayed, or translated. +5. Session/model JSON is imported, exported, or replayed. Malformed units, cyclic graphs, duplicate expression IDs, mixed legacy/typed variables, incompatible dimensions, invalid roots, and invalid trigonometric inputs diff --git a/docs/skill/references/docs/core/serialization/expressions-and-replay.md b/docs/skill/references/docs/core/serialization/expressions-and-replay.md index fdd8be4c..3bf228e6 100644 --- a/docs/skill/references/docs/core/serialization/expressions-and-replay.md +++ b/docs/skill/references/docs/core/serialization/expressions-and-replay.md @@ -116,7 +116,7 @@ Replay rebuilds using width `24.0`, because that is the value stored in `params` Even though replay uses snapshots today, `param_exprs` and `expression_graph` are important for external tools: -- FreeCAD or CAD translators can reconstruct spreadsheet bindings. +- CAD exporters and importers can reconstruct spreadsheet bindings. - UI tools can display which dimensions are driven by variables. - Future parametric replay can use the same expression references. - Diffs can distinguish numeric constants from expression-derived values. diff --git a/docs/skill/references/docs/guides/README.md b/docs/skill/references/docs/guides/README.md index 6c7ab9b9..6830bebb 100644 --- a/docs/skill/references/docs/guides/README.md +++ b/docs/skill/references/docs/guides/README.md @@ -8,7 +8,7 @@ - [Notebook Runtime](notebook-runtime.md): models as marimo notebooks, `sca run`, parameters, the editor. - [Notebook Composition and Cache](notebook-composition-and-cache.md): `scad.use` composition, part families, the cell cache, `@part`/`@assemble` library parts. -- [Product Export](product-export.md): `.scadpkg` delivery, FreeCAD/AP242 targets, STL/OBJ, optional Gmsh volume meshing. +- [Product Export](product-export.md): `.scadpkg` delivery, AP242 target, STL/OBJ, optional Gmsh volume meshing. The corresponding runnable module and examples live in: diff --git a/docs/skill/references/docs/guides/notebook-runtime.md b/docs/skill/references/docs/guides/notebook-runtime.md index c5d1f6bf..00c61369 100644 --- a/docs/skill/references/docs/guides/notebook-runtime.md +++ b/docs/skill/references/docs/guides/notebook-runtime.md @@ -255,4 +255,4 @@ The editor and a coding agent share the notebook file: ## Composing notebooks, the cell cache, library parts, export - Composing notebooks (`scad.use`), part families (`scad.notebook_id()`), the cell cache, and library parts (`@scad.part`, `@scad.assemble`): `notebook-composition-and-cache.md`. -- Product package export (`scad.capture`), downstream targets (`.FCStd`, STEP, STL, OBJ) and the Gmsh meshing example: `product-export.md`. +- Product package export (`scad.capture`), downstream targets (STEP, STL, OBJ) and the Gmsh meshing example: `product-export.md`. diff --git a/docs/skill/references/docs/guides/product-export.md b/docs/skill/references/docs/guides/product-export.md index bd2cfddf..026591b0 100644 --- a/docs/skill/references/docs/guides/product-export.md +++ b/docs/skill/references/docs/guides/product-export.md @@ -1,6 +1,6 @@ # Product Package Export and Downstream Targets -**Read when:** a notebook's product must be written as a `.scadpkg` or delivered to FreeCAD, STEP, STL, OBJ or a mesher. Running a notebook and parameters are in `notebook-runtime.md`. +**Read when:** a notebook's product must be written as a `.scadpkg` or delivered to STEP, STL, OBJ or a mesher. Running a notebook and parameters are in `notebook-runtime.md`. ## Product package export @@ -31,7 +31,6 @@ downstream target from the consumer contract: | Target | Use when | Preserved contract | Boundary | | --- | --- | --- | --- | | `.scadpkg` | Rebuild, replay, or further SimpleCAD tooling is required | Complete durable definition closure, feature graphs, source snapshots, topology, connectors, constraints, and materials | SimpleCAD-specific archive | -| `.FCStd` | A FreeCAD user needs an editable native document | Definition-owned, dependency-first native feature graphs; final body links; repeated instances; nested assemblies; names; solved placements; materials; connectors; constraints; grounding; revision; and content hashes | Requires FreeCADCmd/FreeCAD | | AP242 `.step` | Neutral CAD exchange or downstream OpenCASCADE tooling is required | Evaluated BREP, product hierarchy, shared definitions, occurrence names/placements, materials, colors, density, and named SimpleCAD property payloads | Canonical feature history is not reconstructed as AP242 features | | Triangle `.obj` | Surface inspection or DCC exchange needs an indexed mesh | Direct OpenCASCADE tessellation of evaluated BREP with shared vertices and oriented triangles | Evaluated surface mesh only; no CAD hierarchy, feature semantics, quads, or materials | | Binary `.stl` | Additive manufacturing or triangle-only consumers | The same direct OpenCASCADE BREP triangles | Facet soup only; no shared vertices, CAD hierarchy, feature semantics, or materials | @@ -40,10 +39,6 @@ downstream target from the consumer contract: package_path = "out/product.scadpkg" scad.capture(run.definition, package_path) -fcstd_path = scad.translator.freecad_translator.translate_product_package_to_fcstd( - package_path, - "out/product.FCStd", -) step_report = scad.exporter.export_product_package_to_step( package_path, "out/product.step", diff --git a/docs/skill/references/domains/assembly-and-product.md b/docs/skill/references/domains/assembly-and-product.md index 31c4919c..7784ada9 100644 --- a/docs/skill/references/domains/assembly-and-product.md +++ b/docs/skill/references/domains/assembly-and-product.md @@ -23,7 +23,7 @@ deliver `.scadpkg` packages. - Monolithic single-body manufacturing intent: fuse with `union_rsolid` in `domains/part-modeling.md`. - Export or translation decisions: they branch from the package in - `domains/export-and-translation.md`. + `domains/export.md`. ## Structure model - `Part` wraps exactly one `Solid` plus identity and optional material diff --git a/docs/skill/references/domains/export-and-translation.md b/docs/skill/references/domains/export.md similarity index 80% rename from docs/skill/references/domains/export-and-translation.md rename to docs/skill/references/domains/export.md index 6b9d3242..0d178431 100644 --- a/docs/skill/references/domains/export-and-translation.md +++ b/docs/skill/references/domains/export.md @@ -1,16 +1,13 @@ -# Task Domain: Export and Translation +# Task Domain: Export -**Read when:** a validated `.scadpkg` must be delivered as STEP, STL, OBJ, MJCF or an editable external CAD document. +**Read when:** a validated `.scadpkg` must be delivered as STEP, STL, OBJ or MJCF. -Export validated product packages to neutral and mesh formats, and translate -them into editable external CAD backends. +Export validated product packages to neutral and mesh formats. ## Use when - The deliverable is a STEP, STL, OBJ, or MJCF file from a validated `.scadpkg` product package. -- An external CAD user needs an editable FreeCAD, Fusion 360, or SolidWorks - document or script. - A robotics/simulation consumer needs MJCF with the assembled kinematic tree. ## Do not use @@ -26,7 +23,6 @@ Choose the downstream target from the consumer contract: | Target | Use when | Preserved contract | Boundary | | --- | --- | --- | --- | | `.scadpkg` | Rebuild, replay, or further SimpleCAD tooling | Definition closure, occurrence graph, feature graphs, source snapshots, topology, connectors, constraints, materials | SimpleCAD-specific archive | -| `.FCStd` | A FreeCAD user needs an editable native document | Definition-owned dependency-first feature graphs, repeated instances, nested assemblies, names, solved placements, materials, connectors, constraints, grounding, revision, content hashes | Requires FreeCAD/FreeCADCmd | | AP242 `.step` | Neutral CAD exchange or OpenCASCADE tooling | Evaluated BREP, product hierarchy, shared definitions, occurrence names/placements, materials, colors, density, named property payloads | Feature history is not reconstructed as AP242 features | | `.obj` | Surface inspection or DCC exchange | Direct OpenCASCADE tessellation, shared vertices, oriented triangles | Evaluated surface mesh only | | `.stl` | Additive manufacturing or triangle-only consumers | Same direct tessellation | Facet soup; no shared vertices or hierarchy | @@ -48,19 +44,13 @@ Read the exact page under `references/docs/api/` for every API used: `ProductMJCFExportReport` (mesh/body/joint/equality/closure/grounded/site counts, default density, limitations). Never assume mesh counts exist on the STEP report or vice versa. -- Translators (`scad.translator.`): - `translate_product_package_to_fcstd`, - `translate_product_package_to_freecad_script`, - `translate_product_package_to_fusion360_script`, - `translate_product_package_to_solidworks_script`, plus - `FreeCADTranslator`, `Fusion360Translator`, `SolidWorksTranslator`. - Package reading when downstream tools consume packages directly: `read_product_package`, `load_product_package`, `validate_product_package`. ## Export rules -- Translate only from a validated product package: `capture` the product +- Export only from a validated product package: `capture` the product first, then export from the package path. In a one-shot script (below) the exporters also take the build result itself and package it in memory, with the same validation and without the scene projection nobody reads. @@ -113,16 +103,12 @@ A notebook run unattended in a read-only directory uses - Read the returned export report and print its actual fields per format (see API groups above); never assume success from a missing exception. -- For `.FCStd`, confirm the translation ran against the intended package - revision (units are deduplicated by definition identity). - For MJCF, confirm every intended joint appears, loop-closing movable joints are equality/connect, and gear/belt/rack-pinion couplings are fixed-tendon equalities. ## Failure modes -- Missing FreeCAD/FreeCADCmd: `.FCStd` translation fails; report the missing - backend instead of falling back to STEP-only silently. - Over-coarse tessellation on curved parts: tighten `linear_deflection` / `angular_deflection_degrees` and re-export. - Exporting a stale package: re-capture after source changes before export; diff --git a/docs/skill/references/domains/part-modeling.md b/docs/skill/references/domains/part-modeling.md index 4126484b..842d580c 100644 --- a/docs/skill/references/domains/part-modeling.md +++ b/docs/skill/references/domains/part-modeling.md @@ -56,7 +56,7 @@ Read the exact page under `references/docs/api/` for every API used. Before the first call, extract each page's signature, return type, and documented failure modes into working notes — a method absent from the page does not exist, however plausible it looks. Non-SDK dependencies -(Gmsh, CalculiX, VTK, FreeCAD scripting) are outside these pages: +(Gmsh, CalculiX, VTK) are outside these pages: consult their own documentation before the first call. - Primitives: `make_box_rsolid`, `make_cylinder_rsolid`, `make_sphere_rsolid`, diff --git a/docs/skill/references/domains/requirement-refinement.md b/docs/skill/references/domains/requirement-refinement.md index dd1b5614..64dd4b7e 100644 --- a/docs/skill/references/domains/requirement-refinement.md +++ b/docs/skill/references/domains/requirement-refinement.md @@ -30,7 +30,7 @@ first, and whenever inputs conflict, are ambiguous, or mix modalities. patterns. - Positioning control: faces, axes, origins, connectors, constraints, interfaces. -- Output files requested: package, STEP, STL, OBJ, MJCF, FCStd, scripts. +- Output files requested: package, STEP, STL, OBJ, MJCF, scripts. - Mounting and service conditions when the part fastens to anything or carries load: fastener type/size, head side and insertion direction, mounting face, and the load direction with a magnitude class. diff --git a/docs/skill/references/domains/sketch-and-features.md b/docs/skill/references/domains/sketch-and-features.md index 5df00614..4c12bb91 100644 --- a/docs/skill/references/domains/sketch-and-features.md +++ b/docs/skill/references/domains/sketch-and-features.md @@ -233,6 +233,5 @@ print(plan.get_metadata("projections")) # [{'source': 'front', 'entity': 'wall - Underconstrained sketch drifting on promotion: add evidence-backed constraints, or record the free DOF explicitly. -- Unsupported or redundant constraints in downstream translation are recorded - as skipped, not silently dropped; check the solve snapshot when fidelity - matters. +- Unsupported or redundant constraints are recorded in the solve snapshot, + not silently dropped; check it when fidelity matters. diff --git a/docs/skill/references/workflows/assembly-product-build.md b/docs/skill/references/workflows/assembly-product-build.md index 873bb214..be359c0a 100644 --- a/docs/skill/references/workflows/assembly-product-build.md +++ b/docs/skill/references/workflows/assembly-product-build.md @@ -10,7 +10,7 @@ subassemblies, motion semantics, or product package delivery — including mechanisms composed of standard-library components (gearboxes, reducers, rack drives, cycloidal drives): standard-part usage lives here. Not for monolithic parts (`single-part-modeling.md`) or export-only requests -(`export-and-translation.md` runs from an existing package). +(`export.md` runs from an existing package). ## Read now (one parallel batch) @@ -35,7 +35,7 @@ monolithic parts (`single-part-modeling.md`) or export-only requests | the constraint solve fails or placement is wrong | `discipline/failure-and-repair.md` | | a validation gate needs a check script | `discipline/geometric-validation.md` | | defaults for clearances, backlash or walls are needed | `discipline/manufacturing-boundaries.md` | -| capturing the package and exporting (steps 9-10) | `docs/guides/product-export.md`, `domains/export-and-translation.md` | +| capturing the package and exporting (steps 9-10) | `docs/guides/product-export.md`, `domains/export.md` | ## Unattended mode @@ -65,7 +65,7 @@ required_domains: optional_domains: - sketch-and-features - standard-parts - - export-and-translation + - export artifacts: - one part notebook per physical part - one assembly notebook composing them with scad.use @@ -133,7 +133,7 @@ repair_routes: `sca run .py --out out/.scadpkg`, or `capture(run.definition, ...)` from `run_notebook` — the single delivery boundary. -10. **Export** (`domains/export-and-translation.md`) only after validation. +10. **Export** (`domains/export.md`) only after validation. ## API pages to read diff --git a/docs/skill/references/workflows/drawing-reconstruction.md b/docs/skill/references/workflows/drawing-reconstruction.md index edbcaf42..e182ff59 100644 --- a/docs/skill/references/workflows/drawing-reconstruction.md +++ b/docs/skill/references/workflows/drawing-reconstruction.md @@ -72,7 +72,7 @@ Standing discipline, binding for every role: | 2 | Master Planner | `report_A.md`, `REQUIREMENTS.md`, `discipline/mechanical-modeling.md`, `discipline/datums-and-coordinate-systems.md` | feature hypothesis list + `/BUILD_PLAN.md` + base TODOs | plan presented | | 3 | Verifier Planner | `report_A.md`, `BUILD_PLAN.md`, `discipline/geometric-validation.md`, check-specific API pages | per-stage verification contracts, the roundtrip contract, executable checks | verification artifact ready before modeling | | 4 | Detail Modeling Planner & Builder | stage contract, `domains/part-modeling.md`, `discipline/feature-ordering.md`, `discipline/feature-tree-convention.md`, modeling API pages | stage models, operation hypotheses, rendered inputs | model runs and the prepared verifier passes | -| 5 | Exporter | `REQUIREMENTS.md` export rows, `domains/export-and-translation.md`, `domains/assembly-and-product.md` | `.scadpkg` + exports + evidence pack | artifacts re-open cleanly | +| 5 | Exporter | `REQUIREMENTS.md` export rows, `domains/export.md`, `domains/assembly-and-product.md` | `.scadpkg` + exports + evidence pack | artifacts re-open cleanly | ## Role-switch protocol @@ -136,7 +136,7 @@ owning artifact and repeats the same Role 3/4 loop. | the last stage closes | `workflows/drawing-reconstruction/roundtrip-acceptance.md` | | sheet B is generated | `domains/engineering-drawing.md` | | the roundtrip has passed | `workflows/drawing-reconstruction/role-5-exporter.md` | -| Role 5 exports | `domains/export-and-translation.md` | +| Role 5 exports | `domains/export.md` | | Role 5 exports an assembly-rooted package | `domains/assembly-and-product.md` | | a check fails twice for the same cause, or repeated dead ends | `discipline/failure-and-repair.md` | diff --git a/docs/skill/references/workflows/drawing-reconstruction/role-5-exporter.md b/docs/skill/references/workflows/drawing-reconstruction/role-5-exporter.md index f2072c5c..1b95e5c4 100644 --- a/docs/skill/references/workflows/drawing-reconstruction/role-5-exporter.md +++ b/docs/skill/references/workflows/drawing-reconstruction/role-5-exporter.md @@ -7,7 +7,7 @@ Part of `workflows/drawing-reconstruction.md`. Load when the roundtrip has passe Read the export rows from `REQUIREMENTS.md`. Durable canonical delivery is `sca run .py --out out/.scadpkg` (or `capture(run.definition, ...)` after `run_notebook`); external formats through -`domains/export-and-translation.md`. Post-export gate: re-open the package +`domains/export.md`. Post-export gate: re-open the package in a fresh process and confirm definition/solid counts; list every produced file with size. diff --git a/docs/skill/references/workflows/export-and-translation.md b/docs/skill/references/workflows/export.md similarity index 75% rename from docs/skill/references/workflows/export-and-translation.md rename to docs/skill/references/workflows/export.md index 6fffa78f..6cc908bc 100644 --- a/docs/skill/references/workflows/export-and-translation.md +++ b/docs/skill/references/workflows/export.md @@ -1,4 +1,4 @@ -# Workflow: Export and Translation +# Workflow: Export Take a validated product package and produce the requested downstream deliverables. @@ -14,15 +14,13 @@ when an optional target is unavailable: uv run sca export out/product.scadpkg --output-dir out/exports ``` -Without `--format`, this writes AP242 STEP, binary STL, and OBJ. Add unusual -or backend-dependent outputs deliberately; `--check` performs all package, +Without `--format`, this writes AP242 STEP, binary STL, and OBJ. Add the +non-default output (MJCF) deliberately; `--check` performs all package, output-path, and selected-target prerequisite checks without writing files: ```bash -uv run sca export out/product.scadpkg \ - --format fcstd --format mjcf --output-dir out/exports --check -uv run sca export out/product.scadpkg \ - --format fcstd --freecad-cmd /path/to/FreeCADCmd --output-dir out/exports +uv run sca export out/product.scadpkg --format mjcf --output-dir out/exports --check +uv run sca export out/product.scadpkg --format mjcf --output-dir out/exports ``` Use the lower-level Python APIs only when a workflow needs behavior the CLI @@ -39,10 +37,10 @@ modeling workflow first — exports are deliverables, never validation. ```yaml goal: requested export files from a validated .scadpkg -primary_domain: export-and-translation +primary_domain: export required_domains: - requirement-refinement # which formats and why - - export-and-translation + - export optional_domains: - step-inspection # roundtrip validation of exports artifacts: @@ -55,7 +53,7 @@ validation_gates: repair_routes: - stale export -> re-capture, re-export - coarse mesh -> tighten deflection parameters - - backend missing -> report; no silent format substitution + - target unavailable (MJCF from a non-assembly package) -> report; no silent format substitution ``` ## Steps @@ -66,16 +64,14 @@ repair_routes: making it current, the edit follows `discipline/feature-tree-convention.md` block structure. 2. **Select targets by consumer contract** - (`domains/export-and-translation.md` table): editable FreeCAD document → - `.FCStd`; neutral exchange → AP242 `.step`; DCC/surface inspection → - `.obj`; additive manufacturing → `.stl`; MuJoCo simulation → MJCF. + (`domains/export.md` table): neutral exchange → AP242 `.step`; + DCC/surface inspection → `.obj`; additive manufacturing → `.stl`; MuJoCo simulation → MJCF. **Unattended:** when the request names no format, export the default STEP/STL/OBJ and record that choice as an assumption in the report. 3. **Preflight and export from the package path**. Start with `uv run sca export .scadpkg --output-dir --check`. It checks the package and default STEP/STL/OBJ targets. Add each non-default - target with `--format`; FCStd requires FreeCADCmd (or `--freecad-cmd`) and - MJCF requires an assembly-rooted package. Re-run without `--check` to write + target with `--format`; MJCF requires an assembly-rooted package. Re-run without `--check` to write the files. Use `--output FORMAT=PATH` for a non-conventional file name and `--overwrite` only when replacement is intentional. 4. **Read the JSON report**: definition ids, occurrence/solid/triangle counts, @@ -86,14 +82,13 @@ repair_routes: 5. **Validate roundtrip when it matters**: consumers that re-import STEP → `validate_step_roundtrip_rdescriptor` on the exported file. 6. **Report**: file paths, per-format report facts, parameters chosen - (deflection values), and any backend that was unavailable. + (deflection values), and any target that was unavailable. ## API pages to read `capture` (when re-capturing), this workflow's CLI command contract, the exporter page(s) for every format requested when using APIs or interpreting -format-specific reports, the translator page(s) for every backend requested, -and `validate_step_roundtrip_rdescriptor` when roundtrip validation applies. +format-specific reports, and `validate_step_roundtrip_rdescriptor` when roundtrip validation applies. ## Validation gates @@ -104,18 +99,11 @@ and `validate_step_roundtrip_rdescriptor` when roundtrip validation applies. curved parts, looser for large simple geometry when size matters. - MJCF: every intended joint present; loop-closing constraints emitted as equality/connect; public connectors only expose sites/endpoints. -- `.FCStd`: translation consumed the intended package revision. - `sca export --check` passes before delivery export; the final JSON report records every requested target as successful. ## Failure routes -- FreeCAD/FreeCADCmd missing → `sca export --check --format fcstd` - reports the missing backend before writing. Export default STEP/STL/OBJ if - requested, offer STEP as the neutral fallback, and say so explicitly. - **Unattended:** do not offer; export the default STEP/STL/OBJ if requested, - record the missing backend and the fallback in the report, and never present - the fallback as the requested format. - STL/OBJ too coarse or too large → adjust deflection parameters, re-export; both formats share one tessellation pass. - MJCF joints missing → the assembly lacked explicit constraints; return to @@ -124,7 +112,7 @@ and `validate_step_roundtrip_rdescriptor` when roundtrip validation applies. ## Deliverables Exported file paths, report facts per format, chosen parameters, unavailable -backends, and checks not run. +targets, and checks not run. **Required reading before authoring or editing any part source in this workflow:** `discipline/feature-tree-convention.md` — the block-structured @@ -139,8 +127,8 @@ load its product from verification scripts with | File | Why | | --- | --- | -| `workflows/export-and-translation.md` | the command path, steps and gates (this page) | -| `domains/export-and-translation.md` | the consumer-contract table and format reports | +| `workflows/export.md` | the command path, steps and gates (this page) | +| `domains/export.md` | the consumer-contract table and format reports | ## Read when @@ -161,6 +149,5 @@ decisions are recorded in the report. | Interactive gate | Unattended replacement | | --- | --- | | Step 2: which formats and why (Ask-or-Record in `domains/requirement-refinement.md`) | Take the formats the request names, else the default STEP/STL/OBJ; ledger the choice | -| Failure route: backend missing, offer STEP as the neutral fallback | Export the default targets if requested, record the missing backend and the fallback in the report, no silent substitution | | Package not current or the model needs work (route to the owning modeling workflow) | Record the blocker in the report, export nothing as validated, never invent geometry | -| Closing report to the person | The report (`discipline/operating-modes.md`): file paths, per-format facts, parameters, unavailable backends, checks not run | +| Closing report to the person | The report (`discipline/operating-modes.md`): file paths, per-format facts, parameters, unavailable targets, checks not run | diff --git a/docs/skill/references/workflows/scan-reconstruction.md b/docs/skill/references/workflows/scan-reconstruction.md index cadc58d4..4f642887 100644 --- a/docs/skill/references/workflows/scan-reconstruction.md +++ b/docs/skill/references/workflows/scan-reconstruction.md @@ -8,7 +8,7 @@ likely run unattended; the report and the evidence tiers are first-class. Use when the deliverable is an editable, replayable model of a part and the only source is scan data or pictures. Not for a STEP/BREP source (`workflows/step-reconstruction.md`), not for a vector-PDF drawing -(`workflows/drawing-reconstruction.md`), not for exporting a model to STL (`workflows/export-and-translation.md`). +(`workflows/drawing-reconstruction.md`), not for exporting a model to STL (`workflows/export.md`). ## Read now (one parallel batch) @@ -31,7 +31,7 @@ for a STEP/BREP source (`workflows/step-reconstruction.md`), not for a vector-PD | step 6: comparing, or a comparison fails | `discipline/geometric-validation.md`, `discipline/failure-and-repair.md` | | the part is a standard component | `domains/standard-parts.md` | | the scan is one part of a product | `workflows/assembly-product-build.md` | -| delivering a package or STL | `docs/guides/product-export.md`, `domains/export-and-translation.md` | +| delivering a package or STL | `docs/guides/product-export.md`, `domains/export.md` | ## Unattended mode diff --git a/docs/skill/references/workflows/single-part-modeling.md b/docs/skill/references/workflows/single-part-modeling.md index 4fefadbe..06f04261 100644 --- a/docs/skill/references/workflows/single-part-modeling.md +++ b/docs/skill/references/workflows/single-part-modeling.md @@ -29,7 +29,7 @@ stage-by-stage TDD loop; Role 5 exports only after every stage gate passes. | a stage's profiles are sketch tier | `domains/sketch-and-features.md` | | the requirement is a standard part (gear, bearing, fastener) | `domains/standard-parts.md` | | a mechanism mating several standard parts | `workflows/assembly-product-build.md` | -| Role 5 starts | `domains/export-and-translation.md`, `domains/assembly-and-product.md`, `docs/guides/product-export.md` | +| Role 5 starts | `domains/export.md`, `domains/assembly-and-product.md`, `docs/guides/product-export.md` | | a check or a build keeps failing | `discipline/failure-and-repair.md` | ## Unattended mode @@ -100,7 +100,7 @@ Standing discipline, binding for every role: | 2 | Master Planner | `REQUIREMENTS.md`, `discipline/mechanical-modeling.md`, `discipline/datums-and-coordinate-systems.md` | `/BUILD_PLAN.md` + base TODOs | plan presented | | 3 | Verifier Planner | `REQUIREMENTS.md`, `BUILD_PLAN.md`, `discipline/geometric-validation.md`, exact API/diagnostic pages used by the check | current-stage verification contract, hypothesis snippets, executable verification script, `plan verifier` and `run verifier` TODO items | verification artifact is ready before modeling | | 4 | Detail Modeling Planner & Builder | current stage's verifier contract, `domains/part-modeling.md`, `discipline/feature-ordering.md`, `discipline/feature-tree-convention.md`, `discipline/notebook-cell-design.md`, exact modeling API pages | current-stage model, operation hypotheses, rendered evidence inputs | model runs and the prepared verifier passes | -| 5 | Exporter | `REQUIREMENTS.md` export rows, `domains/export-and-translation.md`, `domains/assembly-and-product.md` | `.scadpkg` + requested exports, readability check | artifacts re-open cleanly | +| 5 | Exporter | `REQUIREMENTS.md` export rows, `domains/export.md`, `domains/assembly-and-product.md` | `.scadpkg` + requested exports, readability check | artifacts re-open cleanly | ## Role-switch protocol @@ -135,7 +135,7 @@ artifact and repeats the same Role 3/4 loop. Read the export rows from `REQUIREMENTS.md`. Durable canonical delivery is `sca run .py --out out/.scadpkg` (or `capture(run.definition, ...)` after `run_notebook`); external formats go through -`domains/export-and-translation.md` capabilities. Post-export gate: +`domains/export.md` capabilities. Post-export gate: re-open the package in a fresh process (`validate_product_package` / definition materialization) and confirm definition/solid counts; list every produced file with size. diff --git a/docs/skill/references/workflows/single-part-modeling/requirements-template.md b/docs/skill/references/workflows/single-part-modeling/requirements-template.md index 7e85a424..20981275 100644 --- a/docs/skill/references/workflows/single-part-modeling/requirements-template.md +++ b/docs/skill/references/workflows/single-part-modeling/requirements-template.md @@ -13,7 +13,7 @@ The file Role 1 writes (`workflows/single-part-modeling/role-1-requirements.md` - Fastening & mounting: Envelope math: min land / boss / offset> - Service conditions: -- Export targets: .scadpkg always; STEP/STL/OBJ/MJCF/FCStd if requested +- Export targets: .scadpkg always; STEP/STL/OBJ/MJCF if requested - Verification intent: - Ask-or-Record ledger: | item | asked/assumed | answer/value | - Assumption ledger (unattended; interactive runs use the Ask-or-Record ledger above): diff --git a/docs/skill/references/workflows/step-reconstruction.md b/docs/skill/references/workflows/step-reconstruction.md index 821c995b..d4582d9b 100644 --- a/docs/skill/references/workflows/step-reconstruction.md +++ b/docs/skill/references/workflows/step-reconstruction.md @@ -30,7 +30,7 @@ Use when the deliverable is an editable/replayable model reproducing a target | splitting the candidate into cells | `discipline/notebook-cell-design.md` | | constraints represent the evidence | `domains/sketch-and-features.md` | | the target has several components | `domains/assembly-and-product.md`, `workflows/assembly-product-build.md` | -| re-exporting for comparison or delivery | `domains/export-and-translation.md` | +| re-exporting for comparison or delivery | `domains/export.md` | | a comparison fails or a feature is falsified | `discipline/failure-and-repair.md` | | the source is a mesh, point cloud or photos, not a STEP | `workflows/scan-reconstruction.md` | @@ -59,7 +59,7 @@ required_domains: optional_domains: - sketch-and-features - assembly-and-product # multi-component targets - - export-and-translation # re-export for comparison or delivery + - export # re-export for comparison or delivery artifacts: - target evidence notes (summaries, entity descriptors, sections) - feature-tree hypothesis with provenance rows diff --git a/examples/.gitignore b/examples/.gitignore index 766d1292..59665f56 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -2,10 +2,6 @@ out/ *.step *.stl *.json -*.FCStd -*.FCBak -*.fcstd -*.fcbak *.scadpkg *.zip *.log diff --git a/examples/README.md b/examples/README.md index 355db72f..1b1e5ece 100644 --- a/examples/README.md +++ b/examples/README.md @@ -39,19 +39,19 @@ uv run python examples/four_bar_linkage/export.py # package + exchange files | Example | Category | Product notebook | Run | Key artifacts (`out/`) | | --- | --- | --- | --- | --- | | `flange_plate/` | part | `flange_plate.py` | `export.py`, `render_views.py`, `verify.py` | `flange_plate.scadpkg` + `.step` + PNG (quickstart FTC part, session replay under `demo/`) | -| `caplcd_enclosure/` | part | `caplcd_enclosure.py` | `export.py` | `caplcd_enclosure_7ep.scadpkg` + `.step` + `.FCStd` | -| `dimension_tolerance_chain/` | part (tolerances) | `dimension_tolerance_chain.py` | `report.py` | worst-case / RSS report, `.scadpkg` + `.step` + `.FCStd` | -| `constrained_sketch/` | part (sketch) | `constrained_sketch.py` | `export.py` | `constrained_sketch.scadpkg` + `.step` + `.FCStd` | +| `caplcd_enclosure/` | part | `caplcd_enclosure.py` | `export.py` | `caplcd_enclosure_7ep.scadpkg` + `.step` | +| `dimension_tolerance_chain/` | part (tolerances) | `dimension_tolerance_chain.py` | `report.py` | worst-case / RSS report, `.scadpkg` + `.step` | +| `constrained_sketch/` | part (sketch) | `constrained_sketch.py` | `export.py` | `constrained_sketch.scadpkg` + `.step` | | `arc_handle/` | part + FEM | `arc_handle.py` | `export.py`, then `uv run --extra fem python examples/arc_handle/fem_analysis.py` | `arc_handle.scadpkg`, render, `fem/` analysis | -| `hydraulic_rod_assembly/` | assembly | `hydraulic_rod_assembly.py` | `export.py` | `hydraulic_rod_assembly.scadpkg` + `.step` + `.FCStd` | -| `external_reference_gear_train/` | assembly (nested) | `nested_external_reference_gear_trains.py` | `export.py` | `nested_external_reference_gear_trains.scadpkg` + STEP/FCStd | +| `hydraulic_rod_assembly/` | assembly | `hydraulic_rod_assembly.py` | `export.py` | `hydraulic_rod_assembly.scadpkg` + `.step` | +| `external_reference_gear_train/` | assembly (nested) | `nested_external_reference_gear_trains.py` | `export.py` | `nested_external_reference_gear_trains.scadpkg` + STEP | | `four_bar_linkage/` | assembly (kinematics, part family) | `four_bar_linkage.py` | `export.py`, `export_mjcf.py` | `four_bar_linkage.scadpkg` + STEP + MJCF | | `u_link_motor_mount/` | assembly | `u_link_motor_mount.py` | `export.py`, `verify/acceptance.py` | `u_link_assembly.scadpkg` + STEP/STL + renders (`demo/index.html` session replay) | | `l_link_motor_mount/` | assembly (part family) | `l_link_motor_mount.py` (`--id l-link-motor-mount- --set PRESET=`) | `export.py`, `verify/acceptance.py`, `verify/export_artifacts.py` | `l_link_assembly_.scadpkg` + STEP/STL per adapter preset + renders | | `pcg_attractor_canopy/` | part (procedural) | `attractor_canopy.py` | `export.py`, `verify.py` | `attractor_canopy.scadpkg` + STEP/STL/OBJ + GIF | | `pcg_facade_tower/` | procedural building (plain modules) | — | `export.py [rect\|chamfer\|l_shape] [n_floors]`, then `verify/s1_verify.py` … `verify/s8_verify.py` | `facade_tower.scadpkg` + AP242 STEP + panel-schedule CSV + rationalization/scale sweeps + verify renders | -| `compact_two_stage_planetary_reducer/` | assembly (part families) | `compact_two_stage_planetary_reducer.py` | `export.py`, `export_mjcf.py` | `compact_two_stage_planetary_reducer.scadpkg` + STEP/FCStd/MJCF | -| `integrated_bldc_joint_actuator/` | product (sub-assembly notebooks) | `integrated_bldc_joint_actuator.py` | `export_all.py`, `render_showcase.py` | `integrated_bldc_joint_actuator.scadpkg` + STEP/FCStd/MJCF + renders | +| `compact_two_stage_planetary_reducer/` | assembly (part families) | `compact_two_stage_planetary_reducer.py` | `export.py`, `export_mjcf.py` | `compact_two_stage_planetary_reducer.scadpkg` + STEP/MJCF | +| `integrated_bldc_joint_actuator/` | product (sub-assembly notebooks) | `integrated_bldc_joint_actuator.py` | `export_all.py`, `render_showcase.py` | `integrated_bldc_joint_actuator.scadpkg` + STEP/MJCF + renders | | `ap242_gmsh_volume_mesh/` | FEM / data exchange | `bracket.py` | see below | AP242 + Gmsh volume mesh + CalculiX statics | | `bowl_connector/` | reverse engineering | — | Re-mode workspace in the unified Web Editor | rebuild artifacts under `re_work/` | | `histcad_demo/` | translation demos | — | `uv run python examples/histcad_demo/