diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7effca0a..dfbd5899 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,8 +80,10 @@ jobs: run: uv run twine check dist/* - name: Build and verify Agent Skill archive run: | - uv run skill-pack --refresh-docs --archive - uv run pytest test/test_skill_pack.py -q + uv run python tools/auto_docs_gen.py --quiet + uv run python tools/skillbuild.py --target omp + uv run pytest test/test_skill_build.py -q + tar -C skills -czf skills/simplecadapi.tar.gz simplecadapi-omp - name: Create GitHub release diff --git a/.gitignore b/.gitignore index e0e50512..de99d0c1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ design-doc/ # Generated skills archives skills/*.tar.gz +# Compiled per-harness skill outputs (built by tools/skillbuild.py) +skills/simplecadapi-*/ + .DS_Store # CAD/export artifacts diff --git a/MANIFEST.in b/MANIFEST.in index 9e054f21..0d02eb29 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,8 +11,6 @@ recursive-include src *.py recursive-include src/simplecadapi/scene/contracts *.json *.md include src/simplecadapi/py.typed -recursive-include src/auto_tools *.py - # 排除不需要的文件 exclude .python-version exclude uv.lock diff --git a/README.md b/README.md index 2710ee14..643d095c 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ See the [full English update notes](docs/updates/2.0.4b3.md) for contracts, cache modes, diagnostics, limitations, and verification coverage. All formal single-script examples emit a synchronized `.scadpkg`, AP242 -`.step`, and editable `.FCStd` from the same product package. Run -`uv run python tools/run_examples.py` to rebuild and validate that set. The +`.step`, and editable `.FCStd` from the same product package. The split AP242/Gmsh example under `examples/12_ap242_gmsh_volume_mesh/` exposes each build and export stage as a separate directly runnable script. @@ -393,32 +392,35 @@ uv run python examples/20_integrated_bldc_joint_actuator/main.py ## Releasing the Agent Skill -The repository includes a thin Agent Skill under `skills/simplecadapi/`. It -contains generated API and modeling references, but does not bundle the SDK -source code. +The skill source tree lives under `docs/skill/` and stays harness-neutral. +`tools/skillbuild.py` compiles it per harness target (targets and output +directories are configured in `skillproj.toml`; the outputs under +`skills/simplecadapi-*/` are regenerable build artifacts and are not +committed). Harness-specific text, when it is ever needed, is marked with +`` conditional blocks that compile per target. -From a clean checkout, update the project version and documentation, then build -and validate the release artifacts: +From a clean checkout, update the project version and documentation, then +build and validate the release artifacts: ```bash uv sync --group dev -uv run skill-pack --refresh-docs --archive -uv run python -m pytest test/test_skill_pack.py +uv run python tools/auto_docs_gen.py --quiet +uv run python tools/skillbuild.py --target omp +uv run pytest test/test_skill_build.py +tar -C skills -czf skills/simplecadapi.tar.gz simplecadapi-omp ``` -The command refreshes the generated docs, rewrites `skills/simplecadapi/`, and -creates `skills/simplecadapi.tar.gz`. Review the generated `SKILL.md` and -references before release: +The commands regenerate the API references inside the skill tree, recompile +the omp target, and create `skills/simplecadapi.tar.gz`. Review the source +tree and the compiled output before release: ```bash -git diff -- skills/simplecadapi docs -tar -tzf skills/simplecadapi.tar.gz +git diff -- docs/skill +tar -tzf skills/simplecadapi.tar.gz | head ``` -Commit the generated `skills/simplecadapi/` directory and refreshed `docs/` -with the release. The archive is intentionally ignored by Git; attach -`skills/simplecadapi.tar.gz` to the corresponding GitHub release or distribute -it through the target Agent Skills registry. +Commit only the `docs/skill/` source tree; the release workflow builds the +harness outputs and uploads the archive to the GitHub release. ## Development diff --git a/docs/architecture/sdk-architecture-review.md b/docs/architecture/sdk-architecture-review.md deleted file mode 100644 index c6dbb636..00000000 --- a/docs/architecture/sdk-architecture-review.md +++ /dev/null @@ -1,365 +0,0 @@ -# SimpleCADAPI SDK 架构评价报告 - -日期:2026-05-21 - -视角:函数式风格 programmer + CAD 软件架构师 - -前提:本报告认同并保留 SimpleCADAPI 的顶层 API 风格。`make_*_r*`、`*_rsolid`、`*_rwire`、`GraphSession`、`export_model_json` 这一套方向不是问题本身,反而是这个 SDK 最有价值的部分。真正的问题在于:内部实现还没有完全配得上这个顶层风格所暗示的稳定性、可组合性和可重放性。 - -## 总结判断 - -SimpleCADAPI 的顶层 API 选择是正确的:它没有把用户拖进传统 CAD kernel 的继承层级和 builder 生命周期,而是用一组接近纯函数的建模函数表达几何变换。这是适合 Python、适合自动化、适合 LLM/脚本生成、也适合未来 GUI 低代码编排的 API 形态。 - -但当前架构的真实状态是:顶层像函数式 CAD DSL,底层仍是“带全局上下文、带隐藏运行时元数据、带 OCC 对象身份、带启发式 replay”的工程拼装体。它能跑通大量示例,但还没有形成足够硬的 CAD SDK 契约。最危险的地方不是 primitive 建模能力,而是拓扑命名、选择语义、replay 严格性、装配求解、schema 稳定性和测试强度。 - -如果用一句话评价:这是一个有正确 API 直觉的 OCP-native CAD SDK 原型,已经越过玩具阶段,但还没有越过“可靠参数化 CAD 平台”的门槛。 - -## 评价边界 - -本报告基于当前仓库源码、文档、示例和测试,不评价尚未落地的设想。 - -主要检查对象: - -- `src/simplecadapi/__init__.py` -- `src/simplecadapi/core.py` -- `src/simplecadapi/operations.py` -- `src/simplecadapi/graph.py` -- `src/simplecadapi/serializer.py` -- `src/simplecadapi/topology.py` -- `src/simplecadapi/tracking.py` -- `src/simplecadapi/ql.py` -- `src/simplecadapi/tagging.py` -- historical assembly/constraint implementation, now removed from the active public/support surface -- historical scalar-field/SDF implementation, now removed from the active public/support surface -- `docs/core/serialization/` -- `docs/core/operation_graph_json_spec.md` -- retained replayable examples under `examples/` -- `test/` 与 `tests/` - -## 顶层 API 评价 - -顶层 API 的方向值得保留。 - -`make_box_rsolid(...)`、`make_line_redge(...)`、`extrude_rsolid(...)`、`union_rsolid(...)` 这种命名确实有点“硬”,但它有一个重要优点:它把 CAD 操作建模成从参数到几何值的映射,返回类型在名字里显式出现。对脚本、生成式建模、图记录、schema 生成和 IDE 补全来说,这比传统 OOP fluent builder 更稳定。 - -强项: - -- `__init__.py` 明确导出建模函数、核心类型、graph/session、serializer、expression 和 `ql` 子模块,公开面可见性好。参考:`src/simplecadapi/__init__.py`。 -- 大多数核心创建函数遵守返回类型后缀,例如 `make_point_rvertex -> Vertex`、`make_line_redge -> Edge`、`make_circle_rwire -> Wire`、`make_box_rsolid -> Solid`。参考:`src/simplecadapi/operations.py:691`、`src/simplecadapi/operations.py:723`、`src/simplecadapi/operations.py:1465`。 -- composite convenience API 在 `GraphSession` 内降低为 canonical low-level graph,这个设计非常正确。用户调用 `make_box_rsolid`,图里记录 rectangle/profile/extrude,这是 CAD DSL 和 replay IR 分层的正确方式。参考:`src/simplecadapi/operations.py` 与 `test/test_serialization.py`。 -- `union_rsolid(...)` 明确返回单个 `Solid`,失败就报错,不默默返回多个实体。这对机械 CAD 是正确的默认语义。参考:`src/simplecadapi/operations.py:2856`、`src/simplecadapi/operations.py:2876`。 -- `GraphSession` + `export_model_json` + `replay_model_json` 的主线是对的。它把脚本建模提升为可交换、可 replay 的模型记录。参考:`src/simplecadapi/graph.py:44`、`src/simplecadapi/serializer.py:416`、`src/simplecadapi/serializer.py:732`。 -- `ql` 被放到子模块而非全部塞进顶层,是正确的边界意识。参考:`src/simplecadapi/__init__.py`、`docs/api/README.md:5`。 - -当前问题与已完成清理: - -- 已完成:顶层 convenience aliases 以及 `export_step`、`export_stl`、`to_step`、`to_stl` 已从公开面移除,不保留兼容转发。 -- 已完成:持久产品只通过 `capture(result, path)` 写出 `.scadpkg`;STEP、STL 和原生 CAD 输出从该产品包显式派生。 -- 仍需关注:`rsolidlist` 命名混杂了“参数类型”和“返回类型”:`cut_rsolid`、`intersect_rsolid` 实际返回 `Solid`,而 `linear_pattern_rsolidlist` 返回 `List[Solid]`。 -- 仍需关注:public op 名和 graph op 名不完全一致,例如 `translate_shape` 记录为 `make_translate_rshape`,`extrude_rsolid` 记录为 `make_extrude_rsolid`;这种分层需要稳定的 source API 到 canonical IR 映射。 -- 仍需关注:部分非 session 分支记录的 graph op 命名与 canonical `make_*_r*` 形式不一致,需要继续收敛。 - -后续重点是稳定 source API 到 canonical graph op 的映射,并在下一次不兼容版本中清理剩余历史命名。 - -## 函数式架构评价 - -顶层是函数式的,底层不是。 - -从函数式 programmer 的角度看,这套 SDK 最好的设计是“操作返回新几何值,而不是用户手动驱动 mutable builder”。但当前实现中,几何值本身携带大量隐藏可变状态:tags、metadata、runtime graph node、topo refs、track summary。这不是不能接受,但必须承认它是 effect system,而不是纯函数系统。 - -可取之处: - -- `operations.py` 的 `_finalize_primitive_shape`、`_finalize_derived_shape`、`_finalize_tracked_solid` 把 graph recording、semantic delta、tracking summary 收敛到少数 finalizer。这个方向正确。参考:`src/simplecadapi/operations.py:597`、`src/simplecadapi/operations.py:629`、`src/simplecadapi/operations.py:650`。 -- 旧 `ScalarField` 尝试用 frozen dataclass 表达隐式建模 AST;该 surface 已移除,后续如恢复需先统一 SDF 语义。 -- `ShapeSelector`、`SerializablePredicate`、`SerializableKey` 都是 dataclass/frozen 风格,QL 作为可序列化 AST 的方向正确。参考:`src/simplecadapi/ql.py:258`、`src/simplecadapi/ql.py:320`、`src/simplecadapi/ql.py:396`。 - -问题: - -- 已解决:`GraphSession` 的 active session 与 recording suspend depth 使用 `ContextVar`,嵌套和异步任务按执行上下文隔离。 -- 已解决:`SimpleWorkplane` 使用 `ContextVar` 帧栈;上下文退出通过 token 精确恢复父帧。 -- `attach_graph_node` 会把 graph node、node id、output slot、topo ref 写入 shape runtime/metadata。这个副作用是设计核心,但它破坏了“同样输入得到同样纯值”的直觉。参考:`src/simplecadapi/graph.py:231`、`src/simplecadapi/graph.py:247`、`src/simplecadapi/graph.py:259`。 -- tagging 已收敛到 `apply_tag(shape, tag)` / `list_tags(shape)` 的 functional public surface;底层仍然是对 shape tag store 的受控 mutation,需要在 docs 中明确这是 controlled tagging effect。 -- 已解决:`GraphSession` 节点记录完整合成的 `context`,replay 通过 `use_coordinate_system(node.context)` 恢复工作平面;嵌套 Workplane 与 sketch creation frame 已有 model JSON 回归。 - -函数式层面的根本建议:把 `GraphSession`、workplane、tag/metadata/runtime 都明确视为 effect context,并用 `contextvars` 或显式 session 参数隔离;公开文档不要暗示全纯函数,而要说“functional surface with controlled recording/tagging effects”。 - -## CAD Kernel 边界评价 - -这套 SDK 是 OCP-native,不是 kernel-agnostic。这一点没有问题,但必须讲清楚。 - -优点: - -- wrapper 很薄,直接包 OCP TopoDS,性能和能力不会被中间抽象拖死。参考:`src/simplecadapi/core.py:422`、`src/simplecadapi/core.py:465`、`src/simplecadapi/core.py:597`、`src/simplecadapi/core.py:713`。 -- `kernel/` 目录已经把 builders、booleans、curves、features、mesh、properties、topology、transforms、export 分层出来,比把所有 OCP 调用塞到 `operations.py` 更可维护。参考:`src/simplecadapi/kernel/ocp_booleans.py:1`、`src/simplecadapi/kernel/ocp_features.py`、`src/simplecadapi/kernel/ocp_transforms.py`。 -- tests 已经明确防止 CadQuery 依赖回流,这是好边界。参考:`tests/test_ocp_core_no_cadquery.py:9`。 - -问题: - -- `.wrapped` 是公开事实,docs 也承认 public geometry wrappers expose `.wrapped`。这不是错,但这意味着 SDK 没有真正封装 kernel,只是提供了 OCP-native convenience layer。参考:`docs/core/README.md:5`、`src/simplecadapi/core.py:427`、`src/simplecadapi/core.py:718`。 -- QL 内部直接用 OCP adaptor 判断 curve/surface type。这个实现合理,但进一步证明 QL 当前绑定 OCP 语义,而不是中立 CAD 语义。参考:`src/simplecadapi/ql.py:193`。 -- 旧 constraints 实现直接用 OCP transform 重建 solid,装配层和 kernel 层耦合很深;该 public/support surface 已移除,等待新契约重做。 -- `operations.py` 仍然直接 import OCP builder 类型并手写部分 kernel 操作。kernel adapter 层还没有完全收敛。参考:`src/simplecadapi/operations.py:14`、`src/simplecadapi/operations.py:17`。 - -建议:不要假装 kernel-agnostic。短期应该明确定位为 OCP-native functional SDK。中期把 `operations.py` 中剩余 OCP 直接调用继续下沉到 `kernel/`,让 public ops 只做参数验证、effect finalization 和 semantic recording。 - -## 拓扑身份与命名 - -这是当前最核心的 CAD 风险。 - -CAD SDK 真正难的不是画 box、cylinder、extrude,而是模型变化后还能稳定地说“我要这个孔的圆边”“我要这个安装面”。当前 SimpleCADAPI 已经意识到这个问题,但实现还没有解决它。 - -已有基础: - -- `_TopologyEntityCache` 用 OCC `HashCode` bucket 加 `IsSame` 做同一 shape occurrence 的合并,能让一个 box 的 shared edge occurrences 共享 topo id。参考:`src/simplecadapi/core.py:42`、`tests/test_topology_identity.py:16`。 -- `TopoRef`、`TopoDelta`、`TopoEntry`、`SemanticDelta` 数据模型已经存在,说明架构上知道需要 graph-aware topology references。参考:`src/simplecadapi/topology.py:60`、`src/simplecadapi/topology.py:203`、`src/simplecadapi/topology.py:223`。 -- `tracking.py` 直接查询 OCC builder 的 `Modified()`、`Generated()`、`IsDeleted()`、`SectionEdges()`,方向正确。参考:`src/simplecadapi/tracking.py:1`、`src/simplecadapi/tracking.py:107`。 - -硬伤: - -- `TopoRef.topo_id` 文档自己承认 implementation-defined,可能是 sequential integer、hash 等。这不够 durable。参考:`src/simplecadapi/topology.py:69`。 -- `_safe_shape_hash` 使用 `HashCode(1000000)`,fallback 是 `hash(shape)`。这只能做运行期/构建期身份辅助,不能做跨 replay 稳定身份。参考:`src/simplecadapi/core.py:22`。 -- `TaggedMixin.topo_id` 在无 entity 时 fallback 到 `id(self)`,这是进程内对象身份,不是 CAD 拓扑身份。参考:`src/simplecadapi/core.py:321`。 -- `tracking._topo_id` 也使用 OCC hash,并且注释叫 “Stable-ish”。这句话本身就是风险说明。参考:`src/simplecadapi/tracking.py:80`。 -- `TopoEntry` 支持 richer lineage,但 `tracking._build_boolean_result` 只把 rich entries 放进 `delta_entries` dict,没有填入 `TopoDelta.entries`。导出时 `export_model_json` 只序列化 `node.topo_delta`,丰富 lineage 没有成为 durable graph contract。参考:`src/simplecadapi/tracking.py:283`、`src/simplecadapi/tracking.py:291`、`src/simplecadapi/serializer.py:480`。 -- boolean、fillet、chamfer、shell 后的 topology tracking 是有用的,但不是 stable topology naming system。它记录了 OCC 的历史回答,不等于建立了语义身份。 - -结论:当前拓扑身份适合调试、局部 selection replay 和轻量 semantic tagging,不适合作为长期参数化模型的核心契约。必须尽快把 QL/SelectionSpec 作为 primary identity,把 raw topo refs 降级为 fallback。 - -## QL 与选择语义 - -QL 是架构上最应该继续投资的部分。 - -好处: - -- QL 已经有 serializable predicate、serializable key、selector、order、limit、exactly cardinality。参考:`src/simplecadapi/ql.py:258`、`src/simplecadapi/ql.py:320`、`src/simplecadapi/ql.py:396`。 -- QL 支持 tag/meta/property/curve_type/surface_type/normal/center/length/area/volume 等基础语义。参考:`src/simplecadapi/ql.py:77`、`src/simplecadapi/ql.py:94`、`src/simplecadapi/ql.py:125`。 -- fillet/chamfer/shell 现在会把 QL selector 的运行时结果编译为 `make_select_*` geo select nodes;`selection_query` 仅保留为旧 payload fallback。参考:`test/test_serialization.py:443`、`src/simplecadapi/serializer.py:1365`。 - -问题: - -- QL graph scope 现在通过 `make_select_*` 节点的 source input 表达,而不是只靠 query AST;未来还需要把这个契约扩展到非 detail-feature 的通用 selection 工作流。 -- 当前 replay resolution order 已经变为 geo select nodes -> selection_query fallback -> topo refs -> indices -> hint;后续风险主要是外部 adapter 需要跟进新顺序。 -- 只有 `exactly(n)`,没有 `at_least`、`at_most`,cardinality 还不够表达真实 CAD 选择约束。参考:`src/simplecadapi/ql.py:457`。 -- ordering 只有单 key,不支持 lexicographic multi-key。复杂 CAD 选择里单 key 很容易产生不稳定 tie。参考:`src/simplecadapi/ql.py:429`。 -- `_shape_identity` 仍然优先用 topo id 或 topo_ref metadata,说明 QL 运行时仍被当前 topology identity 牵引。参考:`src/simplecadapi/ql.py:566`。 - -建议:把 `SelectionSpec` 做成正式 schema:source scope、query AST、多 key order、limit、cardinality、fallback。所有接受 `List[Edge]`、`List[Face]` 的 feature API,在 GraphSession 内都应该 normalize 成 SelectionSpec。replay 必须 QL first,topo refs/indices/hints 只能 fallback。 - -## Graph、Serialization 与 Replay - -这是 SDK 的战略性资产,也是当前最需要变硬的契约。 - -做得好的地方: - -- `OperationGraph` 是 DAG,节点保存 op、params、param_exprs、inputs、context、semantic_delta、topo_delta、tags。结构完整。参考:`src/simplecadapi/topology.py:318`、`src/simplecadapi/topology.py:476`。 -- `export_model_json` 输出 graph、leaf_ids、expression_graph、frame_graph、registries、delta logs、canonical contract。方向很对。参考:`src/simplecadapi/serializer.py:627`。 -- `_assert_graph_is_canonical` 在 export model 前拒绝非 canonical ops,这是保持 IR 干净的正确动作。参考:`src/simplecadapi/serializer.py:246`、`src/simplecadapi/serializer.py:624`。 -- `test/test_serialization.py` 系统覆盖 source API 到 operation tree 的映射,是该契约的主要回归入口。 - -严重问题: - -- replay 过于宽松。多个 replay 分支在输入缺失时 `continue`,最终 leaf collection 用 `outputs.get(node_id, [])`。坏图可能静默变成少输出或空输出。参考:`src/simplecadapi/serializer.py:1018`、`src/simplecadapi/serializer.py:1051`、`src/simplecadapi/serializer.py:1294`。 -- primitive replay 使用 permissive defaults。缺少 `x` 就默认为 0,缺少 radius 就默认为 1。这会把坏 JSON 变成错误几何,而不是报错。参考:`src/simplecadapi/serializer.py:767`。 -- `OperationGraph.from_dict` 对 edges 和 inputs 的缺失引用采取静默跳过。对 interchange schema 来说这太软。参考:`src/simplecadapi/topology.py:692`、`src/simplecadapi/topology.py:701`。 -- graph schema version 是 `1.0`,model schema 是 `2.0-draft`,canonical contract 是 `2.0-final-state`。这三个版本信号混在一起,会让外部消费者不知道哪个才是稳定承诺。参考:`src/simplecadapi/topology.py:19`、`src/simplecadapi/serializer.py:221`、`src/simplecadapi/serializer.py:628`。 -- 已解决:node replay 进入记录时的完整合成 `context`;`frame_graph` 保留相同的绝对帧快照供外部消费者使用。 -- `leaf_ids` 自动来自 graph leaves,而不是用户显式声明的 final outputs。debug/intermediate 独立节点会成为 replay 输出。参考:`src/simplecadapi/serializer.py:624`、`src/simplecadapi/topology.py:563`。 -- expression replay 是 numeric snapshot,不是 parametric replay。这个可以接受,但必须在 SDK 主文档里反复强调。参考:`test/test_serialization.py`。 - -建议:replay 应该默认 strict。所有 missing input、missing param、unknown op、leaf missing output、selection cardinality mismatch 都应该 hard failure。需要宽松模式时显式 `strict=False`。 - -## Boolean 与 Feature Tracking - -当前 boolean API 的用户语义比很多 CAD wrapper 都清楚,但 tracking 和 replay 还不够可信。 - -优点: - -- `union_rsolid` flatten nested inputs,使用 scale-aware fuzzy tolerance,支持 glue,默认 clean,并强制单 solid。参考:`src/simplecadapi/operations.py:221`、`src/simplecadapi/operations.py:2856`、`src/simplecadapi/kernel/ocp_booleans.py:40`。 -- `fuse_shapes` 使用 OCC Fuse、parallel、OBB、fuzzy value、GlueShift 和 same-domain cleanup,基本工程判断正确。参考:`src/simplecadapi/kernel/ocp_booleans.py:45`。 -- `tracked_cut`、`tracked_union`、`tracked_intersect` 使用 OCC history,这比只比较结果 faces 靠谱。参考:`src/simplecadapi/tracking.py:308`、`src/simplecadapi/tracking.py:338`、`src/simplecadapi/tracking.py:374`。 - -问题: - -- `tracked_union` 接收 `glue` 和 `tol`,但没有把它们设置到 `BRepAlgoAPI_Fuse`。也就是说用于结果的 union 和用于 tracking 的 union 参数可能不一致。参考:`src/simplecadapi/tracking.py:338`、`src/simplecadapi/tracking.py:352`。 -- `union_rsolid` replay 忽略记录过的 `clean`、`glue`、`tol`,只调用 `ops.union_rsolid(all_solids)`。参数不 faithful。参考:`src/simplecadapi/operations.py:2946`、`src/simplecadapi/serializer.py:1029`。 -- `cut_rsolid` 对无交集 tool 直接跳过,这对 modeling convenience 可能友好,但对 replay/diagnostic 来说可能隐藏错误。参考:`src/simplecadapi/operations.py:3033`。 -- 多 tool cut/intersect 只保留最后一次 delta,前面 tool 的 lineage 丢失。参考:`src/simplecadapi/operations.py:3020`、`src/simplecadapi/operations.py:3127`。 -- extrude face classification 使用 center 精确相等、normal dot 精确等于 0、angle 精确等于 pi,这在 CAD 数值几何里非常脆弱。参考:`src/simplecadapi/operations.py:2631`、`src/simplecadapi/operations.py:2646`、`src/simplecadapi/operations.py:2653`。 - -建议:boolean result 和 boolean tracking 必须用同一 builder 或至少同一参数配置;replay 必须重放 boolean params;feature tagging 不应靠 exact float equality,应使用 tolerance 和 topology history。 - -## Tagging 与 Metadata - -tagging 的目标是对的,但现在新旧体系混在一起。 - -优点: - -- `tagging.py` 定义了 normalized tag grammar 和 `TagPolicy`,这是 QL 和 anchor semantics 的基础。参考:`src/simplecadapi/tagging.py:8`、`src/simplecadapi/tagging.py:58`。 -- `apply_tag(shape, tag)` / `list_tags(shape)` 是唯一推荐的 public tagging surface,`list_tags` 输出稳定排序。 -- 当前约定是不在 tags 中存数字,而是在 metadata[`geo`] 中保存结构化几何事实。 - -问题: - -- QL、anchor lookup、auto tagging、metadata[`geo`] 之间还需要一个正式 schema 文档把它们串起来。 -- tagging 仍然是 shape-local side effect;graph/session replay 文档应继续明确哪些 tags 会进入 serialized selector hints。 - -建议:建立 tag schema version。新代码只产生 normalized tags,旧 tags 标成 `legacy.*` 或仅作为 lookup fallback。 - -## Assembly 与 Constraints - -旧装配 API 的顶层形态有可取之处,但 solver 只是 MVP;该 surface 已移除,等待基于新 assembly IR / constraint graph 重做。 - -优点: - -- assembly 层和 geometry construction 分开,这是正确的 CAD 架构。geometry API 做 integrated parts,未来 assembly constraints 做最终空间关系。 -- anchor/part handle 这类表达形式可以作为新设计参考,但不能直接恢复旧实现。 -- solved snapshot 的函数式方向可以保留,但需要新的 solver contract 支撑。 - -问题: - -- 旧 solver 是顺序应用约束的迭代 pose adjustment,不是 DOF solver、不是约束图求解器、没有 Jacobian/least-squares、没有 overconstraint/underconstraint 严格诊断。 -- 旧 diagnostics 主要只有 non-convergence 和 unconstrained parts。对真实机械装配不够。 -- 旧 bbox anchor 基于 local AABB,旋转或复杂形体下语义会很粗糙。 -- 旧 `export_model_json` assembly frame 摘要不完整,因此已从当前 schema 中撤回。 - -建议:把当前 assembly 文档称为 “layout constraints” 或 “MVP rigid pose helper”,不要称成熟 assembly solver。下一步优先修 export frame rotation,然后再谈 DOF solver。 - -## Scalar Field 与 Implicit Modeling - -旧 scalar field/SDF surface 已移除;下面记录的是移除前的历史评审结论。 - -优点: - -- 旧 `ScalarField` tree 曾尝试做可序列化/replay 的隐式建模表达。 -- 旧 `make_field_surface_rsolid` 曾区分 replayable scalar field tree 和 opaque callable。 - -问题: - -- sphere 返回平方距离减 `r^2`,box/capsule 接近 signed distance。smooth union/subtract 假设 field value 单位可比,但这里不成立。 -- `scale` 使用 min scale 乘回 field value,对非 SDF field 更不稳定。 -- 这意味着 implicit smooth operations 目前更像 demo/experimental,而不是可靠 SDF modeling kernel。 - -建议:明确 `ScalarField` 是 algebraic implicit field 还是 true SDF。若要支持 smooth booleans,必须统一到 SDF 或至少在每个 primitive 标记 value metric,并拒绝不兼容 smooth blend。 - -## 错误模型与 Developer Experience - -优点: - -- public operations 大量使用 `raise_harness_error` 包装上下文,错误信息对脚本用户友好。参考:`src/simplecadapi/operations.py:204`。 -- import/replay 的错误也有 what happened / possible causes / how to fix,这对 SDK 很有价值。参考:`src/simplecadapi/serializer.py:345`、`src/simplecadapi/serializer.py:743`。 - -问题: - -- 一些地方直接 `print` warning,而不是走 warning/error policy。参考:`src/simplecadapi/core.py:787`、`src/simplecadapi/core.py:808`。 -- 一些 tracking 异常被吞掉,例如 union tracking 失败就继续记录无 delta。这对 robustness 友好,但对 auditability 很差。参考:`src/simplecadapi/operations.py:2930`。 -- replay 对 malformed graph 静默跳过比报错更危险。参考:`src/simplecadapi/serializer.py:1018`。 - -建议:区分 user modeling error、kernel failure、replay schema error、tracking degraded warning。replay/schema 默认必须严格。 - -## 测试体系评价 - -测试覆盖了很多 API,但 CAD robustness 测试还不够狠。 - -已有价值: - -- 有 no-CadQuery boundary test。参考:`tests/test_ocp_core_no_cadquery.py:9`。 -- 有 topology occurrence identity test。参考:`tests/test_topology_identity.py:16`。 -- 有 graph serialization/replay tests,包括 QL selector replay、mirror、sweep、pattern 等。参考:`test/test_serialization.py:233`、`test/test_serialization.py:420`、`test/test_serialization.py:491`。 - -不足: - -- 一些断言是无效断言,如 `len(modified) >= 0`、`len(tagged) >= 0`,这永远成立。参考:`test/test_original_api_integration.py:23`、`test/test_original_api_integration.py:50`。 -- topology identity 测试只证明单个 box 内 shared edge occurrence,不证明跨 operation、跨 replay、跨 boolean 的 durable identity。参考:`tests/test_topology_identity.py:16`。 -- replay 已覆盖 malformed graph、missing inputs、schema rejection、嵌套 workplane context 和 selection ambiguity;跨 translator 的 frame 语义仍需持续验证。 -- assembly tests没有证明 overconstraint/underconstraint、DOF、rotation frame export 的正确性。 - -建议优先加这些测试: - -- [x] GraphSession active session、recording suspension 与嵌套恢复使用 context-local 状态。 -- [x] SimpleWorkplane 内记录后在 world context replay,结果一致,包括两层非共轴嵌套和退出上下文后的 sketch promotion。 -- replay missing param 必须报错,不允许默认生成几何。 -- replay missing input 必须报错。 -- union clean/glue/tol 参数 replay faithful。 -- QL selection ambiguity 必须按 cardinality 报错。 -- boolean tracking result 和 actual result 用同一参数。 -- assembly frame export 必须保留旋转轴。 -- scalar field smooth union 拒绝混合非同量纲 field 或统一 SDF。 - -## 最重要的架构矛盾 - -SimpleCADAPI 当前最大的矛盾不是“函数式 API vs OOP core”。薄 wrapper core 可以接受。 - -真正的矛盾是:顶层 API 和 v2 model JSON 暗示了稳定、可 replay、可交换的 CAD DSL,但底层仍依赖隐式全局状态、runtime metadata、OCC hash、fallback indices、permissive defaults 和非严格 replay。 - -这会带来一个危险结果:demo 看起来很强,复杂模型一旦进入参数变化、拓扑变化、跨进程 replay、GUI roundtrip、自动生成代码迭代,就会出现“没报错但选错面/少输出/变成不同模型”的问题。对 CAD 来说,静默错误比显式失败更糟。 - -## 优先级建议 - -P0:把 replay 变 strict。 - -- 缺参数直接报错。 -- 缺输入直接报错。 -- leaf id 没 output 直接报错。 -- unknown op 直接报错。 -- selection cardinality mismatch 直接报错。 -- 保留 permissive replay 也必须显式 opt-in。 - -P0:修 GraphSession 和 workplane context。 - -- `_active_session` 已改为 `ContextVar`,并用 token 恢复父 session。 -- `_recording_suspend_depth` 已改为 context-local 计数器。 -- `_current_cs` 已改为 `ContextVar` 栈,并在子 Workplane 创建时合成父帧。 -- replay 已使用 `node.context` 重建坐标上下文;`frame_graph` 保留供外部转译器消费。 - -P0:把 QL/SelectionSpec 升为 canonical selection。 - -- SelectionSpec 加 source node/output slot。 -- replay 改成 QL first。 -- topo refs、indices、hints 只做 fallback。 -- 支持 multi-key order。 -- 支持 `at_least`、`at_most`。 - -P1:统一 canonical op 和 schema version。 - -- 明确 source API、canonical graph op、model JSON schema 三层。 -- 移除或隔离 legacy op names。 -- `2.0-draft`、`2.0-final-state` 不要混用。 -- canonical op coverage 变成测试强约束。 - -P1:修 boolean/tracking/replay faithful。 - -- tracking builder 和 actual boolean builder 使用相同参数。 -- union replay 传回 `clean`、`glue`、`tol`。 -- multi-tool cut/intersect 保留完整 delta chain。 -- 无交集 tool 是否跳过应由参数控制,Graph replay 默认不跳过。 - -P1:收敛 tag schema。 - -- normalized tags 成为默认。 -- legacy numeric tags 移出 tags,放 metadata[`geo`]。 -- anchor lookup 明确 role > anchor > face/edge/wire > legacy。 -- QL docs 使用 normalized tags。 - -P2:装配系统诚实命名并逐步增强。 - -- 当前称 layout solver,不称完整 assembly solver。 -- 先修 frame export rotation。 -- 再做 DOF/overconstraint diagnostics。 - -P2:scalar field 数学语义统一。 - -- 决定是否承诺 SDF。 -- smooth booleans 只允许可比 distance fields。 -- surface extraction 对 closure/validity 给硬失败或明确 warning。 - -## 最终评价 - -这套 SDK 最值得肯定的是 API 直觉:用函数表达 CAD 操作,用返回类型后缀表达几何类型,用 GraphSession 捕获建模过程,用 model JSON 做 replay 边界。这条路线是对的,不应该推翻。 - -最需要批评的是工程契约:它现在过于相信 OCC runtime identity,过于容忍 replay 缺失,过于依赖 hidden mutable metadata,过早把 draft schema 包装成 canonical contract,过少用失败来保护用户。 - -CAD 软件架构里,能建出模型只是第一层;能在参数变化后稳定找到同一个语义面,能跨进程 replay 出同一个设计,能在选择歧义时拒绝继续,能在 schema 损坏时报错,才是 SDK 级别的可靠性。 - -SimpleCADAPI 已经有正确的外形和几块关键骨架。下一阶段不应该继续堆更多 primitive,而应该把 graph、selection、topology、schema、test 这些基础层做硬。否则 API 越漂亮,用户越容易误以为它已经是稳定 CAD 平台。 - -最终判断:保留顶层 API,收紧内部契约;少加功能,多加确定性;少相信对象身份,多表达语义选择;少 silent fallback,多 fail fast。 diff --git a/docs/architecture/translator-backend-contract.md b/docs/architecture/translator-backend-contract.md deleted file mode 100644 index da75ba3a..00000000 --- a/docs/architecture/translator-backend-contract.md +++ /dev/null @@ -1,103 +0,0 @@ -# Translator Backend Contract - -This contract defines the package structure and dependency boundaries for every -SimpleCAD translator backend. - -## Backend Naming - -Backend packages live under `simplecadapi.translator` and use the name -`_translator`, where `` is a stable lowercase backend ID. - -Examples: - -- `freecad_translator` -- `openscad_translator` -- `onshape_translator` - -Backends are exported explicitly from `simplecadapi.translator`. Importing a -backend package must not require the target CAD runtime to be installed. - -## Required Files - -Every backend package contains: - -| File | Responsibility | -| --- | --- | -| `__init__.py` | Defines the complete public backend surface through `__all__`. | -| `api.py` | Contains public convenience functions and user-facing error boundaries. | -| `translator.py` | Contains the `Translator` implementation. | -| `capabilities.py` | Declares backend targets and support for every canonical operation. | - -The translator class must inherit `BaseTranslator`. `capabilities.py` exports -`BACKEND_NAME`, `CAPABILITIES`, and `OP_SUPPORT`. The operation support map must -contain exactly the canonical operation set. Unsupported operations require a -non-empty reason. - -## Conditional Files - -Use these standard names when the corresponding responsibility exists: - -| File or directory | Responsibility | -| --- | --- | -| `exporter.py` | File output, external process or remote API execution, and output validation. | -| `context.py` | State owned by one translation invocation. | -| `analysis.py` | Backend-specific graph analysis and lowering decisions. | -| `codegen.py` | Pure target-code formatting and literal helpers. | -| `emitters/` | Canonical operation emitters and their single registry. | -| `runtime/` | Source fragments embedded into an artifact for execution in the target runtime. | - -An `emitters/registry.py` file is the only operation-to-emitter mapping. Runtime -fragments must remain valid Python source, must not execute target APIs when the -SimpleCAD package is imported, and must be assembled in one declared order. - -## Translation And Export - -Translation is an in-memory operation over a validated product-package closure. -It consumes `ProductPackageInput` and returns a `TranslationArtifact` containing -the target script or native artifact description. - -Export is an effectful operation. It may write files, invoke an executable, or -call a remote API. Neutral product file effects belong in `simplecadapi.exporter`; -backend-specific executable effects belong in the backend exporter module. - -Public naming follows these forms: - -- `translate_product_package_to_` for in-memory product translation. -- `export_product_package_to_` for neutral product file output. - -Standalone model JSON translation and export entrances are removed. Model JSON -remains a graph replay and inspection format, not a downstream CAD contract. - -## Dependencies - -The allowed dependency direction is: - -```text -backend/__init__.py -> api.py, translator.py, capabilities.py -api.py -> translator.py, exporter.py -translator.py -> context.py, analysis.py, emitters/, runtime/ -emitters/ -> context and pure code-generation helpers -exporter.py -> shared types/errors and external execution -``` - -The following reverse dependencies are prohibited: - -- Translator or emitters importing `api.py`. -- Translator importing `exporter.py`. -- Emitters importing the public translator class. -- Runtime fragments importing the backend package. -- Capabilities importing translator implementation modules. - -## Compatibility - -The generated artifact and its persisted target metadata are treated as a -compatibility boundary. Pure module moves must not rename generated runtime -helpers, registries, target object properties, or public import paths. Behavior -fixes are made separately from structural migrations. - -## Verification - -The shared backend contract test verifies required files, public exports, -translator inheritance, backend naming, and canonical operation coverage. -Backend tests additionally verify generated artifact syntax and, where the -target runtime is available, real exported files. diff --git a/docs/design/public-connectors.md b/docs/design/public-connectors.md deleted file mode 100644 index 835cdda0..00000000 --- a/docs/design/public-connectors.md +++ /dev/null @@ -1,82 +0,0 @@ -# Public Connector Refactor - -Status: complete - -## Decision - -An Assembly public connector is an interface declaration, not a second `Connector` object. - -Users create the real connector on the direct child component first, then mark that connector as public: - -```python -assembly = scad.set_public_connector_rassembly( - assembly, - public_connector_id="output_axis", - source_component_id="rotor", - source_connector_id="axis", -) -``` - -`set_public_connector_rassembly`: - -- does not create or clone a `Connector`; -- does not accept an offset or geometry; -- does not move the source component; -- records only the public interface name and the direct-child source reference; -- requires the source component to already exist and the source connector to already exist; -- requires public IDs to be unique within the Assembly. - -The source is a direct child component. A direct child Assembly may be used only through a connector that it exposes publicly; the public boundary remains one level at a time. - -## Runtime contract - -`Assembly` does not own a connector collection. Public declarations live in `Assembly.public_connectors` as immutable `PublicConnectorRef` values, while concrete `Connector` values remain owned by leaf `Part` instances. - -A public reference contains: - -```text -public_connector_id -source_component_id -source_connector_id -name (optional) -``` - -No offset is stored. The source connector owns its complete frame. - -Resolving a parent constraint against a child Assembly public connector returns the real source connector plus its composed frame. The frame includes each direct component placement encountered while crossing nested public boundaries. - -## Durable package contract - -`AssemblyDefinition` stores public connector declarations under `public_connectors`. Each declaration stores the public ID, direct-child source reference, optional name, and a resolved frame snapshot used for validation and standalone consumers. It does not use `anchor_kind="forwarded"`, `forwarded_from`, or an offset. - -The declaration and source connector are hashed as part of the Assembly interface. Changing the public name, source component, source connector, or resolved frame changes the Assembly interface hash and invalidates dependent builds. - -## Solver contract - -The solver resolves a public connector reference to the actual leaf connector and its world frame. Public declarations do not create a new rigid body, motion edge, or constraint. A public connector cannot make an internal component movable merely because a parent constraint references it; movement follows the existing assembly constraint graph. - -This deliberately removes the old special case that descended through forwarded connectors to mutate a nested leaf placement. Nested mechanisms must expose and solve their own constraints before a parent consumes their public interface. - -## Scene and exporters - -Scene records distinguish connector ownership from public declarations. A public record references the source connector snapshot and carries the resolved frame for validation. Exporters use the source connector for semantic ownership and the resolved public frame for sites/joint consumers. - -MJCF must not infer a joint from public exposure. Public declarations only identify externally visible sites/endpoints. Hinge/prismatic edges come from explicit assembly constraints. - -## Translator and replay - -The replay operation is `make_set_public_connector_rassembly`. Its parameters contain the public ID, source component ID, source connector ID, and optional name. There is no placement input and no offset branch. - -## Migration policy - -This is a clean cutover on the branch. Remove `forward_connector_rassembly`, the forwarded anchor kind, forwarded offsets, and translator/replay branches after all callers and durable schemas migrate. Do not leave aliases or deprecated compatibility paths. - -## Progress - -- [x] Confirm public semantics: declaration, no clone, no offset, direct child source. -- [x] Replace runtime Assembly public connector storage and resolution. -- [x] Migrate durable AssemblyDefinition and schemas. -- [x] Migrate solver and product-package construction. -- [x] Migrate scene compiler/validation and exporters. -- [x] Migrate serializer/replay and translators. -- [x] Migrate callers/tests and run end-to-end verification. diff --git a/docs/guides/step-brep-reverse-engineering.md b/docs/guides/step-brep-reverse-engineering.md deleted file mode 100644 index c82bd9a8..00000000 --- a/docs/guides/step-brep-reverse-engineering.md +++ /dev/null @@ -1,265 +0,0 @@ -# STEP BREP Reverse Engineering - -This document is the normative STEP BREP reverse-engineering reference shipped -with the SDK (repo path `docs/guides/step-brep-reverse-engineering.md`). -The inspection APIs live in: - -```text -src/simplecadapi/inspect/brep/ -``` - -All of these functions are diagnostic APIs, not modeling -operations: they do not record graph nodes and must not run inside a -`GraphSession`. Export or obtain the geometry under test first, then call them -outside the modeling script: - -```python -from simplecadapi.inspect import brep - -report = brep.inspect_step_rbrepinspection(path="part.step") -summary = brep.inspect_step_rsummary(path="part.step") -face = brep.inspect_step_entity_rdescriptor( - path="part.step", - entity_id="face:0", -) -neighborhood = brep.inspect_topology_neighborhood_rdescriptor( - model_or_path="part.step", - entity_id="face:0", - depth=2, -) -section = brep.inspect_section_rdescriptor( - model_or_path="part.step", - origin=[0, 0, 10], - normal=[0, 0, 1], -) -comparison = brep.compare_global_properties_rdescriptor( - target="target.step", - current="candidate.step", -) -evaluation = brep.evaluate_reconstruction_rdescriptor( - target="target.step", - current="candidate.step", - replay_succeeded=True, -) -fit = brep.fit_face_analytic_rdescriptor( - model_or_path="part.step", - face_id="face:0", - tolerance=1.0e-3, -) -tracks = brep.track_section_contours_rdescriptor(sections=[section_a, section_b]) -image = brep.render_step_comparison_rpath( - target_step_path="target.step", - current_step_path="candidate.step", - output_path="comparison.png", -) -``` - -In `exact_brep_transcription` work, selected target faces can be copied outside -the modeling graph into a content-addressed `.scadbrep` sidecar: - -```python -snapshot = brep.copy_step_region_rpath( - path="target.step", - output_path="freeform-body.scadbrep", - face_ids=["face:0", "face:1", "face:2"], -) -``` - -The selected face IDs must form one connected, valid Shell. The snapshot keeps -the existing carrier surfaces, trims, pcurves, shared edges/vertices, -orientations, and tolerances. It does not infer feature history and remains -target-derived. Omit `face_ids` to snapshot one complete valid Solid. - -The replayable modeling program loads the hash-pinned sidecar without reading -the target STEP: - -```python -import simplecadapi as scad - -copied = scad.load_brep_region_rshell( - path="freeform-body.scadbrep", - sha256="sha256:...", -) -``` - -Model JSON records a relative sidecar path and SHA-256 but does not embed its -bytes; replay therefore resolves that path from the replay working directory. -GraphSession rejects absolute sidecar paths to avoid machine-specific model -JSON. Native BREP bytes are exact for the snapshot's pinned OCCT profile, not a -cross-version geometry hash. Use material and topology comparisons for -acceptance. - -`inspect_step_rsummary` returns entity counts, bounding box, material -volume/area, centroid, and surface/curve type statistics. -`inspect_step_entity_rdescriptor` uses stable zero-based IDs (`body:0`, -`face:0`, `edge:0`, `vertex:0`) and returns geometry type, analytic -parameters, measurements, and adjacency. To reuse an index across many -queries, load the model first: - -```python -model = brep.load_step_rbrepmodel(path="part.step") -summary = model.summary() -face = model.describe_entity("face:0") -neighbors = model.adjacency_details("face:0") -``` - -These IDs stay deterministic across repeated loads of the same unmodified -BREP, but they do not imply semantic correspondence between two different -models. Degenerate edges are reported uniformly as `DEGENERATE`, with the -underlying carrier type preserved in `underlying_curve_type`. - -## Mindset: APIs are not a pipeline - -The built-in inspect functions are composable APIs, not a fixed workflow, and -they do not guarantee coverage of every question. Reverse engineering has no -"standard pipeline": for a specific case, the agent must write case-by-case -inspection code as needed — load the model and traverse entities directly, -compose multiple queries, and write model-specific -sampling/projection/adjacency analysis — to obtain more detailed information -about that model that the built-in primitives do not cover. Primitives are the -starting point, not the endpoint. - -## Acceptance and stopping conditions (descending priority) - -1. **BREP topology identity = complete reverse engineering (best endpoint)**: - the geometric point set matches and the face-edge-vertex adjacency - structure matches. Reach it when you can. -2. **Identical BREP structure with slightly different parameters: - acceptable.** Export/serialization introduces floating-point error; minor - parameter-level deviations (last-digit differences in radii, distances, - etc.) are not failures and should not trigger further idle optimization. -3. **Structurally different but visually close BREP: a valid stopping - condition only when "genuinely unable to optimize further".** - "Genuinely unable to optimize further" is limited to the following two - reasons, with evidence recorded: - - no better feature operation order/combination can be found (feature-tree - hypotheses are exhausted); - - the required operation type is not yet supported by the SDK. - Otherwise, "looks close" is not a reason to stop; keep iterating. - -## Choosing an inspection strategy per problem - -There is no fixed reverse-engineering workflow to apply mechanically. First -clarify the current unknown and the acceptance evidence, then compose the -smallest set of primitives; for details the primitives do not cover, write -case-by-case inspection code for the model: - -| Question | Preferred primitives | -|---|---| -| Global size, mass properties, topology scale | `inspect_step_rsummary`, `compare_global_properties_rdescriptor` | -| Single face/edge parameters and adjacency | `inspect_step_entity_rdescriptor`, `inspect_topology_neighborhood_rdescriptor` | -| Map stable geometry IDs to visual entities | `render_entity_map_rpath` (opaque depth-preserving context with type-specific edge/face/point marks, distinct colors, and anchored `entity_id · geometry.type` callouts) | -| Section profile, wall thickness, or local cut | `inspect_section_rdescriptor`, `compare_sections_rdescriptor` | -| Test whether a face has an analytic carrier | `fit_face_analytic_rdescriptor` (require `accepted=True` and inspect residuals) | -| Track contour topology across ordered sections | `track_section_contours_rdescriptor` | -| Assembly tree and interface visualization | `inspect_step_components_rdescriptorlist`, `render_step_components_rpath` | -| Side-by-side multi-part observation | `render_step_components_colored_rpath` (direct `{component name: color name}` mapping, highlights multiple solids at once, with legend) | -| Where the difference is | `compare_material_rdescriptor`, `inspect_difference_regions_rdescriptor` | -| Local geometric error | `compare_boundary_distance_rdescriptor`, `compare_entities_rdescriptor` | -| Closure, manifoldness, edge uses, and tolerances | `inspect_topology_rdescriptor` | -| Material difference inside one ROI | `compare_material_region_rdescriptor` | -| Ordered section sweep | `compare_sections_batch_rdescriptor` | -| Atomic STEP write/reload evidence | `validate_step_roundtrip_rdescriptor` | -| Final exact-BREP gate | `compare_shapes_rbrepcomparison`, `compare_steps_rbrepcomparison` | -| Shared-scale visual comparison | `render_step_comparison_rpath` | -| Copy an exact connected face region | `copy_step_region_rpath`, then `load_brep_region_rshell` | - -Start from cheap, bounded facts; add boundary sampling, boolean difference, -sections, rendering, or strict topology comparison only when the current -question requires them. The generic schema registry and fixed dispatch have -been removed: pick and call these composable APIs directly per task. - -`inspect_topology_rdescriptor` reports generic BREP validity separately from -shell closure and manifoldness. It classifies face-local edge occurrences as -free, manifold, seam, non-manifold, orphan, degenerate, or orientation-defective, -and also reports wire closure, shell orientation, small faces, and tolerance -ranges. - -`validate_step_roundtrip_rdescriptor` writes to a temporary sibling, reloads -the STEP, checks property and topology-count drift, and replaces the destination -only after validation succeeds. - -`inspect_step_rbrepinspection()` keeps the full knot, multiplicity, control -point, and rational weight data of B-spline curves/surfaces in its report. -`inspect_step_entity_rdescriptor()` defaults to low-latency local -investigation and returns only degree and count summaries. For a single -B-spline/Bezier edge set `include_curve_definition=True`; for a B-spline/ -Bezier face set `include_surface_definition=True` and bound the control net -with `max_surface_control_points`. Surfaces return untrimmed carrier -definitions; trimming is still described by `u_range`, `v_range`, and the -face boundary. - -For an initial inventory, call `inspect_step_rsummary(..., -include_parameter_groups=True)` to get carrier groups by analytic radius or -B-spline degree, multi-solid canonical axes, and Face/Edge adjacency -signatures. Each group is bounded by `max_parameter_groups` and -`examples_per_group`. These only describe multiplicities; they do not infer -arrays, symmetry, or repeated features — validate pattern hypotheses with -spatial positions and spacing. - -For large outlines prefer `inspect_face_boundaries_rdescriptor(..., -compact=True)`. Compact mode keeps coedge order, orientation, type, length, -endpoints, and key parameters without returning 3D/UV sample arrays; request -detailed mode only when fitting or error measurement actually needs it. For -exact carriers add `include_curve_definitions=True` and optionally -`curve_definition_edge_ids=[...]`. - -`inspect_section_rdescriptor(..., compact=True)` still completes contour -connectivity, nesting, and area computation, but returns only endpoints/exact -lengths of each section edge plus a contour summary. Set -`connection_tolerance` explicitly when section endpoints have tiny gaps; -section-local edge indexes are not stable IDs across models. Use `face_ids` to -restrict a section to an already identified carrier set. Align contour samples -in case-specific extraction code only when a loft hypothesis requires it. - -Use `fit_face_analytic_rdescriptor(...)` when an imported face may be supported -by a plane, sphere, cylinder, or cone. Keep the candidate type, parameters, -residuals, and tolerance as evidence; do not treat the fit as recovered feature -history. Use `track_section_contours_rdescriptor(...)` on ordered section -results before selecting a loft strategy. Birth, death, split, or merge events -after the initial section make one global loft unsafe. - -Use `render_step_comparison_rpath(...)` for final visual comparison. It locks -both models to the union of their bounds so independent camera fitting cannot -hide size or placement differences. The rendered image remains diagnostic and -does not replace the strict BREP gate. - -After `compare_steps_rbrepcomparison(...)`, use -`comparison.to_error_summary()` to collect every failed validity, bounds, -material, topology, and carrier-type check. Errors are grouped by plausible -common root cause. One iteration may change multiple related operations or -code locations in a group, but must then rerun Direct modeling, strict replay, -STEP export, and the complete comparison. - -`compare_material_rdescriptor(..., include_components=False)` does a fast -volume estimate with a single intersection; subtracting a common volume can -lose a small residual on large-scale models and cannot by itself prove strict -material equality. For strict acceptance, difference-region localization, or -STEP difference export set `include_components=True` and -`boolean_tolerance=None`. Fuzzy booleans are diagnostic only. - -Rendering and image-section features need the optional dependency: - -```bash -uv sync --extra inspect -``` - -Performance principle: for closed solids, iterative acceptance prefers -validity, global properties, and bidirectional material difference to quickly -rule out large errors; but topology identity is the **best endpoint**, not an -optional extra — when the candidate is close in material and global -properties, check structural identity (see "Acceptance and stopping -conditions") and stop under the degraded conditions only after confirming -topology identity is unreachable. -`evaluate_reconstruction_rdescriptor()` includes global boundary sampling and -is not part of the cheap iteration path. -`compare_boundary_distance_rdescriptor`, `compare_sections_rdescriptor`, -`inspect_difference_regions_rdescriptor`, and local rendering should be called -per suspicious region as needed. - -`compare_boundary_distance_rdescriptor` defaults to at most 200 samples and -supports `target_face_ids`/`current_face_ids` local ranges. Set -`include_records=True` explicitly when handing results to -`inspect_difference_regions_rdescriptor`; then pass the result as -`boundary_result` to avoid recomputation. Center slices remain available via -`compare_step_slices_rslicecomparison` but are not a default step. diff --git a/skills/simplecadapi/SKILL.md b/docs/skill/SKILL.md similarity index 100% rename from skills/simplecadapi/SKILL.md rename to docs/skill/SKILL.md diff --git a/skills/simplecadapi/references/LICENSE.txt b/docs/skill/references/LICENSE.txt similarity index 100% rename from skills/simplecadapi/references/LICENSE.txt rename to docs/skill/references/LICENSE.txt diff --git a/docs/skill/README.md b/docs/skill/references/README.md similarity index 92% rename from docs/skill/README.md rename to docs/skill/references/README.md index 23fdabf1..c36efef7 100644 --- a/docs/skill/README.md +++ b/docs/skill/references/README.md @@ -1,8 +1,7 @@ # Skill Documentation Structure -This directory is the source of the task-routed skill layer packaged into -`skills/simplecadapi/` by `skill-pack`. It sits between the SDK's generated -API references and the top-level `SKILL.md` router. +This directory is the task-routed skill layer. It sits between the SDK's +generated ```text docs/skill/ @@ -73,5 +72,4 @@ Modeling reasoning and invariants, independent of any single API: - Workflow files compose domains; they never duplicate discipline content. - Discipline files state reasoning and invariants; they avoid CLI- or tool-specific detail that belongs in domains/workflows. -- Every `references/...` path written here must exist in the packaged skill; - `skill-pack` validates them (`test_skill_pack.py` enforces the same). +- Every `references/...` path written here must exist in the packaged skill. diff --git a/skills/simplecadapi/references/SDK_OVERVIEW.md b/docs/skill/references/SDK_OVERVIEW.md similarity index 78% rename from skills/simplecadapi/references/SDK_OVERVIEW.md rename to docs/skill/references/SDK_OVERVIEW.md index 5a85de46..5024cb4a 100644 --- a/skills/simplecadapi/references/SDK_OVERVIEW.md +++ b/docs/skill/references/SDK_OVERVIEW.md @@ -19,9 +19,9 @@ ## Main SDK surfaces -- Geometry and modeling operations in `docs/api/`. -- Standard parts library in `docs/stdlib/`, including `scad.std.gear` gear, ring gear, rack, and cycloidal disc factories plus `scad.std.bearing` bearing assembly factories. -- Core shape/type semantics in `docs/core/`. +- Geometry and modeling operations in `references/docs/api/`. +- Standard parts library in `references/docs/stdlib/`, including `scad.std.gear` gear, ring gear, rack, and cycloidal disc factories plus `scad.std.bearing` bearing assembly factories. +- Core shape/type semantics in `references/docs/core/`. - Graph/model serialization and replay APIs. - Expression, parameter, and semantic reference types. - Functional tagging with `apply_tag(shape=..., tag=...)`, `list_tags(shape=...)`, and QL tag predicates. diff --git a/docs/skill/discipline/assembly-positioning.md b/docs/skill/references/discipline/assembly-positioning.md similarity index 100% rename from docs/skill/discipline/assembly-positioning.md rename to docs/skill/references/discipline/assembly-positioning.md diff --git a/docs/skill/discipline/datums-and-coordinate-systems.md b/docs/skill/references/discipline/datums-and-coordinate-systems.md similarity index 100% rename from docs/skill/discipline/datums-and-coordinate-systems.md rename to docs/skill/references/discipline/datums-and-coordinate-systems.md diff --git a/docs/skill/discipline/failure-and-repair.md b/docs/skill/references/discipline/failure-and-repair.md similarity index 100% rename from docs/skill/discipline/failure-and-repair.md rename to docs/skill/references/discipline/failure-and-repair.md diff --git a/docs/skill/discipline/feature-ordering.md b/docs/skill/references/discipline/feature-ordering.md similarity index 100% rename from docs/skill/discipline/feature-ordering.md rename to docs/skill/references/discipline/feature-ordering.md diff --git a/docs/skill/discipline/geometric-validation.md b/docs/skill/references/discipline/geometric-validation.md similarity index 100% rename from docs/skill/discipline/geometric-validation.md rename to docs/skill/references/discipline/geometric-validation.md diff --git a/docs/skill/discipline/manufacturing-boundaries.md b/docs/skill/references/discipline/manufacturing-boundaries.md similarity index 100% rename from docs/skill/discipline/manufacturing-boundaries.md rename to docs/skill/references/discipline/manufacturing-boundaries.md diff --git a/docs/skill/discipline/mechanical-modeling.md b/docs/skill/references/discipline/mechanical-modeling.md similarity index 100% rename from docs/skill/discipline/mechanical-modeling.md rename to docs/skill/references/discipline/mechanical-modeling.md diff --git a/docs/skill/discipline/requirement-and-cad-brief.md b/docs/skill/references/discipline/requirement-and-cad-brief.md similarity index 100% rename from docs/skill/discipline/requirement-and-cad-brief.md rename to docs/skill/references/discipline/requirement-and-cad-brief.md diff --git a/docs/api/Assembly.md b/docs/skill/references/docs/api/Assembly.md similarity index 100% rename from docs/api/Assembly.md rename to docs/skill/references/docs/api/Assembly.md diff --git a/docs/api/AssemblyBuildResult.md b/docs/skill/references/docs/api/AssemblyBuildResult.md similarity index 100% rename from docs/api/AssemblyBuildResult.md rename to docs/skill/references/docs/api/AssemblyBuildResult.md diff --git a/docs/api/AssemblySolveReport.md b/docs/skill/references/docs/api/AssemblySolveReport.md similarity index 100% rename from docs/api/AssemblySolveReport.md rename to docs/skill/references/docs/api/AssemblySolveReport.md diff --git a/docs/api/BRepComparison.md b/docs/skill/references/docs/api/BRepComparison.md similarity index 100% rename from docs/api/BRepComparison.md rename to docs/skill/references/docs/api/BRepComparison.md diff --git a/docs/api/BRepEntityError.md b/docs/skill/references/docs/api/BRepEntityError.md similarity index 100% rename from docs/api/BRepEntityError.md rename to docs/skill/references/docs/api/BRepEntityError.md diff --git a/docs/api/BRepInspection.md b/docs/skill/references/docs/api/BRepInspection.md similarity index 100% rename from docs/api/BRepInspection.md rename to docs/skill/references/docs/api/BRepInspection.md diff --git a/docs/api/BRepModel.md b/docs/skill/references/docs/api/BRepModel.md similarity index 100% rename from docs/api/BRepModel.md rename to docs/skill/references/docs/api/BRepModel.md diff --git a/docs/api/BSplineFitResult.md b/docs/skill/references/docs/api/BSplineFitResult.md similarity index 100% rename from docs/api/BSplineFitResult.md rename to docs/skill/references/docs/api/BSplineFitResult.md diff --git a/docs/api/CacheEntry.md b/docs/skill/references/docs/api/CacheEntry.md similarity index 100% rename from docs/api/CacheEntry.md rename to docs/skill/references/docs/api/CacheEntry.md diff --git a/docs/api/CacheLockTimeout.md b/docs/skill/references/docs/api/CacheLockTimeout.md similarity index 100% rename from docs/api/CacheLockTimeout.md rename to docs/skill/references/docs/api/CacheLockTimeout.md diff --git a/docs/api/CacheMode.md b/docs/skill/references/docs/api/CacheMode.md similarity index 100% rename from docs/api/CacheMode.md rename to docs/skill/references/docs/api/CacheMode.md diff --git a/docs/api/CachePolicy.md b/docs/skill/references/docs/api/CachePolicy.md similarity index 100% rename from docs/api/CachePolicy.md rename to docs/skill/references/docs/api/CachePolicy.md diff --git a/docs/api/CacheRecord.md b/docs/skill/references/docs/api/CacheRecord.md similarity index 100% rename from docs/api/CacheRecord.md rename to docs/skill/references/docs/api/CacheRecord.md diff --git a/docs/api/CacheReport.md b/docs/skill/references/docs/api/CacheReport.md similarity index 100% rename from docs/api/CacheReport.md rename to docs/skill/references/docs/api/CacheReport.md diff --git a/docs/api/CacheStats.md b/docs/skill/references/docs/api/CacheStats.md similarity index 100% rename from docs/api/CacheStats.md rename to docs/skill/references/docs/api/CacheStats.md diff --git a/docs/api/CaptureResult.md b/docs/skill/references/docs/api/CaptureResult.md similarity index 100% rename from docs/api/CaptureResult.md rename to docs/skill/references/docs/api/CaptureResult.md diff --git a/docs/api/Component.md b/docs/skill/references/docs/api/Component.md similarity index 100% rename from docs/api/Component.md rename to docs/skill/references/docs/api/Component.md diff --git a/docs/api/ComponentSolveResult.md b/docs/skill/references/docs/api/ComponentSolveResult.md similarity index 100% rename from docs/api/ComponentSolveResult.md rename to docs/skill/references/docs/api/ComponentSolveResult.md diff --git a/docs/api/Connector.md b/docs/skill/references/docs/api/Connector.md similarity index 100% rename from docs/api/Connector.md rename to docs/skill/references/docs/api/Connector.md diff --git a/docs/api/ConnectorAnchor.md b/docs/skill/references/docs/api/ConnectorAnchor.md similarity index 100% rename from docs/api/ConnectorAnchor.md rename to docs/skill/references/docs/api/ConnectorAnchor.md diff --git a/docs/api/ConnectorRef.md b/docs/skill/references/docs/api/ConnectorRef.md similarity index 100% rename from docs/api/ConnectorRef.md rename to docs/skill/references/docs/api/ConnectorRef.md diff --git a/docs/api/Const.md b/docs/skill/references/docs/api/Const.md similarity index 100% rename from docs/api/Const.md rename to docs/skill/references/docs/api/Const.md diff --git a/docs/api/Constraint.md b/docs/skill/references/docs/api/Constraint.md similarity index 100% rename from docs/api/Constraint.md rename to docs/skill/references/docs/api/Constraint.md diff --git a/docs/api/ConstraintReport.md b/docs/skill/references/docs/api/ConstraintReport.md similarity index 100% rename from docs/api/ConstraintReport.md rename to docs/skill/references/docs/api/ConstraintReport.md diff --git a/docs/api/ConstraintResidual.md b/docs/skill/references/docs/api/ConstraintResidual.md similarity index 100% rename from docs/api/ConstraintResidual.md rename to docs/skill/references/docs/api/ConstraintResidual.md diff --git a/docs/api/ContentAddressedStore.md b/docs/skill/references/docs/api/ContentAddressedStore.md similarity index 100% rename from docs/api/ContentAddressedStore.md rename to docs/skill/references/docs/api/ContentAddressedStore.md diff --git a/docs/api/Dimension.md b/docs/skill/references/docs/api/Dimension.md similarity index 100% rename from docs/api/Dimension.md rename to docs/skill/references/docs/api/Dimension.md diff --git a/docs/api/DimensionTolerance.md b/docs/skill/references/docs/api/DimensionTolerance.md similarity index 100% rename from docs/api/DimensionTolerance.md rename to docs/skill/references/docs/api/DimensionTolerance.md diff --git a/docs/api/EntityInspectionParity.md b/docs/skill/references/docs/api/EntityInspectionParity.md similarity index 100% rename from docs/api/EntityInspectionParity.md rename to docs/skill/references/docs/api/EntityInspectionParity.md diff --git a/docs/api/EvaluationConfig.md b/docs/skill/references/docs/api/EvaluationConfig.md similarity index 100% rename from docs/api/EvaluationConfig.md rename to docs/skill/references/docs/api/EvaluationConfig.md diff --git a/docs/api/Expr.md b/docs/skill/references/docs/api/Expr.md similarity index 100% rename from docs/api/Expr.md rename to docs/skill/references/docs/api/Expr.md diff --git a/docs/api/ExpressionGraph.md b/docs/skill/references/docs/api/ExpressionGraph.md similarity index 100% rename from docs/api/ExpressionGraph.md rename to docs/skill/references/docs/api/ExpressionGraph.md diff --git a/docs/api/FileInput.md b/docs/skill/references/docs/api/FileInput.md similarity index 100% rename from docs/api/FileInput.md rename to docs/skill/references/docs/api/FileInput.md diff --git a/docs/api/FreeCADTranslator.md b/docs/skill/references/docs/api/FreeCADTranslator.md similarity index 100% rename from docs/api/FreeCADTranslator.md rename to docs/skill/references/docs/api/FreeCADTranslator.md diff --git a/docs/api/Fusion360Translator.md b/docs/skill/references/docs/api/Fusion360Translator.md similarity index 100% rename from docs/api/Fusion360Translator.md rename to docs/skill/references/docs/api/Fusion360Translator.md diff --git a/docs/api/GeometryRef.md b/docs/skill/references/docs/api/GeometryRef.md similarity index 100% rename from docs/api/GeometryRef.md rename to docs/skill/references/docs/api/GeometryRef.md diff --git a/docs/api/GraphSession.md b/docs/skill/references/docs/api/GraphSession.md similarity index 100% rename from docs/api/GraphSession.md rename to docs/skill/references/docs/api/GraphSession.md diff --git a/docs/api/InspectionSummaryComparison.md b/docs/skill/references/docs/api/InspectionSummaryComparison.md similarity index 100% rename from docs/api/InspectionSummaryComparison.md rename to docs/skill/references/docs/api/InspectionSummaryComparison.md diff --git a/docs/api/Material.md b/docs/skill/references/docs/api/Material.md similarity index 100% rename from docs/api/Material.md rename to docs/skill/references/docs/api/Material.md diff --git a/docs/api/Part.md b/docs/skill/references/docs/api/Part.md similarity index 100% rename from docs/api/Part.md rename to docs/skill/references/docs/api/Part.md diff --git a/docs/api/PartBuildResult.md b/docs/skill/references/docs/api/PartBuildResult.md similarity index 100% rename from docs/api/PartBuildResult.md rename to docs/skill/references/docs/api/PartBuildResult.md diff --git a/docs/api/Placement.md b/docs/skill/references/docs/api/Placement.md similarity index 100% rename from docs/api/Placement.md rename to docs/skill/references/docs/api/Placement.md diff --git a/docs/api/ProductMJCFExportReport.md b/docs/skill/references/docs/api/ProductMJCFExportReport.md similarity index 100% rename from docs/api/ProductMJCFExportReport.md rename to docs/skill/references/docs/api/ProductMJCFExportReport.md diff --git a/docs/api/ProductOBJExportReport.md b/docs/skill/references/docs/api/ProductOBJExportReport.md similarity index 100% rename from docs/api/ProductOBJExportReport.md rename to docs/skill/references/docs/api/ProductOBJExportReport.md diff --git a/docs/api/ProductPackage.md b/docs/skill/references/docs/api/ProductPackage.md similarity index 100% rename from docs/api/ProductPackage.md rename to docs/skill/references/docs/api/ProductPackage.md diff --git a/docs/api/ProductPackageError.md b/docs/skill/references/docs/api/ProductPackageError.md similarity index 100% rename from docs/api/ProductPackageError.md rename to docs/skill/references/docs/api/ProductPackageError.md diff --git a/docs/api/ProductSTEPExportReport.md b/docs/skill/references/docs/api/ProductSTEPExportReport.md similarity index 100% rename from docs/api/ProductSTEPExportReport.md rename to docs/skill/references/docs/api/ProductSTEPExportReport.md diff --git a/docs/api/ProductSTLExportReport.md b/docs/skill/references/docs/api/ProductSTLExportReport.md similarity index 100% rename from docs/api/ProductSTLExportReport.md rename to docs/skill/references/docs/api/ProductSTLExportReport.md diff --git a/docs/api/PublicConnectorRef.md b/docs/skill/references/docs/api/PublicConnectorRef.md similarity index 100% rename from docs/api/PublicConnectorRef.md rename to docs/skill/references/docs/api/PublicConnectorRef.md diff --git a/docs/api/README.md b/docs/skill/references/docs/api/README.md similarity index 100% rename from docs/api/README.md rename to docs/skill/references/docs/api/README.md diff --git a/docs/api/ScalarLimit.md b/docs/skill/references/docs/api/ScalarLimit.md similarity index 100% rename from docs/api/ScalarLimit.md rename to docs/skill/references/docs/api/ScalarLimit.md diff --git a/docs/api/SectionEvaluationConfig.md b/docs/skill/references/docs/api/SectionEvaluationConfig.md similarity index 100% rename from docs/api/SectionEvaluationConfig.md rename to docs/skill/references/docs/api/SectionEvaluationConfig.md diff --git a/docs/api/SemanticDelta.md b/docs/skill/references/docs/api/SemanticDelta.md similarity index 100% rename from docs/api/SemanticDelta.md rename to docs/skill/references/docs/api/SemanticDelta.md diff --git a/docs/api/SemanticRef.md b/docs/skill/references/docs/api/SemanticRef.md similarity index 100% rename from docs/api/SemanticRef.md rename to docs/skill/references/docs/api/SemanticRef.md diff --git a/docs/api/SimpleCADError.md b/docs/skill/references/docs/api/SimpleCADError.md similarity index 100% rename from docs/api/SimpleCADError.md rename to docs/skill/references/docs/api/SimpleCADError.md diff --git a/docs/api/Sketch.md b/docs/skill/references/docs/api/Sketch.md similarity index 100% rename from docs/api/Sketch.md rename to docs/skill/references/docs/api/Sketch.md diff --git a/docs/api/SketchConstraint.md b/docs/skill/references/docs/api/SketchConstraint.md similarity index 100% rename from docs/api/SketchConstraint.md rename to docs/skill/references/docs/api/SketchConstraint.md diff --git a/docs/api/SketchConstraintDiagnostic.md b/docs/skill/references/docs/api/SketchConstraintDiagnostic.md similarity index 100% rename from docs/api/SketchConstraintDiagnostic.md rename to docs/skill/references/docs/api/SketchConstraintDiagnostic.md diff --git a/docs/api/SketchRef.md b/docs/skill/references/docs/api/SketchRef.md similarity index 100% rename from docs/api/SketchRef.md rename to docs/skill/references/docs/api/SketchRef.md diff --git a/docs/api/SketchSolveResult.md b/docs/skill/references/docs/api/SketchSolveResult.md similarity index 100% rename from docs/api/SketchSolveResult.md rename to docs/skill/references/docs/api/SketchSolveResult.md diff --git a/docs/api/SliceSpec.md b/docs/skill/references/docs/api/SliceSpec.md similarity index 100% rename from docs/api/SliceSpec.md rename to docs/skill/references/docs/api/SliceSpec.md diff --git a/docs/api/SolidWorksTranslator.md b/docs/skill/references/docs/api/SolidWorksTranslator.md similarity index 100% rename from docs/api/SolidWorksTranslator.md rename to docs/skill/references/docs/api/SolidWorksTranslator.md diff --git a/docs/api/SurfaceBoundary.md b/docs/skill/references/docs/api/SurfaceBoundary.md similarity index 100% rename from docs/api/SurfaceBoundary.md rename to docs/skill/references/docs/api/SurfaceBoundary.md diff --git a/docs/api/SurfaceFillingSettings.md b/docs/skill/references/docs/api/SurfaceFillingSettings.md similarity index 100% rename from docs/api/SurfaceFillingSettings.md rename to docs/skill/references/docs/api/SurfaceFillingSettings.md diff --git a/docs/api/ToleranceAnalysis.md b/docs/skill/references/docs/api/ToleranceAnalysis.md similarity index 100% rename from docs/api/ToleranceAnalysis.md rename to docs/skill/references/docs/api/ToleranceAnalysis.md diff --git a/docs/api/ToleranceAnalysisError.md b/docs/skill/references/docs/api/ToleranceAnalysisError.md similarity index 100% rename from docs/api/ToleranceAnalysisError.md rename to docs/skill/references/docs/api/ToleranceAnalysisError.md diff --git a/docs/api/ToleranceCheck.md b/docs/skill/references/docs/api/ToleranceCheck.md similarity index 100% rename from docs/api/ToleranceCheck.md rename to docs/skill/references/docs/api/ToleranceCheck.md diff --git a/docs/api/ToleranceContribution.md b/docs/skill/references/docs/api/ToleranceContribution.md similarity index 100% rename from docs/api/ToleranceContribution.md rename to docs/skill/references/docs/api/ToleranceContribution.md diff --git a/docs/api/ToleranceGraph.md b/docs/skill/references/docs/api/ToleranceGraph.md similarity index 100% rename from docs/api/ToleranceGraph.md rename to docs/skill/references/docs/api/ToleranceGraph.md diff --git a/docs/api/ToleranceReport.md b/docs/skill/references/docs/api/ToleranceReport.md similarity index 100% rename from docs/api/ToleranceReport.md rename to docs/skill/references/docs/api/ToleranceReport.md diff --git a/docs/api/ToleranceRequirement.md b/docs/skill/references/docs/api/ToleranceRequirement.md similarity index 100% rename from docs/api/ToleranceRequirement.md rename to docs/skill/references/docs/api/ToleranceRequirement.md diff --git a/docs/api/ToleranceValidationError.md b/docs/skill/references/docs/api/ToleranceValidationError.md similarity index 100% rename from docs/api/ToleranceValidationError.md rename to docs/skill/references/docs/api/ToleranceValidationError.md diff --git a/docs/api/Unit.md b/docs/skill/references/docs/api/Unit.md similarity index 100% rename from docs/api/Unit.md rename to docs/skill/references/docs/api/Unit.md diff --git a/docs/api/UnitValidationError.md b/docs/skill/references/docs/api/UnitValidationError.md similarity index 100% rename from docs/api/UnitValidationError.md rename to docs/skill/references/docs/api/UnitValidationError.md diff --git a/docs/api/Var.md b/docs/skill/references/docs/api/Var.md similarity index 100% rename from docs/api/Var.md rename to docs/skill/references/docs/api/Var.md diff --git a/docs/api/add_arc_rsketch.md b/docs/skill/references/docs/api/add_arc_rsketch.md similarity index 100% rename from docs/api/add_arc_rsketch.md rename to docs/skill/references/docs/api/add_arc_rsketch.md diff --git a/docs/api/add_belt_constraint_rassembly.md b/docs/skill/references/docs/api/add_belt_constraint_rassembly.md similarity index 100% rename from docs/api/add_belt_constraint_rassembly.md rename to docs/skill/references/docs/api/add_belt_constraint_rassembly.md diff --git a/docs/api/add_bspline_rsketch.md b/docs/skill/references/docs/api/add_bspline_rsketch.md similarity index 100% rename from docs/api/add_bspline_rsketch.md rename to docs/skill/references/docs/api/add_bspline_rsketch.md diff --git a/docs/api/add_circle_rsketch.md b/docs/skill/references/docs/api/add_circle_rsketch.md similarity index 100% rename from docs/api/add_circle_rsketch.md rename to docs/skill/references/docs/api/add_circle_rsketch.md diff --git a/docs/api/add_component_rassembly.md b/docs/skill/references/docs/api/add_component_rassembly.md similarity index 100% rename from docs/api/add_component_rassembly.md rename to docs/skill/references/docs/api/add_component_rassembly.md diff --git a/docs/api/add_connector_rpart.md b/docs/skill/references/docs/api/add_connector_rpart.md similarity index 100% rename from docs/api/add_connector_rpart.md rename to docs/skill/references/docs/api/add_connector_rpart.md diff --git a/docs/api/add_fixed_constraint_rassembly.md b/docs/skill/references/docs/api/add_fixed_constraint_rassembly.md similarity index 100% rename from docs/api/add_fixed_constraint_rassembly.md rename to docs/skill/references/docs/api/add_fixed_constraint_rassembly.md diff --git a/docs/api/add_gear_constraint_rassembly.md b/docs/skill/references/docs/api/add_gear_constraint_rassembly.md similarity index 100% rename from docs/api/add_gear_constraint_rassembly.md rename to docs/skill/references/docs/api/add_gear_constraint_rassembly.md diff --git a/docs/api/add_line_rsketch.md b/docs/skill/references/docs/api/add_line_rsketch.md similarity index 100% rename from docs/api/add_line_rsketch.md rename to docs/skill/references/docs/api/add_line_rsketch.md diff --git a/docs/api/add_point_rsketch.md b/docs/skill/references/docs/api/add_point_rsketch.md similarity index 100% rename from docs/api/add_point_rsketch.md rename to docs/skill/references/docs/api/add_point_rsketch.md diff --git a/docs/api/add_prismatic_constraint_rassembly.md b/docs/skill/references/docs/api/add_prismatic_constraint_rassembly.md similarity index 100% rename from docs/api/add_prismatic_constraint_rassembly.md rename to docs/skill/references/docs/api/add_prismatic_constraint_rassembly.md diff --git a/docs/api/add_rack_pinion_constraint_rassembly.md b/docs/skill/references/docs/api/add_rack_pinion_constraint_rassembly.md similarity index 100% rename from docs/api/add_rack_pinion_constraint_rassembly.md rename to docs/skill/references/docs/api/add_rack_pinion_constraint_rassembly.md diff --git a/docs/api/add_revolute_constraint_rassembly.md b/docs/skill/references/docs/api/add_revolute_constraint_rassembly.md similarity index 100% rename from docs/api/add_revolute_constraint_rassembly.md rename to docs/skill/references/docs/api/add_revolute_constraint_rassembly.md diff --git a/docs/api/analyze_tolerance.md b/docs/skill/references/docs/api/analyze_tolerance.md similarity index 100% rename from docs/api/analyze_tolerance.md rename to docs/skill/references/docs/api/analyze_tolerance.md diff --git a/docs/api/and_.md b/docs/skill/references/docs/api/and_.md similarity index 100% rename from docs/api/and_.md rename to docs/skill/references/docs/api/and_.md diff --git a/docs/api/apply_tag.md b/docs/skill/references/docs/api/apply_tag.md similarity index 100% rename from docs/api/apply_tag.md rename to docs/skill/references/docs/api/apply_tag.md diff --git a/docs/api/apply_tag_rselection.md b/docs/skill/references/docs/api/apply_tag_rselection.md similarity index 100% rename from docs/api/apply_tag_rselection.md rename to docs/skill/references/docs/api/apply_tag_rselection.md diff --git a/docs/api/assemble.md b/docs/skill/references/docs/api/assemble.md similarity index 100% rename from docs/api/assemble.md rename to docs/skill/references/docs/api/assemble.md diff --git a/docs/api/assign_material_rpart.md b/docs/skill/references/docs/api/assign_material_rpart.md similarity index 100% rename from docs/api/assign_material_rpart.md rename to docs/skill/references/docs/api/assign_material_rpart.md diff --git a/docs/api/canonical_unit_for_dimension.md b/docs/skill/references/docs/api/canonical_unit_for_dimension.md similarity index 100% rename from docs/api/canonical_unit_for_dimension.md rename to docs/skill/references/docs/api/canonical_unit_for_dimension.md diff --git a/docs/api/capture.md b/docs/skill/references/docs/api/capture.md similarity index 100% rename from docs/api/capture.md rename to docs/skill/references/docs/api/capture.md diff --git a/docs/api/chamfer_rsolid.md b/docs/skill/references/docs/api/chamfer_rsolid.md similarity index 100% rename from docs/api/chamfer_rsolid.md rename to docs/skill/references/docs/api/chamfer_rsolid.md diff --git a/docs/api/check_tolerance.md b/docs/skill/references/docs/api/check_tolerance.md similarity index 100% rename from docs/api/check_tolerance.md rename to docs/skill/references/docs/api/check_tolerance.md diff --git a/docs/api/classify_benchmark_result.md b/docs/skill/references/docs/api/classify_benchmark_result.md similarity index 100% rename from docs/api/classify_benchmark_result.md rename to docs/skill/references/docs/api/classify_benchmark_result.md diff --git a/docs/api/clear_step_model_cache_rnone.md b/docs/skill/references/docs/api/clear_step_model_cache_rnone.md similarity index 100% rename from docs/api/clear_step_model_cache_rnone.md rename to docs/skill/references/docs/api/clear_step_model_cache_rnone.md diff --git a/docs/api/compare_boundary_distance_rdescriptor.md b/docs/skill/references/docs/api/compare_boundary_distance_rdescriptor.md similarity index 100% rename from docs/api/compare_boundary_distance_rdescriptor.md rename to docs/skill/references/docs/api/compare_boundary_distance_rdescriptor.md diff --git a/docs/api/compare_entities_rdescriptor.md b/docs/skill/references/docs/api/compare_entities_rdescriptor.md similarity index 100% rename from docs/api/compare_entities_rdescriptor.md rename to docs/skill/references/docs/api/compare_entities_rdescriptor.md diff --git a/docs/api/compare_global_properties_rdescriptor.md b/docs/skill/references/docs/api/compare_global_properties_rdescriptor.md similarity index 100% rename from docs/api/compare_global_properties_rdescriptor.md rename to docs/skill/references/docs/api/compare_global_properties_rdescriptor.md diff --git a/docs/api/compare_inspections_rinspectionsummarycomparison.md b/docs/skill/references/docs/api/compare_inspections_rinspectionsummarycomparison.md similarity index 100% rename from docs/api/compare_inspections_rinspectionsummarycomparison.md rename to docs/skill/references/docs/api/compare_inspections_rinspectionsummarycomparison.md diff --git a/docs/api/compare_material_rdescriptor.md b/docs/skill/references/docs/api/compare_material_rdescriptor.md similarity index 100% rename from docs/api/compare_material_rdescriptor.md rename to docs/skill/references/docs/api/compare_material_rdescriptor.md diff --git a/docs/api/compare_material_region_rdescriptor.md b/docs/skill/references/docs/api/compare_material_region_rdescriptor.md similarity index 100% rename from docs/api/compare_material_region_rdescriptor.md rename to docs/skill/references/docs/api/compare_material_region_rdescriptor.md diff --git a/docs/api/compare_model_to_inspection_rentityinspectionparity.md b/docs/skill/references/docs/api/compare_model_to_inspection_rentityinspectionparity.md similarity index 100% rename from docs/api/compare_model_to_inspection_rentityinspectionparity.md rename to docs/skill/references/docs/api/compare_model_to_inspection_rentityinspectionparity.md diff --git a/docs/api/compare_sections_batch_rdescriptor.md b/docs/skill/references/docs/api/compare_sections_batch_rdescriptor.md similarity index 100% rename from docs/api/compare_sections_batch_rdescriptor.md rename to docs/skill/references/docs/api/compare_sections_batch_rdescriptor.md diff --git a/docs/api/compare_sections_rdescriptor.md b/docs/skill/references/docs/api/compare_sections_rdescriptor.md similarity index 100% rename from docs/api/compare_sections_rdescriptor.md rename to docs/skill/references/docs/api/compare_sections_rdescriptor.md diff --git a/docs/api/compare_shape_slices_rslicecomparison.md b/docs/skill/references/docs/api/compare_shape_slices_rslicecomparison.md similarity index 100% rename from docs/api/compare_shape_slices_rslicecomparison.md rename to docs/skill/references/docs/api/compare_shape_slices_rslicecomparison.md diff --git a/docs/api/compare_shapes_rbrepcomparison.md b/docs/skill/references/docs/api/compare_shapes_rbrepcomparison.md similarity index 100% rename from docs/api/compare_shapes_rbrepcomparison.md rename to docs/skill/references/docs/api/compare_shapes_rbrepcomparison.md diff --git a/docs/api/compare_step_slices_rslicecomparison.md b/docs/skill/references/docs/api/compare_step_slices_rslicecomparison.md similarity index 100% rename from docs/api/compare_step_slices_rslicecomparison.md rename to docs/skill/references/docs/api/compare_step_slices_rslicecomparison.md diff --git a/docs/api/compare_step_to_inspection_rentityinspectionparity.md b/docs/skill/references/docs/api/compare_step_to_inspection_rentityinspectionparity.md similarity index 100% rename from docs/api/compare_step_to_inspection_rentityinspectionparity.md rename to docs/skill/references/docs/api/compare_step_to_inspection_rentityinspectionparity.md diff --git a/docs/api/compare_steps_rbrepcomparison.md b/docs/skill/references/docs/api/compare_steps_rbrepcomparison.md similarity index 100% rename from docs/api/compare_steps_rbrepcomparison.md rename to docs/skill/references/docs/api/compare_steps_rbrepcomparison.md diff --git a/docs/api/const_function.md b/docs/skill/references/docs/api/const_function.md similarity index 100% rename from docs/api/const_function.md rename to docs/skill/references/docs/api/const_function.md diff --git a/docs/api/constrain_angle_rsketch.md b/docs/skill/references/docs/api/constrain_angle_rsketch.md similarity index 100% rename from docs/api/constrain_angle_rsketch.md rename to docs/skill/references/docs/api/constrain_angle_rsketch.md diff --git a/docs/api/constrain_coincident_rsketch.md b/docs/skill/references/docs/api/constrain_coincident_rsketch.md similarity index 100% rename from docs/api/constrain_coincident_rsketch.md rename to docs/skill/references/docs/api/constrain_coincident_rsketch.md diff --git a/docs/api/constrain_collinear_rsketch.md b/docs/skill/references/docs/api/constrain_collinear_rsketch.md similarity index 100% rename from docs/api/constrain_collinear_rsketch.md rename to docs/skill/references/docs/api/constrain_collinear_rsketch.md diff --git a/docs/api/constrain_concentric_rsketch.md b/docs/skill/references/docs/api/constrain_concentric_rsketch.md similarity index 100% rename from docs/api/constrain_concentric_rsketch.md rename to docs/skill/references/docs/api/constrain_concentric_rsketch.md diff --git a/docs/api/constrain_connect_rsketch.md b/docs/skill/references/docs/api/constrain_connect_rsketch.md similarity index 100% rename from docs/api/constrain_connect_rsketch.md rename to docs/skill/references/docs/api/constrain_connect_rsketch.md diff --git a/docs/api/constrain_diameter_rsketch.md b/docs/skill/references/docs/api/constrain_diameter_rsketch.md similarity index 100% rename from docs/api/constrain_diameter_rsketch.md rename to docs/skill/references/docs/api/constrain_diameter_rsketch.md diff --git a/docs/api/constrain_distance_rsketch.md b/docs/skill/references/docs/api/constrain_distance_rsketch.md similarity index 100% rename from docs/api/constrain_distance_rsketch.md rename to docs/skill/references/docs/api/constrain_distance_rsketch.md diff --git a/docs/api/constrain_distance_x_rsketch.md b/docs/skill/references/docs/api/constrain_distance_x_rsketch.md similarity index 100% rename from docs/api/constrain_distance_x_rsketch.md rename to docs/skill/references/docs/api/constrain_distance_x_rsketch.md diff --git a/docs/api/constrain_distance_y_rsketch.md b/docs/skill/references/docs/api/constrain_distance_y_rsketch.md similarity index 100% rename from docs/api/constrain_distance_y_rsketch.md rename to docs/skill/references/docs/api/constrain_distance_y_rsketch.md diff --git a/docs/api/constrain_equal_length_rsketch.md b/docs/skill/references/docs/api/constrain_equal_length_rsketch.md similarity index 100% rename from docs/api/constrain_equal_length_rsketch.md rename to docs/skill/references/docs/api/constrain_equal_length_rsketch.md diff --git a/docs/api/constrain_equal_radius_rsketch.md b/docs/skill/references/docs/api/constrain_equal_radius_rsketch.md similarity index 100% rename from docs/api/constrain_equal_radius_rsketch.md rename to docs/skill/references/docs/api/constrain_equal_radius_rsketch.md diff --git a/docs/api/constrain_fix_rsketch.md b/docs/skill/references/docs/api/constrain_fix_rsketch.md similarity index 100% rename from docs/api/constrain_fix_rsketch.md rename to docs/skill/references/docs/api/constrain_fix_rsketch.md diff --git a/docs/api/constrain_horizontal_rsketch.md b/docs/skill/references/docs/api/constrain_horizontal_rsketch.md similarity index 100% rename from docs/api/constrain_horizontal_rsketch.md rename to docs/skill/references/docs/api/constrain_horizontal_rsketch.md diff --git a/docs/api/constrain_length_rsketch.md b/docs/skill/references/docs/api/constrain_length_rsketch.md similarity index 100% rename from docs/api/constrain_length_rsketch.md rename to docs/skill/references/docs/api/constrain_length_rsketch.md diff --git a/docs/api/constrain_midpoint_rsketch.md b/docs/skill/references/docs/api/constrain_midpoint_rsketch.md similarity index 100% rename from docs/api/constrain_midpoint_rsketch.md rename to docs/skill/references/docs/api/constrain_midpoint_rsketch.md diff --git a/docs/api/constrain_parallel_rsketch.md b/docs/skill/references/docs/api/constrain_parallel_rsketch.md similarity index 100% rename from docs/api/constrain_parallel_rsketch.md rename to docs/skill/references/docs/api/constrain_parallel_rsketch.md diff --git a/docs/api/constrain_perpendicular_rsketch.md b/docs/skill/references/docs/api/constrain_perpendicular_rsketch.md similarity index 100% rename from docs/api/constrain_perpendicular_rsketch.md rename to docs/skill/references/docs/api/constrain_perpendicular_rsketch.md diff --git a/docs/api/constrain_point_on_rsketch.md b/docs/skill/references/docs/api/constrain_point_on_rsketch.md similarity index 100% rename from docs/api/constrain_point_on_rsketch.md rename to docs/skill/references/docs/api/constrain_point_on_rsketch.md diff --git a/docs/api/constrain_radius_rsketch.md b/docs/skill/references/docs/api/constrain_radius_rsketch.md similarity index 100% rename from docs/api/constrain_radius_rsketch.md rename to docs/skill/references/docs/api/constrain_radius_rsketch.md diff --git a/docs/api/constrain_symmetric_rsketch.md b/docs/skill/references/docs/api/constrain_symmetric_rsketch.md similarity index 100% rename from docs/api/constrain_symmetric_rsketch.md rename to docs/skill/references/docs/api/constrain_symmetric_rsketch.md diff --git a/docs/api/constrain_tangent_rsketch.md b/docs/skill/references/docs/api/constrain_tangent_rsketch.md similarity index 100% rename from docs/api/constrain_tangent_rsketch.md rename to docs/skill/references/docs/api/constrain_tangent_rsketch.md diff --git a/docs/api/constrain_vertical_rsketch.md b/docs/skill/references/docs/api/constrain_vertical_rsketch.md similarity index 100% rename from docs/api/constrain_vertical_rsketch.md rename to docs/skill/references/docs/api/constrain_vertical_rsketch.md diff --git a/docs/api/convert_value.md b/docs/skill/references/docs/api/convert_value.md similarity index 100% rename from docs/api/convert_value.md rename to docs/skill/references/docs/api/convert_value.md diff --git a/docs/api/copy_step_region_rpath.md b/docs/skill/references/docs/api/copy_step_region_rpath.md similarity index 100% rename from docs/api/copy_step_region_rpath.md rename to docs/skill/references/docs/api/copy_step_region_rpath.md diff --git a/docs/api/cut_rsolid.md b/docs/skill/references/docs/api/cut_rsolid.md similarity index 100% rename from docs/api/cut_rsolid.md rename to docs/skill/references/docs/api/cut_rsolid.md diff --git a/docs/api/evaluate_reconstruction_rdescriptor.md b/docs/skill/references/docs/api/evaluate_reconstruction_rdescriptor.md similarity index 100% rename from docs/api/evaluate_reconstruction_rdescriptor.md rename to docs/skill/references/docs/api/evaluate_reconstruction_rdescriptor.md diff --git a/docs/api/explain_tag.md b/docs/skill/references/docs/api/explain_tag.md similarity index 100% rename from docs/api/explain_tag.md rename to docs/skill/references/docs/api/explain_tag.md diff --git a/docs/api/export_graph_json.md b/docs/skill/references/docs/api/export_graph_json.md similarity index 100% rename from docs/api/export_graph_json.md rename to docs/skill/references/docs/api/export_graph_json.md diff --git a/docs/api/export_model_json.md b/docs/skill/references/docs/api/export_model_json.md similarity index 100% rename from docs/api/export_model_json.md rename to docs/skill/references/docs/api/export_model_json.md diff --git a/docs/api/export_product_package_to_mjcf.md b/docs/skill/references/docs/api/export_product_package_to_mjcf.md similarity index 100% rename from docs/api/export_product_package_to_mjcf.md rename to docs/skill/references/docs/api/export_product_package_to_mjcf.md diff --git a/docs/api/export_product_package_to_obj.md b/docs/skill/references/docs/api/export_product_package_to_obj.md similarity index 100% rename from docs/api/export_product_package_to_obj.md rename to docs/skill/references/docs/api/export_product_package_to_obj.md diff --git a/docs/api/export_product_package_to_step.md b/docs/skill/references/docs/api/export_product_package_to_step.md similarity index 100% rename from docs/api/export_product_package_to_step.md rename to docs/skill/references/docs/api/export_product_package_to_step.md diff --git a/docs/api/export_product_package_to_stl.md b/docs/skill/references/docs/api/export_product_package_to_stl.md similarity index 100% rename from docs/api/export_product_package_to_stl.md rename to docs/skill/references/docs/api/export_product_package_to_stl.md diff --git a/docs/api/export_session_json.md b/docs/skill/references/docs/api/export_session_json.md similarity index 100% rename from docs/api/export_session_json.md rename to docs/skill/references/docs/api/export_session_json.md diff --git a/docs/api/expression_uses_units.md b/docs/skill/references/docs/api/expression_uses_units.md similarity index 100% rename from docs/api/expression_uses_units.md rename to docs/skill/references/docs/api/expression_uses_units.md diff --git a/docs/api/extrude_rsolid.md b/docs/skill/references/docs/api/extrude_rsolid.md similarity index 100% rename from docs/api/extrude_rsolid.md rename to docs/skill/references/docs/api/extrude_rsolid.md diff --git a/docs/api/file_input.md b/docs/skill/references/docs/api/file_input.md similarity index 100% rename from docs/api/file_input.md rename to docs/skill/references/docs/api/file_input.md diff --git a/docs/api/fill_holes_rshell.md b/docs/skill/references/docs/api/fill_holes_rshell.md similarity index 100% rename from docs/api/fill_holes_rshell.md rename to docs/skill/references/docs/api/fill_holes_rshell.md diff --git a/docs/api/fillet_rsolid.md b/docs/skill/references/docs/api/fillet_rsolid.md similarity index 100% rename from docs/api/fillet_rsolid.md rename to docs/skill/references/docs/api/fillet_rsolid.md diff --git a/docs/api/fit_cubic_bspline_control_points.md b/docs/skill/references/docs/api/fit_cubic_bspline_control_points.md similarity index 100% rename from docs/api/fit_cubic_bspline_control_points.md rename to docs/skill/references/docs/api/fit_cubic_bspline_control_points.md diff --git a/docs/api/fit_face_analytic_rdescriptor.md b/docs/skill/references/docs/api/fit_face_analytic_rdescriptor.md similarity index 100% rename from docs/api/fit_face_analytic_rdescriptor.md rename to docs/skill/references/docs/api/fit_face_analytic_rdescriptor.md diff --git a/docs/api/fit_point_grid_rface.md b/docs/skill/references/docs/api/fit_point_grid_rface.md similarity index 100% rename from docs/api/fit_point_grid_rface.md rename to docs/skill/references/docs/api/fit_point_grid_rface.md diff --git a/docs/api/free_boundaries_rwirelist.md b/docs/skill/references/docs/api/free_boundaries_rwirelist.md similarity index 100% rename from docs/api/free_boundaries_rwirelist.md rename to docs/skill/references/docs/api/free_boundaries_rwirelist.md diff --git a/docs/api/geo.md b/docs/skill/references/docs/api/geo.md similarity index 100% rename from docs/api/geo.md rename to docs/skill/references/docs/api/geo.md diff --git a/docs/api/get_active_session.md b/docs/skill/references/docs/api/get_active_session.md similarity index 100% rename from docs/api/get_active_session.md rename to docs/skill/references/docs/api/get_active_session.md diff --git a/docs/api/get_sketch_entity_rsketchref.md b/docs/skill/references/docs/api/get_sketch_entity_rsketchref.md similarity index 100% rename from docs/api/get_sketch_entity_rsketchref.md rename to docs/skill/references/docs/api/get_sketch_entity_rsketchref.md diff --git a/docs/api/get_sketch_point_rsketchref.md b/docs/skill/references/docs/api/get_sketch_point_rsketchref.md similarity index 100% rename from docs/api/get_sketch_point_rsketchref.md rename to docs/skill/references/docs/api/get_sketch_point_rsketchref.md diff --git a/docs/api/get_unit.md b/docs/skill/references/docs/api/get_unit.md similarity index 100% rename from docs/api/get_unit.md rename to docs/skill/references/docs/api/get_unit.md diff --git a/docs/api/ground_component_rassembly.md b/docs/skill/references/docs/api/ground_component_rassembly.md similarity index 100% rename from docs/api/ground_component_rassembly.md rename to docs/skill/references/docs/api/ground_component_rassembly.md diff --git a/docs/api/helical_sweep_rsolid.md b/docs/skill/references/docs/api/helical_sweep_rsolid.md similarity index 100% rename from docs/api/helical_sweep_rsolid.md rename to docs/skill/references/docs/api/helical_sweep_rsolid.md diff --git a/docs/api/identity_placement_rplacement.md b/docs/skill/references/docs/api/identity_placement_rplacement.md similarity index 100% rename from docs/api/identity_placement_rplacement.md rename to docs/skill/references/docs/api/identity_placement_rplacement.md diff --git a/docs/api/import_graph_json.md b/docs/skill/references/docs/api/import_graph_json.md similarity index 100% rename from docs/api/import_graph_json.md rename to docs/skill/references/docs/api/import_graph_json.md diff --git a/docs/api/import_model_json.md b/docs/skill/references/docs/api/import_model_json.md similarity index 100% rename from docs/api/import_model_json.md rename to docs/skill/references/docs/api/import_model_json.md diff --git a/docs/api/import_session_json.md b/docs/skill/references/docs/api/import_session_json.md similarity index 100% rename from docs/api/import_session_json.md rename to docs/skill/references/docs/api/import_session_json.md diff --git a/docs/api/index_shape_rbrepmodel.md b/docs/skill/references/docs/api/index_shape_rbrepmodel.md similarity index 100% rename from docs/api/index_shape_rbrepmodel.md rename to docs/skill/references/docs/api/index_shape_rbrepmodel.md diff --git a/docs/api/infer_dimension.md b/docs/skill/references/docs/api/infer_dimension.md similarity index 100% rename from docs/api/infer_dimension.md rename to docs/skill/references/docs/api/infer_dimension.md diff --git a/docs/api/inspect_assembly_constraints_rconstraintreport.md b/docs/skill/references/docs/api/inspect_assembly_constraints_rconstraintreport.md similarity index 100% rename from docs/api/inspect_assembly_constraints_rconstraintreport.md rename to docs/skill/references/docs/api/inspect_assembly_constraints_rconstraintreport.md diff --git a/docs/api/inspect_benchmark_step.md b/docs/skill/references/docs/api/inspect_benchmark_step.md similarity index 100% rename from docs/api/inspect_benchmark_step.md rename to docs/skill/references/docs/api/inspect_benchmark_step.md diff --git a/docs/api/inspect_difference_regions_rdescriptor.md b/docs/skill/references/docs/api/inspect_difference_regions_rdescriptor.md similarity index 100% rename from docs/api/inspect_difference_regions_rdescriptor.md rename to docs/skill/references/docs/api/inspect_difference_regions_rdescriptor.md diff --git a/docs/api/inspect_face_boundaries_rdescriptor.md b/docs/skill/references/docs/api/inspect_face_boundaries_rdescriptor.md similarity index 100% rename from docs/api/inspect_face_boundaries_rdescriptor.md rename to docs/skill/references/docs/api/inspect_face_boundaries_rdescriptor.md diff --git a/docs/api/inspect_nearby_entities_rdescriptor.md b/docs/skill/references/docs/api/inspect_nearby_entities_rdescriptor.md similarity index 100% rename from docs/api/inspect_nearby_entities_rdescriptor.md rename to docs/skill/references/docs/api/inspect_nearby_entities_rdescriptor.md diff --git a/docs/api/inspect_point_rdescriptor.md b/docs/skill/references/docs/api/inspect_point_rdescriptor.md similarity index 100% rename from docs/api/inspect_point_rdescriptor.md rename to docs/skill/references/docs/api/inspect_point_rdescriptor.md diff --git a/docs/api/inspect_section_rdescriptor.md b/docs/skill/references/docs/api/inspect_section_rdescriptor.md similarity index 100% rename from docs/api/inspect_section_rdescriptor.md rename to docs/skill/references/docs/api/inspect_section_rdescriptor.md diff --git a/docs/api/inspect_shape_rbrepinspection.md b/docs/skill/references/docs/api/inspect_shape_rbrepinspection.md similarity index 100% rename from docs/api/inspect_shape_rbrepinspection.md rename to docs/skill/references/docs/api/inspect_shape_rbrepinspection.md diff --git a/docs/api/inspect_sketch_rsketchresult.md b/docs/skill/references/docs/api/inspect_sketch_rsketchresult.md similarity index 100% rename from docs/api/inspect_sketch_rsketchresult.md rename to docs/skill/references/docs/api/inspect_sketch_rsketchresult.md diff --git a/docs/api/inspect_step_components_rdescriptorlist.md b/docs/skill/references/docs/api/inspect_step_components_rdescriptorlist.md similarity index 100% rename from docs/api/inspect_step_components_rdescriptorlist.md rename to docs/skill/references/docs/api/inspect_step_components_rdescriptorlist.md diff --git a/docs/api/inspect_step_entity_rdescriptor.md b/docs/skill/references/docs/api/inspect_step_entity_rdescriptor.md similarity index 100% rename from docs/api/inspect_step_entity_rdescriptor.md rename to docs/skill/references/docs/api/inspect_step_entity_rdescriptor.md diff --git a/docs/api/inspect_step_rbrepinspection.md b/docs/skill/references/docs/api/inspect_step_rbrepinspection.md similarity index 100% rename from docs/api/inspect_step_rbrepinspection.md rename to docs/skill/references/docs/api/inspect_step_rbrepinspection.md diff --git a/docs/api/inspect_step_rsummary.md b/docs/skill/references/docs/api/inspect_step_rsummary.md similarity index 100% rename from docs/api/inspect_step_rsummary.md rename to docs/skill/references/docs/api/inspect_step_rsummary.md diff --git a/docs/api/inspect_topology_neighborhood_rdescriptor.md b/docs/skill/references/docs/api/inspect_topology_neighborhood_rdescriptor.md similarity index 100% rename from docs/api/inspect_topology_neighborhood_rdescriptor.md rename to docs/skill/references/docs/api/inspect_topology_neighborhood_rdescriptor.md diff --git a/docs/api/inspect_topology_rdescriptor.md b/docs/skill/references/docs/api/inspect_topology_rdescriptor.md similarity index 100% rename from docs/api/inspect_topology_rdescriptor.md rename to docs/skill/references/docs/api/inspect_topology_rdescriptor.md diff --git a/docs/api/intersect_rsolid.md b/docs/skill/references/docs/api/intersect_rsolid.md similarity index 100% rename from docs/api/intersect_rsolid.md rename to docs/skill/references/docs/api/intersect_rsolid.md diff --git a/docs/api/linear_pattern_rsolidlist.md b/docs/skill/references/docs/api/linear_pattern_rsolidlist.md similarity index 100% rename from docs/api/linear_pattern_rsolidlist.md rename to docs/skill/references/docs/api/linear_pattern_rsolidlist.md diff --git a/docs/api/list_tags.md b/docs/skill/references/docs/api/list_tags.md similarity index 100% rename from docs/api/list_tags.md rename to docs/skill/references/docs/api/list_tags.md diff --git a/docs/api/load_brep_region_rshell.md b/docs/skill/references/docs/api/load_brep_region_rshell.md similarity index 100% rename from docs/api/load_brep_region_rshell.md rename to docs/skill/references/docs/api/load_brep_region_rshell.md diff --git a/docs/api/load_brep_region_rsolid.md b/docs/skill/references/docs/api/load_brep_region_rsolid.md similarity index 100% rename from docs/api/load_brep_region_rsolid.md rename to docs/skill/references/docs/api/load_brep_region_rsolid.md diff --git a/docs/api/load_step_rbrepmodel.md b/docs/skill/references/docs/api/load_step_rbrepmodel.md similarity index 100% rename from docs/api/load_step_rbrepmodel.md rename to docs/skill/references/docs/api/load_step_rbrepmodel.md diff --git a/docs/api/load_step_rshape.md b/docs/skill/references/docs/api/load_step_rshape.md similarity index 100% rename from docs/api/load_step_rshape.md rename to docs/skill/references/docs/api/load_step_rshape.md diff --git a/docs/api/loft_rshell.md b/docs/skill/references/docs/api/loft_rshell.md similarity index 100% rename from docs/api/loft_rshell.md rename to docs/skill/references/docs/api/loft_rshell.md diff --git a/docs/api/loft_rsolid.md b/docs/skill/references/docs/api/loft_rsolid.md similarity index 100% rename from docs/api/loft_rsolid.md rename to docs/skill/references/docs/api/loft_rsolid.md diff --git a/docs/api/make_2d_cut_rface.md b/docs/skill/references/docs/api/make_2d_cut_rface.md similarity index 100% rename from docs/api/make_2d_cut_rface.md rename to docs/skill/references/docs/api/make_2d_cut_rface.md diff --git a/docs/api/make_2d_intersect_rface.md b/docs/skill/references/docs/api/make_2d_intersect_rface.md similarity index 100% rename from docs/api/make_2d_intersect_rface.md rename to docs/skill/references/docs/api/make_2d_intersect_rface.md diff --git a/docs/api/make_2d_union_rface.md b/docs/skill/references/docs/api/make_2d_union_rface.md similarity index 100% rename from docs/api/make_2d_union_rface.md rename to docs/skill/references/docs/api/make_2d_union_rface.md diff --git a/docs/api/make_angle_arc_redge.md b/docs/skill/references/docs/api/make_angle_arc_redge.md similarity index 100% rename from docs/api/make_angle_arc_redge.md rename to docs/skill/references/docs/api/make_angle_arc_redge.md diff --git a/docs/api/make_angle_arc_rwire.md b/docs/skill/references/docs/api/make_angle_arc_rwire.md similarity index 100% rename from docs/api/make_angle_arc_rwire.md rename to docs/skill/references/docs/api/make_angle_arc_rwire.md diff --git a/docs/api/make_assembly_rassembly.md b/docs/skill/references/docs/api/make_assembly_rassembly.md similarity index 100% rename from docs/api/make_assembly_rassembly.md rename to docs/skill/references/docs/api/make_assembly_rassembly.md diff --git a/docs/api/make_bezier_surface_rface.md b/docs/skill/references/docs/api/make_bezier_surface_rface.md similarity index 100% rename from docs/api/make_bezier_surface_rface.md rename to docs/skill/references/docs/api/make_bezier_surface_rface.md diff --git a/docs/api/make_box_rsolid.md b/docs/skill/references/docs/api/make_box_rsolid.md similarity index 100% rename from docs/api/make_box_rsolid.md rename to docs/skill/references/docs/api/make_box_rsolid.md diff --git a/docs/api/make_center_slice_specs_rslicespeclist.md b/docs/skill/references/docs/api/make_center_slice_specs_rslicespeclist.md similarity index 100% rename from docs/api/make_center_slice_specs_rslicespeclist.md rename to docs/skill/references/docs/api/make_center_slice_specs_rslicespeclist.md diff --git a/docs/api/make_circle_redge.md b/docs/skill/references/docs/api/make_circle_redge.md similarity index 100% rename from docs/api/make_circle_redge.md rename to docs/skill/references/docs/api/make_circle_redge.md diff --git a/docs/api/make_circle_rface.md b/docs/skill/references/docs/api/make_circle_rface.md similarity index 100% rename from docs/api/make_circle_rface.md rename to docs/skill/references/docs/api/make_circle_rface.md diff --git a/docs/api/make_circle_rwire.md b/docs/skill/references/docs/api/make_circle_rwire.md similarity index 100% rename from docs/api/make_circle_rwire.md rename to docs/skill/references/docs/api/make_circle_rwire.md diff --git a/docs/api/make_compound_from_assembly_rcompound.md b/docs/skill/references/docs/api/make_compound_from_assembly_rcompound.md similarity index 100% rename from docs/api/make_compound_from_assembly_rcompound.md rename to docs/skill/references/docs/api/make_compound_from_assembly_rcompound.md diff --git a/docs/api/make_cone_rsolid.md b/docs/skill/references/docs/api/make_cone_rsolid.md similarity index 100% rename from docs/api/make_cone_rsolid.md rename to docs/skill/references/docs/api/make_cone_rsolid.md diff --git a/docs/api/make_connector_ref_rconnectorref.md b/docs/skill/references/docs/api/make_connector_ref_rconnectorref.md similarity index 100% rename from docs/api/make_connector_ref_rconnectorref.md rename to docs/skill/references/docs/api/make_connector_ref_rconnectorref.md diff --git a/docs/api/make_cylinder_rsolid.md b/docs/skill/references/docs/api/make_cylinder_rsolid.md similarity index 100% rename from docs/api/make_cylinder_rsolid.md rename to docs/skill/references/docs/api/make_cylinder_rsolid.md diff --git a/docs/api/make_cylindrical_surface_rface.md b/docs/skill/references/docs/api/make_cylindrical_surface_rface.md similarity index 100% rename from docs/api/make_cylindrical_surface_rface.md rename to docs/skill/references/docs/api/make_cylindrical_surface_rface.md diff --git a/docs/api/make_edge_connector_rconnector.md b/docs/skill/references/docs/api/make_edge_connector_rconnector.md similarity index 100% rename from docs/api/make_edge_connector_rconnector.md rename to docs/skill/references/docs/api/make_edge_connector_rconnector.md diff --git a/docs/api/make_face_connector_rconnector.md b/docs/skill/references/docs/api/make_face_connector_rconnector.md similarity index 100% rename from docs/api/make_face_connector_rconnector.md rename to docs/skill/references/docs/api/make_face_connector_rconnector.md diff --git a/docs/api/make_face_from_sketch_rface.md b/docs/skill/references/docs/api/make_face_from_sketch_rface.md similarity index 100% rename from docs/api/make_face_from_sketch_rface.md rename to docs/skill/references/docs/api/make_face_from_sketch_rface.md diff --git a/docs/api/make_face_from_wire_rface.md b/docs/skill/references/docs/api/make_face_from_wire_rface.md similarity index 100% rename from docs/api/make_face_from_wire_rface.md rename to docs/skill/references/docs/api/make_face_from_wire_rface.md diff --git a/docs/api/make_face_from_wires_rface.md b/docs/skill/references/docs/api/make_face_from_wires_rface.md similarity index 100% rename from docs/api/make_face_from_wires_rface.md rename to docs/skill/references/docs/api/make_face_from_wires_rface.md diff --git a/docs/api/make_gordon_surface_rface.md b/docs/skill/references/docs/api/make_gordon_surface_rface.md similarity index 100% rename from docs/api/make_gordon_surface_rface.md rename to docs/skill/references/docs/api/make_gordon_surface_rface.md diff --git a/docs/api/make_helix_redge.md b/docs/skill/references/docs/api/make_helix_redge.md similarity index 100% rename from docs/api/make_helix_redge.md rename to docs/skill/references/docs/api/make_helix_redge.md diff --git a/docs/api/make_helix_rwire.md b/docs/skill/references/docs/api/make_helix_rwire.md similarity index 100% rename from docs/api/make_helix_rwire.md rename to docs/skill/references/docs/api/make_helix_rwire.md diff --git a/docs/api/make_interpolated_spline_redge.md b/docs/skill/references/docs/api/make_interpolated_spline_redge.md similarity index 100% rename from docs/api/make_interpolated_spline_redge.md rename to docs/skill/references/docs/api/make_interpolated_spline_redge.md diff --git a/docs/api/make_interpolated_spline_rwire.md b/docs/skill/references/docs/api/make_interpolated_spline_rwire.md similarity index 100% rename from docs/api/make_interpolated_spline_rwire.md rename to docs/skill/references/docs/api/make_interpolated_spline_rwire.md diff --git a/docs/api/make_line_redge.md b/docs/skill/references/docs/api/make_line_redge.md similarity index 100% rename from docs/api/make_line_redge.md rename to docs/skill/references/docs/api/make_line_redge.md diff --git a/docs/api/make_material_rmaterial.md b/docs/skill/references/docs/api/make_material_rmaterial.md similarity index 100% rename from docs/api/make_material_rmaterial.md rename to docs/skill/references/docs/api/make_material_rmaterial.md diff --git a/docs/api/make_n_hole_flange_rsolid.md b/docs/skill/references/docs/api/make_n_hole_flange_rsolid.md similarity index 100% rename from docs/api/make_n_hole_flange_rsolid.md rename to docs/skill/references/docs/api/make_n_hole_flange_rsolid.md diff --git a/docs/api/make_naca_propeller_blade_rsolid.md b/docs/skill/references/docs/api/make_naca_propeller_blade_rsolid.md similarity index 100% rename from docs/api/make_naca_propeller_blade_rsolid.md rename to docs/skill/references/docs/api/make_naca_propeller_blade_rsolid.md diff --git a/docs/api/make_part_rpart.md b/docs/skill/references/docs/api/make_part_rpart.md similarity index 100% rename from docs/api/make_part_rpart.md rename to docs/skill/references/docs/api/make_part_rpart.md diff --git a/docs/api/make_periodic_spline_rwire.md b/docs/skill/references/docs/api/make_periodic_spline_rwire.md similarity index 100% rename from docs/api/make_periodic_spline_rwire.md rename to docs/skill/references/docs/api/make_periodic_spline_rwire.md diff --git a/docs/api/make_placement_connector_rconnector.md b/docs/skill/references/docs/api/make_placement_connector_rconnector.md similarity index 100% rename from docs/api/make_placement_connector_rconnector.md rename to docs/skill/references/docs/api/make_placement_connector_rconnector.md diff --git a/docs/api/make_placement_rplacement.md b/docs/skill/references/docs/api/make_placement_rplacement.md similarity index 100% rename from docs/api/make_placement_rplacement.md rename to docs/skill/references/docs/api/make_placement_rplacement.md diff --git a/docs/api/make_point_rvertex.md b/docs/skill/references/docs/api/make_point_rvertex.md similarity index 100% rename from docs/api/make_point_rvertex.md rename to docs/skill/references/docs/api/make_point_rvertex.md diff --git a/docs/api/make_polyline_rwire.md b/docs/skill/references/docs/api/make_polyline_rwire.md similarity index 100% rename from docs/api/make_polyline_rwire.md rename to docs/skill/references/docs/api/make_polyline_rwire.md diff --git a/docs/api/make_rectangle_rface.md b/docs/skill/references/docs/api/make_rectangle_rface.md similarity index 100% rename from docs/api/make_rectangle_rface.md rename to docs/skill/references/docs/api/make_rectangle_rface.md diff --git a/docs/api/make_rectangle_rwire.md b/docs/skill/references/docs/api/make_rectangle_rwire.md similarity index 100% rename from docs/api/make_rectangle_rwire.md rename to docs/skill/references/docs/api/make_rectangle_rwire.md diff --git a/docs/api/make_ruled_surface_rface.md b/docs/skill/references/docs/api/make_ruled_surface_rface.md similarity index 100% rename from docs/api/make_ruled_surface_rface.md rename to docs/skill/references/docs/api/make_ruled_surface_rface.md diff --git a/docs/api/make_scalar_limit_rscalarlimit.md b/docs/skill/references/docs/api/make_scalar_limit_rscalarlimit.md similarity index 100% rename from docs/api/make_scalar_limit_rscalarlimit.md rename to docs/skill/references/docs/api/make_scalar_limit_rscalarlimit.md diff --git a/docs/api/make_segment_redge.md b/docs/skill/references/docs/api/make_segment_redge.md similarity index 100% rename from docs/api/make_segment_redge.md rename to docs/skill/references/docs/api/make_segment_redge.md diff --git a/docs/api/make_segment_rwire.md b/docs/skill/references/docs/api/make_segment_rwire.md similarity index 100% rename from docs/api/make_segment_rwire.md rename to docs/skill/references/docs/api/make_segment_rwire.md diff --git a/docs/api/make_sketch_rsketch.md b/docs/skill/references/docs/api/make_sketch_rsketch.md similarity index 100% rename from docs/api/make_sketch_rsketch.md rename to docs/skill/references/docs/api/make_sketch_rsketch.md diff --git a/docs/api/make_solid_from_shell_rsolid.md b/docs/skill/references/docs/api/make_solid_from_shell_rsolid.md similarity index 100% rename from docs/api/make_solid_from_shell_rsolid.md rename to docs/skill/references/docs/api/make_solid_from_shell_rsolid.md diff --git a/docs/api/make_sphere_rsolid.md b/docs/skill/references/docs/api/make_sphere_rsolid.md similarity index 100% rename from docs/api/make_sphere_rsolid.md rename to docs/skill/references/docs/api/make_sphere_rsolid.md diff --git a/docs/api/make_spline_redge.md b/docs/skill/references/docs/api/make_spline_redge.md similarity index 100% rename from docs/api/make_spline_redge.md rename to docs/skill/references/docs/api/make_spline_redge.md diff --git a/docs/api/make_spline_rwire.md b/docs/skill/references/docs/api/make_spline_rwire.md similarity index 100% rename from docs/api/make_spline_rwire.md rename to docs/skill/references/docs/api/make_spline_rwire.md diff --git a/docs/api/make_surface_patch_rface.md b/docs/skill/references/docs/api/make_surface_patch_rface.md similarity index 100% rename from docs/api/make_surface_patch_rface.md rename to docs/skill/references/docs/api/make_surface_patch_rface.md diff --git a/docs/api/make_threaded_rod_rsolid.md b/docs/skill/references/docs/api/make_threaded_rod_rsolid.md similarity index 100% rename from docs/api/make_threaded_rod_rsolid.md rename to docs/skill/references/docs/api/make_threaded_rod_rsolid.md diff --git a/docs/api/make_three_point_arc_redge.md b/docs/skill/references/docs/api/make_three_point_arc_redge.md similarity index 100% rename from docs/api/make_three_point_arc_redge.md rename to docs/skill/references/docs/api/make_three_point_arc_redge.md diff --git a/docs/api/make_three_point_arc_rwire.md b/docs/skill/references/docs/api/make_three_point_arc_rwire.md similarity index 100% rename from docs/api/make_three_point_arc_rwire.md rename to docs/skill/references/docs/api/make_three_point_arc_rwire.md diff --git a/docs/api/make_vertex_connector_rconnector.md b/docs/skill/references/docs/api/make_vertex_connector_rconnector.md similarity index 100% rename from docs/api/make_vertex_connector_rconnector.md rename to docs/skill/references/docs/api/make_vertex_connector_rconnector.md diff --git a/docs/api/make_wire_from_edges_rwire.md b/docs/skill/references/docs/api/make_wire_from_edges_rwire.md similarity index 100% rename from docs/api/make_wire_from_edges_rwire.md rename to docs/skill/references/docs/api/make_wire_from_edges_rwire.md diff --git a/docs/api/make_wire_from_sketch_rwire.md b/docs/skill/references/docs/api/make_wire_from_sketch_rwire.md similarity index 100% rename from docs/api/make_wire_from_sketch_rwire.md rename to docs/skill/references/docs/api/make_wire_from_sketch_rwire.md diff --git a/docs/api/measure_constraint_residual_rconstraintresidual.md b/docs/skill/references/docs/api/measure_constraint_residual_rconstraintresidual.md similarity index 100% rename from docs/api/measure_constraint_residual_rconstraintresidual.md rename to docs/skill/references/docs/api/measure_constraint_residual_rconstraintresidual.md diff --git a/docs/api/measure_entity_relation_rdescriptor.md b/docs/skill/references/docs/api/measure_entity_relation_rdescriptor.md similarity index 100% rename from docs/api/measure_entity_relation_rdescriptor.md rename to docs/skill/references/docs/api/measure_entity_relation_rdescriptor.md diff --git a/docs/api/measure_shape_mass_rtuple.md b/docs/skill/references/docs/api/measure_shape_mass_rtuple.md similarity index 100% rename from docs/api/measure_shape_mass_rtuple.md rename to docs/skill/references/docs/api/measure_shape_mass_rtuple.md diff --git a/docs/api/meta.md b/docs/skill/references/docs/api/meta.md similarity index 100% rename from docs/api/meta.md rename to docs/skill/references/docs/api/meta.md diff --git a/docs/api/mirror_shape.md b/docs/skill/references/docs/api/mirror_shape.md similarity index 100% rename from docs/api/mirror_shape.md rename to docs/skill/references/docs/api/mirror_shape.md diff --git a/docs/api/not_.md b/docs/skill/references/docs/api/not_.md similarity index 100% rename from docs/api/not_.md rename to docs/skill/references/docs/api/not_.md diff --git a/docs/api/operation_event.md b/docs/skill/references/docs/api/operation_event.md similarity index 100% rename from docs/api/operation_event.md rename to docs/skill/references/docs/api/operation_event.md diff --git a/docs/api/or_.md b/docs/skill/references/docs/api/or_.md similarity index 100% rename from docs/api/or_.md rename to docs/skill/references/docs/api/or_.md diff --git a/docs/api/origin_role.md b/docs/skill/references/docs/api/origin_role.md similarity index 100% rename from docs/api/origin_role.md rename to docs/skill/references/docs/api/origin_role.md diff --git a/docs/api/output_role.md b/docs/skill/references/docs/api/output_role.md similarity index 100% rename from docs/api/output_role.md rename to docs/skill/references/docs/api/output_role.md diff --git a/docs/api/part_function.md b/docs/skill/references/docs/api/part_function.md similarity index 100% rename from docs/api/part_function.md rename to docs/skill/references/docs/api/part_function.md diff --git a/docs/api/place_component_rassembly.md b/docs/skill/references/docs/api/place_component_rassembly.md similarity index 100% rename from docs/api/place_component_rassembly.md rename to docs/skill/references/docs/api/place_component_rassembly.md diff --git a/docs/api/radial_pattern_rsolidlist.md b/docs/skill/references/docs/api/radial_pattern_rsolidlist.md similarity index 100% rename from docs/api/radial_pattern_rsolidlist.md rename to docs/skill/references/docs/api/radial_pattern_rsolidlist.md diff --git a/docs/api/render_entity_kind_maps_rpath.md b/docs/skill/references/docs/api/render_entity_kind_maps_rpath.md similarity index 100% rename from docs/api/render_entity_kind_maps_rpath.md rename to docs/skill/references/docs/api/render_entity_kind_maps_rpath.md diff --git a/docs/api/render_entity_map_rpath.md b/docs/skill/references/docs/api/render_entity_map_rpath.md similarity index 100% rename from docs/api/render_entity_map_rpath.md rename to docs/skill/references/docs/api/render_entity_map_rpath.md diff --git a/docs/api/render_region_rpath.md b/docs/skill/references/docs/api/render_region_rpath.md similarity index 100% rename from docs/api/render_region_rpath.md rename to docs/skill/references/docs/api/render_region_rpath.md diff --git a/docs/api/render_screenshot_rpath.md b/docs/skill/references/docs/api/render_screenshot_rpath.md similarity index 100% rename from docs/api/render_screenshot_rpath.md rename to docs/skill/references/docs/api/render_screenshot_rpath.md diff --git a/docs/api/render_shape_views_rpath.md b/docs/skill/references/docs/api/render_shape_views_rpath.md similarity index 100% rename from docs/api/render_shape_views_rpath.md rename to docs/skill/references/docs/api/render_shape_views_rpath.md diff --git a/docs/api/render_step_comparison_rpath.md b/docs/skill/references/docs/api/render_step_comparison_rpath.md similarity index 100% rename from docs/api/render_step_comparison_rpath.md rename to docs/skill/references/docs/api/render_step_comparison_rpath.md diff --git a/docs/api/render_step_components_colored_rpath.md b/docs/skill/references/docs/api/render_step_components_colored_rpath.md similarity index 100% rename from docs/api/render_step_components_colored_rpath.md rename to docs/skill/references/docs/api/render_step_components_colored_rpath.md diff --git a/docs/api/render_step_components_rpath.md b/docs/skill/references/docs/api/render_step_components_rpath.md similarity index 100% rename from docs/api/render_step_components_rpath.md rename to docs/skill/references/docs/api/render_step_components_rpath.md diff --git a/docs/api/render_step_views_rpath.md b/docs/skill/references/docs/api/render_step_views_rpath.md similarity index 100% rename from docs/api/render_step_views_rpath.md rename to docs/skill/references/docs/api/render_step_views_rpath.md diff --git a/docs/api/replay_graph.md b/docs/skill/references/docs/api/replay_graph.md similarity index 100% rename from docs/api/replay_graph.md rename to docs/skill/references/docs/api/replay_graph.md diff --git a/docs/api/replay_model_json.md b/docs/skill/references/docs/api/replay_model_json.md similarity index 100% rename from docs/api/replay_model_json.md rename to docs/skill/references/docs/api/replay_model_json.md diff --git a/docs/api/resolve_cache_policy.md b/docs/skill/references/docs/api/resolve_cache_policy.md similarity index 100% rename from docs/api/resolve_cache_policy.md rename to docs/skill/references/docs/api/resolve_cache_policy.md diff --git a/docs/api/revolve_rsolid.md b/docs/skill/references/docs/api/revolve_rsolid.md similarity index 100% rename from docs/api/revolve_rsolid.md rename to docs/skill/references/docs/api/revolve_rsolid.md diff --git a/docs/api/rotate_shape.md b/docs/skill/references/docs/api/rotate_shape.md similarity index 100% rename from docs/api/rotate_shape.md rename to docs/skill/references/docs/api/rotate_shape.md diff --git a/docs/api/run_comparison_bundle.md b/docs/skill/references/docs/api/run_comparison_bundle.md similarity index 100% rename from docs/api/run_comparison_bundle.md rename to docs/skill/references/docs/api/run_comparison_bundle.md diff --git a/docs/api/select.md b/docs/skill/references/docs/api/select.md similarity index 100% rename from docs/api/select.md rename to docs/skill/references/docs/api/select.md diff --git a/docs/api/select_edges_by_tag.md b/docs/skill/references/docs/api/select_edges_by_tag.md similarity index 100% rename from docs/api/select_edges_by_tag.md rename to docs/skill/references/docs/api/select_edges_by_tag.md diff --git a/docs/api/select_faces_by_tag.md b/docs/skill/references/docs/api/select_faces_by_tag.md similarity index 100% rename from docs/api/select_faces_by_tag.md rename to docs/skill/references/docs/api/select_faces_by_tag.md diff --git a/docs/api/select_region_entities_rdescriptor.md b/docs/skill/references/docs/api/select_region_entities_rdescriptor.md similarity index 100% rename from docs/api/select_region_entities_rdescriptor.md rename to docs/skill/references/docs/api/select_region_entities_rdescriptor.md diff --git a/docs/api/set_public_connector_rassembly.md b/docs/skill/references/docs/api/set_public_connector_rassembly.md similarity index 100% rename from docs/api/set_public_connector_rassembly.md rename to docs/skill/references/docs/api/set_public_connector_rassembly.md diff --git a/docs/api/sew_faces_rshell.md b/docs/skill/references/docs/api/sew_faces_rshell.md similarity index 100% rename from docs/api/sew_faces_rshell.md rename to docs/skill/references/docs/api/sew_faces_rshell.md diff --git a/docs/api/shell_rsolid.md b/docs/skill/references/docs/api/shell_rsolid.md similarity index 100% rename from docs/api/shell_rsolid.md rename to docs/skill/references/docs/api/shell_rsolid.md diff --git a/docs/api/shells.md b/docs/skill/references/docs/api/shells.md similarity index 100% rename from docs/api/shells.md rename to docs/skill/references/docs/api/shells.md diff --git a/docs/api/solve_assembly_constraints_rassembly.md b/docs/skill/references/docs/api/solve_assembly_constraints_rassembly.md similarity index 100% rename from docs/api/solve_assembly_constraints_rassembly.md rename to docs/skill/references/docs/api/solve_assembly_constraints_rassembly.md diff --git a/docs/api/source_binding.md b/docs/skill/references/docs/api/source_binding.md similarity index 100% rename from docs/api/source_binding.md rename to docs/skill/references/docs/api/source_binding.md diff --git a/docs/api/source_topology.md b/docs/skill/references/docs/api/source_topology.md similarity index 100% rename from docs/api/source_topology.md rename to docs/skill/references/docs/api/source_topology.md diff --git a/docs/api/suspend_graph_recording.md b/docs/skill/references/docs/api/suspend_graph_recording.md similarity index 100% rename from docs/api/suspend_graph_recording.md rename to docs/skill/references/docs/api/suspend_graph_recording.md diff --git a/docs/api/sweep_rsolid.md b/docs/skill/references/docs/api/sweep_rsolid.md similarity index 100% rename from docs/api/sweep_rsolid.md rename to docs/skill/references/docs/api/sweep_rsolid.md diff --git a/docs/api/tag.md b/docs/skill/references/docs/api/tag.md similarity index 100% rename from docs/api/tag.md rename to docs/skill/references/docs/api/tag.md diff --git a/docs/api/track_section_contours_rdescriptor.md b/docs/skill/references/docs/api/track_section_contours_rdescriptor.md similarity index 100% rename from docs/api/track_section_contours_rdescriptor.md rename to docs/skill/references/docs/api/track_section_contours_rdescriptor.md diff --git a/docs/api/translate_product_package_to_fcstd.md b/docs/skill/references/docs/api/translate_product_package_to_fcstd.md similarity index 100% rename from docs/api/translate_product_package_to_fcstd.md rename to docs/skill/references/docs/api/translate_product_package_to_fcstd.md diff --git a/docs/api/translate_product_package_to_freecad_script.md b/docs/skill/references/docs/api/translate_product_package_to_freecad_script.md similarity index 100% rename from docs/api/translate_product_package_to_freecad_script.md rename to docs/skill/references/docs/api/translate_product_package_to_freecad_script.md diff --git a/docs/api/translate_product_package_to_fusion360_script.md b/docs/skill/references/docs/api/translate_product_package_to_fusion360_script.md similarity index 100% rename from docs/api/translate_product_package_to_fusion360_script.md rename to docs/skill/references/docs/api/translate_product_package_to_fusion360_script.md diff --git a/docs/api/translate_product_package_to_solidworks_script.md b/docs/skill/references/docs/api/translate_product_package_to_solidworks_script.md similarity index 100% rename from docs/api/translate_product_package_to_solidworks_script.md rename to docs/skill/references/docs/api/translate_product_package_to_solidworks_script.md diff --git a/docs/api/translate_shape.md b/docs/skill/references/docs/api/translate_shape.md similarity index 100% rename from docs/api/translate_shape.md rename to docs/skill/references/docs/api/translate_shape.md diff --git a/docs/api/trim_surface_rface.md b/docs/skill/references/docs/api/trim_surface_rface.md similarity index 100% rename from docs/api/trim_surface_rface.md rename to docs/skill/references/docs/api/trim_surface_rface.md diff --git a/docs/api/twisted_sweep_rsolid.md b/docs/skill/references/docs/api/twisted_sweep_rsolid.md similarity index 100% rename from docs/api/twisted_sweep_rsolid.md rename to docs/skill/references/docs/api/twisted_sweep_rsolid.md diff --git a/docs/api/unground_component_rassembly.md b/docs/skill/references/docs/api/unground_component_rassembly.md similarity index 100% rename from docs/api/unground_component_rassembly.md rename to docs/skill/references/docs/api/unground_component_rassembly.md diff --git a/docs/api/union_rsolid.md b/docs/skill/references/docs/api/union_rsolid.md similarity index 100% rename from docs/api/union_rsolid.md rename to docs/skill/references/docs/api/union_rsolid.md diff --git a/docs/api/validate_step_roundtrip_rdescriptor.md b/docs/skill/references/docs/api/validate_step_roundtrip_rdescriptor.md similarity index 100% rename from docs/api/validate_step_roundtrip_rdescriptor.md rename to docs/skill/references/docs/api/validate_step_roundtrip_rdescriptor.md diff --git a/docs/api/value.md b/docs/skill/references/docs/api/value.md similarity index 100% rename from docs/api/value.md rename to docs/skill/references/docs/api/value.md diff --git a/docs/api/var_function.md b/docs/skill/references/docs/api/var_function.md similarity index 100% rename from docs/api/var_function.md rename to docs/skill/references/docs/api/var_function.md diff --git a/docs/core/README.md b/docs/skill/references/docs/core/README.md similarity index 100% rename from docs/core/README.md rename to docs/skill/references/docs/core/README.md diff --git a/docs/core/compound.md b/docs/skill/references/docs/core/compound.md similarity index 100% rename from docs/core/compound.md rename to docs/skill/references/docs/core/compound.md diff --git a/docs/core/coordinate_system.md b/docs/skill/references/docs/core/coordinate_system.md similarity index 100% rename from docs/core/coordinate_system.md rename to docs/skill/references/docs/core/coordinate_system.md diff --git a/docs/core/declarative_constraints.md b/docs/skill/references/docs/core/declarative_constraints.md similarity index 100% rename from docs/core/declarative_constraints.md rename to docs/skill/references/docs/core/declarative_constraints.md diff --git a/docs/core/dimension-tolerance-chains.md b/docs/skill/references/docs/core/dimension-tolerance-chains.md similarity index 100% rename from docs/core/dimension-tolerance-chains.md rename to docs/skill/references/docs/core/dimension-tolerance-chains.md diff --git a/docs/core/edge.md b/docs/skill/references/docs/core/edge.md similarity index 100% rename from docs/core/edge.md rename to docs/skill/references/docs/core/edge.md diff --git a/docs/core/face.md b/docs/skill/references/docs/core/face.md similarity index 100% rename from docs/core/face.md rename to docs/skill/references/docs/core/face.md diff --git a/docs/core/operation_graph_json_spec.md b/docs/skill/references/docs/core/operation_graph_json_spec.md similarity index 100% rename from docs/core/operation_graph_json_spec.md rename to docs/skill/references/docs/core/operation_graph_json_spec.md diff --git a/docs/core/part_assembly_development_plan.md b/docs/skill/references/docs/core/part_assembly_development_plan.md similarity index 100% rename from docs/core/part_assembly_development_plan.md rename to docs/skill/references/docs/core/part_assembly_development_plan.md diff --git a/docs/core/physical-units.md b/docs/skill/references/docs/core/physical-units.md similarity index 100% rename from docs/core/physical-units.md rename to docs/skill/references/docs/core/physical-units.md diff --git a/docs/core/rearchitecture_2_0.md b/docs/skill/references/docs/core/rearchitecture_2_0.md similarity index 100% rename from docs/core/rearchitecture_2_0.md rename to docs/skill/references/docs/core/rearchitecture_2_0.md diff --git a/docs/core/rearchitecture_2_0_requirements.md b/docs/skill/references/docs/core/rearchitecture_2_0_requirements.md similarity index 100% rename from docs/core/rearchitecture_2_0_requirements.md rename to docs/skill/references/docs/core/rearchitecture_2_0_requirements.md diff --git a/docs/core/serialization/README.md b/docs/skill/references/docs/core/serialization/README.md similarity index 100% rename from docs/core/serialization/README.md rename to docs/skill/references/docs/core/serialization/README.md diff --git a/docs/core/serialization/expressions-and-replay.md b/docs/skill/references/docs/core/serialization/expressions-and-replay.md similarity index 100% rename from docs/core/serialization/expressions-and-replay.md rename to docs/skill/references/docs/core/serialization/expressions-and-replay.md diff --git a/docs/core/serialization/features-booleans-transforms.md b/docs/skill/references/docs/core/serialization/features-booleans-transforms.md similarity index 100% rename from docs/core/serialization/features-booleans-transforms.md rename to docs/skill/references/docs/core/serialization/features-booleans-transforms.md diff --git a/docs/core/serialization/primitives-and-profiles.md b/docs/skill/references/docs/core/serialization/primitives-and-profiles.md similarity index 100% rename from docs/core/serialization/primitives-and-profiles.md rename to docs/skill/references/docs/core/serialization/primitives-and-profiles.md diff --git a/docs/core/serialization/scalar-fields.md b/docs/skill/references/docs/core/serialization/scalar-fields.md similarity index 100% rename from docs/core/serialization/scalar-fields.md rename to docs/skill/references/docs/core/serialization/scalar-fields.md diff --git a/docs/core/shell.md b/docs/skill/references/docs/core/shell.md similarity index 100% rename from docs/core/shell.md rename to docs/skill/references/docs/core/shell.md diff --git a/docs/core/simple_workplane.md b/docs/skill/references/docs/core/simple_workplane.md similarity index 100% rename from docs/core/simple_workplane.md rename to docs/skill/references/docs/core/simple_workplane.md diff --git a/docs/core/solid.md b/docs/skill/references/docs/core/solid.md similarity index 100% rename from docs/core/solid.md rename to docs/skill/references/docs/core/solid.md diff --git a/docs/core/tagged_mixin.md b/docs/skill/references/docs/core/tagged_mixin.md similarity index 100% rename from docs/core/tagged_mixin.md rename to docs/skill/references/docs/core/tagged_mixin.md diff --git a/docs/core/vertex.md b/docs/skill/references/docs/core/vertex.md similarity index 100% rename from docs/core/vertex.md rename to docs/skill/references/docs/core/vertex.md diff --git a/docs/core/wire.md b/docs/skill/references/docs/core/wire.md similarity index 100% rename from docs/core/wire.md rename to docs/skill/references/docs/core/wire.md diff --git a/docs/guides/README.md b/docs/skill/references/docs/guides/README.md similarity index 100% rename from docs/guides/README.md rename to docs/skill/references/docs/guides/README.md diff --git a/docs/guides/cache-build-workflow.md b/docs/skill/references/docs/guides/cache-build-workflow.md similarity index 100% rename from docs/guides/cache-build-workflow.md rename to docs/skill/references/docs/guides/cache-build-workflow.md diff --git a/docs/guides/reconstruction-agent-strategy.md b/docs/skill/references/docs/guides/reconstruction-agent-strategy.md similarity index 100% rename from docs/guides/reconstruction-agent-strategy.md rename to docs/skill/references/docs/guides/reconstruction-agent-strategy.md diff --git a/docs/guides/reconstruction-agent-test-prompt.md b/docs/skill/references/docs/guides/reconstruction-agent-test-prompt.md similarity index 100% rename from docs/guides/reconstruction-agent-test-prompt.md rename to docs/skill/references/docs/guides/reconstruction-agent-test-prompt.md diff --git a/docs/stdlib/README.md b/docs/skill/references/docs/stdlib/README.md similarity index 100% rename from docs/stdlib/README.md rename to docs/skill/references/docs/stdlib/README.md diff --git a/docs/stdlib/build_ball_bearing.md b/docs/skill/references/docs/stdlib/build_ball_bearing.md similarity index 100% rename from docs/stdlib/build_ball_bearing.md rename to docs/skill/references/docs/stdlib/build_ball_bearing.md diff --git a/docs/stdlib/make_ball_bearing_rassembly.md b/docs/skill/references/docs/stdlib/make_ball_bearing_rassembly.md similarity index 100% rename from docs/stdlib/make_ball_bearing_rassembly.md rename to docs/skill/references/docs/stdlib/make_ball_bearing_rassembly.md diff --git a/docs/stdlib/make_cycloidal_disc_rsolid.md b/docs/skill/references/docs/stdlib/make_cycloidal_disc_rsolid.md similarity index 100% rename from docs/stdlib/make_cycloidal_disc_rsolid.md rename to docs/skill/references/docs/stdlib/make_cycloidal_disc_rsolid.md diff --git a/docs/stdlib/make_helical_gear_rsolid.md b/docs/skill/references/docs/stdlib/make_helical_gear_rsolid.md similarity index 100% rename from docs/stdlib/make_helical_gear_rsolid.md rename to docs/skill/references/docs/stdlib/make_helical_gear_rsolid.md diff --git a/docs/stdlib/make_helical_rack_rsolid.md b/docs/skill/references/docs/stdlib/make_helical_rack_rsolid.md similarity index 100% rename from docs/stdlib/make_helical_rack_rsolid.md rename to docs/skill/references/docs/stdlib/make_helical_rack_rsolid.md diff --git a/docs/stdlib/make_helical_ring_gear_rsolid.md b/docs/skill/references/docs/stdlib/make_helical_ring_gear_rsolid.md similarity index 100% rename from docs/stdlib/make_helical_ring_gear_rsolid.md rename to docs/skill/references/docs/stdlib/make_helical_ring_gear_rsolid.md diff --git a/docs/stdlib/make_herringbone_gear_rsolid.md b/docs/skill/references/docs/stdlib/make_herringbone_gear_rsolid.md similarity index 100% rename from docs/stdlib/make_herringbone_gear_rsolid.md rename to docs/skill/references/docs/stdlib/make_herringbone_gear_rsolid.md diff --git a/docs/stdlib/make_herringbone_rack_rsolid.md b/docs/skill/references/docs/stdlib/make_herringbone_rack_rsolid.md similarity index 100% rename from docs/stdlib/make_herringbone_rack_rsolid.md rename to docs/skill/references/docs/stdlib/make_herringbone_rack_rsolid.md diff --git a/docs/stdlib/make_herringbone_ring_gear_rsolid.md b/docs/skill/references/docs/stdlib/make_herringbone_ring_gear_rsolid.md similarity index 100% rename from docs/stdlib/make_herringbone_ring_gear_rsolid.md rename to docs/skill/references/docs/stdlib/make_herringbone_ring_gear_rsolid.md diff --git a/docs/stdlib/make_spur_gear_rsolid.md b/docs/skill/references/docs/stdlib/make_spur_gear_rsolid.md similarity index 100% rename from docs/stdlib/make_spur_gear_rsolid.md rename to docs/skill/references/docs/stdlib/make_spur_gear_rsolid.md diff --git a/docs/stdlib/make_spur_rack_rsolid.md b/docs/skill/references/docs/stdlib/make_spur_rack_rsolid.md similarity index 100% rename from docs/stdlib/make_spur_rack_rsolid.md rename to docs/skill/references/docs/stdlib/make_spur_rack_rsolid.md diff --git a/docs/stdlib/make_spur_ring_gear_rsolid.md b/docs/skill/references/docs/stdlib/make_spur_ring_gear_rsolid.md similarity index 100% rename from docs/stdlib/make_spur_ring_gear_rsolid.md rename to docs/skill/references/docs/stdlib/make_spur_ring_gear_rsolid.md diff --git a/docs/stdlib/make_straight_bevel_gear_rsolid.md b/docs/skill/references/docs/stdlib/make_straight_bevel_gear_rsolid.md similarity index 100% rename from docs/stdlib/make_straight_bevel_gear_rsolid.md rename to docs/skill/references/docs/stdlib/make_straight_bevel_gear_rsolid.md diff --git a/docs/skill/domains/assembly-and-product.md b/docs/skill/references/domains/assembly-and-product.md similarity index 100% rename from docs/skill/domains/assembly-and-product.md rename to docs/skill/references/domains/assembly-and-product.md diff --git a/docs/skill/domains/export-and-translation.md b/docs/skill/references/domains/export-and-translation.md similarity index 100% rename from docs/skill/domains/export-and-translation.md rename to docs/skill/references/domains/export-and-translation.md diff --git a/docs/skill/domains/part-modeling.md b/docs/skill/references/domains/part-modeling.md similarity index 100% rename from docs/skill/domains/part-modeling.md rename to docs/skill/references/domains/part-modeling.md diff --git a/docs/skill/domains/requirement-refinement.md b/docs/skill/references/domains/requirement-refinement.md similarity index 100% rename from docs/skill/domains/requirement-refinement.md rename to docs/skill/references/domains/requirement-refinement.md diff --git a/docs/skill/domains/sketch-and-features.md b/docs/skill/references/domains/sketch-and-features.md similarity index 100% rename from docs/skill/domains/sketch-and-features.md rename to docs/skill/references/domains/sketch-and-features.md diff --git a/docs/skill/domains/standard-parts.md b/docs/skill/references/domains/standard-parts.md similarity index 100% rename from docs/skill/domains/standard-parts.md rename to docs/skill/references/domains/standard-parts.md diff --git a/docs/skill/domains/step-inspection.md b/docs/skill/references/domains/step-inspection.md similarity index 100% rename from docs/skill/domains/step-inspection.md rename to docs/skill/references/domains/step-inspection.md diff --git a/skills/simplecadapi/references/inspect/brep-reverse-engineering.md b/docs/skill/references/inspect/brep-reverse-engineering.md similarity index 100% rename from skills/simplecadapi/references/inspect/brep-reverse-engineering.md rename to docs/skill/references/inspect/brep-reverse-engineering.md diff --git a/docs/skill/workflows/assembly-product-build.md b/docs/skill/references/workflows/assembly-product-build.md similarity index 100% rename from docs/skill/workflows/assembly-product-build.md rename to docs/skill/references/workflows/assembly-product-build.md diff --git a/docs/skill/workflows/export-and-translation.md b/docs/skill/references/workflows/export-and-translation.md similarity index 100% rename from docs/skill/workflows/export-and-translation.md rename to docs/skill/references/workflows/export-and-translation.md diff --git a/docs/skill/workflows/single-part-modeling.md b/docs/skill/references/workflows/single-part-modeling.md similarity index 100% rename from docs/skill/workflows/single-part-modeling.md rename to docs/skill/references/workflows/single-part-modeling.md diff --git a/docs/skill/workflows/sketch-feature-modeling.md b/docs/skill/references/workflows/sketch-feature-modeling.md similarity index 100% rename from docs/skill/workflows/sketch-feature-modeling.md rename to docs/skill/references/workflows/sketch-feature-modeling.md diff --git a/docs/skill/workflows/standard-part-assembly.md b/docs/skill/references/workflows/standard-part-assembly.md similarity index 100% rename from docs/skill/workflows/standard-part-assembly.md rename to docs/skill/references/workflows/standard-part-assembly.md diff --git a/docs/skill/workflows/step-reconstruction.md b/docs/skill/references/workflows/step-reconstruction.md similarity index 100% rename from docs/skill/workflows/step-reconstruction.md rename to docs/skill/references/workflows/step-reconstruction.md diff --git a/docs/updates/2.0.2.md b/docs/updates/2.0.2.md index 86f66951..11e84597 100644 --- a/docs/updates/2.0.2.md +++ b/docs/updates/2.0.2.md @@ -101,6 +101,6 @@ part agrees with the original in both geometry and topology. ## Related Documentation -- [STEP BREP reverse-engineering guide](../guides/step-brep-reverse-engineering.md) +- [STEP BREP reverse-engineering guide](../skill/references/inspect/brep-reverse-engineering.md) - [Browser viewer README](../../viewer/README.md) -- [Core serialization and replay documentation](../core/serialization/README.md) +- [Core serialization and replay documentation](../skill/references/docs/core/serialization/README.md) diff --git a/docs/updates/2.0.2.zh-CN.md b/docs/updates/2.0.2.zh-CN.md index 258dee13..c63bcc17 100644 --- a/docs/updates/2.0.2.zh-CN.md +++ b/docs/updates/2.0.2.zh-CN.md @@ -80,6 +80,6 @@ STEP BREP,报告体积、表面积、包围盒、拓扑数量和几何基元 ## 相关文档 -- [STEP BREP 逆向工程指南](../guides/step-brep-reverse-engineering.md) +- [STEP BREP 逆向工程指南](../skill/references/inspect/brep-reverse-engineering.md) - [浏览器查看器说明](../../viewer/README.md) -- [序列化与模型回放文档](../core/serialization/README.md) +- [序列化与模型回放文档](../skill/references/docs/core/serialization/README.md) diff --git a/docs/updates/2.0.4b2.md b/docs/updates/2.0.4b2.md index b65adb7e..0ed7079a 100644 --- a/docs/updates/2.0.4b2.md +++ b/docs/updates/2.0.4b2.md @@ -130,7 +130,7 @@ rendering. ## Related Documentation -- [Reconstruction Agent test specification](../guides/reconstruction-agent-test-prompt.md) -- [STEP BREP reverse-engineering guide](../guides/step-brep-reverse-engineering.md) +- [Reconstruction Agent test specification](../skill/references/docs/guides/reconstruction-agent-test-prompt.md) +- [STEP BREP reverse-engineering guide](../skill/references/inspect/brep-reverse-engineering.md) - [SimpleCADAPI Agent Skill BREP reference](../../skills/simplecadapi/references/inverse_engineer/brep-reverse-engineering.md) - [Previous 2.0.4b1 update notes](2.0.4b1.md) diff --git a/docs/updates/2.0.4b2.zh-CN.md b/docs/updates/2.0.4b2.zh-CN.md index f230a11c..375e83e7 100644 --- a/docs/updates/2.0.4b2.zh-CN.md +++ b/docs/updates/2.0.4b2.zh-CN.md @@ -110,7 +110,7 @@ Edge,包括表达式参数点;周期轮廓还可以继续生成可回放的 ## 相关文档 -- [Reconstruction Agent 测试规范](../guides/reconstruction-agent-test-prompt.md) -- [STEP BREP 逆向工程指南](../guides/step-brep-reverse-engineering.md) +- [Reconstruction Agent 测试规范](../skill/references/docs/guides/reconstruction-agent-test-prompt.md) +- [STEP BREP 逆向工程指南](../skill/references/inspect/brep-reverse-engineering.md) - [SimpleCADAPI Agent Skill BREP 参考](../../skills/simplecadapi/references/inverse_engineer/brep-reverse-engineering.md) - [上一版 2.0.4b1 更新说明](2.0.4b1.zh-CN.md) diff --git a/docs/updates/2.0.4b3.md b/docs/updates/2.0.4b3.md index 077783d2..d0556045 100644 --- a/docs/updates/2.0.4b3.md +++ b/docs/updates/2.0.4b3.md @@ -122,8 +122,8 @@ mesh. ## Related documentation -- [Persistent cache and product build workflow](../guides/cache-build-workflow.md) -- [Product package STEP/STL export APIs](../api/export_product_package_to_step.md) -- [Editable FreeCAD product package API](../api/translate_product_package_to_fcstd.md) +- [Persistent cache and product build workflow](../skill/references/docs/guides/cache-build-workflow.md) +- [Product package STEP/STL export APIs](../skill/references/docs/api/export_product_package_to_step.md) +- [Editable FreeCAD product package API](../skill/references/docs/api/translate_product_package_to_fcstd.md) - [Modeling workflows](../../skills/simplecadapi/references/MODELING_WORKFLOWS.md) - [Previous 2.0.4b2 update notes](2.0.4b2.md) diff --git a/docs/updates/2.0.4b3.zh-CN.md b/docs/updates/2.0.4b3.zh-CN.md index 723fdebf..fd0d79a4 100644 --- a/docs/updates/2.0.4b3.zh-CN.md +++ b/docs/updates/2.0.4b3.zh-CN.md @@ -78,6 +78,6 @@ assembly definition 归档,重新加载并 materialize,然后验证嵌套约 ## 相关文档 -- [持久缓存与产品构建工作流](../guides/cache-build-workflow.md) +- [持久缓存与产品构建工作流](../skill/references/docs/guides/cache-build-workflow.md) - [建模工作流](../../skills/simplecadapi/references/MODELING_WORKFLOWS.md) - [上一版 2.0.4b2 更新说明](2.0.4b2.zh-CN.md) diff --git a/pyproject.toml b/pyproject.toml index b4aeadcb..fece3c6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,8 +119,4 @@ exclude = [ testpaths = ["test", "tests"] [project.scripts] -evolve = "simplecadapi.auto_tools.evolution:main" -make-export = "simplecadapi.auto_tools.make_export:main" -auto-docs-gen = "simplecadapi.auto_tools.auto_docs_gen:main" -skill-pack = "simplecadapi.auto_tools.skill_pack:main" simplecad-cache = "simplecadapi.cache.cli:main" diff --git a/skillproj.toml b/skillproj.toml new file mode 100644 index 00000000..57f12d94 --- /dev/null +++ b/skillproj.toml @@ -0,0 +1,11 @@ +[skill] +name = "simplecadapi" +source = "docs/skill" + +[build] +targets = ["omp", "opencode"] + +[build.output] +omp = "skills/simplecadapi-omp" +opencode = "skills/simplecadapi-opencode" + diff --git a/skills/simplecadapi/references/README.md b/skills/simplecadapi/references/README.md deleted file mode 100644 index 23fdabf1..00000000 --- a/skills/simplecadapi/references/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# Skill Documentation Structure - -This directory is the source of the task-routed skill layer packaged into -`skills/simplecadapi/` by `skill-pack`. It sits between the SDK's generated -API references and the top-level `SKILL.md` router. - -```text -docs/skill/ - domains/ stable, reusable capability modules - workflows/ goal-oriented compositions of domains - discipline/ mechanical modeling knowledge and invariants -``` - -## Layering - -```text -SKILL.md (generated router) -→ workflows/.md what to run, in what order -→ domains/.md capability boundaries and API groups -→ discipline/.md why: modeling reasoning and invariants -→ docs/api|stdlib|core/ exact signatures (auto-generated) -``` - -Load top-down and only what the current task triggers. No task reads the -whole API index up front. - -## Domains - -| Domain | Owns | -| --- | --- | -| `requirement-refinement` | request → brief (dimensions, units, datums, validation targets) | -| `part-modeling` | single-solid parts: primitives, profiles, features, booleans, transforms | -| `sketch-and-features` | declarative constrained sketches and promotion | -| `assembly-and-product` | parts, placements, connectors, constraints, @part/@assemble, cache, `.scadpkg` | -| `standard-parts` | stdlib gears, ring gears, racks, cycloidal discs, bearings | -| `step-inspection` | STEP/BREP evidence, comparison, reconstruction evaluation | -| `export-and-translation` | STEP/STL/OBJ/MJCF export, FreeCAD/Fusion/SolidWorks translation | - -Cross-cutting capabilities — QL grounding, semantic tags, GraphSession replay, -units/tolerances, incremental validation — are not routing targets; each -workflow pulls them in as conditions require. - -## Workflows - -| Workflow | Scenario | -| --- | --- | -| `single-part-modeling` | one physical part from brief to validated solid | -| `sketch-feature-modeling` | constraint-driven profile as the design intent | -| `assembly-product-build` | multi-part product with connectors/constraints and package capture | -| `step-reconstruction` | editable rebuild from a target STEP with tiered acceptance | -| `standard-part-assembly` | mechanisms composed from stdlib components | -| `export-and-translation` | downstream formats from a validated package | - -Each workflow states: goal/scope, task decomposition (required/optional -domains, artifacts, validation gates, repair routes), ordered steps with the -domain/discipline/API references to load, failure routes, and deliverables. - -## Discipline - -Modeling reasoning and invariants, independent of any single API: -`mechanical-modeling` (construction strategy), `requirement-and-cad-brief` -(input precedence, drawings), `datums-and-coordinate-systems`, -`feature-ordering` (operation order and boolean tool geometry), -`assembly-positioning` (mating/motion intent), `geometric-validation` -(validity vs volume, incremental grounding, spec-driven measurement), -`failure-and-repair` (failure classes and the repair loop), -`manufacturing-boundaries` (defaults and what geometry never proves). - -## Authoring rules - -- Domain files say what a capability owns, when to use it, when to route - elsewhere, and which API pages to read — they do not restate signatures. -- Workflow files compose domains; they never duplicate discipline content. -- Discipline files state reasoning and invariants; they avoid CLI- or - tool-specific detail that belongs in domains/workflows. -- Every `references/...` path written here must exist in the packaged skill; - `skill-pack` validates them (`test_skill_pack.py` enforces the same). diff --git a/skills/simplecadapi/references/discipline/assembly-positioning.md b/skills/simplecadapi/references/discipline/assembly-positioning.md deleted file mode 100644 index 6634e55a..00000000 --- a/skills/simplecadapi/references/discipline/assembly-positioning.md +++ /dev/null @@ -1,120 +0,0 @@ -# Discipline: Assembly Positioning - -How SimpleCADAPI represents mating and motion intent, plus engineering guidance -for choosing frames and placements. - -## Evidence labels - -- **SDK contract** below describes behavior implemented by the public assembly, - connector, placement, and solver APIs. -- **Modeling guidance** is a design recommendation. It is not automatically - enforced by the SDK and must be reported as an assumption when it affects fit. - -## Core rule - -Positioning is authored in source — part-local frames, connectors on leaf -parts, placements, declarative constraints — and validated after solving. It -is never eyeballed in a viewer and never patched into exported geometry. - -## The intent ladder - -From weakest to strongest expression: - -```text -raw numeric placement -→ placement tied to a named datum/offset/clearance -→ connector frames on leaf parts (mating interface as data) -→ declarative constraints (fixed/revolute/prismatic/gear/rack-pinion/belt) -→ grounded root + solved constraint graph -``` - -Use the strongest expression the relationship actually has. A lid seated on a -base with a gasket gap is a constraint-bearing relationship, not a matrix. - -## Terminology - -- **Placement** is a canonical right-handed frame created by - `make_placement_rplacement(origin, x_axis=(1,0,0), y_axis=(0,1,0))` or - `identity_placement_rplacement()`. Inputs are interpreted in the active - `SimpleWorkplane` and transformed to global coordinates. The public API does - not accept Euler, quaternion, or axis-angle payloads. -- **Connector** is a named frame owned by a leaf part - (`add_connector_rpart`, `make_placement_connector_rconnector`, - `make_edge_connector_rconnector`, `make_face_connector_rconnector`, - `make_vertex_connector_rconnector`). -- **Public connector** is an interface declaration on an assembly - (`set_public_connector_rassembly`): public id + direct-child component and - connector reference. Declaring it does not clone, offset, or move geometry. - When consumed through nested assemblies, the resolver follows nested public - declarations to the source connector; it is not limited to one nesting level. -- **Constraint** is the design relationship: flush, centered, coaxial, - hinge-like, slider-like, gear mesh, rack drive, belt drive. - -## Choosing constraint types - -| Relationship | Constraint | -| --- | --- | -| Fixed mounting, root grounding | `add_fixed_constraint_rassembly` / `ground_component_rassembly` | -| Hinge, pivot, rotational pose | `add_revolute_constraint_rassembly` | -| Slider, telescoping motion | `add_prismatic_constraint_rassembly` | -| Gear mesh (ratio, axes) | `add_gear_constraint_rassembly` | -| Rack and pinion | `add_rack_pinion_constraint_rassembly` | -| Belt/pulley relation | `add_belt_constraint_rassembly` | - -Ground at least one component — the solver requires a grounded component to -seed placements. Multiple grounded components are accepted, but can -overconstrain the system or fail residual verification; ground exactly the -components that are truly fixed in the product frame. -**Modeling guidance:** when a body is authored away from the assembly origin, -rotate it about its intended local axis before applying the translation. This -avoids an unintended orbit around the assembly origin; it is a source -construction choice, not a separate Placement API requirement. -When a public connector declaration, source connector, or resolved frame -changes, dependent interface hashes and builds are invalidated intentionally; -that is dependency propagation, not a solver error. - -## Nesting - -- **Modeling guidance:** group a functional unit (a bearing, gearbox stage, or - fastener set) into a subassembly when it is placed, reasoned about, or - repeated as a unit. -- A parent consumes a nested subassembly through its public connectors. The - resolver can follow nested public declarations to the source connector, but - a parent constraint does not automatically make an internal component - independently movable. Author and solve the nested mechanism's own - constraints first. -- Public ids are unique within their assembly. Changing a declaration, its - source, or its resolved frame changes the interface hash and invalidates - dependent builds. - -## Authoring workflow - -1. Choose the fixed/root component; ground it. -2. Define part-local frames and datums before placing children - (`datums-and-coordinate-systems.md`). -3. Attach connectors on leaf parts at functional datums. -4. Compose with placements; declare public connectors where a parent will - consume a subassembly. -5. Add declarative constraints for mating and motion. -6. Solve; read `AssemblySolveReport`, residuals - (`measure_constraint_residual_rconstraintresidual`), and - `inspect_assembly_constraints_rconstraintreport`. -7. Validate placement outcomes with measurements, not impressions. - -## Positioning validation checklist - -- Mating faces measure flush (or at the specified gap/offset). -- Screw/bore axes measure coaxial; X/Y positions match. -- Repeated parts share orientation; each occurrence lands at its named - position. -- Moving a component changed placement only — its solid is untouched - (compare volume/bounds before and after if in doubt). -- Solve residuals within tolerance; hits/misses match expectations. - -## When a check fails - -Fix in source, in this order of likelihood: part-local origin or datum; -connector frame definition; placement translation/rotation; constraint -reference (wrong component or connector); missing or conflicting constraint; -assembly hierarchy. Then re-solve and re-validate. Never patch the solved -output. diff --git a/skills/simplecadapi/references/discipline/datums-and-coordinate-systems.md b/skills/simplecadapi/references/discipline/datums-and-coordinate-systems.md deleted file mode 100644 index 9b221dcb..00000000 --- a/skills/simplecadapi/references/discipline/datums-and-coordinate-systems.md +++ /dev/null @@ -1,68 +0,0 @@ -# Discipline: Datums and Coordinate Systems - -Choosing origins, planes, and axes from function before the first primitive. -The coordinate and unit statements below are SDK facts where labeled; origin -choices and part-type defaults are modeling guidance. -## Core rule - -The part-local coordinate system is chosen from the functional datum, and the -SDK evaluates lengths in millimeters and angles in degrees (declared units are -preserved in model JSON). Declaring the convention in the brief is not -optional bookkeeping: every downstream measurement, connector frame, and -placement reads against it. - -## Modeling guidance: origin defaults by part type - -- **Symmetric standalone parts**: origin at the body center. -- **Plates / mounting plates**: origin at footprint center; thickness along - the up axis. -- **Enclosures**: origin at footprint center; base/lid mating surfaces - controlled by named height parameters. -- **Shafts, knobs, axisymmetric parts**: origin on the rotational axis. -- **Adapter / mating plates**: origin on the primary mounting datum or the - bolt-pattern center. - -When nothing better applies, center of the main part or assembly. - -## Convention skeleton - -Declare in the brief: - -```text -Origin: center | base datum | mounting interface | functional axis -Base plane: which model plane carries the main profile -Up / feature direction: which axis, which sign -Named dimensions: offsets, spacings, clearances -Datum features: mating faces, screw axes, centerlines, locating features -``` - -`SimpleWorkplane` (a context manager for modeling in a local frame) and -`CoordinateSystem` exist for local contexts; use them when a feature is -naturally authored in a local frame, and say so in the source. - -## Placement semantics - -- Part-local coordinates equal the wrapped solid's modeling coordinates. If a - different part origin is wanted, build the solid in that frame before - wrapping it as a `Part`. -- A component placement maps child-local coordinates into parent coordinates; - nested placements compose. Moving a part inside an assembly changes only - the placement — never the part's internal solid. -- A numeric placement should correspond to a stated datum, offset, clearance, - axis, or contact relationship. An untraceable transform constant is the - same defect as a magic number. - -## Imported and factory geometry - -Geometry you did not author — stdlib factory output, imported STEP — carries -no assumed origin or orientation. Measure it (QL queries on faces, axes, -bounds; `inspect.brep` for STEP) and derive connector frames from measured -geometry. Bevel gears are the classic trap: measure the output axes before -constraining. - -## Validation - -- Frame checks: expected axes aligned with model axes; repeated parts share - orientation; mating frames land where the brief says. -- After assembly: verify flush faces measure flush, axes measure coaxial, and - offsets measure as specified — see `geometric-validation.md`. diff --git a/skills/simplecadapi/references/discipline/failure-and-repair.md b/skills/simplecadapi/references/discipline/failure-and-repair.md deleted file mode 100644 index cf95e365..00000000 --- a/skills/simplecadapi/references/discipline/failure-and-repair.md +++ /dev/null @@ -1,149 +0,0 @@ -# Discipline: Failure and Repair - -The loop for generation, solve, export, or validation failures. API behavior is -marked as contract; diagnosis heuristics are marked as modeling guidance. - -## Evidence labels - -- **SDK contract** is limited to behavior exposed by the public API or reports. -- **Modeling guidance** suggests a repair path; validate it against the actual - failure and do not present it as an automatic SDK rule. - -## The loop - -1. Read the failing output — the exception, the report, the residual, the - comparison summary. Name what failed before changing anything. -2. Classify the failure (classes below). -3. Make the smallest responsible source or parameter change. -4. Re-run the failed command. -5. Re-run dependent validation. -6. Report remaining risk or deliberate deviations. - -Never suppress the symptom: no exception swallowing, no special-cased input, -no patching exported or solved artifacts. - -## Failure classes -### Boolean failure - -- Verify valid operands and the intended intersection/contact. For union, the - SDK can produce one solid from finite-area face contact or positive-volume - overlap; edge-, vertex-, and tangent-only contact cannot satisfy the - one-manifold-solid contract. -- **Modeling guidance:** remove accidental tangency or coincident terminal - faces by extending through-cut tools beyond the target faces. -- Isolate and simplify the failing base/tool pair. -- `cut_rsolid(..., skip_non_intersecting=False)` is the strict diagnostic mode; - with the default `True`, non-intersecting tools may be ignored. -- After repeated failure, reconsider operation order — not just retry the same - cut harder. - -### Union returns multiple bodies - -`union_rsolid` requires a one-manifold-`Solid` result and fails if it cannot -produce one. If the design is one body, use a contact or overlap that is -topologically capable of producing one solid, then recompute. If the design is -actually multiple parts, the answer is an assembly, not a union. - -### Fillet/chamfer failure - -The following combines the SDK's explicit fillet failure behavior with -modeling guidance for narrowing the cause. -- Radius exceeds local geometry → reduce the radius, narrow the edge - selection, or move the operation later. The public fillet implementation - fails explicitly when the kernel build is not done; it does not silently - choose a smaller radius. -- Unintended tiny edges in the selection → filter by feature intent and split - edge groups rather than filleting everything at once. -- Complex post-boolean topology → apply fillets later in the source order and - re-select edges using stable geometry or tags. - -### Loft/sweep/complex-surface failure - -The following are modeling and diagnosis guidance, not guarantees of every -OCCT or SimpleCADAPI loft result. - -- **Modeling guidance:** bracket the failure with increasing prefixes and - adjacent section pairs; watch reported volume as well as the exception. An - absurd volume is already a failure signal. If every adjacent pair succeeds - but the full set fails, inspect sample count, correspondence, and section - ordering. -- A disconnected section with multiple closed regions can produce a plausible - but unusable result. End the loft at the last connected station, or bridge - and cut back afterwards; confirm the result with volume and BREP/topology - diagnostics. -- Keep the section sample/edge structure intentional. If a component does not - exist at one station, do not silently drop its sample when correspondence - depends on a fixed count; carry a defined value or split the construction. -- A section topology change across stations (birth/death/split/merge) is a - reason to inspect `brep.track_section_contours_rdescriptor` and consider - splitting the loft; this is a diagnosis strategy, not a guarantee that one - global loft must fail. -- A boolean against a large freeform surface can be expensive in practice. - Shallow cosmetic recesses may be better authored additively; reserve - booleans for openings or silhouette changes when that matches the design. - This is modeling/performance guidance, not an algorithmic complexity claim. - -### Wrong scale or bounding box - -Units mismatch, diameter/radius confusion, wrong extrusion direction or -amount, part not centered as assumed, imported STEP with unexpected units. -Check parameter values, re-measure critical extents, correct the source. - -### Missing feature - -Wrong add/subtract mode; tool profile not intersecting the target; blind cut -too shallow; a prior operation renumbered the topology the selection relied -on. Confirm the mode, lengthen through-tools, re-select by stable references. - -### Selector fragility - -Topology changed after a boolean or fillet; similar faces -indistinguishable. Re-select by axis, position, normal, tag, or QL predicate -rather than index. - -### Sketch solve failure - -Missing or contradictory constraints. Read the solve status and backend code; -fix the constraint set, not the coordinates. Record remaining degrees of -freedom when they are intentional. - -### Assembly solve failure -- A nested subassembly constrained through public connectors still owns its - internal degrees of freedom. If an external dual-fixed relationship cannot - close, solve the nested mechanism internally first and let the parent - consume the resulting public interface; do not patch solved placements. - -- Constraint unsolved or conflicting → the constraint graph, not the - geometry. -- Wrong placement → datum or connector frame definition; see - `assembly-positioning.md` fix order. -- Duplicate component ids, cycles, and invalid placements are rejected — fix - the structure. - -### Reconstruction comparison failure - -After a strict comparison fails, group causes with -`BRepComparison.to_error_summary()`: related failures share a root cause, -fix the group together, then run a fresh replay/export/compare cycle. -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 - -Missing external backend (FreeCAD/FreeCADCmd) → report; offer the neutral -fallback explicitly. 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 after repair - -When a fix could have affected unrelated geometry, compare before/after — -for reconstruction, a fresh compare cycle; for parts, re-run the full -per-solid gates plus the spec-driven measurements. - -## Reporting failed repairs - -If a check cannot be repaired in the current environment: what failed, what -was tried, which artifact is still usable, which validation claims cannot be -made, and the next source-level correction to attempt. diff --git a/skills/simplecadapi/references/discipline/feature-ordering.md b/skills/simplecadapi/references/discipline/feature-ordering.md deleted file mode 100644 index 16171928..00000000 --- a/skills/simplecadapi/references/discipline/feature-ordering.md +++ /dev/null @@ -1,86 +0,0 @@ -# Discipline: Feature Ordering - -Operation order is a robustness recommendation, not an SDK-enforced canonical -sequence. Put fragile steps late when that improves diagnosis and repair. - -## Evidence labels - -- **SDK contract:** documented operation results and failure behavior. -- **Modeling guidance:** recommended source organization; other valid operation - orders remain possible when the resulting inputs are valid. - -## Recommended first-pass order - -```text -base solid -→ major additive features -→ subtractive features (openings, pockets) -→ shell -→ through-wall holes -→ fillets and chamfers last -``` - -Why: fillets are often failure-prone, and boolean/detail operations may change -the topology used by later selections. Postponing fragile details often keeps -the model easier to repair; it is not a mandatory SDK ordering rule. - -## Boolean tool geometry - -- **Modeling guidance: overshoot through-cut tools.** Extend cutting tools past - the faces they enter and exit. The amount is part-scale and design-dependent; - `1 mm` is not an SDK default or guarantee. Coincident or coplanar - tool/target faces are a common kernel failure mode. -- **Modeling guidance:** combine identical repeated cuts when convenient; - validate one representative before patterning. -- `union_rsolid` has a one-manifold-`Solid` result contract and fails when it - cannot produce one. Face-area contact or positive-volume overlap can work; - edge-, vertex-, and tangent-only contact cannot satisfy that contract. -- `cut_rsolid(..., skip_non_intersecting=False)` makes non-intersecting tools - fail instead of being silently skipped. Treat this as a strict diagnostic - mode; whether a skipped tool is acceptable is a workflow decision. - -## Selecting what to fillet - -- Radius must fit the local geometry: when a profile cannot accept the - nominal radius, reduce it, narrow the edge selection, or move the operation - later. This SDK's fillet fails explicitly (`ValueError: Fillet failed`) — - there is no silent radius fallback, so treat any failure as a signal to - change radius, selection, or order. -- Filter selected edges by feature intent; split edge groups by feature - rather than filleting everything at once. -- Prefer robust selections (tags, axes, normals, positions, QL predicates) - over topology indexes; booleans and fillets renumber topology. - -## Patterns - -- Verify equal spacing/angles on at least two units before patterning - (`linear_pattern_rsolidlist`, `radial_pattern_rsolidlist`); repetition is a - hypothesis until measured. -- Pattern after the prototype feature validates; never pattern an unvalidated - feature to hide a defect. - -## Structure the source to localize failure - -Each feature is a named step — a per-feature function or a distinct -intermediate variable — so a failed operation names one feature, and a -parameter change touches one obvious place. Print a small QL-derived fact -after each major step (counts, centers, volume) so drift is caught at the -step that caused it. - -## Complex surfaces - -- `loft_rsolid` accepts `Wire`/`Vertex` sections and the implementation enables - OCCT compatibility checking. **Modeling guidance:** keep corresponding wire - sections topologically compatible (same edge count and meaningful feature - boundaries). Compatibility checking is not a substitute for authoring - corresponding sections or validating the resulting solid. -- When authoring wires from sampled data, sample along common rails so each - section places the same feature at the same edge. Cluster samples toward - feature lines or regions where curvature changes fastest. -- Interpolation choice matters: a curve that is flat at each control point - (zero derivative at both ends of every interval) can put a crease at every - knot; measurement noise in control curves can become visible surface ripple. - Smooth control data before lofting through it. -- Use `track_section_contours_rdescriptor` evidence when section topology - changes across stations (birth/death/split/merge); do not force a - topology-changing sequence into one global loft. diff --git a/skills/simplecadapi/references/discipline/geometric-validation.md b/skills/simplecadapi/references/discipline/geometric-validation.md deleted file mode 100644 index 68a2d9f9..00000000 --- a/skills/simplecadapi/references/discipline/geometric-validation.md +++ /dev/null @@ -1,87 +0,0 @@ -# Discipline: Geometric Validation - -Deterministic checks decide pass/fail; scale them to the specification. Every -user-specified dimension requires a targeted measurement. - -## Evidence labels - -- **SDK contract:** `Solid.get_volume()` returns a volume measurement; - `simplecadapi.inspect.brep` exposes diagnostic reports such as `valid`, - volume, and shell closure for BREP outside a `GraphSession`. -- **Validation guidance:** the combination of checks below is a recommended - gate, not a single SDK `Solid.is_valid()` method. - -## Validity is not positive volume - -Validity and positive volume answer different questions. Volume is meaningful -per solid, not only after aggregating multiple bodies; a positive and a negative -body can cancel in an aggregate and hide the problem. - -After boolean/detail operations, check the gates relevant to the artifact: -`Solid.get_volume() > 0` for positive material volume, plus BREP diagnostics -from `simplecadapi.inspect.brep` (`inspect_shape_rbrepinspection` or -`inspect_step_rbrepinspection`) when validity and shell closure matter. These -inspection functions run outside `GraphSession`; they are diagnostic APIs, not -graph operations. `Solid` has no public `is_valid()` method. - -A boolean can also leave a body that is geometrically right but topologically -invalid — correct bounds and volume, one bad face — which survives until the -next operation fails far from the cause. Gate every boolean result, not just -the final one. - -## Incremental grounding - -Every major step prints a small QL-derived fact: selected face count, a -center, an edge count, volume, bounding box. Print only the facts that -validate the current step — never whole solids or full model objects. This is -what makes drift catchable at the step that caused it instead of at final -review. - -## Selection discipline - -- Select by tags, axes, normals, positions, or QL predicates — not arbitrary - topology indexes, which booleans and fillets renumber. -- Indexed getters (`get_faces(index)`, `get_edges(index)`, ...) are for - intentional picks; they are preserved as graph geo-select nodes. -- `apply_tag(shape=..., tag=...)` attaches a tag to exactly the given shape - with LOCAL scope — it never propagates downward; `list_tags(shape=...)` - reads effective tags. Downward/topology-scoped propagation is only exposed - by `apply_tag_rselection` with an explicit propagation policy. Keep numeric - facts in metadata, never in tags. -- A QL-selected face or edge reused by a later feature is preserved as a - stable geo-select node in replayable graphs. - -## Replay as a gate - -When a flow claims replayability, prove it: `export_model_json(session=...)` -→ `replay_model_json(json_str=...)` in a fresh process, and check the -replayed output count/values. A replay that was never run is a claim, not a -check. - -## Spec-driven measurement - -Every dimension, clearance, offset, and relationship in the brief gets a -targeted check: - -- Distances and thicknesses: bounded measurements on selected geometry. -- Flush/centered interfaces: measured deltas, not visual impression. -- Patterns: at least two units measured for spacing/angle before trusting the - pattern. -- Assemblies: solve residuals, coaxiality of mated axes, flush faces, repeated - occurrences at named positions (`assembly-positioning.md`). - -## Visual review converts to deterministic checks - -A visual concern found at review (misplaced feature, wrong silhouette) is not -closed by "looks better now": convert it into a deterministic geometry check -that would have caught it, then run that check. Rendering and comparison -renders (`render_step_comparison_rpath`) are evidence for review — visual -similarity never replaces strict comparison where the contract requires it. - -## Report only what ran - -State the checks that actually executed, with their outcomes. An intended -check that was not run is reported as not run — implying success without -running a check is the cardinal reporting failure. Structural safety, fatigue, -thermal, vibration, tolerance compliance, and regulatory fitness are never -claimed from geometry alone (`manufacturing-boundaries.md`). diff --git a/skills/simplecadapi/references/discipline/manufacturing-boundaries.md b/skills/simplecadapi/references/discipline/manufacturing-boundaries.md deleted file mode 100644 index 5ceb86e4..00000000 --- a/skills/simplecadapi/references/discipline/manufacturing-boundaries.md +++ /dev/null @@ -1,88 +0,0 @@ -# Discipline: Manufacturing Boundaries - -What geometric modeling may and may not conclude about manufacturing. Numeric -defaults in this document are first-pass design heuristics, not SDK defaults. - -## Evidence labels - -- **SDK contract:** canonical length/angle units, product-package/export - boundaries, and tolerance-analysis APIs. -- **Modeling guidance:** wall thickness, fillet, clearance-hole, and backlash - starting values. They require user confirmation or an explicit assumption. - -## Defaults are first-pass, not claims - -When the user does not specify, these defaults keep a model reasonable — they -are not manufacturability, tolerance, or certification conclusions: - -- **SDK contract:** canonical geometry lengths are millimeters and angles are - degrees; declared units remain part of expression/model data. -- Output geometry: closed, positive-volume solids unless surfaces or - construction geometry were explicitly requested. -- Small plastic enclosure wall: 2.0–3.0 mm. -- Cosmetic fillet: 1.0–3.0 mm when safe for local geometry. -- M3/M4/M5 normal clearance holes: 3.4/4.5/5.5 mm unless another standard is - requested. -- Gear mesh backlash starting point: 0.05–0.1 × module — a design decision to - record, not a hidden constant. - -Report which defaults were applied; they are assumptions a reviewer wants to -see. - -## What geometry proves - -Geometric validation (closure, validity, positive volume, measurements, -solve residuals, replay) proves facts about the model: dimensions, -positions, relationships, kinematic structure. That is the full extent. - -## What geometry never proves - -Do not claim, from geometry alone: - -- structural safety or adequate strength margins -- fatigue life -- thermal performance -- vibration or modal behavior -- tolerance-stack compliance (tolerance analysis must actually run and pass) -- complete manufacturability or DFM sign-off -- process certification or regulatory compliance - -These require their own analysis with real inputs. If the user needs them, -say so and route to the appropriate analysis — do not soften the language -into implying them ("should be strong enough" is still a claim). - -## Format responsibilities - -Each export target carries only its own contract -(`../domains/export-and-translation.md`): - -- `.scadpkg` is the editable, replayable SimpleCAD boundary — never treat STL - or OBJ as an editable CAD source. -- STEP carries evaluated BREP and product structure, not feature history. -- STL is facet soup for additive manufacturing; OBJ adds shared vertices for - DCC exchange. Neither is a validation substitute for the solid. -- MJCF carries simulation kinematics from the constraint graph; it is not a - manufacturing artifact. - -## Dimension hygiene at the manufacturing boundary - -- Exposed tunable dimensions are `var()`/`Var` declarations with optional - unit and tolerance — the tolerance chain that matters downstream should be - declared, not implied. -- Derived numbers (fits, cumulative offsets, conversions across many - features) are computed, never freehanded. -- When a tolerance-chain question is the actual task, use the public tolerance - APIs (`analyze_tolerance`, `check_tolerance`, `ToleranceAnalysis`, - `ToleranceReport`) and report their output. `check_tolerance` returns a - check result for a requirement; it does not choose the engineering - requirement for you. - -## Interaction with fabrication processes - -Laser/waterjet/CNC handoff questions about 2D profiles, bend lines, and kerf -belong to the downstream fabrication tooling, not to this SDK's geometry -layer; export the geometry that represents the design and let the fabrication -preflight own its process rules. When a design decision affects -fabricability (wall thickness vs part size, hole diameters vs material), -surface it in the report as a flagged assumption rather than silently -optimizing it away. diff --git a/skills/simplecadapi/references/discipline/mechanical-modeling.md b/skills/simplecadapi/references/discipline/mechanical-modeling.md deleted file mode 100644 index 3388d568..00000000 --- a/skills/simplecadapi/references/discipline/mechanical-modeling.md +++ /dev/null @@ -1,77 +0,0 @@ -# Discipline: Mechanical Modeling - -How to choose a construction strategy before selecting SimpleCADAPI operations. -This document separates SDK contracts from mechanical design guidance. - -## Evidence labels - -- **SDK contract** means behavior verified in the public API or generated API - documentation. -- **Modeling guidance** is an engineering recommendation. The SDK does not - infer manufacturing intent, strength, fit, or optimal feature order from it. - -## Decide the construction before writing geometry - -- **Make the spec's controlling dimensions direct named parameters.** - Profile-driven shapes get one closed profile plus extrude/revolve/sweep/ - loft; block-and-feature parts get a base solid plus subtractive features. - Choose whichever lets the user's dimensions appear as parameters instead of - derived values. -- **Decide part vs assembly before modeling.** Bodies that are separately - manufactured, purchased, or movable belong in an assembly with connectors - and placements; monolithic manufacturing intent gets a single fused solid. - Never leave a multi-body result where one labeled product was intended. -- **Pick the origin and orientation from the functional datum** — the mating - interface, mounting plane, or symmetry axis — not from wherever the first - primitive happened to land. See `datums-and-coordinate-systems.md`. -- **Model the part as a sequence of intentional operations**, not one opaque - final shape: each feature is a named step, so a failed operation points at - exactly one feature and a parameter change touches one obvious place. - -## Build from low to high dimensionality - -```text -Vertex / Edge / Wire / Face profiles -→ Solid features: extrude, revolve, sweep, loft -→ booleans for openings and merged bodies -→ detail: fillets, chamfers, shells last -``` - -**SDK contract:** keep replayable modeling operations in public API calls such as -`make_circle_rface`, `extrude_rsolid`, `cut_rsolid`, and `fillet_rsolid`; use -keyword arguments for documented public APIs. The SDK records graph operations -when a `GraphSession` is active, but it does not require every local helper to -be a one-line public call. - -## Distinguish physical roles - -- **Monolithic part**: one manufactured body, one fused solid. -- **Independent manufactured part**: own file, own `Part`, placed in the - assembly. -- **Purchased/standard component**: stdlib factory or imported geometry with - measured interfaces; never re-modeled by hand when a factory exists. -- **Motion component**: interfaces expressed as connectors; relations as - declarative constraints (revolute/prismatic/gear/rack-pinion/belt). - -## Parameters are design intent - -- Every meaningful dimension is a named parameter in the file that consumes - it; no magic numbers buried inside geometry calls. -- Exposed tunable parameters are `var()`/`Var` declarations (optionally with - unit and tolerance); everything else is a plain constant in place. -- Numbers that are the result of computation (centers, radii from fits, - cumulative offsets) are computed, never freehanded. - -## Sanity-check proportions before generating - -Compare the expected bounding box against the real-world object, wall -thickness against overall size, feature positions against edges and -neighbors. Order-of-magnitude and collision errors pass geometric validation -and fail only at review — catch them in the brief. - -## What geometry cannot tell you - -A valid, closed, positive-volume solid says nothing about strength, fatigue, -thermal behavior, vibration, tolerance compliance, or regulatory fitness. -Do not claim any of those without the corresponding analysis having actually -run. See `manufacturing-boundaries.md`. diff --git a/skills/simplecadapi/references/discipline/requirement-and-cad-brief.md b/skills/simplecadapi/references/discipline/requirement-and-cad-brief.md deleted file mode 100644 index 7fc80327..00000000 --- a/skills/simplecadapi/references/discipline/requirement-and-cad-brief.md +++ /dev/null @@ -1,66 +0,0 @@ -# Discipline: Requirement and CAD Brief - -Converting prose, reference images, and technical drawings into an actionable -modeling brief. The operational steps live in -`../domains/requirement-refinement.md`; this file carries reasoning and -evidence-handling guidance, not automatic SDK behavior. - -## Every modality funnels into one brief - -Prose, images, drawings, and conflicts all reduce to the same artifact: a -note-form brief with units, dimensions, features, positioning intent, paths, -and validation targets. The downstream workflow never changes based on input -modality. - -## Evidence precedence - -- A dimensioned source beats image proportions, always. -- Two dimensioned sources in conflict (prose says one value, a drawing callout - another) → flag the conflict to the user; never silently choose. -- An image without dimensions is design intent, not a spec. Establish scale - from one stated dimension or a known object in frame. If neither exists and - fit matters, that is the one clarification question worth asking. -- Reproduction ("model this exactly") raises fidelity expectations and - validation targets; inspiration ("something like this") leaves freedom. - Record which one the request is. - -## Reading a technical drawing - -A drawing is a dimensioned contract: - -1. Title block and notes first: units, projection convention, revision, - disclaimers. -2. Map every view to model axes before extracting numbers — trust view labels - and callouts, not layout conventions. -3. Section views are the source of truth for internal features: bores, - counterbore/blind-hole depths, wall sections. -4. Every callout becomes a named parameter plus a validation target. - Multiplicity (`4X`), `TYP.`, thread/counterbore callouts expand into - features plus checks. -5. Never scale undimensioned geometry off the drawing; derive it from stated - dimensions when constrained, otherwise assume and report. -6. Cross-check features across views; when views disagree, prefer the - dimensioned view and flag the disagreement. - -Success for a drawing-driven model: every drawing dimension is either verified -by a measurement after generation, or explicitly reported as not verified. - -## Assumptions are load-bearing only when reported - -An assumption silently applied is a future defect. Each one in the brief -should be one a reviewer would want to see: default wall thickness, assumed -clearance standard, chosen corner treatment. Trivia (an internal helper's -name) is noise. - -## The one-question rule - -Ask one focused question only when missing information affects fit, safety, -compliance, or makes the model impossible. Otherwise proceed with explicit -assumptions. A barrage of questions is a failure to apply defaults; a missing -question on a fit-critical dimension is a failure to ask. - -## Brief quality gate - -The brief is ready when it defines: source path(s), units, coordinate -convention, named parameters, feature plan, positioning intent, output paths, -and validation targets — and every assumption it carries is worth reporting. diff --git a/skills/simplecadapi/references/docs/api/Assembly.md b/skills/simplecadapi/references/docs/api/Assembly.md deleted file mode 100644 index 957c9f41..00000000 --- a/skills/simplecadapi/references/docs/api/Assembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# Assembly - -## Class Definition - -```python -class Assembly(assembly_id: str, name: Optional[str] = None, components: Tuple[Component, ...] = (), public_connectors: Tuple[PublicConnectorRef, ...] = (), constraints: Tuple[Constraint, ...] = (), grounded_component_ids: Tuple[str, ...] = ()) -``` - -*Source: assembly.py* - -## Import Surface - -- top-level: `from simplecadapi import Assembly` - -## Description - -Product structure containing placed Part or subassembly components. diff --git a/skills/simplecadapi/references/docs/api/AssemblyBuildResult.md b/skills/simplecadapi/references/docs/api/AssemblyBuildResult.md deleted file mode 100644 index 110c784a..00000000 --- a/skills/simplecadapi/references/docs/api/AssemblyBuildResult.md +++ /dev/null @@ -1,17 +0,0 @@ -# AssemblyBuildResult - -## Class Definition - -```python -class AssemblyBuildResult(value: Assembly, definition: AssemblyDefinition, feature_graph: FeatureGraphArtifact, solve_report: AssemblySolveReport) -``` - -*Source: build/results.py* - -## Import Surface - -- top-level: `from simplecadapi import AssemblyBuildResult` - -## Description - -Runtime Assembly plus its durable definition, feature DAG, and solve evidence. diff --git a/skills/simplecadapi/references/docs/api/AssemblySolveReport.md b/skills/simplecadapi/references/docs/api/AssemblySolveReport.md deleted file mode 100644 index b76f7237..00000000 --- a/skills/simplecadapi/references/docs/api/AssemblySolveReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# AssemblySolveReport - -## Class Definition - -```python -class AssemblySolveReport(mode: str, component_lookups: int, component_hits: int, component_misses: int, corrupt_entries: int, dirty_instances: tuple[str, ...] = (), geometry_dirty_instances: tuple[str, ...] = (), material_dirty_instances: tuple[str, ...] = (), binding_dirty_endpoints: tuple[str, ...] = (), dirty_connectors: tuple[str, ...] = (), dirty_relations: tuple[str, ...] = (), dirty_components: tuple[str, ...] = (), public_connector_changed: tuple[str, ...] = (), propagated_paths: tuple[str, ...] = (), component_results: tuple[ComponentSolveResult, ...] = ()) -``` - -*Source: build/incremental_solver.py* - -## Import Surface - -- top-level: `from simplecadapi import AssemblySolveReport` - -## Description - -Structured incremental solve and dirty-propagation evidence. diff --git a/skills/simplecadapi/references/docs/api/BRepComparison.md b/skills/simplecadapi/references/docs/api/BRepComparison.md deleted file mode 100644 index 8ca09c63..00000000 --- a/skills/simplecadapi/references/docs/api/BRepComparison.md +++ /dev/null @@ -1,21 +0,0 @@ -# BRepComparison - -## Class Definition - -```python -class BRepComparison(target: str | None, candidate: str | None, target_minus_candidate_volume: float, candidate_minus_target_volume: float, same_geometric_point_set: bool, geometry_labelled_incidence_graph_isomorphic: bool, target_graph_nodes_edges: tuple[int, int], candidate_graph_nodes_edges: tuple[int, int], geometric_tolerance: float, boolean_volume_tolerance: float, diagnostics: dict[str, Any] = field(default_factory=dict)) -``` - -*Source: inspect/brep/compare.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.BRepComparison(...)`; unavailable inside GraphSession - -## Description - -Hard-gate comparison facts for two solid BREPs. - -``diagnostics`` records validity, bounds, material, topology, and carrier -evidence. Use ``to_error_summary()`` to group every failed check by a -plausible common root cause without changing the strict hard gate. diff --git a/skills/simplecadapi/references/docs/api/BRepEntityError.md b/skills/simplecadapi/references/docs/api/BRepEntityError.md deleted file mode 100644 index e3fcb5a5..00000000 --- a/skills/simplecadapi/references/docs/api/BRepEntityError.md +++ /dev/null @@ -1,17 +0,0 @@ -# BRepEntityError - -## Class Definition - -```python -class BRepEntityError -``` - -*Source: inspect/brep/model.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.BRepEntityError(...)`; unavailable inside GraphSession - -## Description - -Raised when a STEP model or stable entity query cannot be processed. diff --git a/skills/simplecadapi/references/docs/api/BRepInspection.md b/skills/simplecadapi/references/docs/api/BRepInspection.md deleted file mode 100644 index 4a20c5c6..00000000 --- a/skills/simplecadapi/references/docs/api/BRepInspection.md +++ /dev/null @@ -1,17 +0,0 @@ -# BRepInspection - -## Class Definition - -```python -class BRepInspection(source: str | None, valid: bool, counts: dict[str, int], bounding_box: list[float], volume: float, surface_area: float, center_of_mass: list[float], surface_type_counts: dict[str, int], edge_type_counts: dict[str, int], faces: list[dict[str, Any]], edges: list[dict[str, Any]]) -``` - -*Source: inspect/brep/inspect.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.BRepInspection(...)`; unavailable inside GraphSession - -## Description - -JSON-serializable geometry and topology facts for one BREP. diff --git a/skills/simplecadapi/references/docs/api/BRepModel.md b/skills/simplecadapi/references/docs/api/BRepModel.md deleted file mode 100644 index 3a82b334..00000000 --- a/skills/simplecadapi/references/docs/api/BRepModel.md +++ /dev/null @@ -1,17 +0,0 @@ -# BRepModel - -## Class Definition - -```python -class BRepModel(root: TopoDS_Shape, source: str | None, bodies: tuple[TopoDS_Solid, ...], faces: tuple[TopoDS_Face, ...], edges: tuple[TopoDS_Edge, ...], vertices: tuple[TopoDS_Vertex, ...], adjacency: dict[str, set[str]]) -``` - -*Source: inspect/brep/model.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.BRepModel(...)`; unavailable inside GraphSession - -## Description - -One BREP with deterministic zero-based topology ids and incidence data. diff --git a/skills/simplecadapi/references/docs/api/BSplineFitResult.md b/skills/simplecadapi/references/docs/api/BSplineFitResult.md deleted file mode 100644 index 1533ae7d..00000000 --- a/skills/simplecadapi/references/docs/api/BSplineFitResult.md +++ /dev/null @@ -1,21 +0,0 @@ -# BSplineFitResult - -## Class Definition - -```python -class BSplineFitResult(degree: int, control_points: Tuple[PointTuple, ...], knots: Tuple[float, ...], sample_parameters: Tuple[float, ...], max_error: float, rms_error: float, tolerance: float, fairing: float, iterations: int, converged: bool) -``` - -*Source: math.py* - -## Import Surface - -- top-level: `from simplecadapi import BSplineFitResult` - -## Description - -Result from fitting a cubic B-spline to sampled curve points. - -The result stores a complete, normalized B-spline definition suitable for -passing into the exact B-spline edge/wire APIs: cubic degree, control -points, and a full clamped knot vector. diff --git a/skills/simplecadapi/references/docs/api/CacheEntry.md b/skills/simplecadapi/references/docs/api/CacheEntry.md deleted file mode 100644 index 6c19d0d0..00000000 --- a/skills/simplecadapi/references/docs/api/CacheEntry.md +++ /dev/null @@ -1,17 +0,0 @@ -# CacheEntry - -## Class Definition - -```python -class CacheEntry(record: CacheRecord, payload: bytes) -``` - -*Source: cache/store.py* - -## Import Surface - -- top-level: `from simplecadapi import CacheEntry` - -## Description - -Validated cache record and its object payload. diff --git a/skills/simplecadapi/references/docs/api/CacheLockTimeout.md b/skills/simplecadapi/references/docs/api/CacheLockTimeout.md deleted file mode 100644 index 159b4c24..00000000 --- a/skills/simplecadapi/references/docs/api/CacheLockTimeout.md +++ /dev/null @@ -1,17 +0,0 @@ -# CacheLockTimeout - -## Class Definition - -```python -class CacheLockTimeout -``` - -*Source: cache/store.py* - -## Import Surface - -- top-level: `from simplecadapi import CacheLockTimeout` - -## Description - -Raised when a cache key remains locked past policy timeout. diff --git a/skills/simplecadapi/references/docs/api/CacheMode.md b/skills/simplecadapi/references/docs/api/CacheMode.md deleted file mode 100644 index 65db0328..00000000 --- a/skills/simplecadapi/references/docs/api/CacheMode.md +++ /dev/null @@ -1,17 +0,0 @@ -# CacheMode - -## Class Definition - -```python -class CacheMode -``` - -*Source: cache/policy.py* - -## Import Surface - -- top-level: `from simplecadapi import CacheMode` - -## Description - -Persistent cache read/write mode. diff --git a/skills/simplecadapi/references/docs/api/CachePolicy.md b/skills/simplecadapi/references/docs/api/CachePolicy.md deleted file mode 100644 index 96bb0194..00000000 --- a/skills/simplecadapi/references/docs/api/CachePolicy.md +++ /dev/null @@ -1,17 +0,0 @@ -# CachePolicy - -## Class Definition - -```python -class CachePolicy(mode: CacheMode = CacheMode.READ_WRITE, root: Path = Path('.simplecad/cache'), verify_reads: bool = True, quarantine_corrupt: bool = True, lock_timeout_seconds: float = 30.0, stale_lock_seconds: float = 300.0) -``` - -*Source: cache/policy.py* - -## Import Surface - -- top-level: `from simplecadapi import CachePolicy` - -## Description - -Resolved persistent cache location, integrity, and locking policy. diff --git a/skills/simplecadapi/references/docs/api/CacheRecord.md b/skills/simplecadapi/references/docs/api/CacheRecord.md deleted file mode 100644 index e3065b7b..00000000 --- a/skills/simplecadapi/references/docs/api/CacheRecord.md +++ /dev/null @@ -1,17 +0,0 @@ -# CacheRecord - -## Class Definition - -```python -class CacheRecord(namespace: str, key: str, object_hash: str, byte_length: int, media_type: str, metadata: Mapping[str, Any] = field(default_factory=dict), schema_version: str = field(default=_RECORD_SCHEMA_VERSION, init=False)) -``` - -*Source: cache/records.py* - -## Import Surface - -- top-level: `from simplecadapi import CacheRecord` - -## Description - -Canonical mapping from one namespace/key to a content-addressed object. diff --git a/skills/simplecadapi/references/docs/api/CacheReport.md b/skills/simplecadapi/references/docs/api/CacheReport.md deleted file mode 100644 index 307a4fcb..00000000 --- a/skills/simplecadapi/references/docs/api/CacheReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# CacheReport - -## Class Definition - -```python -class CacheReport(mode: str, build_key: str, part_lookups: int, part_hits: int, part_misses: int, corrupt_entries: int = 0, miss_reason: str | None = None, bytes_read: int = 0, bytes_written: int = 0) -``` - -*Source: build/results.py* - -## Import Surface - -- top-level: `from simplecadapi import CacheReport` - -## Description - -Per-build whole-part cache outcome. diff --git a/skills/simplecadapi/references/docs/api/CacheStats.md b/skills/simplecadapi/references/docs/api/CacheStats.md deleted file mode 100644 index 9a0e0e6e..00000000 --- a/skills/simplecadapi/references/docs/api/CacheStats.md +++ /dev/null @@ -1,17 +0,0 @@ -# CacheStats - -## Class Definition - -```python -class CacheStats(objects: int, records: int, locks: int, quarantined: int, object_bytes: int) -``` - -*Source: cache/store.py* - -## Import Surface - -- top-level: `from simplecadapi import CacheStats` - -## Description - -Aggregate content-addressed store counts and object bytes. diff --git a/skills/simplecadapi/references/docs/api/CaptureResult.md b/skills/simplecadapi/references/docs/api/CaptureResult.md deleted file mode 100644 index a1a2cbc5..00000000 --- a/skills/simplecadapi/references/docs/api/CaptureResult.md +++ /dev/null @@ -1,17 +0,0 @@ -# CaptureResult - -## Class Definition - -```python -class CaptureResult(value: Part | Assembly, definition: PartDefinition | AssemblyDefinition, package: ProductPackage, scene: ProductScenePackage | None, package_bytes: bytes) -``` - -*Source: capture.py* - -## Import Surface - -- top-level: `from simplecadapi import CaptureResult` - -## Description - -Runtime value plus one complete durable product snapshot. diff --git a/skills/simplecadapi/references/docs/api/Component.md b/skills/simplecadapi/references/docs/api/Component.md deleted file mode 100644 index 3e61bc0d..00000000 --- a/skills/simplecadapi/references/docs/api/Component.md +++ /dev/null @@ -1,17 +0,0 @@ -# Component - -## Class Definition - -```python -class Component(component_id: str, item: AssemblyItem, placement: Placement, name: Optional[str] = None) -``` - -*Source: assembly.py* - -## Import Surface - -- top-level: `from simplecadapi import Component` - -## Description - -Assembly-local instance of a Part or subassembly. diff --git a/skills/simplecadapi/references/docs/api/ComponentSolveResult.md b/skills/simplecadapi/references/docs/api/ComponentSolveResult.md deleted file mode 100644 index fe014b8c..00000000 --- a/skills/simplecadapi/references/docs/api/ComponentSolveResult.md +++ /dev/null @@ -1,17 +0,0 @@ -# ComponentSolveResult - -## Class Definition - -```python -class ComponentSolveResult(component_id: str, solve_key: str, instance_ids: tuple[str, ...], relation_ids: tuple[str, ...], cache_hit: bool, solved: bool, miss_reason: str | None = None) -``` - -*Source: build/incremental_solver.py* - -## Import Surface - -- top-level: `from simplecadapi import ComponentSolveResult` - -## Description - -Cache and residual outcome for one connected constraint component. diff --git a/skills/simplecadapi/references/docs/api/Connector.md b/skills/simplecadapi/references/docs/api/Connector.md deleted file mode 100644 index ef955b6b..00000000 --- a/skills/simplecadapi/references/docs/api/Connector.md +++ /dev/null @@ -1,20 +0,0 @@ -# Connector - -## Class Definition - -```python -class Connector(connector_id: str, geometry_ref: Optional[GeometryRef] = None, name: Optional[str] = None, anchor: Optional[ConnectorAnchor] = None) -``` - -*Source: connector.py* - -## Import Surface - -- top-level: `from simplecadapi import Connector` - -## Description - -Semantic datum frame anchored by geometry or an explicit placement. - -Assembly public interfaces reference existing component connectors instead -of cloning connectors into the Assembly. diff --git a/skills/simplecadapi/references/docs/api/ConnectorAnchor.md b/skills/simplecadapi/references/docs/api/ConnectorAnchor.md deleted file mode 100644 index c9b8f53f..00000000 --- a/skills/simplecadapi/references/docs/api/ConnectorAnchor.md +++ /dev/null @@ -1,20 +0,0 @@ -# ConnectorAnchor - -## Class Definition - -```python -class ConnectorAnchor(anchor_kind: str, geometry_ref: Optional[GeometryRef] = None, placement: Optional[Placement] = None) -``` - -*Source: connector.py* - -## Import Surface - -- top-level: `from simplecadapi import ConnectorAnchor` - -## Description - -Serializable source for a connector datum frame. - -Supported ``anchor_kind`` values are ``geometry`` and ``placement``. -Assembly public exposure is modeled separately by ``PublicConnectorRef``. diff --git a/skills/simplecadapi/references/docs/api/ConnectorRef.md b/skills/simplecadapi/references/docs/api/ConnectorRef.md deleted file mode 100644 index fc66b676..00000000 --- a/skills/simplecadapi/references/docs/api/ConnectorRef.md +++ /dev/null @@ -1,17 +0,0 @@ -# ConnectorRef - -## Class Definition - -```python -class ConnectorRef(component_id: str, connector_id: str) -``` - -*Source: connector.py* - -## Import Surface - -- top-level: `from simplecadapi import ConnectorRef` - -## Description - -Reference to a connector through a component instance. diff --git a/skills/simplecadapi/references/docs/api/Const.md b/skills/simplecadapi/references/docs/api/Const.md deleted file mode 100644 index 8abf72c7..00000000 --- a/skills/simplecadapi/references/docs/api/Const.md +++ /dev/null @@ -1,17 +0,0 @@ -# Const - -## Class Definition - -```python -class Const(value: float, expr_id: str = field(default_factory=lambda : _make_expr_id('const'))) -``` - -*Source: expr.py* - -## Import Surface - -- top-level: `from simplecadapi import Const` - -## Description - -Immutable constant node used in the v2 expression graph. diff --git a/skills/simplecadapi/references/docs/api/Constraint.md b/skills/simplecadapi/references/docs/api/Constraint.md deleted file mode 100644 index dd8c87f0..00000000 --- a/skills/simplecadapi/references/docs/api/Constraint.md +++ /dev/null @@ -1,17 +0,0 @@ -# Constraint - -## Class Definition - -```python -class Constraint(constraint_id: str, constraint_kind: ConstraintKind, connector_a: ConnectorRef, connector_b: ConnectorRef, drive_distance: Optional[float] = None, distance_limit: Optional[ScalarLimit] = None, drive_angle_degrees: Optional[float] = None, angle_limit: Optional[ScalarLimit] = None, pitch_radius_a: Optional[float] = None, pitch_radius_b: Optional[float] = None, pulley_radius_a: Optional[float] = None, pulley_radius_b: Optional[float] = None, pitch_radius: Optional[float] = None, phase_offset: Optional[float] = None, name: Optional[str] = None) -``` - -*Source: constraint.py* - -## Import Surface - -- top-level: `from simplecadapi import Constraint` - -## Description - -Connector-to-connector assembly constraint. diff --git a/skills/simplecadapi/references/docs/api/ConstraintReport.md b/skills/simplecadapi/references/docs/api/ConstraintReport.md deleted file mode 100644 index ad13ae2c..00000000 --- a/skills/simplecadapi/references/docs/api/ConstraintReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# ConstraintReport - -## Class Definition - -```python -class ConstraintReport(solved: bool, grounded_component_ids: Tuple[str, ...], solved_component_ids: Tuple[str, ...], unsolved_component_ids: Tuple[str, ...], residuals: Tuple[ConstraintResidual, ...]) -``` - -*Source: constraint.py* - -## Import Surface - -- top-level: `from simplecadapi import ConstraintReport` - -## Description - -Assembly constraint inspection report. diff --git a/skills/simplecadapi/references/docs/api/ConstraintResidual.md b/skills/simplecadapi/references/docs/api/ConstraintResidual.md deleted file mode 100644 index ac829b29..00000000 --- a/skills/simplecadapi/references/docs/api/ConstraintResidual.md +++ /dev/null @@ -1,17 +0,0 @@ -# ConstraintResidual - -## Class Definition - -```python -class ConstraintResidual(constraint_id: str, translation_error: float, angular_error_degrees: float, within_tolerance: bool) -``` - -*Source: constraint.py* - -## Import Surface - -- top-level: `from simplecadapi import ConstraintResidual` - -## Description - -Residual for a single assembly constraint. diff --git a/skills/simplecadapi/references/docs/api/ContentAddressedStore.md b/skills/simplecadapi/references/docs/api/ContentAddressedStore.md deleted file mode 100644 index f68a4055..00000000 --- a/skills/simplecadapi/references/docs/api/ContentAddressedStore.md +++ /dev/null @@ -1,17 +0,0 @@ -# ContentAddressedStore - -## Class Definition - -```python -class ContentAddressedStore(policy: CachePolicy) -``` - -*Source: cache/store.py* - -## Import Surface - -- top-level: `from simplecadapi import ContentAddressedStore` - -## Description - -Persistent CAS whose corrupt entries degrade to misses. diff --git a/skills/simplecadapi/references/docs/api/Dimension.md b/skills/simplecadapi/references/docs/api/Dimension.md deleted file mode 100644 index cce883de..00000000 --- a/skills/simplecadapi/references/docs/api/Dimension.md +++ /dev/null @@ -1,17 +0,0 @@ -# Dimension - -## Class Definition - -```python -class Dimension(length: int = 0, angle: int = 0) -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import Dimension` - -## Description - -Physical dimension represented by integer length and angle exponents. diff --git a/skills/simplecadapi/references/docs/api/DimensionTolerance.md b/skills/simplecadapi/references/docs/api/DimensionTolerance.md deleted file mode 100644 index aac851f4..00000000 --- a/skills/simplecadapi/references/docs/api/DimensionTolerance.md +++ /dev/null @@ -1,20 +0,0 @@ -# DimensionTolerance - -## Class Definition - -```python -class DimensionTolerance(lower_deviation: float, upper_deviation: float) -``` - -*Source: expr.py* - -## Import Surface - -- top-level: `from simplecadapi import DimensionTolerance` - -## Description - -Permitted lower and upper deviations from a nominal dimension. - -Deviations are signed: the lower deviation must be less than or equal to -zero and the upper deviation must be greater than or equal to zero. diff --git a/skills/simplecadapi/references/docs/api/EntityInspectionParity.md b/skills/simplecadapi/references/docs/api/EntityInspectionParity.md deleted file mode 100644 index 1b89af7a..00000000 --- a/skills/simplecadapi/references/docs/api/EntityInspectionParity.md +++ /dev/null @@ -1,17 +0,0 @@ -# EntityInspectionParity - -## Class Definition - -```python -class EntityInspectionParity(source: str | None, valid: bool, issues: tuple[str, ...], checked_faces: int, checked_edges: int, degenerate_edges: int) -``` - -*Source: inspect/brep/parity.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.EntityInspectionParity(...)`; unavailable inside GraphSession - -## Description - -Result of checking stable entity output against a BRepInspection report. diff --git a/skills/simplecadapi/references/docs/api/EvaluationConfig.md b/skills/simplecadapi/references/docs/api/EvaluationConfig.md deleted file mode 100644 index 2aacd610..00000000 --- a/skills/simplecadapi/references/docs/api/EvaluationConfig.md +++ /dev/null @@ -1,25 +0,0 @@ -# EvaluationConfig - -## Class Definition - -```python -class EvaluationConfig(target_kind: str = 'solid', stage_timeout_seconds: float = 120.0, material_timeout_seconds: float = 300.0, global_max_bbox_delta: float = 0.1, global_max_centroid_distance: float = 0.1, global_max_relative_volume_error: float = 0.01, global_max_relative_area_error: float = 0.01, strict_material_tolerance: float = 1e-06, boundary_linear_deflection: float = 0.2, boundary_max_samples: int = 200, boundary_max_hausdorff: float = 0.1, boundary_max_p95: float = 0.1, sections: tuple[SectionEvaluationConfig, ...] = (), strict_geometric_tolerance: float = 1e-07) -``` - -*Source: inverse_engineer/brep/evaluation.py* - -## Import Surface - -- reverse-engineering evaluator: `from simplecadapi.inverse_engineer.brep import EvaluationConfig` - -## Description - -Closed configuration contract for trusted reconstruction evaluation. - -Timeout fields are seconds. ``strict_material_tolerance`` is cubic -millimetres, while boundary linear deflection and strict geometric tolerance -are millimetres. ``boundary_max_samples`` is an integer measurement control. -Paths and this configuration belong to the trusted evaluator; participant -output must not be allowed to replace them. Aggregate and sampled metrics are -diagnostic and have no acceptance thresholds. The ``global_max_*`` and -``boundary_max_*`` fields are deprecated compatibility inputs and are ignored. diff --git a/skills/simplecadapi/references/docs/api/Expr.md b/skills/simplecadapi/references/docs/api/Expr.md deleted file mode 100644 index f47108e1..00000000 --- a/skills/simplecadapi/references/docs/api/Expr.md +++ /dev/null @@ -1,17 +0,0 @@ -# Expr - -## Class Definition - -```python -class Expr(op: str, args: Tuple[ScalarExpr, ...], expr_id: str = field(default_factory=lambda : _make_expr_id('expr'))) -``` - -*Source: expr.py* - -## Import Surface - -- top-level: `from simplecadapi import Expr` - -## Description - -Derived scalar expression node built from one or more operands. diff --git a/skills/simplecadapi/references/docs/api/ExpressionGraph.md b/skills/simplecadapi/references/docs/api/ExpressionGraph.md deleted file mode 100644 index 6947b1bd..00000000 --- a/skills/simplecadapi/references/docs/api/ExpressionGraph.md +++ /dev/null @@ -1,17 +0,0 @@ -# ExpressionGraph - -## Class Definition - -```python -class ExpressionGraph() -``` - -*Source: expr.py* - -## Import Surface - -- top-level: `from simplecadapi import ExpressionGraph` - -## Description - -A lightweight registry of expression DAG nodes. diff --git a/skills/simplecadapi/references/docs/api/FileInput.md b/skills/simplecadapi/references/docs/api/FileInput.md deleted file mode 100644 index c2c33417..00000000 --- a/skills/simplecadapi/references/docs/api/FileInput.md +++ /dev/null @@ -1,17 +0,0 @@ -# FileInput - -## Class Definition - -```python -class FileInput(path: str) -``` - -*Source: build/dependencies.py* - -## Import Surface - -- top-level: `from simplecadapi import FileInput` - -## Description - -A declared external file whose bytes participate in a build key. diff --git a/skills/simplecadapi/references/docs/api/FreeCADTranslator.md b/skills/simplecadapi/references/docs/api/FreeCADTranslator.md deleted file mode 100644 index 954748b7..00000000 --- a/skills/simplecadapi/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/skills/simplecadapi/references/docs/api/Fusion360Translator.md b/skills/simplecadapi/references/docs/api/Fusion360Translator.md deleted file mode 100644 index 5c206436..00000000 --- a/skills/simplecadapi/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/skills/simplecadapi/references/docs/api/GeometryRef.md b/skills/simplecadapi/references/docs/api/GeometryRef.md deleted file mode 100644 index 245c3cc3..00000000 --- a/skills/simplecadapi/references/docs/api/GeometryRef.md +++ /dev/null @@ -1,22 +0,0 @@ -# GeometryRef - -## Class Definition - -```python -class GeometryRef(kind: str, source_node_id: Optional[str], geo_selector: Dict[str, Any], flip: bool = False) -``` - -*Source: connector.py* - -## Import Surface - -- top-level: `from simplecadapi import GeometryRef` - -## Description - -Serializable reference to a sub-shape selected via QL. - -Wraps the geo_selector fingerprint + source graph node id so the -exact sub-element (Face/Edge/Vertex) can be re-resolved at translation -time or during constraint solving. When flip is True, the derived -placement Z axis is negated. diff --git a/skills/simplecadapi/references/docs/api/GraphSession.md b/skills/simplecadapi/references/docs/api/GraphSession.md deleted file mode 100644 index e97d2448..00000000 --- a/skills/simplecadapi/references/docs/api/GraphSession.md +++ /dev/null @@ -1,31 +0,0 @@ -# GraphSession - -## Class Definition - -```python -class GraphSession(graph_id: Optional[str] = None, *, allow_external_definitions: bool = False) -``` - -*Source: graph.py* - -## Import Surface - -- top-level: `from simplecadapi import GraphSession` - -## Description - -Context manager that records CAD operations into a DAG. - -with GraphSession() as session: -n1 = record_operation( -"make_line_redge", {"start": (0, 0, 0), "end": (1, 0, 0)} -) -n2 = record_operation( -"make_line_redge", {"start": (1, 0, 0), "end": (1, 1, 0)} -) -record_operation( -"make_wire_from_edges_rwire", {"edge_count": 2}, inputs=[n1, n2] -) - -# Access the graph after the session -print(session.graph.topological_order()) diff --git a/skills/simplecadapi/references/docs/api/InspectionSummaryComparison.md b/skills/simplecadapi/references/docs/api/InspectionSummaryComparison.md deleted file mode 100644 index 6856222d..00000000 --- a/skills/simplecadapi/references/docs/api/InspectionSummaryComparison.md +++ /dev/null @@ -1,17 +0,0 @@ -# InspectionSummaryComparison - -## Class Definition - -```python -class InspectionSummaryComparison(volume_delta: float, surface_area_delta: float, bounding_box_delta: tuple[float, ...], counts_equal: bool, surface_type_counts_equal: bool, edge_type_counts_equal: bool) -``` - -*Source: inspect/brep/compare.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.InspectionSummaryComparison(...)`; unavailable inside GraphSession - -## Description - -Fast report-level diagnostics; not a geometric acceptance result. diff --git a/skills/simplecadapi/references/docs/api/Material.md b/skills/simplecadapi/references/docs/api/Material.md deleted file mode 100644 index 8321a710..00000000 --- a/skills/simplecadapi/references/docs/api/Material.md +++ /dev/null @@ -1,17 +0,0 @@ -# Material - -## Class Definition - -```python -class Material(material_id: str, name: Optional[str] = None, density: Optional[float] = None, density_unit: Optional[str] = None, color: Optional[Vec3] = None) -``` - -*Source: material.py* - -## Import Surface - -- top-level: `from simplecadapi import Material` - -## Description - -Material definition assigned to a Part through `assign_material_rpart`. diff --git a/skills/simplecadapi/references/docs/api/Part.md b/skills/simplecadapi/references/docs/api/Part.md deleted file mode 100644 index 7b701f62..00000000 --- a/skills/simplecadapi/references/docs/api/Part.md +++ /dev/null @@ -1,17 +0,0 @@ -# Part - -## Class Definition - -```python -class Part(part_id: str, body: Solid, name: Optional[str] = None, material: Optional[Material] = None, connectors: Tuple[Connector, ...] = ()) -``` - -*Source: part.py* - -## Import Surface - -- top-level: `from simplecadapi import Part` - -## Description - -Single-body product item wrapping exactly one Solid. diff --git a/skills/simplecadapi/references/docs/api/PartBuildResult.md b/skills/simplecadapi/references/docs/api/PartBuildResult.md deleted file mode 100644 index b81f14ff..00000000 --- a/skills/simplecadapi/references/docs/api/PartBuildResult.md +++ /dev/null @@ -1,17 +0,0 @@ -# PartBuildResult - -## Class Definition - -```python -class PartBuildResult(value: Part, definition: PartDefinition, feature_graph: FeatureGraphArtifact, cache_report: CacheReport, interface_diff: PartInterfaceDiff | None = None) -``` - -*Source: build/results.py* - -## Import Surface - -- top-level: `from simplecadapi import PartBuildResult` - -## Description - -Runtime Part plus its durable definition, feature DAG, and cache evidence. diff --git a/skills/simplecadapi/references/docs/api/Placement.md b/skills/simplecadapi/references/docs/api/Placement.md deleted file mode 100644 index baf436b2..00000000 --- a/skills/simplecadapi/references/docs/api/Placement.md +++ /dev/null @@ -1,17 +0,0 @@ -# Placement - -## Class Definition - -```python -class Placement(origin: Vec3, x_axis: Vec3 = (1.0, 0.0, 0.0), y_axis: Vec3 = (0.0, 1.0, 0.0), z_axis: Vec3 = (0.0, 0.0, 1.0)) -``` - -*Source: placement.py* - -## Import Surface - -- top-level: `from simplecadapi import Placement` - -## Description - -Right-handed placement mapping child-local coordinates to parent coordinates. diff --git a/skills/simplecadapi/references/docs/api/ProductMJCFExportReport.md b/skills/simplecadapi/references/docs/api/ProductMJCFExportReport.md deleted file mode 100644 index 9b10c22e..00000000 --- a/skills/simplecadapi/references/docs/api/ProductMJCFExportReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# ProductMJCFExportReport - -## Class Definition - -```python -class ProductMJCFExportReport(output_path: Path, mapping_path: Path, mesh_directory: Path, root_definition_id: str, mesh_count: int, body_count: int, joint_count: int, equality_count: int, closure_count: int, grounded_group_count: int, site_count: int, default_density_count: int, limitations: tuple[str, ...]) -``` - -*Source: exporter/mjcf.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.mjcf.ProductMJCFExportReport(...)` - -## Description - -Observed facts and compiler decisions from one MJCF export. diff --git a/skills/simplecadapi/references/docs/api/ProductOBJExportReport.md b/skills/simplecadapi/references/docs/api/ProductOBJExportReport.md deleted file mode 100644 index 9e0ea7d5..00000000 --- a/skills/simplecadapi/references/docs/api/ProductOBJExportReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# ProductOBJExportReport - -## Class Definition - -```python -class ProductOBJExportReport(output_path: Path, root_definition_id: str, solid_count: int, definition_count: int, vertex_count: int, triangle_count: int, linear_deflection: float, angular_deflection_degrees: float, relative: bool, tessellation_backend: str = 'opencascade-brep-tessellation') -``` - -*Source: exporter/obj.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.obj.ProductOBJExportReport(...)` - -## Description - -Evidence from direct BREP tessellation and triangle OBJ export. diff --git a/skills/simplecadapi/references/docs/api/ProductPackage.md b/skills/simplecadapi/references/docs/api/ProductPackage.md deleted file mode 100644 index 38679615..00000000 --- a/skills/simplecadapi/references/docs/api/ProductPackage.md +++ /dev/null @@ -1,17 +0,0 @@ -# ProductPackage - -## Class Definition - -```python -class ProductPackage(manifest: Mapping[str, Any], objects: Mapping[str, bytes], root_definition: Definition = field(compare=False, repr=False)) -``` - -*Source: product_packages.py* - -## Import Surface - -- top-level: `from simplecadapi import ProductPackage` - -## Description - -Validated package containing definitions, shared blobs, and projections. diff --git a/skills/simplecadapi/references/docs/api/ProductPackageError.md b/skills/simplecadapi/references/docs/api/ProductPackageError.md deleted file mode 100644 index a06fcf74..00000000 --- a/skills/simplecadapi/references/docs/api/ProductPackageError.md +++ /dev/null @@ -1,17 +0,0 @@ -# ProductPackageError - -## Class Definition - -```python -class ProductPackageError -``` - -*Source: product_packages.py* - -## Import Surface - -- top-level: `from simplecadapi import ProductPackageError` - -## Description - -Raised when a product package violates its closed artifact contract. diff --git a/skills/simplecadapi/references/docs/api/ProductSTEPExportReport.md b/skills/simplecadapi/references/docs/api/ProductSTEPExportReport.md deleted file mode 100644 index 4dbea8ce..00000000 --- a/skills/simplecadapi/references/docs/api/ProductSTEPExportReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# ProductSTEPExportReport - -## Class Definition - -```python -class ProductSTEPExportReport(output_path: Path, schema: str, definition_ids: tuple[str, ...], occurrence_count: int, material_ids: tuple[str, ...], metadata_item_count: int, limitations: tuple[str, ...]) -``` - -*Source: exporter/step.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.step.ProductSTEPExportReport(...)` - -## Description - -Observed AP242 export facts and explicit semantic limitations. diff --git a/skills/simplecadapi/references/docs/api/ProductSTLExportReport.md b/skills/simplecadapi/references/docs/api/ProductSTLExportReport.md deleted file mode 100644 index 9ef3b9d7..00000000 --- a/skills/simplecadapi/references/docs/api/ProductSTLExportReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# ProductSTLExportReport - -## Class Definition - -```python -class ProductSTLExportReport(output_path: Path, root_definition_id: str, solid_count: int, definition_count: int, vertex_count: int, triangle_count: int, linear_deflection: float, angular_deflection_degrees: float, relative: bool, tessellation_backend: str = 'opencascade-brep-tessellation') -``` - -*Source: exporter/stl.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.stl.ProductSTLExportReport(...)` - -## Description - -Evidence from direct BREP tessellation and binary STL export. diff --git a/skills/simplecadapi/references/docs/api/PublicConnectorRef.md b/skills/simplecadapi/references/docs/api/PublicConnectorRef.md deleted file mode 100644 index a5bcf97e..00000000 --- a/skills/simplecadapi/references/docs/api/PublicConnectorRef.md +++ /dev/null @@ -1,17 +0,0 @@ -# PublicConnectorRef - -## Class Definition - -```python -class PublicConnectorRef(public_connector_id: str, component_id: str, connector_id: str, name: Optional[str] = None) -``` - -*Source: assembly.py* - -## Import Surface - -- top-level: `from simplecadapi import PublicConnectorRef` - -## Description - -Public alias for an existing connector on a direct child component. diff --git a/skills/simplecadapi/references/docs/api/README.md b/skills/simplecadapi/references/docs/api/README.md deleted file mode 100644 index eda332ff..00000000 --- a/skills/simplecadapi/references/docs/api/README.md +++ /dev/null @@ -1,369 +0,0 @@ -# SimpleCAD API Index - -This index includes generated docs for the public SimpleCAD API surface, including geometry operations, graph/model JSON workflows, durable product builds, persistent cache controls, inspection tools, expressions, QL, and export helpers. - -## Import Surfaces - -- Entries marked `top-level` are exported from `simplecadapi` and can be imported with `from simplecadapi import `. -- 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 `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 - -- [make_2d_cut_rface](make_2d_cut_rface.md) *(from _operators_boolean.py)* `top-level` -- [make_2d_intersect_rface](make_2d_intersect_rface.md) *(from _operators_boolean.py)* `top-level` -- [make_2d_union_rface](make_2d_union_rface.md) *(from _operators_boolean.py)* `top-level` -- [make_angle_arc_redge](make_angle_arc_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_angle_arc_rwire](make_angle_arc_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_assembly_rassembly](make_assembly_rassembly.md) *(from _operators_product.py)* `top-level` -- [make_bezier_surface_rface](make_bezier_surface_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_box_rsolid](make_box_rsolid.md) *(from _operators_geometry.py)* `top-level` -- [make_circle_redge](make_circle_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_circle_rface](make_circle_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_circle_rwire](make_circle_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_compound_from_assembly_rcompound](make_compound_from_assembly_rcompound.md) *(from _operators_product.py)* `top-level` -- [make_cone_rsolid](make_cone_rsolid.md) *(from _operators_geometry.py)* `top-level` -- [make_connector_ref_rconnectorref](make_connector_ref_rconnectorref.md) *(from _operators_product.py)* `top-level` -- [make_cylinder_rsolid](make_cylinder_rsolid.md) *(from _operators_geometry.py)* `top-level` -- [make_cylindrical_surface_rface](make_cylindrical_surface_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_edge_connector_rconnector](make_edge_connector_rconnector.md) *(from _operators_product.py)* `top-level` -- [make_face_connector_rconnector](make_face_connector_rconnector.md) *(from _operators_product.py)* `top-level` -- [make_face_from_sketch_rface](make_face_from_sketch_rface.md) *(from _operators_sketch.py)* `top-level` -- [make_face_from_wire_rface](make_face_from_wire_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_face_from_wires_rface](make_face_from_wires_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_gordon_surface_rface](make_gordon_surface_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_helix_redge](make_helix_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_helix_rwire](make_helix_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_interpolated_spline_redge](make_interpolated_spline_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_interpolated_spline_rwire](make_interpolated_spline_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_line_redge](make_line_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_material_rmaterial](make_material_rmaterial.md) *(from _operators_product.py)* `top-level` -- [make_part_rpart](make_part_rpart.md) *(from _operators_product.py)* `top-level` -- [make_periodic_spline_rwire](make_periodic_spline_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_placement_connector_rconnector](make_placement_connector_rconnector.md) *(from _operators_product.py)* `top-level` -- [make_placement_rplacement](make_placement_rplacement.md) *(from _operators_product.py)* `top-level` -- [make_point_rvertex](make_point_rvertex.md) *(from _operators_geometry.py)* `top-level` -- [make_polyline_rwire](make_polyline_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_rectangle_rface](make_rectangle_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_rectangle_rwire](make_rectangle_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_ruled_surface_rface](make_ruled_surface_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_scalar_limit_rscalarlimit](make_scalar_limit_rscalarlimit.md) *(from _operators_product.py)* `top-level` -- [make_segment_redge](make_segment_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_segment_rwire](make_segment_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_sketch_rsketch](make_sketch_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [make_solid_from_shell_rsolid](make_solid_from_shell_rsolid.md) *(from _operators_geometry.py)* `top-level` -- [make_sphere_rsolid](make_sphere_rsolid.md) *(from _operators_geometry.py)* `top-level` -- [make_spline_redge](make_spline_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_spline_rwire](make_spline_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_surface_patch_rface](make_surface_patch_rface.md) *(from _operators_geometry.py)* `top-level` -- [make_three_point_arc_redge](make_three_point_arc_redge.md) *(from _operators_geometry.py)* `top-level` -- [make_three_point_arc_rwire](make_three_point_arc_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_vertex_connector_rconnector](make_vertex_connector_rconnector.md) *(from _operators_product.py)* `top-level` -- [make_wire_from_edges_rwire](make_wire_from_edges_rwire.md) *(from _operators_geometry.py)* `top-level` -- [make_wire_from_sketch_rwire](make_wire_from_sketch_rwire.md) *(from _operators_sketch.py)* `top-level` - -## Transforms - -- [mirror_shape](mirror_shape.md) *(from _operators_transform.py)* `top-level` -- [rotate_shape](rotate_shape.md) *(from _operators_transform.py)* `top-level` -- [translate_shape](translate_shape.md) *(from _operators_transform.py)* `top-level` - -## 3D Operations - -- [extrude_rsolid](extrude_rsolid.md) *(from _operators_features.py)* `top-level` -- [loft_rshell](loft_rshell.md) *(from _operators_geometry.py)* `top-level` -- [loft_rsolid](loft_rsolid.md) *(from _operators_features.py)* `top-level` -- [revolve_rsolid](revolve_rsolid.md) *(from _operators_features.py)* `top-level` -- [sweep_rsolid](sweep_rsolid.md) *(from _operators_features.py)* `top-level` - -## Tagging and Selection - -- [apply_tag](apply_tag.md) *(from _operators_selection.py)* `top-level` -- [apply_tag_rselection](apply_tag_rselection.md) *(from _operators_selection.py)* `top-level` -- [list_tags](list_tags.md) *(from _operators_selection.py)* `top-level` -- [select_edges_by_tag](select_edges_by_tag.md) *(from _operators_selection.py)* `top-level` -- [select_faces_by_tag](select_faces_by_tag.md) *(from _operators_selection.py)* `top-level` - -## Boolean Operations - -- [cut_rsolid](cut_rsolid.md) *(from _operators_boolean.py)* `top-level` -- [intersect_rsolid](intersect_rsolid.md) *(from _operators_boolean.py)* `top-level` -- [union_rsolid](union_rsolid.md) *(from _operators_boolean.py)* `top-level` - -## Export - -- [ProductMJCFExportReport](ProductMJCFExportReport.md) *(from exporter/mjcf.py)* `exporter namespace` -- [ProductOBJExportReport](ProductOBJExportReport.md) *(from exporter/obj.py)* `exporter namespace` -- [ProductSTEPExportReport](ProductSTEPExportReport.md) *(from exporter/step.py)* `exporter namespace` -- [ProductSTLExportReport](ProductSTLExportReport.md) *(from exporter/stl.py)* `exporter namespace` -- [export_product_package_to_mjcf](export_product_package_to_mjcf.md) *(from exporter/mjcf.py)* `exporter namespace` -- [export_product_package_to_obj](export_product_package_to_obj.md) *(from exporter/obj.py)* `exporter namespace` -- [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` -- [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` -- [fit_cubic_bspline_control_points](fit_cubic_bspline_control_points.md) *(from math.py)* `top-level` - -## Modeling Graph and Replay - -- [GraphSession](GraphSession.md) *(from graph.py)* `top-level` -- [export_graph_json](export_graph_json.md) *(from serializer.py)* `top-level` -- [export_model_json](export_model_json.md) *(from serializer.py)* `top-level` -- [export_session_json](export_session_json.md) *(from serializer.py)* `top-level` -- [get_active_session](get_active_session.md) *(from graph.py)* `top-level` -- [import_graph_json](import_graph_json.md) *(from serializer.py)* `top-level` -- [import_model_json](import_model_json.md) *(from serializer.py)* `top-level` -- [import_session_json](import_session_json.md) *(from serializer.py)* `top-level` -- [replay_graph](replay_graph.md) *(from serializer.py)* `top-level` -- [replay_model_json](replay_model_json.md) *(from serializer.py)* `top-level` -- [suspend_graph_recording](suspend_graph_recording.md) *(from graph.py)* `top-level` - -## Expressions and Parameters - -- [Const](Const.md) *(from expr.py)* `top-level` -- [DimensionTolerance](DimensionTolerance.md) *(from expr.py)* `top-level` -- [Expr](Expr.md) *(from expr.py)* `top-level` -- [ExpressionGraph](ExpressionGraph.md) *(from expr.py)* `top-level` -- [ToleranceAnalysis](ToleranceAnalysis.md) *(from tolerance.py)* `top-level` -- [ToleranceAnalysisError](ToleranceAnalysisError.md) *(from tolerance.py)* `top-level` -- [ToleranceCheck](ToleranceCheck.md) *(from tolerance.py)* `top-level` -- [ToleranceContribution](ToleranceContribution.md) *(from tolerance.py)* `top-level` -- [ToleranceGraph](ToleranceGraph.md) *(from tolerance.py)* `top-level` -- [ToleranceReport](ToleranceReport.md) *(from tolerance.py)* `top-level` -- [ToleranceRequirement](ToleranceRequirement.md) *(from tolerance.py)* `top-level` -- [ToleranceValidationError](ToleranceValidationError.md) *(from tolerance.py)* `top-level` -- [Var](Var.md) *(from expr.py)* `top-level` -- [analyze_tolerance](analyze_tolerance.md) *(from tolerance.py)* `top-level` -- [check_tolerance](check_tolerance.md) *(from tolerance.py)* `top-level` -- [const](const_function.md) *(from expr.py)* `top-level` -- [var](var_function.md) *(from expr.py)* `top-level` - -## Physical Units - -- [Dimension](Dimension.md) *(from units.py)* `top-level` -- [Unit](Unit.md) *(from units.py)* `top-level` -- [UnitValidationError](UnitValidationError.md) *(from units.py)* `top-level` -- [canonical_unit_for_dimension](canonical_unit_for_dimension.md) *(from units.py)* `top-level` -- [convert_value](convert_value.md) *(from units.py)* `top-level` -- [expression_uses_units](expression_uses_units.md) *(from units.py)* `top-level` -- [get_unit](get_unit.md) *(from units.py)* `top-level` -- [infer_dimension](infer_dimension.md) *(from units.py)* `top-level` - -## Types and Errors - -- [SimpleCADError](SimpleCADError.md) *(from errors.py)* `top-level` -- [Sketch](Sketch.md) *(from sketch.py)* `top-level` -- [SketchConstraint](SketchConstraint.md) *(from sketch.py)* `top-level` -- [SketchConstraintDiagnostic](SketchConstraintDiagnostic.md) *(from sketch.py)* `top-level` -- [SketchRef](SketchRef.md) *(from sketch.py)* `top-level` -- [SketchSolveResult](SketchSolveResult.md) *(from sketch.py)* `top-level` - -## Advanced Features - -- [chamfer_rsolid](chamfer_rsolid.md) *(from _operators_features.py)* `top-level` -- [fillet_rsolid](fillet_rsolid.md) *(from _operators_features.py)* `top-level` -- [helical_sweep_rsolid](helical_sweep_rsolid.md) *(from _operators_features.py)* `top-level` -- [shell_rsolid](shell_rsolid.md) *(from _operators_features.py)* `top-level` - -## Evolve - -- [make_n_hole_flange_rsolid](make_n_hole_flange_rsolid.md) *(from evolve.py)* `top-level` -- [make_naca_propeller_blade_rsolid](make_naca_propeller_blade_rsolid.md) *(from evolve.py)* `top-level` -- [make_threaded_rod_rsolid](make_threaded_rod_rsolid.md) *(from evolve.py)* `top-level` - -## STEP/BREP Inspection - -- [BRepComparison](BRepComparison.md) *(from inspect/brep/compare.py)* `inspection namespace` -- [BRepEntityError](BRepEntityError.md) *(from inspect/brep/model.py)* `inspection namespace` -- [BRepInspection](BRepInspection.md) *(from inspect/brep/inspect.py)* `inspection namespace` -- [BRepModel](BRepModel.md) *(from inspect/brep/model.py)* `inspection namespace` -- [EntityInspectionParity](EntityInspectionParity.md) *(from inspect/brep/parity.py)* `inspection namespace` -- [InspectionSummaryComparison](InspectionSummaryComparison.md) *(from inspect/brep/compare.py)* `inspection namespace` -- [SliceSpec](SliceSpec.md) *(from inspect/brep/slices.py)* `inspection namespace` -- [clear_step_model_cache_rnone](clear_step_model_cache_rnone.md) *(from inspect/brep/model.py)* `inspection namespace` -- [compare_boundary_distance_rdescriptor](compare_boundary_distance_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [compare_entities_rdescriptor](compare_entities_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [compare_global_properties_rdescriptor](compare_global_properties_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [compare_inspections_rinspectionsummarycomparison](compare_inspections_rinspectionsummarycomparison.md) *(from inspect/brep/compare.py)* `inspection namespace` -- [compare_material_rdescriptor](compare_material_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [compare_material_region_rdescriptor](compare_material_region_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [compare_model_to_inspection_rentityinspectionparity](compare_model_to_inspection_rentityinspectionparity.md) *(from inspect/brep/parity.py)* `inspection namespace` -- [compare_sections_batch_rdescriptor](compare_sections_batch_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [compare_sections_rdescriptor](compare_sections_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [compare_shape_slices_rslicecomparison](compare_shape_slices_rslicecomparison.md) *(from inspect/brep/slices.py)* `inspection namespace` -- [compare_shapes_rbrepcomparison](compare_shapes_rbrepcomparison.md) *(from inspect/brep/compare.py)* `inspection namespace` -- [compare_step_slices_rslicecomparison](compare_step_slices_rslicecomparison.md) *(from inspect/brep/slices.py)* `inspection namespace` -- [compare_step_to_inspection_rentityinspectionparity](compare_step_to_inspection_rentityinspectionparity.md) *(from inspect/brep/parity.py)* `inspection namespace` -- [compare_steps_rbrepcomparison](compare_steps_rbrepcomparison.md) *(from inspect/brep/compare.py)* `inspection namespace` -- [copy_step_region_rpath](copy_step_region_rpath.md) *(from inspect/brep/snapshots.py)* `inspection namespace` -- [evaluate_reconstruction_rdescriptor](evaluate_reconstruction_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [fit_face_analytic_rdescriptor](fit_face_analytic_rdescriptor.md) *(from inspect/brep/fitting.py)* `inspection namespace` -- [index_shape_rbrepmodel](index_shape_rbrepmodel.md) *(from inspect/brep/model.py)* `inspection namespace` -- [inspect_difference_regions_rdescriptor](inspect_difference_regions_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [inspect_face_boundaries_rdescriptor](inspect_face_boundaries_rdescriptor.md) *(from inspect/brep/queries.py)* `inspection namespace` -- [inspect_nearby_entities_rdescriptor](inspect_nearby_entities_rdescriptor.md) *(from inspect/brep/diagnostics.py)* `inspection namespace` -- [inspect_point_rdescriptor](inspect_point_rdescriptor.md) *(from inspect/brep/queries.py)* `inspection namespace` -- [inspect_section_rdescriptor](inspect_section_rdescriptor.md) *(from inspect/brep/queries.py)* `inspection namespace` -- [inspect_shape_rbrepinspection](inspect_shape_rbrepinspection.md) *(from inspect/brep/inspect.py)* `inspection namespace` -- [inspect_step_components_rdescriptorlist](inspect_step_components_rdescriptorlist.md) *(from inspect/brep/render.py)* `inspection namespace` -- [inspect_step_entity_rdescriptor](inspect_step_entity_rdescriptor.md) *(from inspect/brep/model.py)* `inspection namespace` -- [inspect_step_rbrepinspection](inspect_step_rbrepinspection.md) *(from inspect/brep/inspect.py)* `inspection namespace` -- [inspect_step_rsummary](inspect_step_rsummary.md) *(from inspect/brep/model.py)* `inspection namespace` -- [inspect_topology_neighborhood_rdescriptor](inspect_topology_neighborhood_rdescriptor.md) *(from inspect/brep/queries.py)* `inspection namespace` -- [inspect_topology_rdescriptor](inspect_topology_rdescriptor.md) *(from inspect/brep/topology_inspection.py)* `inspection namespace` -- [load_step_rbrepmodel](load_step_rbrepmodel.md) *(from inspect/brep/model.py)* `inspection namespace` -- [load_step_rshape](load_step_rshape.md) *(from inspect/brep/io.py)* `inspection namespace` -- [make_center_slice_specs_rslicespeclist](make_center_slice_specs_rslicespeclist.md) *(from inspect/brep/slices.py)* `inspection namespace` -- [measure_entity_relation_rdescriptor](measure_entity_relation_rdescriptor.md) *(from inspect/brep/queries.py)* `inspection namespace` -- [measure_shape_mass_rtuple](measure_shape_mass_rtuple.md) *(from inspect/brep/io.py)* `inspection namespace` -- [render_entity_kind_maps_rpath](render_entity_kind_maps_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [render_entity_map_rpath](render_entity_map_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [render_region_rpath](render_region_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [render_shape_views_rpath](render_shape_views_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [render_step_comparison_rpath](render_step_comparison_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [render_step_components_colored_rpath](render_step_components_colored_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [render_step_components_rpath](render_step_components_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [render_step_views_rpath](render_step_views_rpath.md) *(from inspect/brep/render.py)* `inspection namespace` -- [select_region_entities_rdescriptor](select_region_entities_rdescriptor.md) *(from inspect/brep/queries.py)* `inspection namespace` -- [track_section_contours_rdescriptor](track_section_contours_rdescriptor.md) *(from inspect/brep/section_tracking.py)* `inspection namespace` -- [validate_step_roundtrip_rdescriptor](validate_step_roundtrip_rdescriptor.md) *(from inspect/brep/persistence.py)* `inspection namespace` - -## Product Build and Cache - -- [AssemblyBuildResult](AssemblyBuildResult.md) *(from build/results.py)* `top-level` -- [AssemblySolveReport](AssemblySolveReport.md) *(from build/incremental_solver.py)* `top-level` -- [CacheEntry](CacheEntry.md) *(from cache/store.py)* `top-level` -- [CacheLockTimeout](CacheLockTimeout.md) *(from cache/store.py)* `top-level` -- [CacheMode](CacheMode.md) *(from cache/policy.py)* `top-level` -- [CachePolicy](CachePolicy.md) *(from cache/policy.py)* `top-level` -- [CacheRecord](CacheRecord.md) *(from cache/records.py)* `top-level` -- [CacheReport](CacheReport.md) *(from build/results.py)* `top-level` -- [CacheStats](CacheStats.md) *(from cache/store.py)* `top-level` -- [ComponentSolveResult](ComponentSolveResult.md) *(from build/incremental_solver.py)* `top-level` -- [ContentAddressedStore](ContentAddressedStore.md) *(from cache/store.py)* `top-level` -- [FileInput](FileInput.md) *(from build/dependencies.py)* `top-level` -- [PartBuildResult](PartBuildResult.md) *(from build/results.py)* `top-level` -- [assemble](assemble.md) *(from build/assembly_builder.py)* `top-level` -- [file_input](file_input.md) *(from build/dependencies.py)* `top-level` -- [part](part_function.md) *(from build/part_builder.py)* `top-level` -- [resolve_cache_policy](resolve_cache_policy.md) *(from cache/policy.py)* `top-level` - -## Reconstruction Evaluation - -- [EvaluationConfig](EvaluationConfig.md) *(from inverse_engineer/brep/evaluation.py)* `reverse-engineering evaluator` -- [SectionEvaluationConfig](SectionEvaluationConfig.md) *(from inverse_engineer/brep/evaluation.py)* `reverse-engineering evaluator` -- [classify_benchmark_result](classify_benchmark_result.md) *(from inverse_engineer/brep/evaluation.py)* `reverse-engineering evaluator` -- [inspect_benchmark_step](inspect_benchmark_step.md) *(from inverse_engineer/brep/evaluation.py)* `reverse-engineering evaluator` -- [run_comparison_bundle](run_comparison_bundle.md) *(from inverse_engineer/brep/evaluation.py)* `reverse-engineering evaluator` - -## Other - -- [Assembly](Assembly.md) *(from assembly.py)* `top-level` -- [CaptureResult](CaptureResult.md) *(from capture.py)* `top-level` -- [Component](Component.md) *(from assembly.py)* `top-level` -- [Connector](Connector.md) *(from connector.py)* `top-level` -- [ConnectorAnchor](ConnectorAnchor.md) *(from connector.py)* `top-level` -- [ConnectorRef](ConnectorRef.md) *(from connector.py)* `top-level` -- [Constraint](Constraint.md) *(from constraint.py)* `top-level` -- [ConstraintReport](ConstraintReport.md) *(from constraint.py)* `top-level` -- [ConstraintResidual](ConstraintResidual.md) *(from constraint.py)* `top-level` -- [GeometryRef](GeometryRef.md) *(from connector.py)* `top-level` -- [Material](Material.md) *(from material.py)* `top-level` -- [Part](Part.md) *(from part.py)* `top-level` -- [Placement](Placement.md) *(from placement.py)* `top-level` -- [ProductPackage](ProductPackage.md) *(from product_packages.py)* `top-level` -- [ProductPackageError](ProductPackageError.md) *(from product_packages.py)* `top-level` -- [PublicConnectorRef](PublicConnectorRef.md) *(from assembly.py)* `top-level` -- [ScalarLimit](ScalarLimit.md) *(from constraint.py)* `top-level` -- [SemanticDelta](SemanticDelta.md) *(from topology.py)* `top-level` -- [SemanticRef](SemanticRef.md) *(from topology.py)* `top-level` -- [SurfaceBoundary](SurfaceBoundary.md) *(from _operators_geometry.py)* `top-level` -- [SurfaceFillingSettings](SurfaceFillingSettings.md) *(from _operators_geometry.py)* `top-level` -- [add_arc_rsketch](add_arc_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [add_belt_constraint_rassembly](add_belt_constraint_rassembly.md) *(from _operators_product.py)* `top-level` -- [add_bspline_rsketch](add_bspline_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [add_circle_rsketch](add_circle_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [add_component_rassembly](add_component_rassembly.md) *(from _operators_product.py)* `top-level` -- [add_connector_rpart](add_connector_rpart.md) *(from _operators_product.py)* `top-level` -- [add_fixed_constraint_rassembly](add_fixed_constraint_rassembly.md) *(from _operators_product.py)* `top-level` -- [add_gear_constraint_rassembly](add_gear_constraint_rassembly.md) *(from _operators_product.py)* `top-level` -- [add_line_rsketch](add_line_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [add_point_rsketch](add_point_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [add_prismatic_constraint_rassembly](add_prismatic_constraint_rassembly.md) *(from _operators_product.py)* `top-level` -- [add_rack_pinion_constraint_rassembly](add_rack_pinion_constraint_rassembly.md) *(from _operators_product.py)* `top-level` -- [add_revolute_constraint_rassembly](add_revolute_constraint_rassembly.md) *(from _operators_product.py)* `top-level` -- [and_](and_.md) *(from ql.py)* `submodule:ql` -- [assign_material_rpart](assign_material_rpart.md) *(from _operators_product.py)* `top-level` -- [capture](capture.md) *(from capture.py)* `top-level` -- [constrain_angle_rsketch](constrain_angle_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_coincident_rsketch](constrain_coincident_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_collinear_rsketch](constrain_collinear_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_concentric_rsketch](constrain_concentric_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_connect_rsketch](constrain_connect_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_diameter_rsketch](constrain_diameter_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_distance_rsketch](constrain_distance_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_distance_x_rsketch](constrain_distance_x_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_distance_y_rsketch](constrain_distance_y_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_equal_length_rsketch](constrain_equal_length_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_equal_radius_rsketch](constrain_equal_radius_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_fix_rsketch](constrain_fix_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_horizontal_rsketch](constrain_horizontal_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_length_rsketch](constrain_length_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_midpoint_rsketch](constrain_midpoint_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_parallel_rsketch](constrain_parallel_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_perpendicular_rsketch](constrain_perpendicular_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_point_on_rsketch](constrain_point_on_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_radius_rsketch](constrain_radius_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_symmetric_rsketch](constrain_symmetric_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_tangent_rsketch](constrain_tangent_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [constrain_vertical_rsketch](constrain_vertical_rsketch.md) *(from _operators_sketch.py)* `top-level` -- [explain_tag](explain_tag.md) *(from _operators_selection.py)* `top-level` -- [fill_holes_rshell](fill_holes_rshell.md) *(from _operators_geometry.py)* `top-level` -- [fit_point_grid_rface](fit_point_grid_rface.md) *(from _operators_geometry.py)* `top-level` -- [free_boundaries_rwirelist](free_boundaries_rwirelist.md) *(from _operators_geometry.py)* `top-level` -- [geo](geo.md) *(from ql.py)* `submodule:ql` -- [get_sketch_entity_rsketchref](get_sketch_entity_rsketchref.md) *(from _operators_sketch.py)* `top-level` -- [get_sketch_point_rsketchref](get_sketch_point_rsketchref.md) *(from _operators_sketch.py)* `top-level` -- [ground_component_rassembly](ground_component_rassembly.md) *(from _operators_product.py)* `top-level` -- [identity_placement_rplacement](identity_placement_rplacement.md) *(from _operators_product.py)* `top-level` -- [inspect_assembly_constraints_rconstraintreport](inspect_assembly_constraints_rconstraintreport.md) *(from _operators_product.py)* `top-level` -- [inspect_sketch_rsketchresult](inspect_sketch_rsketchresult.md) *(from _operators_sketch.py)* `top-level` -- [linear_pattern_rsolidlist](linear_pattern_rsolidlist.md) *(from _operators_transform.py)* `top-level` -- [load_brep_region_rshell](load_brep_region_rshell.md) *(from _operators_geometry.py)* `top-level` -- [load_brep_region_rsolid](load_brep_region_rsolid.md) *(from _operators_geometry.py)* `top-level` -- [measure_constraint_residual_rconstraintresidual](measure_constraint_residual_rconstraintresidual.md) *(from _operators_product.py)* `top-level` -- [meta](meta.md) *(from ql.py)* `submodule:ql` -- [not_](not_.md) *(from ql.py)* `submodule:ql` -- [operation_event](operation_event.md) *(from ql.py)* `submodule:ql` -- [or_](or_.md) *(from ql.py)* `submodule:ql` -- [origin_role](origin_role.md) *(from ql.py)* `submodule:ql` -- [output_role](output_role.md) *(from ql.py)* `submodule:ql` -- [place_component_rassembly](place_component_rassembly.md) *(from _operators_product.py)* `top-level` -- [radial_pattern_rsolidlist](radial_pattern_rsolidlist.md) *(from _operators_transform.py)* `top-level` -- [render_screenshot_rpath](render_screenshot_rpath.md) *(from _operators_features.py)* `top-level` -- [select](select.md) *(from ql.py)* `submodule:ql` -- [set_public_connector_rassembly](set_public_connector_rassembly.md) *(from _operators_product.py)* `top-level` -- [sew_faces_rshell](sew_faces_rshell.md) *(from _operators_geometry.py)* `top-level` -- [shells](shells.md) *(from ql.py)* `submodule:ql` -- [solve_assembly_constraints_rassembly](solve_assembly_constraints_rassembly.md) *(from _operators_product.py)* `top-level` -- [source_binding](source_binding.md) *(from ql.py)* `submodule:ql` -- [source_topology](source_topology.md) *(from ql.py)* `submodule:ql` -- [tag](tag.md) *(from ql.py)* `submodule:ql` -- [trim_surface_rface](trim_surface_rface.md) *(from _operators_geometry.py)* `top-level` -- [twisted_sweep_rsolid](twisted_sweep_rsolid.md) *(from _operators_features.py)* `top-level` -- [unground_component_rassembly](unground_component_rassembly.md) *(from _operators_product.py)* `top-level` -- [value](value.md) *(from ql.py)* `submodule:ql` diff --git a/skills/simplecadapi/references/docs/api/ScalarLimit.md b/skills/simplecadapi/references/docs/api/ScalarLimit.md deleted file mode 100644 index 6a5c78bb..00000000 --- a/skills/simplecadapi/references/docs/api/ScalarLimit.md +++ /dev/null @@ -1,17 +0,0 @@ -# ScalarLimit - -## Class Definition - -```python -class ScalarLimit(lower_value: float, upper_value: float) -``` - -*Source: constraint.py* - -## Import Surface - -- top-level: `from simplecadapi import ScalarLimit` - -## Description - -Closed scalar range for a constraint drive coordinate. diff --git a/skills/simplecadapi/references/docs/api/SectionEvaluationConfig.md b/skills/simplecadapi/references/docs/api/SectionEvaluationConfig.md deleted file mode 100644 index 11028ed6..00000000 --- a/skills/simplecadapi/references/docs/api/SectionEvaluationConfig.md +++ /dev/null @@ -1,23 +0,0 @@ -# SectionEvaluationConfig - -## Class Definition - -```python -class SectionEvaluationConfig(section_id: str, origin: tuple[float, float, float], normal: tuple[float, float, float], tolerance: float = 1e-07, samples_per_edge: int = 16, require_nonempty: bool = True, max_hausdorff: float = 0.1, max_relative_area_error: float = 0.01) -``` - -*Source: inverse_engineer/brep/evaluation.py* - -## Import Surface - -- reverse-engineering evaluator: `from simplecadapi.inverse_engineer.brep import SectionEvaluationConfig` - -## Description - -One bounded diagnostic section probe used by reconstruction evaluation. - -Coordinates and tolerance are millimetres, and ``samples_per_edge`` is an -integer measurement control. Section IDs must be unique within an -``EvaluationConfig``. Section results are diagnostics, not acceptance gates. -``require_nonempty``, ``max_hausdorff``, and ``max_relative_area_error`` are -deprecated compatibility inputs and do not affect stage status. diff --git a/skills/simplecadapi/references/docs/api/SemanticDelta.md b/skills/simplecadapi/references/docs/api/SemanticDelta.md deleted file mode 100644 index 09923099..00000000 --- a/skills/simplecadapi/references/docs/api/SemanticDelta.md +++ /dev/null @@ -1,17 +0,0 @@ -# SemanticDelta - -## Class Definition - -```python -class SemanticDelta(created: Tuple[SemanticRef, ...] = (), modified: Tuple[SemanticRef, ...] = (), deleted: Tuple[SemanticRef, ...] = (), metadata: Dict[str, Any] = field(default_factory=dict)) -``` - -*Source: topology.py* - -## Import Surface - -- top-level: `from simplecadapi import SemanticDelta` - -## Description - -Semantic entity change set attached to a single recorded operation. diff --git a/skills/simplecadapi/references/docs/api/SemanticRef.md b/skills/simplecadapi/references/docs/api/SemanticRef.md deleted file mode 100644 index a331af46..00000000 --- a/skills/simplecadapi/references/docs/api/SemanticRef.md +++ /dev/null @@ -1,17 +0,0 @@ -# SemanticRef - -## Class Definition - -```python -class SemanticRef(graph_id: str, node_id: str, entity_type: str, entity_id: str) -``` - -*Source: topology.py* - -## Import Surface - -- top-level: `from simplecadapi import SemanticRef` - -## Description - -Stable reference to a semantic model entity in the recorded graph. diff --git a/skills/simplecadapi/references/docs/api/SimpleCADError.md b/skills/simplecadapi/references/docs/api/SimpleCADError.md deleted file mode 100644 index 9a2d148d..00000000 --- a/skills/simplecadapi/references/docs/api/SimpleCADError.md +++ /dev/null @@ -1,17 +0,0 @@ -# SimpleCADError - -## Class Definition - -```python -class SimpleCADError(operation: str, guidance: ErrorGuidance) -``` - -*Source: errors.py* - -## Import Surface - -- top-level: `from simplecadapi import SimpleCADError` - -## Description - -Structured ValueError variant for LLM-oriented repair guidance. diff --git a/skills/simplecadapi/references/docs/api/Sketch.md b/skills/simplecadapi/references/docs/api/Sketch.md deleted file mode 100644 index e7b4d375..00000000 --- a/skills/simplecadapi/references/docs/api/Sketch.md +++ /dev/null @@ -1,24 +0,0 @@ -# Sketch - -## Class Definition - -```python -class Sketch(curves: Iterable[Edge | Wire] | None = None, *, name: Optional[str] = None, plane: Any = 'XY', sketch_id: Optional[str] = None) -``` - -*Source: sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import Sketch` - -## Description - -Declarative constrained sketch container. - -Use `make_sketch_rsketch(...)`, `add_point_rsketch(...)`, -`add_line_rsketch(...)`, `add_circle_rsketch(...)`, and -`constrain_*_rsketch(...)` as the canonical API for building sketch -profiles. Public sketch construction APIs are functional and return an -updated `Sketch` document. The legacy `curves` constructor remains only for -reading already-built wire/edge containers. diff --git a/skills/simplecadapi/references/docs/api/SketchConstraint.md b/skills/simplecadapi/references/docs/api/SketchConstraint.md deleted file mode 100644 index aa912aef..00000000 --- a/skills/simplecadapi/references/docs/api/SketchConstraint.md +++ /dev/null @@ -1,17 +0,0 @@ -# SketchConstraint - -## Class Definition - -```python -class SketchConstraint(constraint_id: str, kind: str, targets: Tuple[Dict[str, Any], ...], value: Any = None, driving: bool = True, metadata: Dict[str, Any] = field(default_factory=dict)) -``` - -*Source: sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import SketchConstraint` - -## Description - -Serializable constraint inside a declarative sketch. diff --git a/skills/simplecadapi/references/docs/api/SketchConstraintDiagnostic.md b/skills/simplecadapi/references/docs/api/SketchConstraintDiagnostic.md deleted file mode 100644 index 282e3c78..00000000 --- a/skills/simplecadapi/references/docs/api/SketchConstraintDiagnostic.md +++ /dev/null @@ -1,17 +0,0 @@ -# SketchConstraintDiagnostic - -## Class Definition - -```python -class SketchConstraintDiagnostic(constraint_id: Optional[str], severity: str, code: str, message: str, residual: Optional[float] = None) -``` - -*Source: sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import SketchConstraintDiagnostic` - -## Description - -Diagnostic emitted by the sketch solver. diff --git a/skills/simplecadapi/references/docs/api/SketchRef.md b/skills/simplecadapi/references/docs/api/SketchRef.md deleted file mode 100644 index f5b1d6b9..00000000 --- a/skills/simplecadapi/references/docs/api/SketchRef.md +++ /dev/null @@ -1,17 +0,0 @@ -# SketchRef - -## Class Definition - -```python -class SketchRef(sketch_id: str, entity_id: str, *, kind: str, subentity: str = 'geometry') -``` - -*Source: sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import SketchRef` - -## Description - -Stable reference to a sketch entity or subentity. diff --git a/skills/simplecadapi/references/docs/api/SketchSolveResult.md b/skills/simplecadapi/references/docs/api/SketchSolveResult.md deleted file mode 100644 index eb0f5a72..00000000 --- a/skills/simplecadapi/references/docs/api/SketchSolveResult.md +++ /dev/null @@ -1,17 +0,0 @@ -# SketchSolveResult - -## Class Definition - -```python -class SketchSolveResult(sketch_id: str, status: str, dof: int, residual_norm: float, iterations: int, solved_points: Dict[str, Tuple[float, float]], solved_scalars: Dict[str, float], solved_entities: Dict[str, Dict[str, Any]] = field(default_factory=dict), diagnostics: Tuple[SketchConstraintDiagnostic, ...] = (), backend: str = 'unknown', backend_version: str = 'unknown', backend_status_code: Optional[int] = None) -``` - -*Source: sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import SketchSolveResult` - -## Description - -Backend-neutral result of solving a declarative sketch. diff --git a/skills/simplecadapi/references/docs/api/SliceSpec.md b/skills/simplecadapi/references/docs/api/SliceSpec.md deleted file mode 100644 index 5a0fc0b5..00000000 --- a/skills/simplecadapi/references/docs/api/SliceSpec.md +++ /dev/null @@ -1,17 +0,0 @@ -# SliceSpec - -## Class Definition - -```python -class SliceSpec(plane: SlicePlane, value: float, label: str | None = None) -``` - -*Source: inspect/brep/slices.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.SliceSpec(...)`; unavailable inside GraphSession - -## Description - -One constant-coordinate physical slice. diff --git a/skills/simplecadapi/references/docs/api/SolidWorksTranslator.md b/skills/simplecadapi/references/docs/api/SolidWorksTranslator.md deleted file mode 100644 index 09580538..00000000 --- a/skills/simplecadapi/references/docs/api/SolidWorksTranslator.md +++ /dev/null @@ -1,17 +0,0 @@ -# SolidWorksTranslator - -## Class Definition - -```python -class SolidWorksTranslator(document_name: str = 'SimpleCADProduct', *, output_path: str | None = None, visible: bool = False, source_kernel_fallback: bool = False) -``` - -*Source: translator/solidworks_translator/translator.py* - -## Import Surface - -- translator backend: `from simplecadapi.translator.solidworks_translator import SolidWorksTranslator` - -## Description - -Translate one validated `.scadpkg` closure into SolidWorks automation. diff --git a/skills/simplecadapi/references/docs/api/SurfaceBoundary.md b/skills/simplecadapi/references/docs/api/SurfaceBoundary.md deleted file mode 100644 index d1532f53..00000000 --- a/skills/simplecadapi/references/docs/api/SurfaceBoundary.md +++ /dev/null @@ -1,17 +0,0 @@ -# SurfaceBoundary - -## Class Definition - -```python -class SurfaceBoundary(edge: Edge, continuity: str = 'C0', support: Optional[Face] = None) -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import SurfaceBoundary` - -## Description - -One edge constraint used by ``make_surface_patch_rface``. diff --git a/skills/simplecadapi/references/docs/api/SurfaceFillingSettings.md b/skills/simplecadapi/references/docs/api/SurfaceFillingSettings.md deleted file mode 100644 index dcaf18f0..00000000 --- a/skills/simplecadapi/references/docs/api/SurfaceFillingSettings.md +++ /dev/null @@ -1,17 +0,0 @@ -# SurfaceFillingSettings - -## Class Definition - -```python -class SurfaceFillingSettings(degree: int = 3, points_per_curve: int = 15, iterations: int = 2, anisotropic: bool = False, tolerance_2d: float = 1e-05, tolerance_3d: float = 0.0001, angular_tolerance: float = 0.01, curvature_tolerance: float = 0.1, max_degree: int = 8, max_segments: int = 9) -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import SurfaceFillingSettings` - -## Description - -Explicit OCCT filling controls; units are model units and radians. diff --git a/skills/simplecadapi/references/docs/api/ToleranceAnalysis.md b/skills/simplecadapi/references/docs/api/ToleranceAnalysis.md deleted file mode 100644 index 3483c913..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceAnalysis.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceAnalysis - -## Class Definition - -```python -class ToleranceAnalysis(target_expr_id: str, method: ToleranceMethod, nominal: float, lower_bound: float, upper_bound: float, lower_deviation: float, upper_deviation: float, dimension: Dimension | None = None, unit: Unit | None = None, contributions: Tuple[ToleranceContribution, ...] = ()) -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceAnalysis` - -## Description - -Nominal value and propagated limits for an expression. diff --git a/skills/simplecadapi/references/docs/api/ToleranceAnalysisError.md b/skills/simplecadapi/references/docs/api/ToleranceAnalysisError.md deleted file mode 100644 index edbdb0b5..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceAnalysisError.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceAnalysisError - -## Class Definition - -```python -class ToleranceAnalysisError -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceAnalysisError` - -## Description - -Raised when a tolerance chain cannot be propagated safely. diff --git a/skills/simplecadapi/references/docs/api/ToleranceCheck.md b/skills/simplecadapi/references/docs/api/ToleranceCheck.md deleted file mode 100644 index 088507c5..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceCheck.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceCheck - -## Class Definition - -```python -class ToleranceCheck(requirement: ToleranceRequirement, analysis: ToleranceAnalysis, passed: bool, lower_margin: float, upper_margin: float) -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceCheck` - -## Description - -Validation result for one tolerance requirement. diff --git a/skills/simplecadapi/references/docs/api/ToleranceContribution.md b/skills/simplecadapi/references/docs/api/ToleranceContribution.md deleted file mode 100644 index 142a3338..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceContribution.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceContribution - -## Class Definition - -```python -class ToleranceContribution(variable_expr_id: str, variable_name: str, nominal: float, source_tolerance: DimensionTolerance, sensitivity: float | None, lower_deviation: float, upper_deviation: float, source_unit: Unit | None = None) -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceContribution` - -## Description - -One source dimension's propagated contribution to a result. diff --git a/skills/simplecadapi/references/docs/api/ToleranceGraph.md b/skills/simplecadapi/references/docs/api/ToleranceGraph.md deleted file mode 100644 index 47033d41..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceGraph.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceGraph - -## Class Definition - -```python -class ToleranceGraph(expression_graph: ExpressionGraph) -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceGraph` - -## Description - -Tolerance requirements attached to one expression graph. diff --git a/skills/simplecadapi/references/docs/api/ToleranceReport.md b/skills/simplecadapi/references/docs/api/ToleranceReport.md deleted file mode 100644 index c57407ec..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceReport.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceReport - -## Class Definition - -```python -class ToleranceReport(checks: Tuple[ToleranceCheck, ...] = ()) -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceReport` - -## Description - -Validation report for every requirement in a tolerance graph. diff --git a/skills/simplecadapi/references/docs/api/ToleranceRequirement.md b/skills/simplecadapi/references/docs/api/ToleranceRequirement.md deleted file mode 100644 index 094441fc..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceRequirement.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceRequirement - -## Class Definition - -```python -class ToleranceRequirement(requirement_id: str, target_expr_id: str, tolerance: DimensionTolerance, method: ToleranceMethod = 'worst_case', name: str = '', tolerance_unit: Unit | None = None, target_dimension: Dimension | None = None) -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceRequirement` - -## Description - -Permitted result deviations for one derived dimension. diff --git a/skills/simplecadapi/references/docs/api/ToleranceValidationError.md b/skills/simplecadapi/references/docs/api/ToleranceValidationError.md deleted file mode 100644 index 092283b8..00000000 --- a/skills/simplecadapi/references/docs/api/ToleranceValidationError.md +++ /dev/null @@ -1,17 +0,0 @@ -# ToleranceValidationError - -## Class Definition - -```python -class ToleranceValidationError(report: 'ToleranceReport') -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import ToleranceValidationError` - -## Description - -Raised when one or more declared tolerance requirements fail. diff --git a/skills/simplecadapi/references/docs/api/Unit.md b/skills/simplecadapi/references/docs/api/Unit.md deleted file mode 100644 index 6516627b..00000000 --- a/skills/simplecadapi/references/docs/api/Unit.md +++ /dev/null @@ -1,20 +0,0 @@ -# Unit - -## Class Definition - -```python -class Unit(symbol: str, dimension: Dimension, scale_to_canonical: float) -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import Unit` - -## Description - -Named unit with a scale to SimpleCAD's canonical numeric units. - -Custom units are supported and serialize their symbol, dimension, and scale. -Registered built-in units serialize as compact symbols. diff --git a/skills/simplecadapi/references/docs/api/UnitValidationError.md b/skills/simplecadapi/references/docs/api/UnitValidationError.md deleted file mode 100644 index 6f2e25ab..00000000 --- a/skills/simplecadapi/references/docs/api/UnitValidationError.md +++ /dev/null @@ -1,17 +0,0 @@ -# UnitValidationError - -## Class Definition - -```python -class UnitValidationError -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import UnitValidationError` - -## Description - -Raised when units or expression dimensions are physically inconsistent. diff --git a/skills/simplecadapi/references/docs/api/Var.md b/skills/simplecadapi/references/docs/api/Var.md deleted file mode 100644 index 35221e27..00000000 --- a/skills/simplecadapi/references/docs/api/Var.md +++ /dev/null @@ -1,21 +0,0 @@ -# Var - -## Class Definition - -```python -class Var(name: str, default: float, comment: str | None = None, expr_id: str = field(default_factory=lambda : _make_expr_id('var')), tolerance: DimensionTolerance | None = None, unit: Unit | None = None, tolerance_unit: Unit | None = None) -``` - -*Source: expr.py* - -## Import Surface - -- top-level: `from simplecadapi import Var` - -## Description - -Named scalar parameter with optional physical-unit and tolerance intent. - -``default`` and ``tolerance`` remain in their declared units. Evaluation, -geometry parameters, and tolerance propagation convert them to SimpleCAD's -canonical CAD units: millimeters for length and degrees for angle. diff --git a/skills/simplecadapi/references/docs/api/add_arc_rsketch.md b/skills/simplecadapi/references/docs/api/add_arc_rsketch.md deleted file mode 100644 index d74f1cf2..00000000 --- a/skills/simplecadapi/references/docs/api/add_arc_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_arc_rsketch - -## API Definition - -```python -def add_arc_rsketch(sketch: Sketch, entity_id: str, start: Union[SketchRef, str], end: Union[SketchRef, str], center: Union[SketchRef, str], *, construction: bool = False) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import add_arc_rsketch` - -## Description - -Add an arc entity to a sketch. diff --git a/skills/simplecadapi/references/docs/api/add_belt_constraint_rassembly.md b/skills/simplecadapi/references/docs/api/add_belt_constraint_rassembly.md deleted file mode 100644 index 4861741f..00000000 --- a/skills/simplecadapi/references/docs/api/add_belt_constraint_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_belt_constraint_rassembly - -## API Definition - -```python -def add_belt_constraint_rassembly(assembly: Assembly, constraint_id: str, connector_a: ConnectorRef, connector_b: ConnectorRef, pulley_radius_a: float, pulley_radius_b: float, phase_offset: Optional[float] = None, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_belt_constraint_rassembly` - -## Description - -Couple two revolute axes as belt-linked pulleys with same-direction rotation. diff --git a/skills/simplecadapi/references/docs/api/add_bspline_rsketch.md b/skills/simplecadapi/references/docs/api/add_bspline_rsketch.md deleted file mode 100644 index 6fe3a030..00000000 --- a/skills/simplecadapi/references/docs/api/add_bspline_rsketch.md +++ /dev/null @@ -1,20 +0,0 @@ -# add_bspline_rsketch - -## API Definition - -```python -def add_bspline_rsketch(sketch: Sketch, entity_id: str, start: Union[SketchRef, str], end: Union[SketchRef, str], control_points: Sequence[Any], degree: int = 3, knots: Optional[Sequence[float]] = None, multiplicities: Optional[Sequence[int]] = None, weights: Optional[Sequence[float]] = None, periodic: bool = False, *, construction: bool = False) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import add_bspline_rsketch` - -## Description - -Add a B-spline curve entity to a sketch. - -The start/end point refs link the B-spline into a closed profile -loop. Control points may be literal 2-D coordinates or point refs. diff --git a/skills/simplecadapi/references/docs/api/add_circle_rsketch.md b/skills/simplecadapi/references/docs/api/add_circle_rsketch.md deleted file mode 100644 index ed58fc16..00000000 --- a/skills/simplecadapi/references/docs/api/add_circle_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_circle_rsketch - -## API Definition - -```python -def add_circle_rsketch(sketch: Sketch, entity_id: str, center: Union[SketchRef, str], radius: ScalarLike, *, construction: bool = False) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import add_circle_rsketch` - -## Description - -Add a named circle entity and return an updated sketch document. diff --git a/skills/simplecadapi/references/docs/api/add_component_rassembly.md b/skills/simplecadapi/references/docs/api/add_component_rassembly.md deleted file mode 100644 index 4c66298a..00000000 --- a/skills/simplecadapi/references/docs/api/add_component_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_component_rassembly - -## API Definition - -```python -def add_component_rassembly(assembly: Assembly, item: Union[Part, Assembly], component_id: str, placement: Placement, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_component_rassembly` - -## Description - -Add a placed Part or subassembly component instance to an Assembly. diff --git a/skills/simplecadapi/references/docs/api/add_connector_rpart.md b/skills/simplecadapi/references/docs/api/add_connector_rpart.md deleted file mode 100644 index 773a9dd3..00000000 --- a/skills/simplecadapi/references/docs/api/add_connector_rpart.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_connector_rpart - -## API Definition - -```python -def add_connector_rpart(part: Part, connector: Connector) -> Part -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_connector_rpart` - -## Description - -Attach a connector datum frame to a Part definition. diff --git a/skills/simplecadapi/references/docs/api/add_fixed_constraint_rassembly.md b/skills/simplecadapi/references/docs/api/add_fixed_constraint_rassembly.md deleted file mode 100644 index e12a32f8..00000000 --- a/skills/simplecadapi/references/docs/api/add_fixed_constraint_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_fixed_constraint_rassembly - -## API Definition - -```python -def add_fixed_constraint_rassembly(assembly: Assembly, constraint_id: str, connector_a: ConnectorRef, connector_b: ConnectorRef, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_fixed_constraint_rassembly` - -## Description - -Constrain two component connectors to the same frame. diff --git a/skills/simplecadapi/references/docs/api/add_gear_constraint_rassembly.md b/skills/simplecadapi/references/docs/api/add_gear_constraint_rassembly.md deleted file mode 100644 index afa34353..00000000 --- a/skills/simplecadapi/references/docs/api/add_gear_constraint_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_gear_constraint_rassembly - -## API Definition - -```python -def add_gear_constraint_rassembly(assembly: Assembly, constraint_id: str, connector_a: ConnectorRef, connector_b: ConnectorRef, pitch_radius_a: float, pitch_radius_b: float, phase_offset: Optional[float] = None, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_gear_constraint_rassembly` - -## Description - -Couple two revolute axes as meshing gears with inverse rotation. diff --git a/skills/simplecadapi/references/docs/api/add_line_rsketch.md b/skills/simplecadapi/references/docs/api/add_line_rsketch.md deleted file mode 100644 index 261c5670..00000000 --- a/skills/simplecadapi/references/docs/api/add_line_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_line_rsketch - -## API Definition - -```python -def add_line_rsketch(sketch: Sketch, entity_id: str, start: Union[SketchRef, str], end: Union[SketchRef, str], *, construction: bool = False) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import add_line_rsketch` - -## Description - -Add a named line entity and return an updated sketch document. diff --git a/skills/simplecadapi/references/docs/api/add_point_rsketch.md b/skills/simplecadapi/references/docs/api/add_point_rsketch.md deleted file mode 100644 index 4d65ae42..00000000 --- a/skills/simplecadapi/references/docs/api/add_point_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_point_rsketch - -## API Definition - -```python -def add_point_rsketch(sketch: Sketch, point_id: str, x: ScalarLike, y: ScalarLike) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import add_point_rsketch` - -## Description - -Add a named point entity and return an updated sketch document. diff --git a/skills/simplecadapi/references/docs/api/add_prismatic_constraint_rassembly.md b/skills/simplecadapi/references/docs/api/add_prismatic_constraint_rassembly.md deleted file mode 100644 index 22b0c7d1..00000000 --- a/skills/simplecadapi/references/docs/api/add_prismatic_constraint_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_prismatic_constraint_rassembly - -## API Definition - -```python -def add_prismatic_constraint_rassembly(assembly: Assembly, constraint_id: str, connector_a: ConnectorRef, connector_b: ConnectorRef, drive_distance: Optional[float] = None, distance_limit: Optional[ScalarLimit] = None, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_prismatic_constraint_rassembly` - -## Description - -Constrain two connectors as a prismatic slider pair. diff --git a/skills/simplecadapi/references/docs/api/add_rack_pinion_constraint_rassembly.md b/skills/simplecadapi/references/docs/api/add_rack_pinion_constraint_rassembly.md deleted file mode 100644 index 5fcd2ea1..00000000 --- a/skills/simplecadapi/references/docs/api/add_rack_pinion_constraint_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_rack_pinion_constraint_rassembly - -## API Definition - -```python -def add_rack_pinion_constraint_rassembly(assembly: Assembly, constraint_id: str, rack_connector: ConnectorRef, pinion_connector: ConnectorRef, pitch_radius: float, phase_offset: Optional[float] = None, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_rack_pinion_constraint_rassembly` - -## Description - -Couple a prismatic rack axis to a revolute pinion axis. diff --git a/skills/simplecadapi/references/docs/api/add_revolute_constraint_rassembly.md b/skills/simplecadapi/references/docs/api/add_revolute_constraint_rassembly.md deleted file mode 100644 index 841ca2c1..00000000 --- a/skills/simplecadapi/references/docs/api/add_revolute_constraint_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# add_revolute_constraint_rassembly - -## API Definition - -```python -def add_revolute_constraint_rassembly(assembly: Assembly, constraint_id: str, connector_a: ConnectorRef, connector_b: ConnectorRef, drive_angle_degrees: Optional[float] = None, angle_limit: Optional[ScalarLimit] = None, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import add_revolute_constraint_rassembly` - -## Description - -Constrain two connectors as a revolute axis pair. diff --git a/skills/simplecadapi/references/docs/api/analyze_tolerance.md b/skills/simplecadapi/references/docs/api/analyze_tolerance.md deleted file mode 100644 index 863d25a6..00000000 --- a/skills/simplecadapi/references/docs/api/analyze_tolerance.md +++ /dev/null @@ -1,27 +0,0 @@ -# analyze_tolerance - -## API Definition - -```python -def analyze_tolerance(value: ScalarLike, *, method: ToleranceMethod = 'worst_case') -> ToleranceAnalysis -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import analyze_tolerance` - -## Description - -Propagate source manufacturing tolerances through a scalar expression. - -``worst_case`` returns guaranteed interval bounds. Affine chains are -dependency-aware, so repeated variables such as ``x - x`` cancel exactly; -nonlinear chains use conservative interval arithmetic. ``rss`` performs a -first-order root-sum-square calculation using analytic sensitivities. - -Unit-aware variables are converted to canonical CAD units before -propagation. The returned analysis reports the inferred physical dimension -and canonical result unit. Every variable in the expression must declare a -source tolerance. diff --git a/skills/simplecadapi/references/docs/api/and_.md b/skills/simplecadapi/references/docs/api/and_.md deleted file mode 100644 index bb44eefd..00000000 --- a/skills/simplecadapi/references/docs/api/and_.md +++ /dev/null @@ -1,17 +0,0 @@ -# and_ - -## API Definition - -```python -def and_(*predicates: Predicate) -> Predicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import and_` or `simplecadapi.ql.and_` - -## Description - -Combine predicates so all of them must match. diff --git a/skills/simplecadapi/references/docs/api/apply_tag.md b/skills/simplecadapi/references/docs/api/apply_tag.md deleted file mode 100644 index 3ee97ac4..00000000 --- a/skills/simplecadapi/references/docs/api/apply_tag.md +++ /dev/null @@ -1,17 +0,0 @@ -# apply_tag - -## API Definition - -```python -def apply_tag(shape: AnyShape, tag: str) -> AnyShape -``` - -*Source: _operators_selection.py* - -## Import Surface - -- top-level: `from simplecadapi import apply_tag` - -## Description - -Attach a local user tag with continuation/fragment lineage policy. diff --git a/skills/simplecadapi/references/docs/api/apply_tag_rselection.md b/skills/simplecadapi/references/docs/api/apply_tag_rselection.md deleted file mode 100644 index f4ae5cdb..00000000 --- a/skills/simplecadapi/references/docs/api/apply_tag_rselection.md +++ /dev/null @@ -1,17 +0,0 @@ -# apply_tag_rselection - -## API Definition - -```python -def apply_tag_rselection(scope: AnyShape, targets: Union[ShapeSelector, Sequence[AnyShape]], tag: str, topology_propagation: str | TopologyPropagation = TopologyPropagation.LOCAL, lineage_policy: str | LineagePolicy = LineagePolicy.CONTINUATION_FRAGMENT) -> AnyShape -``` - -*Source: _operators_selection.py* - -## Import Surface - -- top-level: `from simplecadapi import apply_tag_rselection` - -## Description - -Return a semantic shape view with a canonical tag assignment. diff --git a/skills/simplecadapi/references/docs/api/assemble.md b/skills/simplecadapi/references/docs/api/assemble.md deleted file mode 100644 index af7b3f6a..00000000 --- a/skills/simplecadapi/references/docs/api/assemble.md +++ /dev/null @@ -1,17 +0,0 @@ -# assemble - -## API Definition - -```python -def assemble(func: Callable[_P, _R] | None = None, *, id: str | None = None, revision: str = '1.0.0', definitions: Sequence[Any] = (), cache: CachePolicy | Mapping[str, Any] | str | None = None, project_root: str | Path | None = None, tolerance_profile: str = 'simplecad-default') -> Callable[[Callable[_P, _R]], Callable[_P, AssemblyBuildResult]] | Callable[_P, AssemblyBuildResult] -``` - -*Source: build/assembly_builder.py* - -## Import Surface - -- top-level: `from simplecadapi import assemble` - -## Description - -Decorate one assembly builder with explicit external definitions. diff --git a/skills/simplecadapi/references/docs/api/assign_material_rpart.md b/skills/simplecadapi/references/docs/api/assign_material_rpart.md deleted file mode 100644 index d4851b29..00000000 --- a/skills/simplecadapi/references/docs/api/assign_material_rpart.md +++ /dev/null @@ -1,17 +0,0 @@ -# assign_material_rpart - -## API Definition - -```python -def assign_material_rpart(part: Part, material: Material) -> Part -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import assign_material_rpart` - -## Description - -Assign a Material to a Part and return the updated Part. diff --git a/skills/simplecadapi/references/docs/api/canonical_unit_for_dimension.md b/skills/simplecadapi/references/docs/api/canonical_unit_for_dimension.md deleted file mode 100644 index af5f5058..00000000 --- a/skills/simplecadapi/references/docs/api/canonical_unit_for_dimension.md +++ /dev/null @@ -1,19 +0,0 @@ -# canonical_unit_for_dimension - -## API Definition - -```python -def canonical_unit_for_dimension(dimension: Dimension) -> Unit -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import canonical_unit_for_dimension` - -## Description - -Return the canonical unit used by CAD and tolerance calculations. - -Length, area, volume, and angle use ``mm``, ``mm^2``, ``mm^3``, and ``deg``. diff --git a/skills/simplecadapi/references/docs/api/capture.md b/skills/simplecadapi/references/docs/api/capture.md deleted file mode 100644 index 57934fc0..00000000 --- a/skills/simplecadapi/references/docs/api/capture.md +++ /dev/null @@ -1,21 +0,0 @@ -# capture - -## API Definition - -```python -def capture(result: Any, path: str | Path, /, *, include_scene: bool = True) -> CaptureResult -``` - -*Source: capture.py* - -## Import Surface - -- top-level: `from simplecadapi import capture` - -## Description - -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 -feature graphs from the definition closure, so they do not need it. diff --git a/skills/simplecadapi/references/docs/api/chamfer_rsolid.md b/skills/simplecadapi/references/docs/api/chamfer_rsolid.md deleted file mode 100644 index af3e863e..00000000 --- a/skills/simplecadapi/references/docs/api/chamfer_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# chamfer_rsolid - -## API Definition - -```python -def chamfer_rsolid(solid: Solid, edges: Union[Sequence[Edge], ShapeSelector], distance: ScalarLike, *, result_tag: Optional[str] = None, generated_faces_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import chamfer_rsolid` - -## Description - -Apply chamfers, with optional tagging of kernel-proven patch faces. diff --git a/skills/simplecadapi/references/docs/api/check_tolerance.md b/skills/simplecadapi/references/docs/api/check_tolerance.md deleted file mode 100644 index 9f6a8cf1..00000000 --- a/skills/simplecadapi/references/docs/api/check_tolerance.md +++ /dev/null @@ -1,22 +0,0 @@ -# check_tolerance - -## API Definition - -```python -def check_tolerance(value: ScalarLike, tolerance: ToleranceLike, *, method: ToleranceMethod = 'worst_case', name: str | None = None, tolerance_unit: UnitLike | None = None) -> ToleranceCheck -``` - -*Source: tolerance.py* - -## Import Surface - -- top-level: `from simplecadapi import check_tolerance` - -## Description - -Propagate and verify one Length or Angle requirement. - -``tolerance_unit`` defaults to the target dimension's canonical unit. When -provided, it must be dimensionally compatible and is converted before the -comparison. Legacy unitless requirements remain supported when no unit is -supplied. diff --git a/skills/simplecadapi/references/docs/api/classify_benchmark_result.md b/skills/simplecadapi/references/docs/api/classify_benchmark_result.md deleted file mode 100644 index b1a50b13..00000000 --- a/skills/simplecadapi/references/docs/api/classify_benchmark_result.md +++ /dev/null @@ -1,38 +0,0 @@ -# classify_benchmark_result - -## API Definition - -```python -def classify_benchmark_result(*, replay_succeeded: bool, persistence_succeeded: bool, baseline_integrity_passed: bool, candidate_bytes_equal_target: bool, target_kind: str, candidate_inspection: Mapping[str, Any], stages: Mapping[str, Mapping[str, Any]], strict_topology_requested: bool, parameter_representation_required: bool, parameter_representation_passed: bool | None) -> dict[str, Any] -``` - -*Source: inverse_engineer/brep/evaluation.py* - -## Import Surface - -- reverse-engineering evaluator: `from simplecadapi.inverse_engineer.brep import classify_benchmark_result` - -## Description - -Classify trusted evidence without erasing a proven lower tier. - -``candidate_inspection`` must be the unmodified, process-local result of -``inspect_benchmark_step``. Candidate validity and solid/shell kind are -derived from its completed strict-schema report, never from participant -claims. Open-shell classification requires zero solids, at least one shell -explicitly reported open, and at least one unique face. ``stages`` must likewise be the unmodified, -process-local output of ``run_comparison_bundle``. Both results bind the -evaluated paths and SHA-256 digests, so replacing either STEP invalidates -the evidence. ``exact_brep`` requires the strict report's -validity, directional-volume, point-set, and incidence evidence, not just a -claimed stage status. It also requires the trusted envelope's -``checks.hard_gate``. Parameter-representation evidence is supplied by the -trusted case harness when that additional gate is required. Global -properties, sampled boundary distances, and bounded section probes are -diagnostics and are ignored by classification. - -The result schema is ``{"classification": str, "reasons": list[str]}``. -Classifications are ``unsupported_or_incomplete``, ``approximation``, -``geometry_equivalent``, and ``exact_brep``. This function performs no CAD -work and all ratios, distances, and volumes retain the units documented by -``run_comparison_bundle``. diff --git a/skills/simplecadapi/references/docs/api/clear_step_model_cache_rnone.md b/skills/simplecadapi/references/docs/api/clear_step_model_cache_rnone.md deleted file mode 100644 index 8ed290cb..00000000 --- a/skills/simplecadapi/references/docs/api/clear_step_model_cache_rnone.md +++ /dev/null @@ -1,17 +0,0 @@ -# clear_step_model_cache_rnone - -## API Definition - -```python -def clear_step_model_cache_rnone() -> None -``` - -*Source: inspect/brep/model.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.clear_step_model_cache_rnone(...)`; unavailable inside GraphSession - -## Description - -Clear the bounded STEP entity-model cache. diff --git a/skills/simplecadapi/references/docs/api/compare_boundary_distance_rdescriptor.md b/skills/simplecadapi/references/docs/api/compare_boundary_distance_rdescriptor.md deleted file mode 100644 index 19174a8f..00000000 --- a/skills/simplecadapi/references/docs/api/compare_boundary_distance_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_boundary_distance_rdescriptor - -## API Definition - -```python -def compare_boundary_distance_rdescriptor(target: ModelInput, current: ModelInput, *, linear_deflection: float = 0.5, max_samples: int = 200, target_face_ids: Sequence[str] | None = None, current_face_ids: Sequence[str] | None = None, include_records: bool = False) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_boundary_distance_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Compute bidirectional sampled-boundary to exact-boundary distances. diff --git a/skills/simplecadapi/references/docs/api/compare_entities_rdescriptor.md b/skills/simplecadapi/references/docs/api/compare_entities_rdescriptor.md deleted file mode 100644 index a27360af..00000000 --- a/skills/simplecadapi/references/docs/api/compare_entities_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_entities_rdescriptor - -## API Definition - -```python -def compare_entities_rdescriptor(target: ModelInput, target_entity_id: str, current: ModelInput, current_entity_id: str) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_entities_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Compare entity geometry, scalar parameters, distance, and adjacency. diff --git a/skills/simplecadapi/references/docs/api/compare_global_properties_rdescriptor.md b/skills/simplecadapi/references/docs/api/compare_global_properties_rdescriptor.md deleted file mode 100644 index bfabbbd3..00000000 --- a/skills/simplecadapi/references/docs/api/compare_global_properties_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_global_properties_rdescriptor - -## API Definition - -```python -def compare_global_properties_rdescriptor(target: ModelInput, current: ModelInput) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_global_properties_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Compare material counts, mass properties, bounds, and raw topology. diff --git a/skills/simplecadapi/references/docs/api/compare_inspections_rinspectionsummarycomparison.md b/skills/simplecadapi/references/docs/api/compare_inspections_rinspectionsummarycomparison.md deleted file mode 100644 index a67187a5..00000000 --- a/skills/simplecadapi/references/docs/api/compare_inspections_rinspectionsummarycomparison.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_inspections_rinspectionsummarycomparison - -## API Definition - -```python -def compare_inspections_rinspectionsummarycomparison(target: BRepInspection, candidate: BRepInspection) -> InspectionSummaryComparison -``` - -*Source: inspect/brep/compare.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_inspections_rinspectionsummarycomparison(...)`; unavailable inside GraphSession - -## Description - -Compare inexpensive inspection summaries without claiming BREP equality. diff --git a/skills/simplecadapi/references/docs/api/compare_material_rdescriptor.md b/skills/simplecadapi/references/docs/api/compare_material_rdescriptor.md deleted file mode 100644 index 3c0ee100..00000000 --- a/skills/simplecadapi/references/docs/api/compare_material_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_material_rdescriptor - -## API Definition - -```python -def compare_material_rdescriptor(target: ModelInput, current: ModelInput, *, boolean_tolerance: float | None = None, output_directory: str | Path | None = None, include_components: bool = True) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_material_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Compute missing/excess volumes using directional cuts by default. diff --git a/skills/simplecadapi/references/docs/api/compare_material_region_rdescriptor.md b/skills/simplecadapi/references/docs/api/compare_material_region_rdescriptor.md deleted file mode 100644 index 13a4908b..00000000 --- a/skills/simplecadapi/references/docs/api/compare_material_region_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_material_region_rdescriptor - -## API Definition - -```python -def compare_material_region_rdescriptor(target: ModelInput, current: ModelInput, *, region_min: Sequence[float], region_max: Sequence[float], boolean_tolerance: float | None = None, output_directory: str | Path | None = None, max_components: int = 100) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_material_region_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Compute directional material differences inside one axis-aligned ROI. diff --git a/skills/simplecadapi/references/docs/api/compare_model_to_inspection_rentityinspectionparity.md b/skills/simplecadapi/references/docs/api/compare_model_to_inspection_rentityinspectionparity.md deleted file mode 100644 index 07861031..00000000 --- a/skills/simplecadapi/references/docs/api/compare_model_to_inspection_rentityinspectionparity.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_model_to_inspection_rentityinspectionparity - -## API Definition - -```python -def compare_model_to_inspection_rentityinspectionparity(model: BRepModel, report: Mapping[str, Any], *, relative_tolerance: float = 1e-08, absolute_tolerance: float = 1e-08) -> EntityInspectionParity -``` - -*Source: inspect/brep/parity.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_model_to_inspection_rentityinspectionparity(...)`; unavailable inside GraphSession - -## Description - -Check summary, geometry labels, measurements, and incidence parity. diff --git a/skills/simplecadapi/references/docs/api/compare_sections_batch_rdescriptor.md b/skills/simplecadapi/references/docs/api/compare_sections_batch_rdescriptor.md deleted file mode 100644 index ab0f737d..00000000 --- a/skills/simplecadapi/references/docs/api/compare_sections_batch_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_sections_batch_rdescriptor - -## API Definition - -```python -def compare_sections_batch_rdescriptor(target: ModelInput, current: ModelInput, *, sections: Sequence[Mapping[str, Any]], tolerance: float = 1e-07, samples_per_edge: int = 32) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_sections_batch_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Compare an ordered batch of sections after loading each model once. diff --git a/skills/simplecadapi/references/docs/api/compare_sections_rdescriptor.md b/skills/simplecadapi/references/docs/api/compare_sections_rdescriptor.md deleted file mode 100644 index 155cec57..00000000 --- a/skills/simplecadapi/references/docs/api/compare_sections_rdescriptor.md +++ /dev/null @@ -1,20 +0,0 @@ -# compare_sections_rdescriptor - -## API Definition - -```python -def compare_sections_rdescriptor(target: ModelInput, current: ModelInput, plane_origin: Sequence[float], plane_normal: Sequence[float], *, tolerance: float = 1e-07, samples_per_edge: int = 32) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_sections_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Compare target and current contour geometry on one physical plane. - -Empty results use a bounded OCP shape-plane intersection, sized from the -root bounds, to distinguish true emptiness from dropped section edges. diff --git a/skills/simplecadapi/references/docs/api/compare_shape_slices_rslicecomparison.md b/skills/simplecadapi/references/docs/api/compare_shape_slices_rslicecomparison.md deleted file mode 100644 index 53ab45a0..00000000 --- a/skills/simplecadapi/references/docs/api/compare_shape_slices_rslicecomparison.md +++ /dev/null @@ -1,21 +0,0 @@ -# compare_shape_slices_rslicecomparison - -## API Definition - -```python -def compare_shape_slices_rslicecomparison(target: TopoDS_Shape, candidate: TopoDS_Shape, *, slices: Sequence[SliceSpec] | None = None, samples: tuple[int, int] = (91, 121), classification_tolerance: float = 1e-08, margin_ratio: float = 0.03, output_path: str | Path | None = None, target_name: str | None = None, candidate_name: str | None = None, dpi: int = 180) -> SliceComparison -``` - -*Source: inspect/brep/slices.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_shape_slices_rslicecomparison(...)`; unavailable inside GraphSession - -## Description - -Compare occupancy on physical slices and optionally render an XOR image. - -This is a visual diagnostic, not a replacement for bidirectional Boolean -comparison. Keep sample counts moderate because exact BREP classification -is intentionally used for every point. diff --git a/skills/simplecadapi/references/docs/api/compare_shapes_rbrepcomparison.md b/skills/simplecadapi/references/docs/api/compare_shapes_rbrepcomparison.md deleted file mode 100644 index 2fbbc9bf..00000000 --- a/skills/simplecadapi/references/docs/api/compare_shapes_rbrepcomparison.md +++ /dev/null @@ -1,20 +0,0 @@ -# compare_shapes_rbrepcomparison - -## API Definition - -```python -def compare_shapes_rbrepcomparison(target: TopoDS_Shape, candidate: TopoDS_Shape, *, target_name: str | None = None, candidate_name: str | None = None, geometric_tolerance: float = 1e-07, boolean_volume_tolerance: float = 1e-09, boolean_fuzzy_tolerance: float | None = None, material_difference_volumes: Sequence[float] | None = None) -> BRepComparison -``` - -*Source: inspect/brep/compare.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_shapes_rbrepcomparison(...)`; unavailable inside GraphSession - -## Description - -Compare material point sets and geometry-labelled incidence graphs. - -Optional precomputed volumes are validated for compatibility but never used -as equality evidence; strict directional cuts are always recomputed. diff --git a/skills/simplecadapi/references/docs/api/compare_step_slices_rslicecomparison.md b/skills/simplecadapi/references/docs/api/compare_step_slices_rslicecomparison.md deleted file mode 100644 index f35b1939..00000000 --- a/skills/simplecadapi/references/docs/api/compare_step_slices_rslicecomparison.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_step_slices_rslicecomparison - -## API Definition - -```python -def compare_step_slices_rslicecomparison(target_path: str | Path, candidate_path: str | Path, **kwargs) -> SliceComparison -``` - -*Source: inspect/brep/slices.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_step_slices_rslicecomparison(...)`; unavailable inside GraphSession - -## Description - -Load two STEP solids and compare physical occupancy slices. diff --git a/skills/simplecadapi/references/docs/api/compare_step_to_inspection_rentityinspectionparity.md b/skills/simplecadapi/references/docs/api/compare_step_to_inspection_rentityinspectionparity.md deleted file mode 100644 index 794f212c..00000000 --- a/skills/simplecadapi/references/docs/api/compare_step_to_inspection_rentityinspectionparity.md +++ /dev/null @@ -1,17 +0,0 @@ -# compare_step_to_inspection_rentityinspectionparity - -## API Definition - -```python -def compare_step_to_inspection_rentityinspectionparity(step_path: str | Path, report_path: str | Path, *, relative_tolerance: float = 1e-08, absolute_tolerance: float = 1e-08) -> EntityInspectionParity -``` - -*Source: inspect/brep/parity.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_step_to_inspection_rentityinspectionparity(...)`; unavailable inside GraphSession - -## Description - -Load a STEP file and compare it with a serialized BRepInspection report. diff --git a/skills/simplecadapi/references/docs/api/compare_steps_rbrepcomparison.md b/skills/simplecadapi/references/docs/api/compare_steps_rbrepcomparison.md deleted file mode 100644 index 7ce6caa0..00000000 --- a/skills/simplecadapi/references/docs/api/compare_steps_rbrepcomparison.md +++ /dev/null @@ -1,22 +0,0 @@ -# compare_steps_rbrepcomparison - -## API Definition - -```python -def compare_steps_rbrepcomparison(target_path: str | Path, candidate_path: str | Path, **kwargs) -> BRepComparison -``` - -*Source: inspect/brep/compare.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.compare_steps_rbrepcomparison(...)`; unavailable inside GraphSession - -## Description - -Load two STEP files and run the strict BREP comparison. - -The returned comparison includes validity, bounds, material, topology, and -carrier diagnostics. Use ``to_error_summary()`` or -``write_error_summary_json(...)`` to report all failures by plausible -common root cause. diff --git a/skills/simplecadapi/references/docs/api/const_function.md b/skills/simplecadapi/references/docs/api/const_function.md deleted file mode 100644 index fcfe3b8f..00000000 --- a/skills/simplecadapi/references/docs/api/const_function.md +++ /dev/null @@ -1,17 +0,0 @@ -# const - -## API Definition - -```python -def const(value: int | float) -> Const -``` - -*Source: expr.py* - -## Import Surface - -- top-level: `from simplecadapi import const` - -## Description - -Create a constant scalar node for parameterized modeling. diff --git a/skills/simplecadapi/references/docs/api/constrain_angle_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_angle_rsketch.md deleted file mode 100644 index 300774fb..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_angle_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_angle_rsketch - -## API Definition - -```python -def constrain_angle_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], value: ScalarLike, *, constraint_id: Optional[str] = None, driving: bool = True) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_angle_rsketch` - -## Description - -Add a driving angle constraint between two sketch lines. diff --git a/skills/simplecadapi/references/docs/api/constrain_coincident_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_coincident_rsketch.md deleted file mode 100644 index 5a4359c2..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_coincident_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_coincident_rsketch - -## API Definition - -```python -def constrain_coincident_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_coincident_rsketch` - -## Description - -Constrain two sketch points to be coincident. diff --git a/skills/simplecadapi/references/docs/api/constrain_collinear_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_collinear_rsketch.md deleted file mode 100644 index f24d0bc5..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_collinear_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_collinear_rsketch - -## API Definition - -```python -def constrain_collinear_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_collinear_rsketch` - -## Description - -Constrain two sketch lines to lie on the same infinite line. diff --git a/skills/simplecadapi/references/docs/api/constrain_concentric_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_concentric_rsketch.md deleted file mode 100644 index e98fa6d8..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_concentric_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_concentric_rsketch - -## API Definition - -```python -def constrain_concentric_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_concentric_rsketch` - -## Description - -Constrain two sketch circles to share a center. diff --git a/skills/simplecadapi/references/docs/api/constrain_connect_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_connect_rsketch.md deleted file mode 100644 index 217945f1..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_connect_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_connect_rsketch - -## API Definition - -```python -def constrain_connect_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_connect_rsketch` - -## Description - -Alias for `constrain_coincident_rsketch` using connection wording. diff --git a/skills/simplecadapi/references/docs/api/constrain_diameter_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_diameter_rsketch.md deleted file mode 100644 index 51c7df0b..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_diameter_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_diameter_rsketch - -## API Definition - -```python -def constrain_diameter_rsketch(sketch: Sketch, circle: Union[SketchRef, str], value: ScalarLike, *, constraint_id: Optional[str] = None, driving: bool = True) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_diameter_rsketch` - -## Description - -Add a driving circle or arc diameter constraint. diff --git a/skills/simplecadapi/references/docs/api/constrain_distance_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_distance_rsketch.md deleted file mode 100644 index b2fb3285..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_distance_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_distance_rsketch - -## API Definition - -```python -def constrain_distance_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], value: ScalarLike, *, constraint_id: Optional[str] = None, driving: bool = True) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_distance_rsketch` - -## Description - -Add a driving point-to-point distance constraint. diff --git a/skills/simplecadapi/references/docs/api/constrain_distance_x_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_distance_x_rsketch.md deleted file mode 100644 index 577d6da3..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_distance_x_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_distance_x_rsketch - -## API Definition - -```python -def constrain_distance_x_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], value: ScalarLike, *, constraint_id: Optional[str] = None, driving: bool = True) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_distance_x_rsketch` - -## Description - -Add a driving horizontal distance constraint. diff --git a/skills/simplecadapi/references/docs/api/constrain_distance_y_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_distance_y_rsketch.md deleted file mode 100644 index 897330df..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_distance_y_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_distance_y_rsketch - -## API Definition - -```python -def constrain_distance_y_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], value: ScalarLike, *, constraint_id: Optional[str] = None, driving: bool = True) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_distance_y_rsketch` - -## Description - -Add a driving vertical distance constraint. diff --git a/skills/simplecadapi/references/docs/api/constrain_equal_length_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_equal_length_rsketch.md deleted file mode 100644 index 427e56ab..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_equal_length_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_equal_length_rsketch - -## API Definition - -```python -def constrain_equal_length_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_equal_length_rsketch` - -## Description - -Constrain two sketch lines to have equal length. diff --git a/skills/simplecadapi/references/docs/api/constrain_equal_radius_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_equal_radius_rsketch.md deleted file mode 100644 index 75f878f9..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_equal_radius_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_equal_radius_rsketch - -## API Definition - -```python -def constrain_equal_radius_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_equal_radius_rsketch` - -## Description - -Constrain two circles/arcs to have equal radius. diff --git a/skills/simplecadapi/references/docs/api/constrain_fix_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_fix_rsketch.md deleted file mode 100644 index 683ad257..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_fix_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_fix_rsketch - -## API Definition - -```python -def constrain_fix_rsketch(sketch: Sketch, target: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_fix_rsketch` - -## Description - -Fix a sketch point or entity to its initial coordinates. diff --git a/skills/simplecadapi/references/docs/api/constrain_horizontal_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_horizontal_rsketch.md deleted file mode 100644 index 677fb0e3..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_horizontal_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_horizontal_rsketch - -## API Definition - -```python -def constrain_horizontal_rsketch(sketch: Sketch, line: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_horizontal_rsketch` - -## Description - -Constrain a sketch line to be horizontal. diff --git a/skills/simplecadapi/references/docs/api/constrain_length_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_length_rsketch.md deleted file mode 100644 index e30a7e81..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_length_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_length_rsketch - -## API Definition - -```python -def constrain_length_rsketch(sketch: Sketch, line: Union[SketchRef, str], value: ScalarLike, *, constraint_id: Optional[str] = None, driving: bool = True) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_length_rsketch` - -## Description - -Add a driving length constraint to a line, arc, or B-spline. diff --git a/skills/simplecadapi/references/docs/api/constrain_midpoint_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_midpoint_rsketch.md deleted file mode 100644 index 73993c36..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_midpoint_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_midpoint_rsketch - -## API Definition - -```python -def constrain_midpoint_rsketch(sketch: Sketch, point: Union[SketchRef, str], line: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_midpoint_rsketch` - -## Description - -Constrain a sketch point to the midpoint of a line. diff --git a/skills/simplecadapi/references/docs/api/constrain_parallel_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_parallel_rsketch.md deleted file mode 100644 index 06a3fce3..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_parallel_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_parallel_rsketch - -## API Definition - -```python -def constrain_parallel_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_parallel_rsketch` - -## Description - -Constrain two sketch lines to be parallel. diff --git a/skills/simplecadapi/references/docs/api/constrain_perpendicular_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_perpendicular_rsketch.md deleted file mode 100644 index 2d7ef414..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_perpendicular_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_perpendicular_rsketch - -## API Definition - -```python -def constrain_perpendicular_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_perpendicular_rsketch` - -## Description - -Constrain two sketch lines to be perpendicular. diff --git a/skills/simplecadapi/references/docs/api/constrain_point_on_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_point_on_rsketch.md deleted file mode 100644 index 0564c0b5..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_point_on_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_point_on_rsketch - -## API Definition - -```python -def constrain_point_on_rsketch(sketch: Sketch, point: Union[SketchRef, str], entity: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_point_on_rsketch` - -## Description - -Constrain a sketch point to lie on a line, circle, or circular arc. diff --git a/skills/simplecadapi/references/docs/api/constrain_radius_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_radius_rsketch.md deleted file mode 100644 index bb32ec95..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_radius_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_radius_rsketch - -## API Definition - -```python -def constrain_radius_rsketch(sketch: Sketch, circle: Union[SketchRef, str], value: ScalarLike, *, constraint_id: Optional[str] = None, driving: bool = True) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_radius_rsketch` - -## Description - -Add a driving circle or arc radius constraint. diff --git a/skills/simplecadapi/references/docs/api/constrain_symmetric_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_symmetric_rsketch.md deleted file mode 100644 index d47fd10e..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_symmetric_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_symmetric_rsketch - -## API Definition - -```python -def constrain_symmetric_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], axis: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_symmetric_rsketch` - -## Description - -Constrain two sketch points to be symmetric about a line axis. diff --git a/skills/simplecadapi/references/docs/api/constrain_tangent_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_tangent_rsketch.md deleted file mode 100644 index f966989e..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_tangent_rsketch.md +++ /dev/null @@ -1,21 +0,0 @@ -# constrain_tangent_rsketch - -## API Definition - -```python -def constrain_tangent_rsketch(sketch: Sketch, a: Union[SketchRef, str], b: Union[SketchRef, str], *, at_a: Optional[str] = None, at_b: Optional[str] = None, mode: str = 'external', constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_tangent_rsketch` - -## Description - -Constrain supported curves to be tangent on an explicit branch. - -``at_a``/``at_b`` select ``"start"`` or ``"end"`` for arc and -B-spline endpoint tangency. Circle-circle tangency accepts -``mode="external"`` or ``mode="internal"``. diff --git a/skills/simplecadapi/references/docs/api/constrain_vertical_rsketch.md b/skills/simplecadapi/references/docs/api/constrain_vertical_rsketch.md deleted file mode 100644 index 554a3ff1..00000000 --- a/skills/simplecadapi/references/docs/api/constrain_vertical_rsketch.md +++ /dev/null @@ -1,17 +0,0 @@ -# constrain_vertical_rsketch - -## API Definition - -```python -def constrain_vertical_rsketch(sketch: Sketch, line: Union[SketchRef, str], *, constraint_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import constrain_vertical_rsketch` - -## Description - -Constrain a sketch line to be vertical. diff --git a/skills/simplecadapi/references/docs/api/convert_value.md b/skills/simplecadapi/references/docs/api/convert_value.md deleted file mode 100644 index 6ddf2439..00000000 --- a/skills/simplecadapi/references/docs/api/convert_value.md +++ /dev/null @@ -1,17 +0,0 @@ -# convert_value - -## API Definition - -```python -def convert_value(value: int | float, from_unit: UnitLike, to_unit: UnitLike) -> float -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import convert_value` - -## Description - -Convert a finite numeric value between dimensionally compatible units. diff --git a/skills/simplecadapi/references/docs/api/copy_step_region_rpath.md b/skills/simplecadapi/references/docs/api/copy_step_region_rpath.md deleted file mode 100644 index f4eb159f..00000000 --- a/skills/simplecadapi/references/docs/api/copy_step_region_rpath.md +++ /dev/null @@ -1,23 +0,0 @@ -# copy_step_region_rpath - -## API Definition - -```python -def copy_step_region_rpath(path: str | Path, output_path: str | Path, *, face_ids: Sequence[str] | None = None) -> Path -``` - -*Source: inspect/brep/snapshots.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.copy_step_region_rpath(...)`; unavailable inside GraphSession - -## Description - -Copy one STEP solid or one connected face Shell into a BREP snapshot. - -``face_ids`` copies the selected target faces with their existing carriers, -trims, pcurves, shared edges/vertices, orientations, and tolerances. The -selection must form one connected valid Shell. Omitting ``face_ids`` copies -the complete single Solid. The operation runs outside GraphSession and writes -atomically to ``.scadbrep``. diff --git a/skills/simplecadapi/references/docs/api/cut_rsolid.md b/skills/simplecadapi/references/docs/api/cut_rsolid.md deleted file mode 100644 index 13e1bab3..00000000 --- a/skills/simplecadapi/references/docs/api/cut_rsolid.md +++ /dev/null @@ -1,38 +0,0 @@ -# cut_rsolid - -## API Definition - -```python -def cut_rsolid(*solids: Union[Solid, Sequence[Solid]], skip_non_intersecting: bool = True, tracking_policy: TrackingPolicy | str = TrackingPolicy.FULL) -> Solid -``` - -*Source: _operators_boolean.py* - -## Import Surface - -- top-level: `from simplecadapi import cut_rsolid` - -## Description - -Compute the boolean difference of solids. - -Accepts a base solid followed by one or more tool solids, including nested -sequences, and returns a single `Solid`. - -## Parameters - -### solids - -- **Description**: One or more Solid objects or sequences of Solid. Nested sequences are flattened before processing; the first solid is the base, the rest are subtracted in order. - -### skip_non_intersecting - -- **Description**: When True, tools with no meaningful intersection are ignored for interactive convenience. Graph replay records this flag and should use False for strict diagnostic workflows. - -### tracking_policy - -- **Description**: FULL computes topology history and lineage. GRAPH keeps the replayable operation node without computing a TopoDelta. - -## Returns - -Solid: The cut result solid. diff --git a/skills/simplecadapi/references/docs/api/evaluate_reconstruction_rdescriptor.md b/skills/simplecadapi/references/docs/api/evaluate_reconstruction_rdescriptor.md deleted file mode 100644 index 35bc52eb..00000000 --- a/skills/simplecadapi/references/docs/api/evaluate_reconstruction_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# evaluate_reconstruction_rdescriptor - -## API Definition - -```python -def evaluate_reconstruction_rdescriptor(target: ModelInput, current: ModelInput, *, replay_succeeded: bool, boundary_tolerance: float = 0.1, bounding_box_tolerance: float = 0.1, relative_volume_tolerance: float = 0.001, relative_area_tolerance: float = 0.001, relative_material_tolerance: float = 0.001, linear_deflection: float = 0.5, max_samples: int = 600, boolean_tolerance: float | None = None, strict_geometric_tolerance: float = 1e-06, strict_material_tolerance: float = 1e-06, require_strict_brep: bool = False) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.evaluate_reconstruction_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Apply replay, validity, material, boundary, and optional strict gates. diff --git a/skills/simplecadapi/references/docs/api/explain_tag.md b/skills/simplecadapi/references/docs/api/explain_tag.md deleted file mode 100644 index 58abeafa..00000000 --- a/skills/simplecadapi/references/docs/api/explain_tag.md +++ /dev/null @@ -1,17 +0,0 @@ -# explain_tag - -## API Definition - -```python -def explain_tag(shape: AnyShape, tag: str, scope: str | TagScope = TagScope.EFFECTIVE) -> List[Dict[str, Any]] -``` - -*Source: _operators_selection.py* - -## Import Surface - -- top-level: `from simplecadapi import explain_tag` - -## Description - -Explain every visible binding that produces a tag token. diff --git a/skills/simplecadapi/references/docs/api/export_graph_json.md b/skills/simplecadapi/references/docs/api/export_graph_json.md deleted file mode 100644 index 2babf98e..00000000 --- a/skills/simplecadapi/references/docs/api/export_graph_json.md +++ /dev/null @@ -1,31 +0,0 @@ -# export_graph_json - -## API Definition - -```python -def export_graph_json(graph: OperationGraph, indent: int = 2) -> str -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import export_graph_json` - -## Description - -Export an OperationGraph to a JSON string. - -## Parameters - -### graph - -- **Description**: The graph to export. - -### indent - -- **Description**: JSON indentation level. - -## Returns - -JSON string representation. diff --git a/skills/simplecadapi/references/docs/api/export_model_json.md b/skills/simplecadapi/references/docs/api/export_model_json.md deleted file mode 100644 index 2a47b003..00000000 --- a/skills/simplecadapi/references/docs/api/export_model_json.md +++ /dev/null @@ -1,22 +0,0 @@ -# export_model_json - -## API Definition - -```python -def export_model_json(session: 'GraphSession', indent: int = 2, *, result_node_ids: Optional[Sequence[str]] = None) -> str -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import export_model_json` - -## Description - -Export the canonical 2.0 model seed JSON. - -Current Phase 1 scope uses the active session as the container of: -- operation graph -- expression graph -- capabilities/schema metadata diff --git a/skills/simplecadapi/references/docs/api/export_product_package_to_mjcf.md b/skills/simplecadapi/references/docs/api/export_product_package_to_mjcf.md deleted file mode 100644 index a41c05fd..00000000 --- a/skills/simplecadapi/references/docs/api/export_product_package_to_mjcf.md +++ /dev/null @@ -1,23 +0,0 @@ -# export_product_package_to_mjcf - -## API Definition - -```python -def export_product_package_to_mjcf(data: ProductPackageInput, output_path: str | Path, *, mesh_directory: str | Path | None = None, mapping_path: str | Path | None = None, linear_deflection: float = 0.15, angular_deflection_degrees: float = _DEFAULT_MJCF_ANGULAR_DEFLECTION_DEGREES, default_density_kg_m3: float | None = None) -> ProductMJCFExportReport -``` - -*Source: exporter/mjcf.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.mjcf.export_product_package_to_mjcf(...)` - -## Description - -Compile a validated `.scadpkg` assembly into an MJCF model. -Fixed constraints create rigid groups. Public connector declarations resolve -endpoint ownership to their leaf connectors without changing the constraint -kind. Revolute/prismatic edges form a deterministic spanning tree. Gear, -belt, and rack-pinion relations become independent fixed-tendon -equalities. Root assembly connectors and geometry names in the -``interface.*`` namespace become MJCF sites. diff --git a/skills/simplecadapi/references/docs/api/export_product_package_to_obj.md b/skills/simplecadapi/references/docs/api/export_product_package_to_obj.md deleted file mode 100644 index 4e84a492..00000000 --- a/skills/simplecadapi/references/docs/api/export_product_package_to_obj.md +++ /dev/null @@ -1,21 +0,0 @@ -# export_product_package_to_obj - -## API Definition - -```python -def export_product_package_to_obj(data: ProductPackageInput, output_path: str | Path, *, linear_deflection: float = 0.1, angular_deflection_degrees: float = 20.0, relative: bool = False) -> ProductOBJExportReport -``` - -*Source: exporter/obj.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.obj.export_product_package_to_obj(...)` - -## Description - -Export one `.scadpkg` directly from evaluated BREP as triangle OBJ. - -`linear_deflection` is the maximum chordal deviation in product units. -`angular_deflection_degrees` limits angular deviation on curved surfaces. -No remeshing or topology reconstruction is performed. diff --git a/skills/simplecadapi/references/docs/api/export_product_package_to_step.md b/skills/simplecadapi/references/docs/api/export_product_package_to_step.md deleted file mode 100644 index 6882ff1a..00000000 --- a/skills/simplecadapi/references/docs/api/export_product_package_to_step.md +++ /dev/null @@ -1,17 +0,0 @@ -# export_product_package_to_step - -## API Definition - -```python -def export_product_package_to_step(data: ProductPackageInput, output_path: str | Path) -> ProductSTEPExportReport -``` - -*Source: exporter/step.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.step.export_product_package_to_step(...)` - -## Description - -Export a validated `.scadpkg` closure as XCAF-backed AP242 STEP. diff --git a/skills/simplecadapi/references/docs/api/export_product_package_to_stl.md b/skills/simplecadapi/references/docs/api/export_product_package_to_stl.md deleted file mode 100644 index 63c9f908..00000000 --- a/skills/simplecadapi/references/docs/api/export_product_package_to_stl.md +++ /dev/null @@ -1,21 +0,0 @@ -# export_product_package_to_stl - -## API Definition - -```python -def export_product_package_to_stl(data: ProductPackageInput, output_path: str | Path, *, linear_deflection: float = 0.1, angular_deflection_degrees: float = 20.0, relative: bool = False) -> ProductSTLExportReport -``` - -*Source: exporter/stl.py* - -## Import Surface - -- exporter namespace: `from simplecadapi import exporter` then `exporter.stl.export_product_package_to_stl(...)` - -## Description - -Export one `.scadpkg` directly from evaluated BREP as binary STL. - -`linear_deflection` is the maximum chordal deviation in product units. -`angular_deflection_degrees` limits angular deviation on curved surfaces. -No remeshing or topology reconstruction is performed. diff --git a/skills/simplecadapi/references/docs/api/export_session_json.md b/skills/simplecadapi/references/docs/api/export_session_json.md deleted file mode 100644 index 1e23e68c..00000000 --- a/skills/simplecadapi/references/docs/api/export_session_json.md +++ /dev/null @@ -1,17 +0,0 @@ -# export_session_json - -## API Definition - -```python -def export_session_json(session: 'GraphSession', indent: int = 2) -> str -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import export_session_json` - -## Description - -Export a graph session including its expression graph. diff --git a/skills/simplecadapi/references/docs/api/expression_uses_units.md b/skills/simplecadapi/references/docs/api/expression_uses_units.md deleted file mode 100644 index 2548e6bb..00000000 --- a/skills/simplecadapi/references/docs/api/expression_uses_units.md +++ /dev/null @@ -1,17 +0,0 @@ -# expression_uses_units - -## API Definition - -```python -def expression_uses_units(value: 'ScalarLike') -> bool -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import expression_uses_units` - -## Description - -Return whether an expression contains an explicit unit declaration. diff --git a/skills/simplecadapi/references/docs/api/extrude_rsolid.md b/skills/simplecadapi/references/docs/api/extrude_rsolid.md deleted file mode 100644 index 845c5996..00000000 --- a/skills/simplecadapi/references/docs/api/extrude_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# extrude_rsolid - -## API Definition - -```python -def extrude_rsolid(profile: Union[Wire, Face], direction: Tuple[float, float, float], distance: ScalarLike, *, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_face_tag: Optional[str] = None, end_face_tag: Optional[str] = None, side_faces_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import extrude_rsolid` - -## Description - -Create a solid by extruding a profile, with optional role-based tags. diff --git a/skills/simplecadapi/references/docs/api/file_input.md b/skills/simplecadapi/references/docs/api/file_input.md deleted file mode 100644 index dacc9f5b..00000000 --- a/skills/simplecadapi/references/docs/api/file_input.md +++ /dev/null @@ -1,17 +0,0 @@ -# file_input - -## API Definition - -```python -def file_input(path: str) -> FileInput -``` - -*Source: build/dependencies.py* - -## Import Surface - -- top-level: `from simplecadapi import file_input` - -## Description - -Declare one project-relative regular file as a builder dependency. diff --git a/skills/simplecadapi/references/docs/api/fill_holes_rshell.md b/skills/simplecadapi/references/docs/api/fill_holes_rshell.md deleted file mode 100644 index 2e0b8fb9..00000000 --- a/skills/simplecadapi/references/docs/api/fill_holes_rshell.md +++ /dev/null @@ -1,17 +0,0 @@ -# fill_holes_rshell - -## API Definition - -```python -def fill_holes_rshell(shell: Shell, hole_indices: Optional[Sequence[int]] = None, *, tolerance: float = 1e-06, settings: Optional[SurfaceFillingSettings] = None, tag_prefix: Optional[str] = None) -> Shell -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import fill_holes_rshell` - -## Description - -Fill selected closed free boundaries and return a sewn Shell. diff --git a/skills/simplecadapi/references/docs/api/fillet_rsolid.md b/skills/simplecadapi/references/docs/api/fillet_rsolid.md deleted file mode 100644 index 761c99b4..00000000 --- a/skills/simplecadapi/references/docs/api/fillet_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# fillet_rsolid - -## API Definition - -```python -def fillet_rsolid(solid: Solid, edges: Union[Sequence[Edge], ShapeSelector], radius: ScalarLike, *, result_tag: Optional[str] = None, generated_faces_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import fillet_rsolid` - -## Description - -Apply fillets, with optional tagging of kernel-proven patch faces. diff --git a/skills/simplecadapi/references/docs/api/fit_cubic_bspline_control_points.md b/skills/simplecadapi/references/docs/api/fit_cubic_bspline_control_points.md deleted file mode 100644 index 6a5fd21c..00000000 --- a/skills/simplecadapi/references/docs/api/fit_cubic_bspline_control_points.md +++ /dev/null @@ -1,79 +0,0 @@ -# fit_cubic_bspline_control_points - -## API Definition - -```python -def fit_cubic_bspline_control_points(sample_points: Sequence[Sequence[float]], *, tolerance: float = 0.001, max_control_points: Optional[int] = None, fairing: float = 1e-06, duplicate_tolerance: float = 1e-12, knot_tolerance: float = 1e-09, raise_on_failure: bool = True) -> BSplineFitResult -``` - -*Source: math.py* - -## Import Surface - -- top-level: `from simplecadapi import fit_cubic_bspline_control_points` - -## Description - -Fit a minimal cubic B-spline control polygon to sampled curve points. - -Uses chord-length parameterization, cubic clamped B-spline least squares, -second-difference fairing regularization, and adaptive simple knot insertion -until the maximum sample error is within `tolerance`. Only simple interior -knots are inserted, so a cubic result remains C2-continuous at every interior -knot. - -## Parameters - -### sample_points - -- **Description**: Ordered 2D or 3D points sampled along the intended curve. Consecutive duplicate points within `duplicate_tolerance` are ignored. - -### tolerance - -- **Description**: Maximum allowed Euclidean fitting error at the input samples. - -### max_control_points - -- **Description**: Upper bound for fitted control points. Defaults to the cleaned sample count, with a cubic minimum of four controls. - -### fairing - -- **Description**: Non-negative second-difference regularization weight. Larger values prefer smoother control polygons while still respecting the error tolerance when possible. - -### duplicate_tolerance - -- **Description**: Distance threshold for removing consecutive duplicate sample points before chord-length parameterization. - -### knot_tolerance - -- **Description**: Normalized parameter spacing threshold used to avoid duplicate or near-boundary interior knots. - -### raise_on_failure - -- **Description**: Raise `ValueError` when the tolerance cannot be reached within `max_control_points`. If false, return the best non-converged result instead. - -## Returns - -`BSplineFitResult` containing cubic degree, control points, a full clamped -knot vector, knot multiplicities, sample parameters, and fitting error. - -## Raises - -- **ValueError**: If inputs are invalid, or if the tolerance cannot be met and `raise_on_failure=True`. - -## Examples - -### Example 1 -```python -```python -from simplecadapi.math import fit_cubic_bspline_control_points -``` - -### Example 2 -```python -samples = [(0.0, 0.0, 0.0), (1.0, 0.4, 0.0), (2.0, 0.0, 0.0)] -fit = fit_cubic_bspline_control_points(samples, tolerance=0.01) -print(fit.control_points) -print(fit.knots, fit.multiplicities) -``` -``` diff --git a/skills/simplecadapi/references/docs/api/fit_face_analytic_rdescriptor.md b/skills/simplecadapi/references/docs/api/fit_face_analytic_rdescriptor.md deleted file mode 100644 index 8b1876c7..00000000 --- a/skills/simplecadapi/references/docs/api/fit_face_analytic_rdescriptor.md +++ /dev/null @@ -1,22 +0,0 @@ -# fit_face_analytic_rdescriptor - -## API Definition - -```python -def fit_face_analytic_rdescriptor(model_or_path: BRepModel | TopoDS_Shape | str | Path, face_id: str, *, tolerance: float = 0.001, u_samples: int = 11, v_samples: int = 11) -> dict[str, Any] -``` - -*Source: inspect/brep/fitting.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.fit_face_analytic_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Fit plane, sphere, cylinder, and cone carriers to one indexed face. - -Results are evidence, not feature-history assertions. Callers should use -``accepted`` and residuals instead of assuming the best candidate is exact. -The report includes every fitted candidate and the selected carrier -parameters. diff --git a/skills/simplecadapi/references/docs/api/fit_point_grid_rface.md b/skills/simplecadapi/references/docs/api/fit_point_grid_rface.md deleted file mode 100644 index 72674150..00000000 --- a/skills/simplecadapi/references/docs/api/fit_point_grid_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# fit_point_grid_rface - -## API Definition - -```python -def fit_point_grid_rface(points: Sequence[Sequence[Sequence[float]]], *, tolerance: float = 0.001, degree_min: int = 3, degree_max: int = 8, smoothing: Optional[Tuple[float, float, float]] = None, tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import fit_point_grid_rface` - -## Description - -Fit a B-spline Face through a rectangular 3D point grid. diff --git a/skills/simplecadapi/references/docs/api/free_boundaries_rwirelist.md b/skills/simplecadapi/references/docs/api/free_boundaries_rwirelist.md deleted file mode 100644 index 90816832..00000000 --- a/skills/simplecadapi/references/docs/api/free_boundaries_rwirelist.md +++ /dev/null @@ -1,17 +0,0 @@ -# free_boundaries_rwirelist - -## API Definition - -```python -def free_boundaries_rwirelist(shell: Shell, *, tolerance: float = 1e-06) -> List[Wire] -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import free_boundaries_rwirelist` - -## Description - -Return unique closed and open free boundary wires of a Shell. diff --git a/skills/simplecadapi/references/docs/api/geo.md b/skills/simplecadapi/references/docs/api/geo.md deleted file mode 100644 index f47db63f..00000000 --- a/skills/simplecadapi/references/docs/api/geo.md +++ /dev/null @@ -1,17 +0,0 @@ -# geo - -## API Definition - -```python -def geo(field: str, default: Any = None) -> SerializableKey -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import geo` or `simplecadapi.ql.geo` - -## Description - -Shortcut for reading `geom.*` fields inside QL queries. diff --git a/skills/simplecadapi/references/docs/api/get_active_session.md b/skills/simplecadapi/references/docs/api/get_active_session.md deleted file mode 100644 index 9b528a1e..00000000 --- a/skills/simplecadapi/references/docs/api/get_active_session.md +++ /dev/null @@ -1,17 +0,0 @@ -# get_active_session - -## API Definition - -```python -def get_active_session() -> Optional[GraphSession] -``` - -*Source: graph.py* - -## Import Surface - -- top-level: `from simplecadapi import get_active_session` - -## Description - -Return the currently active GraphSession, or None. diff --git a/skills/simplecadapi/references/docs/api/get_sketch_entity_rsketchref.md b/skills/simplecadapi/references/docs/api/get_sketch_entity_rsketchref.md deleted file mode 100644 index 6f41415b..00000000 --- a/skills/simplecadapi/references/docs/api/get_sketch_entity_rsketchref.md +++ /dev/null @@ -1,17 +0,0 @@ -# get_sketch_entity_rsketchref - -## API Definition - -```python -def get_sketch_entity_rsketchref(sketch: Sketch, entity_id: str) -> SketchRef -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import get_sketch_entity_rsketchref` - -## Description - -Return a stable ref for a named sketch entity. diff --git a/skills/simplecadapi/references/docs/api/get_sketch_point_rsketchref.md b/skills/simplecadapi/references/docs/api/get_sketch_point_rsketchref.md deleted file mode 100644 index 4cd18e7d..00000000 --- a/skills/simplecadapi/references/docs/api/get_sketch_point_rsketchref.md +++ /dev/null @@ -1,17 +0,0 @@ -# get_sketch_point_rsketchref - -## API Definition - -```python -def get_sketch_point_rsketchref(sketch: Sketch, point_path: str) -> SketchRef -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import get_sketch_point_rsketchref` - -## Description - -Return a stable ref for a sketch point or endpoint path. diff --git a/skills/simplecadapi/references/docs/api/get_unit.md b/skills/simplecadapi/references/docs/api/get_unit.md deleted file mode 100644 index ca5818bb..00000000 --- a/skills/simplecadapi/references/docs/api/get_unit.md +++ /dev/null @@ -1,17 +0,0 @@ -# get_unit - -## API Definition - -```python -def get_unit(value: UnitLike) -> Unit -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import get_unit` - -## Description - -Resolve a built-in unit name/alias or return an existing ``Unit``. diff --git a/skills/simplecadapi/references/docs/api/ground_component_rassembly.md b/skills/simplecadapi/references/docs/api/ground_component_rassembly.md deleted file mode 100644 index bfcd8366..00000000 --- a/skills/simplecadapi/references/docs/api/ground_component_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# ground_component_rassembly - -## API Definition - -```python -def ground_component_rassembly(assembly: Assembly, component_id: str) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import ground_component_rassembly` - -## Description - -Ground a component at its current authored placement. diff --git a/skills/simplecadapi/references/docs/api/helical_sweep_rsolid.md b/skills/simplecadapi/references/docs/api/helical_sweep_rsolid.md deleted file mode 100644 index a1e8aa1f..00000000 --- a/skills/simplecadapi/references/docs/api/helical_sweep_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# helical_sweep_rsolid - -## API Definition - -```python -def helical_sweep_rsolid(profile: Wire, pitch: float, height: float, radius: float, center: Tuple[float, float, float] = (0, 0, 0), dir: Tuple[float, float, float] = (0, 0, 1)) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import helical_sweep_rsolid` - -## Description - -Create a solid by sweeping a profile along a helical path. diff --git a/skills/simplecadapi/references/docs/api/identity_placement_rplacement.md b/skills/simplecadapi/references/docs/api/identity_placement_rplacement.md deleted file mode 100644 index a3abf906..00000000 --- a/skills/simplecadapi/references/docs/api/identity_placement_rplacement.md +++ /dev/null @@ -1,17 +0,0 @@ -# identity_placement_rplacement - -## API Definition - -```python -def identity_placement_rplacement() -> Placement -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import identity_placement_rplacement` - -## Description - -Create the identity placement of the active workplane. diff --git a/skills/simplecadapi/references/docs/api/import_graph_json.md b/skills/simplecadapi/references/docs/api/import_graph_json.md deleted file mode 100644 index 503bcc34..00000000 --- a/skills/simplecadapi/references/docs/api/import_graph_json.md +++ /dev/null @@ -1,27 +0,0 @@ -# import_graph_json - -## API Definition - -```python -def import_graph_json(json_str: str) -> OperationGraph -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import import_graph_json` - -## Description - -Import an OperationGraph from a JSON string. - -## Parameters - -### json_str - -- **Description**: JSON string to parse. - -## Returns - -Reconstructed OperationGraph. diff --git a/skills/simplecadapi/references/docs/api/import_model_json.md b/skills/simplecadapi/references/docs/api/import_model_json.md deleted file mode 100644 index ca17c822..00000000 --- a/skills/simplecadapi/references/docs/api/import_model_json.md +++ /dev/null @@ -1,17 +0,0 @@ -# import_model_json - -## API Definition - -```python -def import_model_json(json_str: str) -> Dict[str, Any] -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import import_model_json` - -## Description - -Import canonical 2.0 model seed JSON. diff --git a/skills/simplecadapi/references/docs/api/import_session_json.md b/skills/simplecadapi/references/docs/api/import_session_json.md deleted file mode 100644 index 8679db15..00000000 --- a/skills/simplecadapi/references/docs/api/import_session_json.md +++ /dev/null @@ -1,17 +0,0 @@ -# import_session_json - -## API Definition - -```python -def import_session_json(json_str: str) -> Dict[str, Any] -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import import_session_json` - -## Description - -Import session payload containing graph and expression graph. diff --git a/skills/simplecadapi/references/docs/api/index_shape_rbrepmodel.md b/skills/simplecadapi/references/docs/api/index_shape_rbrepmodel.md deleted file mode 100644 index 42c2e0e9..00000000 --- a/skills/simplecadapi/references/docs/api/index_shape_rbrepmodel.md +++ /dev/null @@ -1,17 +0,0 @@ -# index_shape_rbrepmodel - -## API Definition - -```python -def index_shape_rbrepmodel(shape: TopoDS_Shape, *, source: str | Path | None = None) -> BRepModel -``` - -*Source: inspect/brep/model.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.index_shape_rbrepmodel(...)`; unavailable inside GraphSession - -## Description - -Build stable entity maps for one in-memory OCP shape. diff --git a/skills/simplecadapi/references/docs/api/infer_dimension.md b/skills/simplecadapi/references/docs/api/infer_dimension.md deleted file mode 100644 index d740467f..00000000 --- a/skills/simplecadapi/references/docs/api/infer_dimension.md +++ /dev/null @@ -1,21 +0,0 @@ -# infer_dimension - -## API Definition - -```python -def infer_dimension(value: 'ScalarLike') -> Dimension | None -``` - -*Source: units.py* - -## Import Surface - -- top-level: `from simplecadapi import infer_dimension` - -## Description - -Infer and validate an expression's result dimension. - -``None`` means the expression uses only legacy variables without unit -declarations. Expressions that contain explicit units are validated -strictly and cannot mix in legacy variables. diff --git a/skills/simplecadapi/references/docs/api/inspect_assembly_constraints_rconstraintreport.md b/skills/simplecadapi/references/docs/api/inspect_assembly_constraints_rconstraintreport.md deleted file mode 100644 index 0836d11c..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_assembly_constraints_rconstraintreport.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_assembly_constraints_rconstraintreport - -## API Definition - -```python -def inspect_assembly_constraints_rconstraintreport(assembly: Assembly) -> ConstraintReport -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import inspect_assembly_constraints_rconstraintreport` - -## Description - -Inspect all assembly constraint residuals without mutating the assembly. diff --git a/skills/simplecadapi/references/docs/api/inspect_benchmark_step.md b/skills/simplecadapi/references/docs/api/inspect_benchmark_step.md deleted file mode 100644 index bfdc9419..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_benchmark_step.md +++ /dev/null @@ -1,29 +0,0 @@ -# inspect_benchmark_step - -## API Definition - -```python -def inspect_benchmark_step(path: str | Path, *, name: str, output_directory: str | Path, timeout_seconds: float, python_executable: str = sys.executable) -> dict[str, Any] -``` - -*Source: inverse_engineer/brep/evaluation.py* - -## Import Surface - -- reverse-engineering evaluator: `from simplecadapi.inverse_engineer.brep import inspect_benchmark_step` - -## Description - -Inspect one candidate or target STEP in a bounded trusted worker. - -The returned stage envelope has ``status`` (``passed``, ``failed``, or -``error``), boolean ``gate_passed``, ``elapsed_seconds``, ``report``, -``report_path``, and ``error``. A completed report contains ``valid`` and -``counts``; classification uses the integer ``solid`` and ``shell`` counts. -Lengths are millimetres, area is square millimetres, volume is cubic -millimetres, and elapsed time is seconds. - -The process is isolated from participant Python paths and a timeout kills its -entire process tree. Only the unmodified process-local result of this trusted function may -be supplied to ``classify_benchmark_result``; a participant-authored -inspection report or claimed shape kind is not acceptance evidence. diff --git a/skills/simplecadapi/references/docs/api/inspect_difference_regions_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_difference_regions_rdescriptor.md deleted file mode 100644 index 12dac091..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_difference_regions_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_difference_regions_rdescriptor - -## API Definition - -```python -def inspect_difference_regions_rdescriptor(target: ModelInput, current: ModelInput, *, distance_threshold: float = 0.1, linear_deflection: float = 0.5, max_samples: int = 600, cluster_radius: float | None = None, merge_radius: float | None = None, boolean_tolerance: float | None = None, include_boundary: bool = False, boundary_result: Mapping[str, Any] | None = None, material_result: Mapping[str, Any] | None = None) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_difference_regions_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Aggregate material components and optional precomputed boundary anomalies. diff --git a/skills/simplecadapi/references/docs/api/inspect_face_boundaries_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_face_boundaries_rdescriptor.md deleted file mode 100644 index e065fb78..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_face_boundaries_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_face_boundaries_rdescriptor - -## API Definition - -```python -def inspect_face_boundaries_rdescriptor(model_or_path: BRepModel | TopoDS_Shape | str | Path, face_id: str, samples_per_edge: int = 16, compact: bool = False, include_curve_definitions: bool = False, curve_definition_edge_ids: Sequence[str] | None = None, max_total_control_points: int = 256) -> dict[str, Any] -``` - -*Source: inspect/brep/queries.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_face_boundaries_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Return ordered outer and inner wire occurrences for one stable face id. diff --git a/skills/simplecadapi/references/docs/api/inspect_nearby_entities_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_nearby_entities_rdescriptor.md deleted file mode 100644 index 5a60d48a..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_nearby_entities_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_nearby_entities_rdescriptor - -## API Definition - -```python -def inspect_nearby_entities_rdescriptor(model: ModelInput, *, location: Sequence[float] | None = None, region: Mapping[str, Any] | str | None = None, radius: float = 1.0, entity_types: Sequence[str] = ('face', 'edge', 'vertex'), max_results: int = 30) -> dict[str, Any] -``` - -*Source: inspect/brep/diagnostics.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_nearby_entities_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Find stable entities whose exact geometry lies near a point or region. diff --git a/skills/simplecadapi/references/docs/api/inspect_point_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_point_rdescriptor.md deleted file mode 100644 index 2612aa82..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_point_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_point_rdescriptor - -## API Definition - -```python -def inspect_point_rdescriptor(model_or_path: BRepModel | TopoDS_Shape | str | Path, point: Sequence[float], entity_kinds: Sequence[str] = ('face', 'edge', 'vertex'), limit: int = 20) -> dict[str, Any] -``` - -*Source: inspect/brep/queries.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_point_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Return exact point-to-entity distances, ordered by distance then stable id. diff --git a/skills/simplecadapi/references/docs/api/inspect_section_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_section_rdescriptor.md deleted file mode 100644 index 767a9c82..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_section_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_section_rdescriptor - -## API Definition - -```python -def inspect_section_rdescriptor(model_or_path: BRepModel | TopoDS_Shape | str | Path, origin: Sequence[float], normal: Sequence[float], tolerance: float = 1e-07, samples_per_edge: int = 16, connection_tolerance: float | None = None, compact: bool = False, face_ids: Sequence[str] | None = None) -> dict[str, Any] -``` - -*Source: inspect/brep/queries.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_section_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Intersect a model or selected faces with a plane and assemble contours. diff --git a/skills/simplecadapi/references/docs/api/inspect_shape_rbrepinspection.md b/skills/simplecadapi/references/docs/api/inspect_shape_rbrepinspection.md deleted file mode 100644 index c97ffc4d..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_shape_rbrepinspection.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_shape_rbrepinspection - -## API Definition - -```python -def inspect_shape_rbrepinspection(shape: TopoDS_Shape, *, source: str | Path | None = None) -> BRepInspection -``` - -*Source: inspect/brep/inspect.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_shape_rbrepinspection(...)`; unavailable inside GraphSession - -## Description - -Inspect one imported shape without relying on STEP entity numbering. diff --git a/skills/simplecadapi/references/docs/api/inspect_sketch_rsketchresult.md b/skills/simplecadapi/references/docs/api/inspect_sketch_rsketchresult.md deleted file mode 100644 index ff46c325..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_sketch_rsketchresult.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_sketch_rsketchresult - -## API Definition - -```python -def inspect_sketch_rsketchresult(sketch: Sketch, *, require_fully_constrained: bool = False, strict: bool = True, tolerance: float = 1e-07, max_iterations: int = 80) -> SketchSolveResult -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import inspect_sketch_rsketchresult` - -## Description - -Inspect sketch constraints by running the solver without recording graph nodes. diff --git a/skills/simplecadapi/references/docs/api/inspect_step_components_rdescriptorlist.md b/skills/simplecadapi/references/docs/api/inspect_step_components_rdescriptorlist.md deleted file mode 100644 index d107ed3d..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_step_components_rdescriptorlist.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_step_components_rdescriptorlist - -## API Definition - -```python -def inspect_step_components_rdescriptorlist(step_path: str | Path) -> list[dict[str, object]] -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_step_components_rdescriptorlist(...)`; unavailable inside GraphSession - -## Description - -List targetable XCAF component occurrences with unique hierarchy paths. diff --git a/skills/simplecadapi/references/docs/api/inspect_step_entity_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_step_entity_rdescriptor.md deleted file mode 100644 index 1b4b3a77..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_step_entity_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_step_entity_rdescriptor - -## API Definition - -```python -def inspect_step_entity_rdescriptor(path: str | Path, entity_id: str, *, include_curve_definition: bool = False, include_surface_definition: bool = False, max_surface_control_points: int = 256) -> dict[str, Any] -``` - -*Source: inspect/brep/model.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_step_entity_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Return geometry, measurements, bounds, and adjacency for one entity id. diff --git a/skills/simplecadapi/references/docs/api/inspect_step_rbrepinspection.md b/skills/simplecadapi/references/docs/api/inspect_step_rbrepinspection.md deleted file mode 100644 index cc529692..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_step_rbrepinspection.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_step_rbrepinspection - -## API Definition - -```python -def inspect_step_rbrepinspection(path: str | Path) -> BRepInspection -``` - -*Source: inspect/brep/inspect.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_step_rbrepinspection(...)`; unavailable inside GraphSession - -## Description - -Load and inspect one valid, single-root STEP file. diff --git a/skills/simplecadapi/references/docs/api/inspect_step_rsummary.md b/skills/simplecadapi/references/docs/api/inspect_step_rsummary.md deleted file mode 100644 index 9ff396b2..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_step_rsummary.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_step_rsummary - -## API Definition - -```python -def inspect_step_rsummary(path: str | Path, *, include_parameter_groups: bool = False, max_parameter_groups: int = 24, examples_per_group: int = 3) -> dict[str, Any] -``` - -*Source: inspect/brep/model.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_step_rsummary(...)`; unavailable inside GraphSession - -## Description - -Return global material and topology facts for one STEP file. diff --git a/skills/simplecadapi/references/docs/api/inspect_topology_neighborhood_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_topology_neighborhood_rdescriptor.md deleted file mode 100644 index f7485d3f..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_topology_neighborhood_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# inspect_topology_neighborhood_rdescriptor - -## API Definition - -```python -def inspect_topology_neighborhood_rdescriptor(model_or_path: BRepModel | TopoDS_Shape | str | Path, entity_id: str, depth: int = 1, max_entities: int = 100) -> dict[str, Any] -``` - -*Source: inspect/brep/queries.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_topology_neighborhood_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Return a deterministic, bounded breadth-first topology neighborhood. diff --git a/skills/simplecadapi/references/docs/api/inspect_topology_rdescriptor.md b/skills/simplecadapi/references/docs/api/inspect_topology_rdescriptor.md deleted file mode 100644 index 1280339b..00000000 --- a/skills/simplecadapi/references/docs/api/inspect_topology_rdescriptor.md +++ /dev/null @@ -1,22 +0,0 @@ -# inspect_topology_rdescriptor - -## API Definition - -```python -def inspect_topology_rdescriptor(model_or_shape: ModelInput, *, max_problem_edges: int = 100, small_face_area_threshold: float = 1e-08, max_small_faces: int = 100) -> dict[str, Any] -``` - -*Source: inspect/brep/topology_inspection.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.inspect_topology_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Report topology use counts independently from generic BREP validity. - -Edge classifications use face-local occurrences, so a seam used twice by -one face is distinct from a free edge that merely has one unique ancestor. -``edge_evidence_counts`` preserves degenerate-and-orphan combinations; -``orphan_vertex_count`` and ``orphan_vertex_ids`` report isolated vertices. diff --git a/skills/simplecadapi/references/docs/api/intersect_rsolid.md b/skills/simplecadapi/references/docs/api/intersect_rsolid.md deleted file mode 100644 index c4d5317f..00000000 --- a/skills/simplecadapi/references/docs/api/intersect_rsolid.md +++ /dev/null @@ -1,31 +0,0 @@ -# intersect_rsolid - -## API Definition - -```python -def intersect_rsolid(*solids: Union[Solid, Sequence[Solid]]) -> Solid -``` - -*Source: _operators_boolean.py* - -## Import Surface - -- top-level: `from simplecadapi import intersect_rsolid` - -## Description - -Compute the boolean intersection of solids. - -Accepts one or more solids, including nested sequences, and returns a single -`Solid`. If the inputs do not overlap meaningfully, the API raises a clear -error instead of returning an empty list. - -## Parameters - -### solids - -- **Description**: One or more Solid objects or sequences of Solid. Nested sequences are flattened before processing. - -## Returns - -Solid: The overlap region as a single solid. diff --git a/skills/simplecadapi/references/docs/api/linear_pattern_rsolidlist.md b/skills/simplecadapi/references/docs/api/linear_pattern_rsolidlist.md deleted file mode 100644 index 61dff4ab..00000000 --- a/skills/simplecadapi/references/docs/api/linear_pattern_rsolidlist.md +++ /dev/null @@ -1,17 +0,0 @@ -# linear_pattern_rsolidlist - -## API Definition - -```python -def linear_pattern_rsolidlist(shape: AnyShape, direction: Tuple[float, float, float], count: int, spacing: float) -> List[Solid] -``` - -*Source: _operators_transform.py* - -## Import Surface - -- top-level: `from simplecadapi import linear_pattern_rsolidlist` - -## Description - -Create a linear pattern of solids. diff --git a/skills/simplecadapi/references/docs/api/list_tags.md b/skills/simplecadapi/references/docs/api/list_tags.md deleted file mode 100644 index 4d2982b0..00000000 --- a/skills/simplecadapi/references/docs/api/list_tags.md +++ /dev/null @@ -1,17 +0,0 @@ -# list_tags - -## API Definition - -```python -def list_tags(shape: AnyShape, scope: str | TagScope = TagScope.EFFECTIVE) -> List[str] -``` - -*Source: _operators_selection.py* - -## Import Surface - -- top-level: `from simplecadapi import list_tags` - -## Description - -Return shape tags in deterministic sorted order for one scope. diff --git a/skills/simplecadapi/references/docs/api/load_brep_region_rshell.md b/skills/simplecadapi/references/docs/api/load_brep_region_rshell.md deleted file mode 100644 index 3e65165e..00000000 --- a/skills/simplecadapi/references/docs/api/load_brep_region_rshell.md +++ /dev/null @@ -1,21 +0,0 @@ -# load_brep_region_rshell - -## API Definition - -```python -def load_brep_region_rshell(path: str | Path, sha256: str, *, tag_prefix: Optional[str] = None) -> Shell -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import load_brep_region_rshell` - -## Description - -Load a hash-pinned, target-derived BREP face region as one Shell. - -The Shell keeps target-derived topology and is tagged with imported-sidecar -provenance. Use ordinary replayable surface operations to join it to fitted -or analytic feature faces. GraphSession requires a relative sidecar path. diff --git a/skills/simplecadapi/references/docs/api/load_brep_region_rsolid.md b/skills/simplecadapi/references/docs/api/load_brep_region_rsolid.md deleted file mode 100644 index 0c2fe956..00000000 --- a/skills/simplecadapi/references/docs/api/load_brep_region_rsolid.md +++ /dev/null @@ -1,22 +0,0 @@ -# load_brep_region_rsolid - -## API Definition - -```python -def load_brep_region_rsolid(path: str | Path, sha256: str, *, tag_prefix: Optional[str] = None) -> Solid -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import load_brep_region_rsolid` - -## Description - -Load a hash-pinned, target-derived BREP region snapshot as one Solid. - -The complete artifact SHA-256 is verified before native BREP decoding. In a -GraphSession, ``path`` must be relative and is replayed relative to the replay -process working directory. Model JSON records the locator and digest, not the -sidecar bytes. diff --git a/skills/simplecadapi/references/docs/api/load_step_rbrepmodel.md b/skills/simplecadapi/references/docs/api/load_step_rbrepmodel.md deleted file mode 100644 index 9eb7cbf0..00000000 --- a/skills/simplecadapi/references/docs/api/load_step_rbrepmodel.md +++ /dev/null @@ -1,17 +0,0 @@ -# load_step_rbrepmodel - -## API Definition - -```python -def load_step_rbrepmodel(path: str | Path) -> BRepModel -``` - -*Source: inspect/brep/model.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.load_step_rbrepmodel(...)`; unavailable inside GraphSession - -## Description - -Load and cache a STEP model with deterministic topology ids. diff --git a/skills/simplecadapi/references/docs/api/load_step_rshape.md b/skills/simplecadapi/references/docs/api/load_step_rshape.md deleted file mode 100644 index 6cafd213..00000000 --- a/skills/simplecadapi/references/docs/api/load_step_rshape.md +++ /dev/null @@ -1,17 +0,0 @@ -# load_step_rshape - -## API Definition - -```python -def load_step_rshape(path: str | Path, *, require_single_root: bool = True, require_valid: bool = True) -> TopoDS_Shape -``` - -*Source: inspect/brep/io.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.load_step_rshape(...)`; unavailable inside GraphSession - -## Description - -Load one transferred STEP shape and optionally require a valid BREP. diff --git a/skills/simplecadapi/references/docs/api/loft_rshell.md b/skills/simplecadapi/references/docs/api/loft_rshell.md deleted file mode 100644 index 8ed24db2..00000000 --- a/skills/simplecadapi/references/docs/api/loft_rshell.md +++ /dev/null @@ -1,17 +0,0 @@ -# loft_rshell - -## API Definition - -```python -def loft_rshell(sections: Sequence[Union[Wire, Vertex]], *, ruled: bool = False, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_wire_tag: Optional[str] = None, end_wire_tag: Optional[str] = None, side_faces_tag: Optional[str] = None) -> Shell -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import loft_rshell` - -## Description - -Create an open loft Shell with endpoint-Wire and side-Face naming. diff --git a/skills/simplecadapi/references/docs/api/loft_rsolid.md b/skills/simplecadapi/references/docs/api/loft_rsolid.md deleted file mode 100644 index 79397577..00000000 --- a/skills/simplecadapi/references/docs/api/loft_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# loft_rsolid - -## API Definition - -```python -def loft_rsolid(profiles: Sequence[Union[Wire, Vertex]], ruled: bool = False, *, tracking_policy: TrackingPolicy | str = TrackingPolicy.FULL, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_face_tag: Optional[str] = None, end_face_tag: Optional[str] = None, side_faces_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import loft_rsolid` - -## Description - -Create a lofted solid, with optional kernel-role-based tags. diff --git a/skills/simplecadapi/references/docs/api/make_2d_cut_rface.md b/skills/simplecadapi/references/docs/api/make_2d_cut_rface.md deleted file mode 100644 index 39108062..00000000 --- a/skills/simplecadapi/references/docs/api/make_2d_cut_rface.md +++ /dev/null @@ -1,36 +0,0 @@ -# make_2d_cut_rface - -## API Definition - -```python -def make_2d_cut_rface(body: Face, tool: Face) -> Face -``` - -*Source: _operators_boolean.py* - -## Import Surface - -- top-level: `from simplecadapi import make_2d_cut_rface` - -## Description - -Subtract one 2D face from another (2D boolean difference). - -## Parameters - -### body - -- **Type**: `Face` -- **Description**: The face to subtract from. - -### tool - -- **Type**: `Face` -- **Description**: The face to subtract (the cutter). - -## Returns - -------- -Face -The resulting face after subtraction. The result may contain -inner wires (holes) if the tool was fully inside the body. diff --git a/skills/simplecadapi/references/docs/api/make_2d_intersect_rface.md b/skills/simplecadapi/references/docs/api/make_2d_intersect_rface.md deleted file mode 100644 index f5b48c75..00000000 --- a/skills/simplecadapi/references/docs/api/make_2d_intersect_rface.md +++ /dev/null @@ -1,35 +0,0 @@ -# make_2d_intersect_rface - -## API Definition - -```python -def make_2d_intersect_rface(face_a: Face, face_b: Face) -> Face -``` - -*Source: _operators_boolean.py* - -## Import Surface - -- top-level: `from simplecadapi import make_2d_intersect_rface` - -## Description - -Compute the boolean intersection of two 2D faces. - -## Parameters - -### face_a - -- **Type**: `Face` -- **Description**: First face. - -### face_b - -- **Type**: `Face` -- **Description**: Second face. - -## Returns - -------- -Face -The overlapping region of the two faces. diff --git a/skills/simplecadapi/references/docs/api/make_2d_union_rface.md b/skills/simplecadapi/references/docs/api/make_2d_union_rface.md deleted file mode 100644 index 59d4d43a..00000000 --- a/skills/simplecadapi/references/docs/api/make_2d_union_rface.md +++ /dev/null @@ -1,36 +0,0 @@ -# make_2d_union_rface - -## API Definition - -```python -def make_2d_union_rface(face_a: Face, face_b: Face) -> Face -``` - -*Source: _operators_boolean.py* - -## Import Surface - -- top-level: `from simplecadapi import make_2d_union_rface` - -## Description - -Compute the boolean union of two 2D faces. - -## Parameters - -### face_a - -- **Type**: `Face` -- **Description**: First face. - -### face_b - -- **Type**: `Face` -- **Description**: Second face. - -## Returns - -------- -Face -The merged face. Both inputs must overlap or touch so that the -result is a single connected face. diff --git a/skills/simplecadapi/references/docs/api/make_angle_arc_redge.md b/skills/simplecadapi/references/docs/api/make_angle_arc_redge.md deleted file mode 100644 index 288bf6b5..00000000 --- a/skills/simplecadapi/references/docs/api/make_angle_arc_redge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_angle_arc_redge - -## API Definition - -```python -def make_angle_arc_redge(center: Tuple[float, float, float], radius: ScalarLike, start_angle: ScalarLike, end_angle: ScalarLike, normal: Tuple[float, float, float] = (0, 0, 1)) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_angle_arc_redge` - -## Description - -Create an arc edge from a center, radius, and angle range. diff --git a/skills/simplecadapi/references/docs/api/make_angle_arc_rwire.md b/skills/simplecadapi/references/docs/api/make_angle_arc_rwire.md deleted file mode 100644 index 45a93299..00000000 --- a/skills/simplecadapi/references/docs/api/make_angle_arc_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_angle_arc_rwire - -## API Definition - -```python -def make_angle_arc_rwire(center: Tuple[float, float, float], radius: float, start_angle: float, end_angle: float, normal: Tuple[float, float, float] = (0, 0, 1)) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_angle_arc_rwire` - -## Description - -Create a wire containing an arc defined by a center, radius, and angle range. diff --git a/skills/simplecadapi/references/docs/api/make_assembly_rassembly.md b/skills/simplecadapi/references/docs/api/make_assembly_rassembly.md deleted file mode 100644 index 9da13bd5..00000000 --- a/skills/simplecadapi/references/docs/api/make_assembly_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_assembly_rassembly - -## API Definition - -```python -def make_assembly_rassembly(assembly_id: str, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_assembly_rassembly` - -## Description - -Create an empty assembly product structure. diff --git a/skills/simplecadapi/references/docs/api/make_bezier_surface_rface.md b/skills/simplecadapi/references/docs/api/make_bezier_surface_rface.md deleted file mode 100644 index 29dab84c..00000000 --- a/skills/simplecadapi/references/docs/api/make_bezier_surface_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_bezier_surface_rface - -## API Definition - -```python -def make_bezier_surface_rface(control_points: Sequence[Sequence[Sequence[float]]], weights: Optional[Sequence[Sequence[float]]] = None, *, tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_bezier_surface_rface` - -## Description - -Create a trimmed Face carrying a tensor-product Bezier surface. diff --git a/skills/simplecadapi/references/docs/api/make_box_rsolid.md b/skills/simplecadapi/references/docs/api/make_box_rsolid.md deleted file mode 100644 index 6ef01a54..00000000 --- a/skills/simplecadapi/references/docs/api/make_box_rsolid.md +++ /dev/null @@ -1,39 +0,0 @@ -# make_box_rsolid - -## API Definition - -```python -def make_box_rsolid(width: ScalarLike, height: ScalarLike, depth: ScalarLike, bottom_face_center: Tuple[float, float, float] = (0, 0, 0), *, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, bottom_face_tag: Optional[str] = None, top_face_tag: Optional[str] = None, front_face_tag: Optional[str] = None, back_face_tag: Optional[str] = None, left_face_tag: Optional[str] = None, right_face_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_box_rsolid` - -## Description - -Create a box with native kernel-backed Face topology tags. - -The box extends ``depth`` along the current coordinate-system z_axis -starting at the bottom face; ``width`` spans the x_axis and ``height`` -spans the y_axis. - -## Parameters - -### width - -- **Description**: Box size along the current coordinate-system x_axis. - -### height - -- **Description**: Box size along the current coordinate-system y_axis. - -### depth - -- **Description**: Box size along the current coordinate-system z_axis. - -### bottom_face_center - -- **Description**: Geometric center of the box's bottom face in the current coordinate system. The box is centered on this point along x and y (it spans width/2 and height/2 to each side) and extends the full ``depth`` upward along the z_axis from this point's height. It is not a corner; to build a box occupying x in [0, w], pass ``bottom_face_center=(w/2, h/2, z0)``. diff --git a/skills/simplecadapi/references/docs/api/make_center_slice_specs_rslicespeclist.md b/skills/simplecadapi/references/docs/api/make_center_slice_specs_rslicespeclist.md deleted file mode 100644 index 87a807ca..00000000 --- a/skills/simplecadapi/references/docs/api/make_center_slice_specs_rslicespeclist.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_center_slice_specs_rslicespeclist - -## API Definition - -```python -def make_center_slice_specs_rslicespeclist(minimum: np.ndarray, maximum: np.ndarray) -> tuple[SliceSpec, ...] -``` - -*Source: inspect/brep/slices.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.make_center_slice_specs_rslicespeclist(...)`; unavailable inside GraphSession - -## Description - -Return one center slice normal to each global axis. diff --git a/skills/simplecadapi/references/docs/api/make_circle_redge.md b/skills/simplecadapi/references/docs/api/make_circle_redge.md deleted file mode 100644 index 0942fa8f..00000000 --- a/skills/simplecadapi/references/docs/api/make_circle_redge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_circle_redge - -## API Definition - -```python -def make_circle_redge(center: Tuple[float, float, float], radius: ScalarLike, normal: Tuple[float, float, float] = (0, 0, 1), *, tag_prefix: Optional[str] = None) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_circle_redge` - -## Description - -Create a circular edge. diff --git a/skills/simplecadapi/references/docs/api/make_circle_rface.md b/skills/simplecadapi/references/docs/api/make_circle_rface.md deleted file mode 100644 index fed87240..00000000 --- a/skills/simplecadapi/references/docs/api/make_circle_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_circle_rface - -## API Definition - -```python -def make_circle_rface(center: Tuple[float, float, float], radius: ScalarLike, normal: Tuple[float, float, float] = (0, 0, 1), *, tag_prefix: Optional[str] = None, edge_tag: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_circle_rface` - -## Description - -Create a circular face. diff --git a/skills/simplecadapi/references/docs/api/make_circle_rwire.md b/skills/simplecadapi/references/docs/api/make_circle_rwire.md deleted file mode 100644 index 953b1bb4..00000000 --- a/skills/simplecadapi/references/docs/api/make_circle_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_circle_rwire - -## API Definition - -```python -def make_circle_rwire(center: Tuple[float, float, float], radius: ScalarLike, normal: Tuple[float, float, float] = (0, 0, 1), *, tag_prefix: Optional[str] = None, edge_tag: Optional[str] = None) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_circle_rwire` - -## Description - -Create a circular wire. diff --git a/skills/simplecadapi/references/docs/api/make_compound_from_assembly_rcompound.md b/skills/simplecadapi/references/docs/api/make_compound_from_assembly_rcompound.md deleted file mode 100644 index c9050300..00000000 --- a/skills/simplecadapi/references/docs/api/make_compound_from_assembly_rcompound.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_compound_from_assembly_rcompound - -## API Definition - -```python -def make_compound_from_assembly_rcompound(assembly: Assembly) -> Compound -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_compound_from_assembly_rcompound` - -## Description - -Project an Assembly into an explicit flattened Compound geometry value. diff --git a/skills/simplecadapi/references/docs/api/make_cone_rsolid.md b/skills/simplecadapi/references/docs/api/make_cone_rsolid.md deleted file mode 100644 index 57dde814..00000000 --- a/skills/simplecadapi/references/docs/api/make_cone_rsolid.md +++ /dev/null @@ -1,43 +0,0 @@ -# make_cone_rsolid - -## API Definition - -```python -def make_cone_rsolid(bottom_radius: ScalarLike, height: ScalarLike, top_radius: ScalarLike = 0.0, bottom_face_center: Tuple[float, float, float] = (0, 0, 0), axis: Tuple[float, float, float] = (0, 0, 1), *, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_face_tag: Optional[str] = None, end_face_tag: Optional[str] = None, side_face_tag: Optional[str] = None, start_edge_tag: Optional[str] = None, end_edge_tag: Optional[str] = None, seam_edge_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_cone_rsolid` - -## Description - -Create a cone or frustum with native kernel-backed topology tags. - -The solid extends ``height`` along ``axis`` from the bottom face, -tapering from ``bottom_radius`` to ``top_radius`` (a cone when -``top_radius`` is 0). - -## Parameters - -### bottom_radius - -- **Description**: Radius of the bottom (start) face. - -### height - -- **Description**: Frustum length along ``axis``. - -### top_radius - -- **Description**: Radius of the top face; 0 produces a cone. - -### bottom_face_center - -- **Description**: Geometric center of the bottom (start) face in the current coordinate system; the solid extends the full ``height`` along ``axis`` from this point. - -### axis - -- **Description**: Direction of the frustum axis in the current coordinate system. diff --git a/skills/simplecadapi/references/docs/api/make_connector_ref_rconnectorref.md b/skills/simplecadapi/references/docs/api/make_connector_ref_rconnectorref.md deleted file mode 100644 index 1e8cbf28..00000000 --- a/skills/simplecadapi/references/docs/api/make_connector_ref_rconnectorref.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_connector_ref_rconnectorref - -## API Definition - -```python -def make_connector_ref_rconnectorref(component_id: str, connector_id: str) -> ConnectorRef -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_connector_ref_rconnectorref` - -## Description - -Reference a connector through a component instance. diff --git a/skills/simplecadapi/references/docs/api/make_cylinder_rsolid.md b/skills/simplecadapi/references/docs/api/make_cylinder_rsolid.md deleted file mode 100644 index e6c56c21..00000000 --- a/skills/simplecadapi/references/docs/api/make_cylinder_rsolid.md +++ /dev/null @@ -1,37 +0,0 @@ -# make_cylinder_rsolid - -## API Definition - -```python -def make_cylinder_rsolid(radius: ScalarLike, height: ScalarLike, bottom_face_center: Tuple[float, float, float] = (0, 0, 0), axis: Tuple[float, float, float] = (0, 0, 1), *, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_face_tag: Optional[str] = None, end_face_tag: Optional[str] = None, side_face_tag: Optional[str] = None, start_edge_tag: Optional[str] = None, end_edge_tag: Optional[str] = None, seam_edge_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_cylinder_rsolid` - -## Description - -Create a cylinder with native kernel-backed Face and Edge topology tags. - -The cylinder extends ``height`` along ``axis`` from the bottom face. - -## Parameters - -### radius - -- **Description**: Cylinder radius. - -### height - -- **Description**: Cylinder length along ``axis``. - -### bottom_face_center - -- **Description**: Geometric center of the cylinder's bottom (start) face in the current coordinate system; the solid extends the full ``height`` along ``axis`` from this point. - -### axis - -- **Description**: Direction of the cylinder axis in the current coordinate system. diff --git a/skills/simplecadapi/references/docs/api/make_cylindrical_surface_rface.md b/skills/simplecadapi/references/docs/api/make_cylindrical_surface_rface.md deleted file mode 100644 index 04e8f850..00000000 --- a/skills/simplecadapi/references/docs/api/make_cylindrical_surface_rface.md +++ /dev/null @@ -1,22 +0,0 @@ -# make_cylindrical_surface_rface - -## API Definition - -```python -def make_cylindrical_surface_rface(radius: ScalarLike, u_range: Tuple[ScalarLike, ScalarLike], v_range: Tuple[ScalarLike, ScalarLike], origin: Tuple[float, float, float] = (0, 0, 0), axis: Tuple[float, float, float] = (0, 0, 1), x_direction: Optional[Tuple[float, float, float]] = None, *, tolerance: ScalarLike = 1e-07, tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_cylindrical_surface_rface` - -## Description - -Create a finite cylindrical carrier Face over explicit U/V ranges. - -``radius``, V values, and ``tolerance`` use model length units. U values -are unitless raw radians, must increase, and may span at most one -revolution. Unit-aware angle expressions are not accepted for U because -the existing expression evaluator returns canonical angles in degrees. diff --git a/skills/simplecadapi/references/docs/api/make_edge_connector_rconnector.md b/skills/simplecadapi/references/docs/api/make_edge_connector_rconnector.md deleted file mode 100644 index 4e2d2599..00000000 --- a/skills/simplecadapi/references/docs/api/make_edge_connector_rconnector.md +++ /dev/null @@ -1,20 +0,0 @@ -# make_edge_connector_rconnector - -## API Definition - -```python -def make_edge_connector_rconnector(connector_id: str, edge: Edge, name: Optional[str] = None, flip: bool = False) -> Connector -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_edge_connector_rconnector` - -## Description - -Create a connector anchored to an Edge. - -Z axis follows the edge direction (start->end); origin is the edge midpoint. -Set flip=True to negate the Z axis. diff --git a/skills/simplecadapi/references/docs/api/make_face_connector_rconnector.md b/skills/simplecadapi/references/docs/api/make_face_connector_rconnector.md deleted file mode 100644 index 94e34233..00000000 --- a/skills/simplecadapi/references/docs/api/make_face_connector_rconnector.md +++ /dev/null @@ -1,20 +0,0 @@ -# make_face_connector_rconnector - -## API Definition - -```python -def make_face_connector_rconnector(connector_id: str, face: Face, name: Optional[str] = None, flip: bool = False) -> Connector -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_face_connector_rconnector` - -## Description - -Create a connector anchored to a Face. - -Z axis follows the face normal; origin is the face center. -Set flip=True to negate the Z axis (point it opposite to the normal). diff --git a/skills/simplecadapi/references/docs/api/make_face_from_sketch_rface.md b/skills/simplecadapi/references/docs/api/make_face_from_sketch_rface.md deleted file mode 100644 index 6b1d237e..00000000 --- a/skills/simplecadapi/references/docs/api/make_face_from_sketch_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_face_from_sketch_rface - -## API Definition - -```python -def make_face_from_sketch_rface(sketch: Sketch, profile: int | str = 0, *, inner_profiles: Sequence[int | str] = (), require_fully_constrained: bool = False, strict: bool = True, tolerance: float = 1e-07, max_iterations: int = 80) -> Face -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import make_face_from_sketch_rface` - -## Description - -Promote one outer and optional inner sketch profiles to a face. diff --git a/skills/simplecadapi/references/docs/api/make_face_from_wire_rface.md b/skills/simplecadapi/references/docs/api/make_face_from_wire_rface.md deleted file mode 100644 index e2733b85..00000000 --- a/skills/simplecadapi/references/docs/api/make_face_from_wire_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_face_from_wire_rface - -## API Definition - -```python -def make_face_from_wire_rface(wire: Wire, normal: Tuple[float, float, float] = (0, 0, 1), *, tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_face_from_wire_rface` - -## Description - -Create a face from a closed wire. diff --git a/skills/simplecadapi/references/docs/api/make_face_from_wires_rface.md b/skills/simplecadapi/references/docs/api/make_face_from_wires_rface.md deleted file mode 100644 index 56f472c0..00000000 --- a/skills/simplecadapi/references/docs/api/make_face_from_wires_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_face_from_wires_rface - -## API Definition - -```python -def make_face_from_wires_rface(outer_wire: Wire, inner_wires: Sequence[Wire], normal: Tuple[float, float, float] = (0, 0, 1)) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_face_from_wires_rface` - -## Description - -Create a face from one outer closed wire and optional inner closed wires. diff --git a/skills/simplecadapi/references/docs/api/make_gordon_surface_rface.md b/skills/simplecadapi/references/docs/api/make_gordon_surface_rface.md deleted file mode 100644 index 4ba94118..00000000 --- a/skills/simplecadapi/references/docs/api/make_gordon_surface_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_gordon_surface_rface - -## API Definition - -```python -def make_gordon_surface_rface(profiles: Sequence[Edge], guides: Sequence[Edge], *, tolerance: float = 0.001, tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_gordon_surface_rface` - -## Description - -Create a Gordon Face from intersecting profile and guide edge networks. diff --git a/skills/simplecadapi/references/docs/api/make_helix_redge.md b/skills/simplecadapi/references/docs/api/make_helix_redge.md deleted file mode 100644 index 9e126315..00000000 --- a/skills/simplecadapi/references/docs/api/make_helix_redge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_helix_redge - -## API Definition - -```python -def make_helix_redge(pitch: ScalarLike, height: ScalarLike, radius: ScalarLike, center: Tuple[float, float, float] = (0, 0, 0), dir: Tuple[float, float, float] = (0, 0, 1)) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_helix_redge` - -## Description - -Create a helix edge. diff --git a/skills/simplecadapi/references/docs/api/make_helix_rwire.md b/skills/simplecadapi/references/docs/api/make_helix_rwire.md deleted file mode 100644 index d598c52d..00000000 --- a/skills/simplecadapi/references/docs/api/make_helix_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_helix_rwire - -## API Definition - -```python -def make_helix_rwire(pitch: float, height: float, radius: float, center: Tuple[float, float, float] = (0, 0, 0), dir: Tuple[float, float, float] = (0, 0, 1)) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_helix_rwire` - -## Description - -Create a helix wire. diff --git a/skills/simplecadapi/references/docs/api/make_interpolated_spline_redge.md b/skills/simplecadapi/references/docs/api/make_interpolated_spline_redge.md deleted file mode 100644 index c8d67a06..00000000 --- a/skills/simplecadapi/references/docs/api/make_interpolated_spline_redge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_interpolated_spline_redge - -## API Definition - -```python -def make_interpolated_spline_redge(*, points: Sequence[Sequence[ScalarLike]], periodic: bool = False, tolerance: ScalarLike = 1e-06) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_interpolated_spline_redge` - -## Description - -Interpolate an exact B-spline edge through the supplied points. diff --git a/skills/simplecadapi/references/docs/api/make_interpolated_spline_rwire.md b/skills/simplecadapi/references/docs/api/make_interpolated_spline_rwire.md deleted file mode 100644 index a980b98e..00000000 --- a/skills/simplecadapi/references/docs/api/make_interpolated_spline_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_interpolated_spline_rwire - -## API Definition - -```python -def make_interpolated_spline_rwire(*, points: Sequence[Sequence[ScalarLike]], periodic: bool = False, tolerance: ScalarLike = 1e-06) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_interpolated_spline_rwire` - -## Description - -Create a one-edge wire that interpolates the supplied points. diff --git a/skills/simplecadapi/references/docs/api/make_line_redge.md b/skills/simplecadapi/references/docs/api/make_line_redge.md deleted file mode 100644 index e0924f04..00000000 --- a/skills/simplecadapi/references/docs/api/make_line_redge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_line_redge - -## API Definition - -```python -def make_line_redge(start: Tuple[ScalarLike, ScalarLike, ScalarLike], end: Tuple[ScalarLike, ScalarLike, ScalarLike], *, tag_prefix: Optional[str] = None) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_line_redge` - -## Description - -Create a straight edge between two points. diff --git a/skills/simplecadapi/references/docs/api/make_material_rmaterial.md b/skills/simplecadapi/references/docs/api/make_material_rmaterial.md deleted file mode 100644 index 456f0b44..00000000 --- a/skills/simplecadapi/references/docs/api/make_material_rmaterial.md +++ /dev/null @@ -1,21 +0,0 @@ -# make_material_rmaterial - -## API Definition - -```python -def make_material_rmaterial(material_id: str, name: Optional[str] = None, density: Optional[float] = None, density_unit: Optional[str] = None, color: Optional[Tuple[float, float, float]] = None) -> Material -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_material_rmaterial` - -## Description - -Create a material definition for later Part assignment. - -Material is deliberately separate from `make_part_rpart(...)`; the only -correct workflow is to create a material and then assign it to a Part with -`assign_material_rpart(...)`. diff --git a/skills/simplecadapi/references/docs/api/make_n_hole_flange_rsolid.md b/skills/simplecadapi/references/docs/api/make_n_hole_flange_rsolid.md deleted file mode 100644 index d002a9d3..00000000 --- a/skills/simplecadapi/references/docs/api/make_n_hole_flange_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_n_hole_flange_rsolid - -## API Definition - -```python -def make_n_hole_flange_rsolid(flange_outer_diameter = 120.0, flange_inner_diameter = 60.0, flange_thickness = 15.0, boss_outer_diameter = 80.0, boss_height = 5.0, hole_diameter = 8.0, hole_circle_diameter = 100.0, hole_count = 8, chamfer_size = 1.0) -> Solid -``` - -*Source: evolve.py* - -## Import Surface - -- top-level: `from simplecadapi import make_n_hole_flange_rsolid` - -## Description - -Create an n-hole flange with a raised boss ring and optional chamfers. The center of the bottom face is placed at the origin. diff --git a/skills/simplecadapi/references/docs/api/make_naca_propeller_blade_rsolid.md b/skills/simplecadapi/references/docs/api/make_naca_propeller_blade_rsolid.md deleted file mode 100644 index d898f1c3..00000000 --- a/skills/simplecadapi/references/docs/api/make_naca_propeller_blade_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_naca_propeller_blade_rsolid - -## API Definition - -```python -def make_naca_propeller_blade_rsolid(blade_length = 5.0, root_chord = 1.5, tip_chord = 0.3, total_twist_angle = 45.0, num_sections = 7, t_c = 0.16) -> Solid -``` - -*Source: evolve.py* - -## Import Surface - -- top-level: `from simplecadapi import make_naca_propeller_blade_rsolid` - -## Description - -Create a single propeller blade solid from a twisted NACA 0016 profile. The blade root starts at the origin and extends along +Z. diff --git a/skills/simplecadapi/references/docs/api/make_part_rpart.md b/skills/simplecadapi/references/docs/api/make_part_rpart.md deleted file mode 100644 index c8a14778..00000000 --- a/skills/simplecadapi/references/docs/api/make_part_rpart.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_part_rpart - -## API Definition - -```python -def make_part_rpart(part_id: str, body: Solid, name: Optional[str] = None) -> Part -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_part_rpart` - -## Description - -Wrap exactly one Solid as a semantic single-body Part. diff --git a/skills/simplecadapi/references/docs/api/make_periodic_spline_rwire.md b/skills/simplecadapi/references/docs/api/make_periodic_spline_rwire.md deleted file mode 100644 index 99cd261d..00000000 --- a/skills/simplecadapi/references/docs/api/make_periodic_spline_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_periodic_spline_rwire - -## API Definition - -```python -def make_periodic_spline_rwire(*, points: Sequence[Sequence[ScalarLike]], tolerance: ScalarLike = 1e-06) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_periodic_spline_rwire` - -## Description - -Create a closed periodic spline wire interpolating the supplied points. diff --git a/skills/simplecadapi/references/docs/api/make_placement_connector_rconnector.md b/skills/simplecadapi/references/docs/api/make_placement_connector_rconnector.md deleted file mode 100644 index 6cf49399..00000000 --- a/skills/simplecadapi/references/docs/api/make_placement_connector_rconnector.md +++ /dev/null @@ -1,20 +0,0 @@ -# make_placement_connector_rconnector - -## API Definition - -```python -def make_placement_connector_rconnector(connector_id: str, placement: Placement, name: Optional[str] = None) -> Connector -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_placement_connector_rconnector` - -## Description - -Create a connector anchored to an explicit local placement frame. - -Use this when a datum should be defined by a stable coordinate frame -instead of a selected BREP face, edge, or vertex. diff --git a/skills/simplecadapi/references/docs/api/make_placement_rplacement.md b/skills/simplecadapi/references/docs/api/make_placement_rplacement.md deleted file mode 100644 index cce0187b..00000000 --- a/skills/simplecadapi/references/docs/api/make_placement_rplacement.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_placement_rplacement - -## API Definition - -```python -def make_placement_rplacement(origin: Tuple[float, float, float], x_axis: Tuple[float, float, float] = (1.0, 0.0, 0.0), y_axis: Tuple[float, float, float] = (0.0, 1.0, 0.0)) -> Placement -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_placement_rplacement` - -## Description - -Create a canonical right-handed placement in the active workplane. diff --git a/skills/simplecadapi/references/docs/api/make_point_rvertex.md b/skills/simplecadapi/references/docs/api/make_point_rvertex.md deleted file mode 100644 index b76c7889..00000000 --- a/skills/simplecadapi/references/docs/api/make_point_rvertex.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_point_rvertex - -## API Definition - -```python -def make_point_rvertex(x: ScalarLike, y: ScalarLike, z: ScalarLike) -> Vertex -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_point_rvertex` - -## Description - -Create a point in 3D space and return it as a vertex. diff --git a/skills/simplecadapi/references/docs/api/make_polyline_rwire.md b/skills/simplecadapi/references/docs/api/make_polyline_rwire.md deleted file mode 100644 index 45104f26..00000000 --- a/skills/simplecadapi/references/docs/api/make_polyline_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_polyline_rwire - -## API Definition - -```python -def make_polyline_rwire(points: List[Tuple[ScalarLike, ScalarLike, ScalarLike]], closed: bool = False) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_polyline_rwire` - -## Description - -Create a polyline wire from a point list. diff --git a/skills/simplecadapi/references/docs/api/make_rectangle_rface.md b/skills/simplecadapi/references/docs/api/make_rectangle_rface.md deleted file mode 100644 index 3595f76b..00000000 --- a/skills/simplecadapi/references/docs/api/make_rectangle_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_rectangle_rface - -## API Definition - -```python -def make_rectangle_rface(width: ScalarLike, height: ScalarLike, center: Tuple[ScalarLike, ScalarLike, ScalarLike] = (0, 0, 0), normal: Tuple[ScalarLike, ScalarLike, ScalarLike] = (0, 0, 1), *, tag_prefix: Optional[str] = None, edge_tags: Optional[Sequence[str]] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_rectangle_rface` - -## Description - -Create a rectangular face. diff --git a/skills/simplecadapi/references/docs/api/make_rectangle_rwire.md b/skills/simplecadapi/references/docs/api/make_rectangle_rwire.md deleted file mode 100644 index 7d4e5c01..00000000 --- a/skills/simplecadapi/references/docs/api/make_rectangle_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_rectangle_rwire - -## API Definition - -```python -def make_rectangle_rwire(width: ScalarLike, height: ScalarLike, center: Tuple[ScalarLike, ScalarLike, ScalarLike] = (0, 0, 0), normal: Tuple[ScalarLike, ScalarLike, ScalarLike] = (0, 0, 1), *, tag_prefix: Optional[str] = None, edge_tags: Optional[Sequence[str]] = None) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_rectangle_rwire` - -## Description - -Create a rectangular wire. diff --git a/skills/simplecadapi/references/docs/api/make_ruled_surface_rface.md b/skills/simplecadapi/references/docs/api/make_ruled_surface_rface.md deleted file mode 100644 index 112b24c4..00000000 --- a/skills/simplecadapi/references/docs/api/make_ruled_surface_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_ruled_surface_rface - -## API Definition - -```python -def make_ruled_surface_rface(edge_a: Edge, edge_b: Edge, *, tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_ruled_surface_rface` - -## Description - -Create a ruled Face spanning two compatible edges. diff --git a/skills/simplecadapi/references/docs/api/make_scalar_limit_rscalarlimit.md b/skills/simplecadapi/references/docs/api/make_scalar_limit_rscalarlimit.md deleted file mode 100644 index b9e1c2d5..00000000 --- a/skills/simplecadapi/references/docs/api/make_scalar_limit_rscalarlimit.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_scalar_limit_rscalarlimit - -## API Definition - -```python -def make_scalar_limit_rscalarlimit(lower_value: float, upper_value: float) -> ScalarLimit -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_scalar_limit_rscalarlimit` - -## Description - -Create a closed scalar limit for driven constraint coordinates. diff --git a/skills/simplecadapi/references/docs/api/make_segment_redge.md b/skills/simplecadapi/references/docs/api/make_segment_redge.md deleted file mode 100644 index 48b471c9..00000000 --- a/skills/simplecadapi/references/docs/api/make_segment_redge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_segment_redge - -## API Definition - -```python -def make_segment_redge(start: Tuple[float, float, float], end: Tuple[float, float, float]) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_segment_redge` - -## Description - -Alias of `make_line_redge` that returns a straight edge. diff --git a/skills/simplecadapi/references/docs/api/make_segment_rwire.md b/skills/simplecadapi/references/docs/api/make_segment_rwire.md deleted file mode 100644 index 42e3f461..00000000 --- a/skills/simplecadapi/references/docs/api/make_segment_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_segment_rwire - -## API Definition - -```python -def make_segment_rwire(start: Tuple[float, float, float], end: Tuple[float, float, float]) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_segment_rwire` - -## Description - -Create a wire containing a single straight segment. diff --git a/skills/simplecadapi/references/docs/api/make_sketch_rsketch.md b/skills/simplecadapi/references/docs/api/make_sketch_rsketch.md deleted file mode 100644 index 53347d4f..00000000 --- a/skills/simplecadapi/references/docs/api/make_sketch_rsketch.md +++ /dev/null @@ -1,20 +0,0 @@ -# make_sketch_rsketch - -## API Definition - -```python -def make_sketch_rsketch(name: Optional[str] = None, *, plane: Any = 'XY', sketch_id: Optional[str] = None) -> Sketch -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import make_sketch_rsketch` - -## Description - -Create an empty declarative sketch document. - -Use this API, not concrete edge/wire constructors, when the intent is to -build a sketch profile with constraints. diff --git a/skills/simplecadapi/references/docs/api/make_solid_from_shell_rsolid.md b/skills/simplecadapi/references/docs/api/make_solid_from_shell_rsolid.md deleted file mode 100644 index 1babc1e4..00000000 --- a/skills/simplecadapi/references/docs/api/make_solid_from_shell_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_solid_from_shell_rsolid - -## API Definition - -```python -def make_solid_from_shell_rsolid(shell: Shell, *, tag_prefix: Optional[str] = None) -> Solid -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_solid_from_shell_rsolid` - -## Description - -Create an oriented Solid from one valid closed Shell. diff --git a/skills/simplecadapi/references/docs/api/make_sphere_rsolid.md b/skills/simplecadapi/references/docs/api/make_sphere_rsolid.md deleted file mode 100644 index 34bbe730..00000000 --- a/skills/simplecadapi/references/docs/api/make_sphere_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_sphere_rsolid - -## API Definition - -```python -def make_sphere_rsolid(radius: ScalarLike, center: Tuple[float, float, float] = (0, 0, 0)) -> Solid -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_sphere_rsolid` - -## Description - -Create a sphere solid. diff --git a/skills/simplecadapi/references/docs/api/make_spline_redge.md b/skills/simplecadapi/references/docs/api/make_spline_redge.md deleted file mode 100644 index 588134fb..00000000 --- a/skills/simplecadapi/references/docs/api/make_spline_redge.md +++ /dev/null @@ -1,22 +0,0 @@ -# make_spline_redge - -## API Definition - -```python -def make_spline_redge(*, control_points: Sequence[Sequence[ScalarLike]], degree: int = 3, knots: Optional[Sequence[ScalarLike]] = None, multiplicities: Optional[Sequence[int]] = None, weights: Optional[Sequence[ScalarLike]] = None, periodic: bool = False) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_spline_redge` - -## Description - -Create an exact B-spline edge from named control-point parameters. - -Pass sampled curve points through `fit_cubic_bspline_control_points(...)` first, -then pass the result fields explicitly as `control_points=...`, `knots=...`, -and `multiplicities=...`. `control_points` are poles, not interpolation -points; the curve generally does not pass through interior poles. diff --git a/skills/simplecadapi/references/docs/api/make_spline_rwire.md b/skills/simplecadapi/references/docs/api/make_spline_rwire.md deleted file mode 100644 index ec6d0c04..00000000 --- a/skills/simplecadapi/references/docs/api/make_spline_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_spline_rwire - -## API Definition - -```python -def make_spline_rwire(*, control_points: Sequence[Sequence[ScalarLike]], degree: int = 3, knots: Optional[Sequence[ScalarLike]] = None, multiplicities: Optional[Sequence[int]] = None, weights: Optional[Sequence[ScalarLike]] = None, periodic: bool = False) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_spline_rwire` - -## Description - -Create a wire containing one exact B-spline edge. diff --git a/skills/simplecadapi/references/docs/api/make_surface_patch_rface.md b/skills/simplecadapi/references/docs/api/make_surface_patch_rface.md deleted file mode 100644 index 452d991a..00000000 --- a/skills/simplecadapi/references/docs/api/make_surface_patch_rface.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_surface_patch_rface - -## API Definition - -```python -def make_surface_patch_rface(boundaries: Sequence[SurfaceBoundary], *, points: Sequence[Sequence[float]] = (), settings: Optional[SurfaceFillingSettings] = None, holes: Sequence[Wire] = (), tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_surface_patch_rface` - -## Description - -Fill a constrained boundary network into one Face, optionally with holes. diff --git a/skills/simplecadapi/references/docs/api/make_threaded_rod_rsolid.md b/skills/simplecadapi/references/docs/api/make_threaded_rod_rsolid.md deleted file mode 100644 index 7d2f4747..00000000 --- a/skills/simplecadapi/references/docs/api/make_threaded_rod_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_threaded_rod_rsolid - -## API Definition - -```python -def make_threaded_rod_rsolid(thread_diameter = 8.0, thread_length = 20.0, total_length = 30.0, thread_pitch = 1.25, thread_start_position = 0.0, chamfer_size = 0.5) -> Solid -``` - -*Source: evolve.py* - -## Import Surface - -- top-level: `from simplecadapi import make_threaded_rod_rsolid` - -## Description - -Create a threaded rod with configurable rod length, thread span, and pitch. The top center is placed at the origin and the rod extends in -Z. diff --git a/skills/simplecadapi/references/docs/api/make_three_point_arc_redge.md b/skills/simplecadapi/references/docs/api/make_three_point_arc_redge.md deleted file mode 100644 index c96a138e..00000000 --- a/skills/simplecadapi/references/docs/api/make_three_point_arc_redge.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_three_point_arc_redge - -## API Definition - -```python -def make_three_point_arc_redge(start: Tuple[float, float, float], middle: Tuple[float, float, float], end: Tuple[float, float, float]) -> Edge -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_three_point_arc_redge` - -## Description - -Create an arc edge from three points. diff --git a/skills/simplecadapi/references/docs/api/make_three_point_arc_rwire.md b/skills/simplecadapi/references/docs/api/make_three_point_arc_rwire.md deleted file mode 100644 index 784b7352..00000000 --- a/skills/simplecadapi/references/docs/api/make_three_point_arc_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_three_point_arc_rwire - -## API Definition - -```python -def make_three_point_arc_rwire(start: Tuple[float, float, float], middle: Tuple[float, float, float], end: Tuple[float, float, float]) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_three_point_arc_rwire` - -## Description - -Create a wire containing an arc defined by three points. diff --git a/skills/simplecadapi/references/docs/api/make_vertex_connector_rconnector.md b/skills/simplecadapi/references/docs/api/make_vertex_connector_rconnector.md deleted file mode 100644 index 27000f56..00000000 --- a/skills/simplecadapi/references/docs/api/make_vertex_connector_rconnector.md +++ /dev/null @@ -1,20 +0,0 @@ -# make_vertex_connector_rconnector - -## API Definition - -```python -def make_vertex_connector_rconnector(connector_id: str, vertex: Vertex, name: Optional[str] = None, flip: bool = False) -> Connector -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import make_vertex_connector_rconnector` - -## Description - -Create a connector anchored to a Vertex. - -Origin is the vertex point; axes are identity. -flip has no effect on vertex connectors (no direction). diff --git a/skills/simplecadapi/references/docs/api/make_wire_from_edges_rwire.md b/skills/simplecadapi/references/docs/api/make_wire_from_edges_rwire.md deleted file mode 100644 index df5dac7e..00000000 --- a/skills/simplecadapi/references/docs/api/make_wire_from_edges_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_wire_from_edges_rwire - -## API Definition - -```python -def make_wire_from_edges_rwire(edges: List[Edge], *, tag_prefix: Optional[str] = None) -> Wire -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import make_wire_from_edges_rwire` - -## Description - -Create a wire from a list of connected edges. diff --git a/skills/simplecadapi/references/docs/api/make_wire_from_sketch_rwire.md b/skills/simplecadapi/references/docs/api/make_wire_from_sketch_rwire.md deleted file mode 100644 index 8bf517d4..00000000 --- a/skills/simplecadapi/references/docs/api/make_wire_from_sketch_rwire.md +++ /dev/null @@ -1,17 +0,0 @@ -# make_wire_from_sketch_rwire - -## API Definition - -```python -def make_wire_from_sketch_rwire(sketch: Sketch, profile: int | str = 0, *, require_fully_constrained: bool = False, strict: bool = True, tolerance: float = 1e-07, max_iterations: int = 80) -> Wire -``` - -*Source: _operators_sketch.py* - -## Import Surface - -- top-level: `from simplecadapi import make_wire_from_sketch_rwire` - -## Description - -Promote a sketch profile to a concrete wire, solving internally. diff --git a/skills/simplecadapi/references/docs/api/measure_constraint_residual_rconstraintresidual.md b/skills/simplecadapi/references/docs/api/measure_constraint_residual_rconstraintresidual.md deleted file mode 100644 index bcb5df0e..00000000 --- a/skills/simplecadapi/references/docs/api/measure_constraint_residual_rconstraintresidual.md +++ /dev/null @@ -1,17 +0,0 @@ -# measure_constraint_residual_rconstraintresidual - -## API Definition - -```python -def measure_constraint_residual_rconstraintresidual(assembly: Assembly, constraint_id: str) -> ConstraintResidual -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import measure_constraint_residual_rconstraintresidual` - -## Description - -Measure residual for one assembly constraint without mutating the assembly. diff --git a/skills/simplecadapi/references/docs/api/measure_entity_relation_rdescriptor.md b/skills/simplecadapi/references/docs/api/measure_entity_relation_rdescriptor.md deleted file mode 100644 index 2f489760..00000000 --- a/skills/simplecadapi/references/docs/api/measure_entity_relation_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# measure_entity_relation_rdescriptor - -## API Definition - -```python -def measure_entity_relation_rdescriptor(model_or_path: BRepModel | TopoDS_Shape | str | Path, first_entity_id: str, second_entity_id: str, tolerance: float = 1e-07, angular_tolerance_degrees: float = 0.0001, second_model_or_path: BRepModel | TopoDS_Shape | str | Path | None = None) -> dict[str, Any] -``` - -*Source: inspect/brep/queries.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.measure_entity_relation_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Measure exact distance and conservatively report supported analytic relations. diff --git a/skills/simplecadapi/references/docs/api/measure_shape_mass_rtuple.md b/skills/simplecadapi/references/docs/api/measure_shape_mass_rtuple.md deleted file mode 100644 index ce2f74e4..00000000 --- a/skills/simplecadapi/references/docs/api/measure_shape_mass_rtuple.md +++ /dev/null @@ -1,17 +0,0 @@ -# measure_shape_mass_rtuple - -## API Definition - -```python -def measure_shape_mass_rtuple(shape: TopoDS_Shape, kind: PropertyKind) -> tuple[float, np.ndarray] -``` - -*Source: inspect/brep/io.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.measure_shape_mass_rtuple(...)`; unavailable inside GraphSession - -## Description - -Return mass-like value and center for volume, area, or length. diff --git a/skills/simplecadapi/references/docs/api/meta.md b/skills/simplecadapi/references/docs/api/meta.md deleted file mode 100644 index 66b84e32..00000000 --- a/skills/simplecadapi/references/docs/api/meta.md +++ /dev/null @@ -1,35 +0,0 @@ -# meta - -## API Definition - -```python -def meta(path: str, op: str, value_: Any) -> SerializablePredicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import meta` or `simplecadapi.ql.meta` - -## Description - -Build a metadata comparison predicate for QL filtering. - -## Parameters - -### path - -- **Description**: Dot-separated metadata path. - -### op - -- **Description**: Comparison operator such as `==`, `!=`, `>`, `>=`, `<`, or `<=`. - -### value_ - -- **Description**: Comparison value. - -## Returns - -Serializable predicate that compares metadata values. diff --git a/skills/simplecadapi/references/docs/api/mirror_shape.md b/skills/simplecadapi/references/docs/api/mirror_shape.md deleted file mode 100644 index c19efb04..00000000 --- a/skills/simplecadapi/references/docs/api/mirror_shape.md +++ /dev/null @@ -1,17 +0,0 @@ -# mirror_shape - -## API Definition - -```python -def mirror_shape(shape: AnyShape, plane_origin: Tuple[float, float, float], plane_normal: Tuple[float, float, float]) -> AnyShape -``` - -*Source: _operators_transform.py* - -## Import Surface - -- top-level: `from simplecadapi import mirror_shape` - -## Description - -Mirror a shape across a plane. diff --git a/skills/simplecadapi/references/docs/api/not_.md b/skills/simplecadapi/references/docs/api/not_.md deleted file mode 100644 index bd55f590..00000000 --- a/skills/simplecadapi/references/docs/api/not_.md +++ /dev/null @@ -1,17 +0,0 @@ -# not_ - -## API Definition - -```python -def not_(predicate: Predicate) -> Predicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import not_` or `simplecadapi.ql.not_` - -## Description - -Negate a QL predicate. diff --git a/skills/simplecadapi/references/docs/api/operation_event.md b/skills/simplecadapi/references/docs/api/operation_event.md deleted file mode 100644 index 06bd14ee..00000000 --- a/skills/simplecadapi/references/docs/api/operation_event.md +++ /dev/null @@ -1,17 +0,0 @@ -# operation_event - -## API Definition - -```python -def operation_event(op_name: str, event: str = '*') -> SerializablePredicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import operation_event` or `simplecadapi.ql.operation_event` - -## Description - -Match typed operation and topology-event metadata under ``track``. diff --git a/skills/simplecadapi/references/docs/api/or_.md b/skills/simplecadapi/references/docs/api/or_.md deleted file mode 100644 index 5a01e274..00000000 --- a/skills/simplecadapi/references/docs/api/or_.md +++ /dev/null @@ -1,17 +0,0 @@ -# or_ - -## API Definition - -```python -def or_(*predicates: Predicate) -> Predicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import or_` or `simplecadapi.ql.or_` - -## Description - -Combine predicates so at least one of them must match. diff --git a/skills/simplecadapi/references/docs/api/origin_role.md b/skills/simplecadapi/references/docs/api/origin_role.md deleted file mode 100644 index 13c3992e..00000000 --- a/skills/simplecadapi/references/docs/api/origin_role.md +++ /dev/null @@ -1,17 +0,0 @@ -# origin_role - -## API Definition - -```python -def origin_role(role_name: str) -> SerializablePredicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import origin_role` or `simplecadapi.ql.origin_role` - -## Description - -Match a typed source role under ``track`` metadata. diff --git a/skills/simplecadapi/references/docs/api/output_role.md b/skills/simplecadapi/references/docs/api/output_role.md deleted file mode 100644 index f98ff2ef..00000000 --- a/skills/simplecadapi/references/docs/api/output_role.md +++ /dev/null @@ -1,17 +0,0 @@ -# output_role - -## API Definition - -```python -def output_role(role_name: str) -> SerializablePredicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import output_role` or `simplecadapi.ql.output_role` - -## Description - -Match a kernel-proven operation output role under ``track`` metadata. diff --git a/skills/simplecadapi/references/docs/api/part_function.md b/skills/simplecadapi/references/docs/api/part_function.md deleted file mode 100644 index 82d70405..00000000 --- a/skills/simplecadapi/references/docs/api/part_function.md +++ /dev/null @@ -1,17 +0,0 @@ -# part - -## API Definition - -```python -def part(func: Callable[_P, _R] | None = None, *, id: str | None = None, revision: str = '1.0.0', inputs: Sequence[FileInput] = (), cache: CachePolicy | Mapping[str, Any] | str | None = None, project_root: str | Path | None = None, tolerance_profile: str = 'simplecad-default') -> Callable[[Callable[_P, _R]], Callable[_P, PartBuildResult]] | Callable[_P, PartBuildResult] -``` - -*Source: build/part_builder.py* - -## Import Surface - -- top-level: `from simplecadapi import part` - -## Description - -Decorate one synchronous builder as a cached single-solid product part. diff --git a/skills/simplecadapi/references/docs/api/place_component_rassembly.md b/skills/simplecadapi/references/docs/api/place_component_rassembly.md deleted file mode 100644 index 66c62d63..00000000 --- a/skills/simplecadapi/references/docs/api/place_component_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# place_component_rassembly - -## API Definition - -```python -def place_component_rassembly(assembly: Assembly, component_id: str, placement: Placement) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import place_component_rassembly` - -## Description - -Move an existing assembly component by replacing its placement. diff --git a/skills/simplecadapi/references/docs/api/radial_pattern_rsolidlist.md b/skills/simplecadapi/references/docs/api/radial_pattern_rsolidlist.md deleted file mode 100644 index c8e3d4ab..00000000 --- a/skills/simplecadapi/references/docs/api/radial_pattern_rsolidlist.md +++ /dev/null @@ -1,17 +0,0 @@ -# radial_pattern_rsolidlist - -## API Definition - -```python -def radial_pattern_rsolidlist(shape: AnyShape, center: Tuple[float, float, float], axis: Tuple[float, float, float], count: int, total_rotation_angle: float) -> List[Solid] -``` - -*Source: _operators_transform.py* - -## Import Surface - -- top-level: `from simplecadapi import radial_pattern_rsolidlist` - -## Description - -Create a radial pattern of solids. diff --git a/skills/simplecadapi/references/docs/api/render_entity_kind_maps_rpath.md b/skills/simplecadapi/references/docs/api/render_entity_kind_maps_rpath.md deleted file mode 100644 index 9a142601..00000000 --- a/skills/simplecadapi/references/docs/api/render_entity_kind_maps_rpath.md +++ /dev/null @@ -1,17 +0,0 @@ -# render_entity_kind_maps_rpath - -## API Definition - -```python -def render_entity_kind_maps_rpath(model_or_path: BRepModel | TopoDS_Shape | str | Path, entity_ids: Sequence[str], output_dir: str | Path, *, title: str = 'BREP entity map', views: Sequence[tuple[float, float, str]] = DEFAULT_VIEWS, image_size: tuple[float, float] = (18.0, 12.0), dpi: int = 180, linear_deflection: float = 0.12, angular_deflection: float = 0.18, edge_samples: int = 96, context_opacity: float = 1.0, highlight_edge_width: float = 6.0, highlight_point_size: float = 18.0, label_mode: Literal['auto', 'callout', 'legend', 'none'] = 'legend', max_callouts: int = 4, legend_columns: int = 3) -> dict[str, Path] -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_entity_kind_maps_rpath(...)`; unavailable inside GraphSession - -## Description - -Render independent face, edge, and vertex highlight maps. diff --git a/skills/simplecadapi/references/docs/api/render_entity_map_rpath.md b/skills/simplecadapi/references/docs/api/render_entity_map_rpath.md deleted file mode 100644 index 3e27f77c..00000000 --- a/skills/simplecadapi/references/docs/api/render_entity_map_rpath.md +++ /dev/null @@ -1,24 +0,0 @@ -# render_entity_map_rpath - -## API Definition - -```python -def render_entity_map_rpath(model_or_path: BRepModel | TopoDS_Shape | str | Path, entity_ids: Sequence[str], output_path: str | Path, *, title: str = 'BREP entity map', views: Sequence[tuple[float, float, str]] = DEFAULT_VIEWS, highlight_edge_width: float = 6.0, highlight_point_size: float = 18.0, image_size: tuple[float, float] = (18.0, 12.0), dpi: int = 180, linear_deflection: float = 0.12, angular_deflection: float = 0.18, edge_samples: int = 96, context_opacity: float = 1.0, label_mode: Literal['auto', 'callout', 'legend', 'none'] = 'legend', max_callouts: int = 4, legend_columns: int = 3) -> Path -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_entity_map_rpath(...)`; unavailable inside GraphSession - -## Description - -Render stable BREP entity IDs without flattening model depth. - -The base model stays opaque by default and keeps its true BREP edges. -Bodies use colored topology edges, faces use a restrained translucent tint -plus boundary edges, edges use thick curves, and vertices use colored -points. ``highlight_edge_width`` and ``highlight_point_size`` make selected -edges and vertices visually dominant. A dedicated ID/type key is the safe -default; callouts remain available for focused selections. diff --git a/skills/simplecadapi/references/docs/api/render_region_rpath.md b/skills/simplecadapi/references/docs/api/render_region_rpath.md deleted file mode 100644 index f7d90b54..00000000 --- a/skills/simplecadapi/references/docs/api/render_region_rpath.md +++ /dev/null @@ -1,17 +0,0 @@ -# render_region_rpath - -## API Definition - -```python -def render_region_rpath(model_or_path: BRepModel | TopoDS_Shape | str | Path, entity_ids: Sequence[str], output_path: str | Path, *, neighborhood_depth: int = 0, title: str = 'Highlighted BREP region', views: Sequence[tuple[float, float, str]] = DEFAULT_VIEWS, image_size: tuple[float, float] = (18.0, 12.0), dpi: int = 180, linear_deflection: float = 0.12, angular_deflection: float = 0.18, edge_samples: int = 96, highlight_edge_width: float = 6.0, highlight_point_size: float = 18.0) -> Path -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_region_rpath(...)`; unavailable inside GraphSession - -## Description - -Highlight stable entities and their optional topology neighborhood. diff --git a/skills/simplecadapi/references/docs/api/render_screenshot_rpath.md b/skills/simplecadapi/references/docs/api/render_screenshot_rpath.md deleted file mode 100644 index 08b9d79d..00000000 --- a/skills/simplecadapi/references/docs/api/render_screenshot_rpath.md +++ /dev/null @@ -1,17 +0,0 @@ -# render_screenshot_rpath - -## API Definition - -```python -def render_screenshot_rpath(shapes: Union[Solid, Sequence[Solid]], output_path: str, highlight_tags: Optional[Sequence[str]] = None, tag_labels: Optional[Dict[str, str]] = None, image_size: Tuple[int, int] = (1400, 900), view: Union[Tuple[float, float], str] = 'auto', show_axes: bool = True, show_legend: bool = True, zoom: float = 4.0, show_callouts: bool = True) -> str -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import render_screenshot_rpath` - -## Description - -Render SDK solids through the shared OCCT/VTK BREP renderer. diff --git a/skills/simplecadapi/references/docs/api/render_shape_views_rpath.md b/skills/simplecadapi/references/docs/api/render_shape_views_rpath.md deleted file mode 100644 index 3afb565b..00000000 --- a/skills/simplecadapi/references/docs/api/render_shape_views_rpath.md +++ /dev/null @@ -1,20 +0,0 @@ -# render_shape_views_rpath - -## API Definition - -```python -def render_shape_views_rpath(shape: TopoDS_Shape, output_path: str | Path, *, title: str = 'BREP views', views: Sequence[tuple[float, float, str]] = DEFAULT_VIEWS, image_size: tuple[float, float] = (18.0, 12.0), dpi: int = 180, linear_deflection: float = 0.12, angular_deflection: float = 0.18, show_brep_edges: bool = True) -> Path -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_shape_views_rpath(...)`; unavailable inside GraphSession - -## Description - -Render smooth shaded BREP views with true topology edges by default. - -``show_brep_edges`` draws exact topological edges sampled from the BREP; it -never exposes the internal triangle edges used by the GPU. diff --git a/skills/simplecadapi/references/docs/api/render_step_comparison_rpath.md b/skills/simplecadapi/references/docs/api/render_step_comparison_rpath.md deleted file mode 100644 index b0faf0d5..00000000 --- a/skills/simplecadapi/references/docs/api/render_step_comparison_rpath.md +++ /dev/null @@ -1,21 +0,0 @@ -# render_step_comparison_rpath - -## API Definition - -```python -def render_step_comparison_rpath(target_step_path: str | Path, current_step_path: str | Path, output_path: str | Path, *, views: Sequence[tuple[float, float, str]] = DEFAULT_VIEWS, image_size: tuple[float, float] = (16.0, 20.0), dpi: int = 160, linear_deflection: float = 0.12, angular_deflection: float = 0.18, show_brep_edges: bool = True) -> Path -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_step_comparison_rpath(...)`; unavailable inside GraphSession - -## Description - -Render target and current STEP models with identical cameras and scale. - -Shared views, union bounds, tessellation, and BREP-edge settings keep -independent camera fitting from hiding size or placement differences. The -image is diagnostic evidence and does not replace strict comparison. diff --git a/skills/simplecadapi/references/docs/api/render_step_components_colored_rpath.md b/skills/simplecadapi/references/docs/api/render_step_components_colored_rpath.md deleted file mode 100644 index 45c86842..00000000 --- a/skills/simplecadapi/references/docs/api/render_step_components_colored_rpath.md +++ /dev/null @@ -1,37 +0,0 @@ -# render_step_components_colored_rpath - -## API Definition - -```python -def render_step_components_colored_rpath(step_path: str | Path, component_colors: Mapping[str, ColorSpec], output_path: str | Path, *, palette: Sequence[ColorSpec] | None = None, with_context: bool = True, title: str | None = None, views: Sequence[tuple[float, float, str]] = DEFAULT_VIEWS, image_size: tuple[float, float] = (18.0, 12.0), dpi: int = 180, linear_deflection: float = 0.12, angular_deflection: float = 0.18, show_legend: bool = True) -> Path -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_step_components_colored_rpath(...)`; unavailable inside GraphSession - -## Description - -Render multiple STEP components, each in its own color. - -The recommended, most semantic form maps each component selector -directly to a color NAME:: - -render_step_components_colored_rpath( -"assembly.step", -{"SPK-2030X4MM": "cyan", "USER_LIBRARY-USB_TYPE_C_PORT__S": "purple"}, -"out.png", -) - -Selectors resolve like ``render_step_components_rpath`` (names, paths, -or node ids) and multiple occurrences of one name share its color. -``component_colors`` values accept a named color from the built-in set -(red, crimson, orange, gold, yellow, lime, green, teal, cyan, skyblue, -blue, navy, purple, violet, magenta, pink, salmon, brown, tan, olive, -gray, silver, black, white), a ``#RRGGBB`` / ``#RGB`` hex string, an -``(r, g, b)`` 0..1 tuple, or an integer palette index (with ``palette``). -The result shows every selected solid at once, color-coded, with an -optional color legend so the geometry can be matched to per-component -text. diff --git a/skills/simplecadapi/references/docs/api/render_step_components_rpath.md b/skills/simplecadapi/references/docs/api/render_step_components_rpath.md deleted file mode 100644 index 534a0368..00000000 --- a/skills/simplecadapi/references/docs/api/render_step_components_rpath.md +++ /dev/null @@ -1,17 +0,0 @@ -# render_step_components_rpath - -## API Definition - -```python -def render_step_components_rpath(step_path: str | Path, component_names: Sequence[str], output_path: str | Path, *, with_context: bool = True, title: str | None = None, views: Sequence[tuple[float, float, str]] = DEFAULT_VIEWS, image_size: tuple[float, float] = (18.0, 12.0), dpi: int = 180, linear_deflection: float = 0.12, angular_deflection: float = 0.18) -> Path -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_step_components_rpath(...)`; unavailable inside GraphSession - -## Description - -Render named XCAF component occurrences, optionally in assembly context. diff --git a/skills/simplecadapi/references/docs/api/render_step_views_rpath.md b/skills/simplecadapi/references/docs/api/render_step_views_rpath.md deleted file mode 100644 index 60730573..00000000 --- a/skills/simplecadapi/references/docs/api/render_step_views_rpath.md +++ /dev/null @@ -1,17 +0,0 @@ -# render_step_views_rpath - -## API Definition - -```python -def render_step_views_rpath(step_path: str | Path, output_path: str | Path, **kwargs) -> Path -``` - -*Source: inspect/brep/render.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.render_step_views_rpath(...)`; unavailable inside GraphSession - -## Description - -Load STEP/XCAF colors and render smooth faces with true BREP edges. diff --git a/skills/simplecadapi/references/docs/api/replay_graph.md b/skills/simplecadapi/references/docs/api/replay_graph.md deleted file mode 100644 index 6839ddbf..00000000 --- a/skills/simplecadapi/references/docs/api/replay_graph.md +++ /dev/null @@ -1,31 +0,0 @@ -# replay_graph - -## API Definition - -```python -def replay_graph(graph: OperationGraph, *, strict: bool = True) -> List[Any] -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import replay_graph` - -## Description - -Replay an OperationGraph to rebuild the model. - -Executes nodes in topological order. Primitives are created from their -parameters; boolean operations consume upstream outputs. - -## Parameters - -### graph - -- **Description**: The graph to replay. - -## Returns - -List of leaf-node outputs. These may be solids, faces, wires, edges, -or vertices depending on the workflow. diff --git a/skills/simplecadapi/references/docs/api/replay_model_json.md b/skills/simplecadapi/references/docs/api/replay_model_json.md deleted file mode 100644 index 74d23093..00000000 --- a/skills/simplecadapi/references/docs/api/replay_model_json.md +++ /dev/null @@ -1,17 +0,0 @@ -# replay_model_json - -## API Definition - -```python -def replay_model_json(json_str: str, *, strict: bool = True) -> List[Any] -``` - -*Source: serializer.py* - -## Import Surface - -- top-level: `from simplecadapi import replay_model_json` - -## Description - -Replay a model payload using its canonical low-level graph. diff --git a/skills/simplecadapi/references/docs/api/resolve_cache_policy.md b/skills/simplecadapi/references/docs/api/resolve_cache_policy.md deleted file mode 100644 index 90bb0c3b..00000000 --- a/skills/simplecadapi/references/docs/api/resolve_cache_policy.md +++ /dev/null @@ -1,17 +0,0 @@ -# resolve_cache_policy - -## API Definition - -```python -def resolve_cache_policy(explicit: CachePolicy | Mapping[str, Any] | None = None, *, project_root: str | Path = '.', environ: Mapping[str, str] | None = None) -> CachePolicy -``` - -*Source: cache/policy.py* - -## Import Surface - -- top-level: `from simplecadapi import resolve_cache_policy` - -## Description - -Resolve fields using explicit > environment > project > defaults. diff --git a/skills/simplecadapi/references/docs/api/revolve_rsolid.md b/skills/simplecadapi/references/docs/api/revolve_rsolid.md deleted file mode 100644 index 82d3fc4c..00000000 --- a/skills/simplecadapi/references/docs/api/revolve_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# revolve_rsolid - -## API Definition - -```python -def revolve_rsolid(profile: Union[Wire, Face], axis: Tuple[float, float, float] = (0, 0, 1), angle: ScalarLike = 360, origin: Tuple[float, float, float] = (0, 0, 0), *, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_face_tag: Optional[str] = None, end_face_tag: Optional[str] = None, side_faces_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import revolve_rsolid` - -## Description - -Create a revolved solid, with optional kernel-role-based tags. diff --git a/skills/simplecadapi/references/docs/api/rotate_shape.md b/skills/simplecadapi/references/docs/api/rotate_shape.md deleted file mode 100644 index 9e963685..00000000 --- a/skills/simplecadapi/references/docs/api/rotate_shape.md +++ /dev/null @@ -1,17 +0,0 @@ -# rotate_shape - -## API Definition - -```python -def rotate_shape(shape: AnyShape, angle: ScalarLike, axis: Tuple[float, float, float] = (0, 0, 1), origin: Tuple[float, float, float] = (0, 0, 0)) -> AnyShape -``` - -*Source: _operators_transform.py* - -## Import Surface - -- top-level: `from simplecadapi import rotate_shape` - -## Description - -Rotate a shape around an axis. diff --git a/skills/simplecadapi/references/docs/api/run_comparison_bundle.md b/skills/simplecadapi/references/docs/api/run_comparison_bundle.md deleted file mode 100644 index 1c0ef4f8..00000000 --- a/skills/simplecadapi/references/docs/api/run_comparison_bundle.md +++ /dev/null @@ -1,61 +0,0 @@ -# run_comparison_bundle - -## API Definition - -```python -def run_comparison_bundle(config: EvaluationConfig, *, target_path: str | Path, candidate_path: str | Path, output_directory: str | Path, diagnostics: bool = False, strict_topology: bool = False, python_executable: str = sys.executable) -> dict[str, dict[str, Any]] -``` - -*Source: inverse_engineer/brep/evaluation.py* - -## Import Surface - -- reverse-engineering evaluator: `from simplecadapi.inverse_engineer.brep import run_comparison_bundle` - -## Description - -Run trusted acceptance stages and optional geometric diagnostics. - -Worker-stage envelopes contain ``status``, ``gate_passed``, -``elapsed_seconds``, ``report``, ``report_path``, and ``error``. Successful -diagnostics have status ``completed``, ``gate_passed=None``, and no -acceptance checks. Completed material and strict acceptance stages add -boolean ``checks`` and become ``passed`` or ``failed``. Non-run stages contain -a ``reason`` instead; the aggregate ``sections`` stage contains ``reports``, -one worker envelope per unique section ID. ``global`` and ``material`` always -appear; ``boundary`` and ``sections`` appear only when ``diagnostics=True``; -``strict`` always appears but runs only for a solid with proven material -equality when ``strict_topology=True``. - -Report schemas and units: - -- ``global`` reports bounding-box and centroid distances in millimetres, -total surface area in square millimetres, aggregate volume in cubic -millimetres, topology counts, and dimensionless relative deltas. -- ``material`` reports the comparison method, directional missing/excess -volumes in cubic millimetres, Boolean and volume-balance validity, and the -derived ``strict_point_set_equal`` tri-state. Its -``relative_total_difference`` is dimensionless and diagnostic. For regular -solids, non-fuzzy bidirectional Cut residual volumes establish -tolerance-bounded material equivalence; this is not an aggregate -mass-property comparison and does not prove topology, representation, or -literal boundary identity. -- ``boundary`` reports sampled-to-exact distances in millimetres, including -approximate Hausdorff and p95 distances. It is diagnostic, never equality -proof. -- ``sections`` contains one envelope per configured section. Plane values, -perimeters, and Hausdorff distances are millimetres; section areas are -square millimetres; ``relative_area_error`` is dimensionless. -- ``strict`` reports directional difference volumes in cubic millimetres, -geometric and Boolean tolerances, STEP validity, geometric point-set -equality, geometry-labelled incidence isomorphism, and -``hard_gate_passed``. Exact classification also requires the trusted -envelope's ``checks.hard_gate`` to be true. - -The evaluator configuration, target/candidate paths, worker executable, and -returned reports are trusted-harness data. Participant-authored reports or -edited stage envelopes must never be passed to classification. Aggregate -global properties, sampled boundary distances, and bounded section probes are -diagnostics and never affect classification. Only strict bidirectional -material residual evidence and, when requested, strict topology evidence are -acceptance gates. diff --git a/skills/simplecadapi/references/docs/api/select.md b/skills/simplecadapi/references/docs/api/select.md deleted file mode 100644 index 8ed35810..00000000 --- a/skills/simplecadapi/references/docs/api/select.md +++ /dev/null @@ -1,17 +0,0 @@ -# select - -## API Definition - -```python -def select(items: Iterable[Any]) -> Query -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import select` or `simplecadapi.ql.select` - -## Description - -Start a QL query over a shape collection or selector scope. diff --git a/skills/simplecadapi/references/docs/api/select_edges_by_tag.md b/skills/simplecadapi/references/docs/api/select_edges_by_tag.md deleted file mode 100644 index 0d3ae54a..00000000 --- a/skills/simplecadapi/references/docs/api/select_edges_by_tag.md +++ /dev/null @@ -1,17 +0,0 @@ -# select_edges_by_tag - -## API Definition - -```python -def select_edges_by_tag(shape: Union[Face, Solid], tag: str, scope: str | TagScope = TagScope.EFFECTIVE) -> List[Edge] -``` - -*Source: _operators_selection.py* - -## Import Surface - -- top-level: `from simplecadapi import select_edges_by_tag` - -## Description - -Select edges by tag. diff --git a/skills/simplecadapi/references/docs/api/select_faces_by_tag.md b/skills/simplecadapi/references/docs/api/select_faces_by_tag.md deleted file mode 100644 index 6225ecbd..00000000 --- a/skills/simplecadapi/references/docs/api/select_faces_by_tag.md +++ /dev/null @@ -1,17 +0,0 @@ -# select_faces_by_tag - -## API Definition - -```python -def select_faces_by_tag(solid: Solid, tag: str, scope: str | TagScope = TagScope.EFFECTIVE) -> List[Face] -``` - -*Source: _operators_selection.py* - -## Import Surface - -- top-level: `from simplecadapi import select_faces_by_tag` - -## Description - -Select faces by tag. diff --git a/skills/simplecadapi/references/docs/api/select_region_entities_rdescriptor.md b/skills/simplecadapi/references/docs/api/select_region_entities_rdescriptor.md deleted file mode 100644 index b9326ce7..00000000 --- a/skills/simplecadapi/references/docs/api/select_region_entities_rdescriptor.md +++ /dev/null @@ -1,17 +0,0 @@ -# select_region_entities_rdescriptor - -## API Definition - -```python -def select_region_entities_rdescriptor(model_or_path: BRepModel | TopoDS_Shape | str | Path, entity_ids: Sequence[str] | None = None, center: Sequence[float] | None = None, radius: float | None = None, depth: int = 0) -> dict[str, Any] -``` - -*Source: inspect/brep/queries.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.select_region_entities_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Expand stable ids through topology and optionally filter them by bounds distance. diff --git a/skills/simplecadapi/references/docs/api/set_public_connector_rassembly.md b/skills/simplecadapi/references/docs/api/set_public_connector_rassembly.md deleted file mode 100644 index 89fdf831..00000000 --- a/skills/simplecadapi/references/docs/api/set_public_connector_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# set_public_connector_rassembly - -## API Definition - -```python -def set_public_connector_rassembly(assembly: Assembly, public_connector_id: str, source_component_id: str, source_connector_id: str, name: Optional[str] = None) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import set_public_connector_rassembly` - -## Description - -Expose an existing connector on a direct child component. diff --git a/skills/simplecadapi/references/docs/api/sew_faces_rshell.md b/skills/simplecadapi/references/docs/api/sew_faces_rshell.md deleted file mode 100644 index edb23400..00000000 --- a/skills/simplecadapi/references/docs/api/sew_faces_rshell.md +++ /dev/null @@ -1,17 +0,0 @@ -# sew_faces_rshell - -## API Definition - -```python -def sew_faces_rshell(faces: Sequence[Face], *, tolerance: float = 1e-06, tag_prefix: Optional[str] = None) -> Shell -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import sew_faces_rshell` - -## Description - -Sew faces into exactly one connected Shell. diff --git a/skills/simplecadapi/references/docs/api/shell_rsolid.md b/skills/simplecadapi/references/docs/api/shell_rsolid.md deleted file mode 100644 index f2aa5fc3..00000000 --- a/skills/simplecadapi/references/docs/api/shell_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# shell_rsolid - -## API Definition - -```python -def shell_rsolid(solid: Solid, faces_to_remove: Union[Sequence[Face], ShapeSelector], thickness: ScalarLike, *, result_tag: Optional[str] = None, body_faces_tag: Optional[str] = None, offset_faces_tag: Optional[str] = None, closing_faces_tag: Optional[str] = None, wall_edges_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import shell_rsolid` - -## Description - -Shell a solid, with optional kernel-role-based face tags. diff --git a/skills/simplecadapi/references/docs/api/shells.md b/skills/simplecadapi/references/docs/api/shells.md deleted file mode 100644 index 4f7ef786..00000000 --- a/skills/simplecadapi/references/docs/api/shells.md +++ /dev/null @@ -1,17 +0,0 @@ -# shells - -## API Definition - -```python -def shells() -> ShapeSelector -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import shells` or `simplecadapi.ql.shells` - -## Description - -Select Shell entities from a Shell or compatible topology scope. diff --git a/skills/simplecadapi/references/docs/api/solve_assembly_constraints_rassembly.md b/skills/simplecadapi/references/docs/api/solve_assembly_constraints_rassembly.md deleted file mode 100644 index 933cbbb3..00000000 --- a/skills/simplecadapi/references/docs/api/solve_assembly_constraints_rassembly.md +++ /dev/null @@ -1,28 +0,0 @@ -# solve_assembly_constraints_rassembly - -## API Definition - -```python -def solve_assembly_constraints_rassembly(assembly: Assembly, strict: bool = True) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import solve_assembly_constraints_rassembly` - -## Description - -Solve fixed, revolute, and prismatic assembly constraints. - -Solving is limit-aware: when a constraint carries a ``ScalarLimit`` -(``angle_limit`` or ``distance_limit``), the drive scalar is clamped -into the closed range before placement propagation. When no drive -scalar is present but a limit exists, the current relative-frame -scalar is projected into the bounds. Unresolvable closed kinematic -loops fall back to a golden-section search over the limit bounds. - -A ``ConstraintReport`` is recorded on the returned assembly under the -``constraint_report`` runtime key for later inspection via -``inspect_assembly_constraints_rassembly``. diff --git a/skills/simplecadapi/references/docs/api/source_binding.md b/skills/simplecadapi/references/docs/api/source_binding.md deleted file mode 100644 index e18f40b6..00000000 --- a/skills/simplecadapi/references/docs/api/source_binding.md +++ /dev/null @@ -1,17 +0,0 @@ -# source_binding - -## API Definition - -```python -def source_binding(binding_id: str) -> SerializablePredicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import source_binding` or `simplecadapi.ql.source_binding` - -## Description - -Match a projected local binding by its exact source binding identity. diff --git a/skills/simplecadapi/references/docs/api/source_topology.md b/skills/simplecadapi/references/docs/api/source_topology.md deleted file mode 100644 index 8afe1618..00000000 --- a/skills/simplecadapi/references/docs/api/source_topology.md +++ /dev/null @@ -1,17 +0,0 @@ -# source_topology - -## API Definition - -```python -def source_topology(topo_id: str) -> SerializablePredicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import source_topology` or `simplecadapi.ql.source_topology` - -## Description - -Match a projected local binding by its exact source topology identity. diff --git a/skills/simplecadapi/references/docs/api/suspend_graph_recording.md b/skills/simplecadapi/references/docs/api/suspend_graph_recording.md deleted file mode 100644 index 5997d1da..00000000 --- a/skills/simplecadapi/references/docs/api/suspend_graph_recording.md +++ /dev/null @@ -1,17 +0,0 @@ -# suspend_graph_recording - -## API Definition - -```python -def suspend_graph_recording() -``` - -*Source: graph.py* - -## Import Surface - -- top-level: `from simplecadapi import suspend_graph_recording` - -## Description - -Temporarily suspend automatic graph recording for internal API composition. diff --git a/skills/simplecadapi/references/docs/api/sweep_rsolid.md b/skills/simplecadapi/references/docs/api/sweep_rsolid.md deleted file mode 100644 index 42b6d3cd..00000000 --- a/skills/simplecadapi/references/docs/api/sweep_rsolid.md +++ /dev/null @@ -1,17 +0,0 @@ -# sweep_rsolid - -## API Definition - -```python -def sweep_rsolid(profile: Face, path: Wire, is_frenet: bool = False, *, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_face_tag: Optional[str] = None, end_face_tag: Optional[str] = None, side_faces_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import sweep_rsolid` - -## Description - -Create a swept solid, with optional kernel-role-based tags. diff --git a/skills/simplecadapi/references/docs/api/tag.md b/skills/simplecadapi/references/docs/api/tag.md deleted file mode 100644 index 87f3b555..00000000 --- a/skills/simplecadapi/references/docs/api/tag.md +++ /dev/null @@ -1,31 +0,0 @@ -# tag - -## API Definition - -```python -def tag(pattern: str, scope: str | TagScope = TagScope.EFFECTIVE) -> SerializablePredicate -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import tag` or `simplecadapi.ql.tag` - -## Description - -Build a tag predicate for QL filtering. - -## Parameters - -### pattern - -- **Description**: Exact tag string or a trailing `*` prefix match. - -### scope - -- **Description**: One of ``local``, ``inherited``, ``effective``, or ``lineage``. - -## Returns - -Serializable predicate that can be used in `Query.where(...)`. diff --git a/skills/simplecadapi/references/docs/api/track_section_contours_rdescriptor.md b/skills/simplecadapi/references/docs/api/track_section_contours_rdescriptor.md deleted file mode 100644 index a483a280..00000000 --- a/skills/simplecadapi/references/docs/api/track_section_contours_rdescriptor.md +++ /dev/null @@ -1,22 +0,0 @@ -# track_section_contours_rdescriptor - -## API Definition - -```python -def track_section_contours_rdescriptor(*, sections: Sequence[Mapping[str, Any]], maximum_match_cost: float = 1.5, topology_area_tolerance: float = 0.2) -> dict[str, Any] -``` - -*Source: inspect/brep/section_tracking.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.track_section_contours_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Track contours across ordered stations without forcing one global loft. - -The output distinguishes continuation, birth, death, split and merge -events. Its summary reports whether topology changes make one global loft -unsafe. It is hypothesis evidence and must not be copied into the raw BREP -summary. diff --git a/skills/simplecadapi/references/docs/api/translate_product_package_to_fcstd.md b/skills/simplecadapi/references/docs/api/translate_product_package_to_fcstd.md deleted file mode 100644 index 7dc48cf1..00000000 --- a/skills/simplecadapi/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/skills/simplecadapi/references/docs/api/translate_product_package_to_freecad_script.md b/skills/simplecadapi/references/docs/api/translate_product_package_to_freecad_script.md deleted file mode 100644 index b4c82c63..00000000 --- a/skills/simplecadapi/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/skills/simplecadapi/references/docs/api/translate_product_package_to_fusion360_script.md b/skills/simplecadapi/references/docs/api/translate_product_package_to_fusion360_script.md deleted file mode 100644 index 5ed70116..00000000 --- a/skills/simplecadapi/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/skills/simplecadapi/references/docs/api/translate_product_package_to_solidworks_script.md b/skills/simplecadapi/references/docs/api/translate_product_package_to_solidworks_script.md deleted file mode 100644 index 7d6f3736..00000000 --- a/skills/simplecadapi/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: ProductPackageInput, document_name: str = 'SimpleCADProduct', *, output_path: str | None = None, visible: bool = False, source_kernel_fallback: bool = False) -> 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/skills/simplecadapi/references/docs/api/translate_shape.md b/skills/simplecadapi/references/docs/api/translate_shape.md deleted file mode 100644 index c5e5791a..00000000 --- a/skills/simplecadapi/references/docs/api/translate_shape.md +++ /dev/null @@ -1,17 +0,0 @@ -# translate_shape - -## API Definition - -```python -def translate_shape(shape: AnyShape, vector: Tuple[float, float, float]) -> AnyShape -``` - -*Source: _operators_transform.py* - -## Import Surface - -- top-level: `from simplecadapi import translate_shape` - -## Description - -Translate a shape by an offset vector. diff --git a/skills/simplecadapi/references/docs/api/trim_surface_rface.md b/skills/simplecadapi/references/docs/api/trim_surface_rface.md deleted file mode 100644 index c3c23328..00000000 --- a/skills/simplecadapi/references/docs/api/trim_surface_rface.md +++ /dev/null @@ -1,24 +0,0 @@ -# trim_surface_rface - -## API Definition - -```python -def trim_surface_rface(carrier: Face, outer: Wire, holes: Sequence[Wire] = (), *, tolerance: float = 1e-07, tag_prefix: Optional[str] = None) -> Face -``` - -*Source: _operators_geometry.py* - -## Import Surface - -- top-level: `from simplecadapi import trim_surface_rface` - -## Description - -Trim a carrier Face to exactly one connected Face. - -Existing carrier bounds and holes are preserved by intersecting them with -the requested closed, simple outer loop and optional closed, simple holes. -Empty or disconnected intersections are rejected. Every trim curve must -lie on the carrier within ``tolerance``. Periodic carriers do not support -holes; their outer loop must fit within one seam period without crossing -the seam. diff --git a/skills/simplecadapi/references/docs/api/twisted_sweep_rsolid.md b/skills/simplecadapi/references/docs/api/twisted_sweep_rsolid.md deleted file mode 100644 index b4e87d48..00000000 --- a/skills/simplecadapi/references/docs/api/twisted_sweep_rsolid.md +++ /dev/null @@ -1,21 +0,0 @@ -# twisted_sweep_rsolid - -## API Definition - -```python -def twisted_sweep_rsolid(profile: Face, distance: ScalarLike, twist_angle: ScalarLike, axis: Tuple[float, float, float] = (0.0, 0.0, 1.0), origin: Tuple[float, float, float] = (0.0, 0.0, 0.0), *, guide_radius: ScalarLike = 1.0, tag_prefix: Optional[str] = None, result_tag: Optional[str] = None, start_face_tag: Optional[str] = None, end_face_tag: Optional[str] = None, side_faces_tag: Optional[str] = None) -> Solid -``` - -*Source: _operators_features.py* - -## Import Surface - -- top-level: `from simplecadapi import twisted_sweep_rsolid` - -## Description - -Sweep a planar profile along a straight axis with linear rotation. - -``twist_angle`` is the signed total rotation in degrees. The operation uses -a cylindrical auxiliary spine to define a continuous rotation law, yielding -one continuous side face per profile edge instead of a segmented ruled loft. diff --git a/skills/simplecadapi/references/docs/api/unground_component_rassembly.md b/skills/simplecadapi/references/docs/api/unground_component_rassembly.md deleted file mode 100644 index 6769a400..00000000 --- a/skills/simplecadapi/references/docs/api/unground_component_rassembly.md +++ /dev/null @@ -1,17 +0,0 @@ -# unground_component_rassembly - -## API Definition - -```python -def unground_component_rassembly(assembly: Assembly, component_id: str) -> Assembly -``` - -*Source: _operators_product.py* - -## Import Surface - -- top-level: `from simplecadapi import unground_component_rassembly` - -## Description - -Remove a component grounding marker. diff --git a/skills/simplecadapi/references/docs/api/union_rsolid.md b/skills/simplecadapi/references/docs/api/union_rsolid.md deleted file mode 100644 index cdc51851..00000000 --- a/skills/simplecadapi/references/docs/api/union_rsolid.md +++ /dev/null @@ -1,66 +0,0 @@ -# union_rsolid - -## API Definition - -```python -def union_rsolid(*solids: Union[Solid, Sequence[Solid]], clean: bool = True, glue: bool = _DEFAULT_UNION_GLUE, tol: Optional[float] = None, tracking_policy: TrackingPolicy | str = TrackingPolicy.FULL) -> Solid -``` - -*Source: _operators_boolean.py* - -## Import Surface - -- top-level: `from simplecadapi import union_rsolid` - -## Description - -Compute the boolean union and return one manifold solid. - -Face-area contact and positive-volume overlap can produce one solid without -artificial embedding. Edge-only, vertex-only, and point/curve tangencies -are non-manifold connections and cannot satisfy the one-Solid contract. - -``glue`` is an OCC optimization for compatible touching or coincident -topology, not a geometry repair switch. If the optimized pass does not -return one solid, SimpleCAD automatically retries the normal fuse algorithm. - -Accepts standalone `Solid` objects, lists of `Solid`, and nested sequences, -but always returns exactly one `Solid`. If the kernel cannot produce -exactly one solid result, the API raises a clear error instead of -returning multiple pieces. - -## Parameters - -### solids - -- **Description**: One or more Solid objects or sequences of Solid. Nested sequences are flattened before processing. - -### clean - -- **Description**: Unify same-domain faces and remove splitter edges when possible. - -### glue - -- **Description**: Try OCC glue optimization first, then fall back to normal fuse if necessary. Defaults to False. - -### tol - -- **Type**: `Optional finite non-negative fuzzy-boolean tolerance used by OCC. It` -- **Description**: may intentionally bridge a small gap but cannot make a non-manifold point or edge contact into a valid solid. - -### tracking_policy - -- **Description**: FULL computes topology history and lineage. GRAPH keeps the replayable operation node without computing a TopoDelta. - -## Returns - -Solid: The merged union result. - -## Examples - -```python -body = make_box_rsolid(10, 4, 4, bottom_face_center=(0, 0, 0)) -rib = make_box_rsolid(2, 4, 4, bottom_face_center=(4, 0, 0)) -merged = union_rsolid(body, rib) -print(merged.get_volume()) -``` diff --git a/skills/simplecadapi/references/docs/api/validate_step_roundtrip_rdescriptor.md b/skills/simplecadapi/references/docs/api/validate_step_roundtrip_rdescriptor.md deleted file mode 100644 index d40b8094..00000000 --- a/skills/simplecadapi/references/docs/api/validate_step_roundtrip_rdescriptor.md +++ /dev/null @@ -1,26 +0,0 @@ -# validate_step_roundtrip_rdescriptor - -## API Definition - -```python -def validate_step_roundtrip_rdescriptor(model_or_shape: ModelInput, output_path: str | Path, *, relative_property_tolerance: float = 1e-07, position_tolerance: float = 1e-06, protected_input_paths: tuple[str | Path, ...] = (), compact: bool = True) -> dict[str, Any] -``` - -*Source: inspect/brep/persistence.py* - -## Import Surface - -- inspection namespace: `from simplecadapi.inspect import brep` then `brep.validate_step_roundtrip_rdescriptor(...)`; unavailable inside GraphSession - -## Description - -Atomically write and reload STEP, publishing only a verified result. - -Relative tolerance bounds candidate-before/after volume and surface-area -drift. Position tolerance, in model length units, bounds candidate-before/ -after centroid distance and both material and root bounding-box coordinate -drift. These are STEP serialization integrity checks, not candidate-to-target -similarity metrics. The returned descriptor records each measured delta. -Topology acceptance compares defect counts and shell facts, preserving -existing open topology while rejecting newly introduced defects and shell -closure, orientation, or closed-manifold regressions. diff --git a/skills/simplecadapi/references/docs/api/value.md b/skills/simplecadapi/references/docs/api/value.md deleted file mode 100644 index 345e3ebd..00000000 --- a/skills/simplecadapi/references/docs/api/value.md +++ /dev/null @@ -1,31 +0,0 @@ -# value - -## API Definition - -```python -def value(path: str, default: Any = None) -> SerializableKey -``` - -*Source: ql.py* - -## Import Surface - -- submodule: `from simplecadapi.ql import value` or `simplecadapi.ql.value` - -## Description - -Build a value key extractor for ordering and projection in QL. - -## Parameters - -### path - -- **Description**: Property or metadata path to resolve. - -### default - -- **Description**: Fallback value when the path is missing. - -## Returns - -Serializable key function for `Query.order_by(...)`. diff --git a/skills/simplecadapi/references/docs/api/var_function.md b/skills/simplecadapi/references/docs/api/var_function.md deleted file mode 100644 index d0e136c3..00000000 --- a/skills/simplecadapi/references/docs/api/var_function.md +++ /dev/null @@ -1,26 +0,0 @@ -# var - -## API Definition - -```python -def var(name: str, default: int | float, comment: str | None = None, tolerance: ToleranceLike | None = None, *, unit: UnitLike | None = None, tolerance_unit: UnitLike | None = None) -> Var -``` - -*Source: expr.py* - -## Import Surface - -- top-level: `from simplecadapi import var` - -## Description - -Create a physical or legacy scalar variable. - -``tolerance=0.1`` declares a symmetric ``+/-0.1`` tolerance. Use a -``(lower_deviation, upper_deviation)`` pair for an asymmetric tolerance. -``tolerance_unit`` defaults to ``unit`` when a nominal unit is declared. -Values are converted to canonical CAD units only when evaluated, so the -declaration and serialized expression node preserve the user's units. - -Variables without ``unit`` retain legacy unitless behavior. A unit-aware -expression cannot mix declared-unit variables with legacy variables. diff --git a/skills/simplecadapi/references/docs/core/README.md b/skills/simplecadapi/references/docs/core/README.md deleted file mode 100644 index 76383d1a..00000000 --- a/skills/simplecadapi/references/docs/core/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# SimpleCAD API Core Classes Documentation - -This directory documents the core public object model for SimpleCADAPI. - -SimpleCADAPI is OCP-native at runtime: public geometry objects are thin Python wrappers around OpenCascade/OCP shapes exposed through the `.wrapped` attribute. The package provides functional modeling operations, expression parameters, QL selectors, and replayable model JSON. - -## Core Classes Overview - -### Coordinate and tagging utilities - -#### [CoordinateSystem](coordinate_system.md) -A right-handed 3D coordinate system for local modeling contexts and point/vector transformation. - -#### [SimpleWorkplane](simple_workplane.md) -A context manager for temporarily modeling in a local coordinate system. - -#### [TaggedMixin](tagged_mixin.md) -Shared tag and metadata behavior for geometry wrappers. - -### Geometry wrappers - -#### [Vertex](vertex.md) -A 0D topology wrapper with coordinate queries. - -#### [Edge](edge.md) -A 1D topology wrapper for lines, arcs, circles, splines, and other curve edges. - -#### [Wire](wire.md) -A connected path made from edges. Wires may be open or closed. - -#### [Face](face.md) -A bounded surface with an outer wire and optional inner wires. - -#### [Shell](shell.md) -A connected set of faces that may be open or closed. - -#### [Solid](solid.md) -A closed 3D body with volume, faces, edges, tags, and metadata. - -#### [Compound](compound.md) -A collection wrapper for multiple geometry objects. - -### Product semantics roadmap - -#### [Part and Assembly Development Plan](part_assembly_development_plan.md) -Planned single-body `Part`, material assignment, component placement, and `Assembly` semantics layered above the current topology/geometry and operation graph model. - -## Relationship Diagram - -```text -TaggedMixin -├── Vertex (0D) -├── Edge (1D) -├── Wire (1D) ← composed of edges -├── Face (2D) ← bounded by wires -├── Shell (2D) ← connected set of faces -├── Solid (3D) ← bounded by faces -└── Compound ← collection of shapes - -CoordinateSystem ← independent utility -SimpleWorkplane ← local modeling context -``` - -## Design Principles - -- **Shape-first API**: users work with `Vertex`, `Edge`, `Wire`, `Face`, `Shell`, and `Solid`, not graph nodes. -- **Functional modeling style**: public operations return new geometry values, e.g. `make_box_rsolid(...)`, `cut_rsolid(...)`, `fillet_rsolid(...)`. -- **OCP-native runtime**: geometry construction, topology traversal, properties, booleans, transforms, and export use OCP/OpenCascade helpers. -- **Replayable graph workflows**: an explicit `GraphSession` records operations, `session.capture_result()` selects canonical output nodes, and `export_model_json()` plus `replay_model_json()` provide interchange and replay. -- **Tags and metadata**: tags are useful for lightweight semantics; structured numeric facts should be stored in metadata such as `metadata["geo"]`. -- **Indexed topology access**: use plural methods such as `get_edges()` and `get_faces()` for enumeration, and pass an index to the same getter, such as `get_edges(index)` or `get_faces(index)`, for intentional indexed picks that should become graph selection nodes. - -## Basic Usage - -```python -import simplecadapi as scad - -with scad.SimpleWorkplane(origin=(0, 0, 0)): - box = scad.make_box_rsolid(width=5, height=3, depth=2) - -scad.apply_tag(shape=box, tag="role.bracket") -box.set_metadata("material", "6061-T6") -box.auto_tag_faces("box") - -top_faces = [ - face for face in box.get_faces() - if "face.top" in scad.list_tags(shape=face) -] -print(len(top_faces)) -``` - -## Replayable Model JSON - -```python -import simplecadapi as scad -from simplecadapi import GraphSession, export_model_json, replay_model_json - -with GraphSession(graph_id="drilled_block") as session: - body = scad.make_box_rsolid(width=10, height=10, depth=4) - hole = scad.make_cylinder_rsolid( - radius=1.5, height=8, bottom_face_center=(0, 0, -2) - ) - part = scad.cut_rsolid(body, hole) - session.capture_result(value=part) - payload = export_model_json(session=session) - -rebuilt = replay_model_json(json_str=payload) -print(len(rebuilt)) -``` - -## More Resources - -- [API Reference Documentation](../api/) -- [Examples](../../examples/) -- [User Guide](../../README.md) -- [JSON Operation Graph Spec](operation_graph_json_spec.md) -- [Serialization and Replay Operation Guides](serialization/) diff --git a/skills/simplecadapi/references/docs/core/compound.md b/skills/simplecadapi/references/docs/core/compound.md deleted file mode 100644 index 1f138d3b..00000000 --- a/skills/simplecadapi/references/docs/core/compound.md +++ /dev/null @@ -1,22 +0,0 @@ -# Compound - -`Compound` is an explicit multi-shape projection wrapper. - -SimpleCADAPI 2.0 beta keeps integrated modeling centered on single `Solid` -results, but product-level `Assembly` workflows can be projected into a flattened -`Compound` with `make_compound_from_assembly_rcompound(...)`. - -The stable public geometry wrapper surface is: - -- `Vertex` -- `Edge` -- `Wire` -- `Face` -- `Solid` -- `Compound` - -Use `Compound` when a workflow intentionally needs a flattened geometry -projection. Do not use it as a substitute for `Assembly` product structure. - -For normal part modeling, keep using `Solid` as the body-level geometry. A -single-body `Part` wraps exactly one `Solid`. diff --git a/skills/simplecadapi/references/docs/core/coordinate_system.md b/skills/simplecadapi/references/docs/core/coordinate_system.md deleted file mode 100644 index 1477b3e9..00000000 --- a/skills/simplecadapi/references/docs/core/coordinate_system.md +++ /dev/null @@ -1,30 +0,0 @@ -# CoordinateSystem - -`CoordinateSystem` represents a right-handed local coordinate frame used by `SimpleWorkplane` and public modeling operations. - -## Public constructor - -```python -CoordinateSystem( - origin=(0, 0, 0), - x_axis=(1, 0, 0), - y_axis=(0, 1, 0), - z_axis=(0, 0, 1), -) -``` - -## Main capabilities - -- Store an origin and orthonormal axes. -- Transform local points to global coordinates. -- Transform local vectors to global vectors. -- Format readable frame diagnostics. - -## Example - -```python -import simplecadapi as scad - -cs = scad.CoordinateSystem(origin=(10, 0, 0)) -print(cs.transform_point((1, 2, 3))) -``` diff --git a/skills/simplecadapi/references/docs/core/declarative_constraints.md b/skills/simplecadapi/references/docs/core/declarative_constraints.md deleted file mode 100644 index cec8dd52..00000000 --- a/skills/simplecadapi/references/docs/core/declarative_constraints.md +++ /dev/null @@ -1,79 +0,0 @@ -# Declarative Constraint Status - -Sketch constraints are supported through the isomorphic sketch API surface: - -- `make_sketch_rsketch(...)` -- `add_point_rsketch(...)` -- `add_line_rsketch(...)` -- `add_circle_rsketch(...)` -- `constrain_*_rsketch(...)` -- `inspect_sketch_rsketchresult(...)` for non-recording diagnostics -- `make_wire_from_sketch_rwire(...)` -- `make_face_from_sketch_rface(...)` - -When the modeling intent is a sketch/profile, use these sketch APIs as the only recommended construction path. Concrete geometry APIs such as `make_line_redge(...)` and `make_wire_from_edges_rwire(...)` remain for paths, pure geometry, and internal lowering targets. - -Sketch document construction is functional: `add_*_rsketch(...)` and `constrain_*_rsketch(...)` return an updated `Sketch` instead of mutating the input document. Each sketch entity must have a stable explicit id, and constraints may use those ids directly: - -```python -sketch = make_sketch_rsketch("plate_profile") -sketch = add_point_rsketch(sketch, "p0", 0.0, 0.0) -sketch = add_point_rsketch(sketch, "p1", 72.0, 0.0) -sketch = add_line_rsketch(sketch, "bottom", "p0", "p1") -sketch = constrain_horizontal_rsketch(sketch, "bottom") -sketch = constrain_distance_rsketch(sketch, "p0", "p1", 72.0) -``` - -`solve` is not a first-class modeling graph leaf. `make_wire_from_sketch_rwire(...)` and `make_face_from_sketch_rface(...)` run the sketch solver internally during `Sketch -> Wire/Face` promotion. Promotion graph nodes record `solve_snapshot` and `promotion_map` evidence, and promoted geometry receives `source_sketch`, `sketch_solve`, and sketch entity metadata/tags. `inspect_sketch_rsketchresult(...)` is diagnostic-only and does not record graph nodes. - -The default sketch solver backend is `py-slvs` (`py-slvs==1.0.6`). The public sketch document and solve result do not expose native solver handles. Alternative backends implement `SketchSolverBackend.solve(sketch, *, options)`, register with `register_sketch_solver_backend(...)`, and can be selected by name with `Sketch.solve(backend="name")` or process-wide with `set_default_sketch_solver_backend(...)`. `SketchSolveResult` snapshots record `backend`, `backend_version`, and `backend_status_code` so replay evidence identifies the solver that produced it. - -```python -class MyBackend: - name = "my-solver" - version = "1" - - def solve(self, sketch, *, options): - return SketchSolveResult(...) - -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. - -Removed public APIs include: - -- `Assembly` -- `PartHandle` -- `PointAnchor` -- `AxisAnchor` -- `AssemblyResult` -- `SolveReport` -- `make_assembly_rassembly` -- `clone_assembly_rassembly` -- `add_part_rassembly` -- `translate_part_rassembly` -- `rotate_part_rassembly` -- `solve_assembly_rresult` -- `constrain_coincident_rassembly` -- `constrain_concentric_rassembly` -- `constrain_offset_rassembly` -- `constrain_distance_rassembly` -- `clear_constraints_rassembly` -- `stack_rassembly` -- `stack` - -Current supported workflows should model durable products through explicit boundaries: - -- Use `@scad.part` for one physical solid and `@scad.assemble` for a multi-part product. -- Use `scad.capture(result, path)` as the only public `.scadpkg` write boundary. -- Use `union_rsolid(...)`, `cut_rsolid(...)`, and `intersect_rsolid(...)` when a single merged solid is required. - -`export_model_json(...)` no longer accepts `assembly=...`, and newly exported model JSON does not include `assembly`, `assembly_registry`, or `constraint_registry` fields. - -The next assembly implementation should define a new assembly graph / constraint graph contract before reintroducing public APIs. diff --git a/skills/simplecadapi/references/docs/core/dimension-tolerance-chains.md b/skills/simplecadapi/references/docs/core/dimension-tolerance-chains.md deleted file mode 100644 index 81bff63c..00000000 --- a/skills/simplecadapi/references/docs/core/dimension-tolerance-chains.md +++ /dev/null @@ -1,256 +0,0 @@ -# Dimension Tolerance Chains - -SimpleCADAPI can attach units and manufacturing tolerances to declared dimension -variables, infer dimensions through the expression DAG, propagate source -variation, and verify derived dimensions against design requirements. - -This feature is separate from sketch-solver residual tolerances, boolean fuzzy tolerances, mesh resolution, and geometric fitting tolerances. A dimension tolerance describes permitted manufacturing variation around a nominal design value; it never changes a CAD operation's numerical robustness settings. - -## Declare Source Dimensions - -Every variable that participates in a tolerance chain must declare a tolerance: - -```python -import simplecadapi as scad - -width = scad.var("width", 10.0, unit="mm", tolerance=0.1) -shaft = scad.var( - "shaft", - 0.315, - unit="in", - tolerance=(-0.05, 0.0), - tolerance_unit="mm", -) -``` - -A scalar tolerance is symmetric. `tolerance=0.1` means `-0.1/+0.1` -around the nominal value. A two-value sequence contains signed -`(lower_deviation, upper_deviation)` values. The lower deviation must be at most -zero, the upper deviation must be at least zero, and all values must be finite. - -`tolerance_unit` defaults to `unit`. It may differ from the nominal unit, but the -dimensions must match. Geometry and tolerance propagation use canonical -millimeters for length and degrees for angle. Declaration-space values remain on -the `Var` for display and serialization. - -The same values can be represented explicitly: - -```python -tolerance = scad.DimensionTolerance( - lower_deviation=-0.05, - upper_deviation=0.0, -) -shaft = scad.var("shaft", 8.0, unit="mm", tolerance=tolerance) -``` - -Tolerance identity follows `expr_id`, not the human-readable variable name. Two variables with the same name remain separate tolerance sources. - -## Propagate A Chain - -```python -housing = scad.var("housing", 100.0, unit="mm", tolerance=0.15) -bearing = scad.var( - "bearing", 2.0, unit="cm", tolerance=(-0.04, 0.05), tolerance_unit="mm" -) -spacer = scad.var("spacer", 79.4, unit="mm", tolerance=0.05) -clearance = housing - bearing - spacer - -result = scad.analyze_tolerance(clearance, method="worst_case") - -print(result.nominal) -print(result.lower_bound, result.upper_bound) -print(result.lower_deviation, result.upper_deviation) -for contribution in result.contributions: - print(contribution.variable_name, contribution.lower_deviation, contribution.upper_deviation) -``` - -`ToleranceAnalysis` contains absolute bounds, deviations from nominal, inferred -`dimension`, canonical `unit`, and one contribution record per source variable. -Each contribution reports its nominal and source tolerance in canonical units. - -The unit system validates the expression before propagation. This permits -physically meaningful nonlinear chains such as: - -```python -width = scad.var("width", 30.0, unit="mm", tolerance=0.1) -height = scad.var("height", 40.0, unit="mm", tolerance=0.2) -diagonal = scad.sqrt(width**2 + height**2) - -analysis = scad.analyze_tolerance(diagonal) -assert analysis.dimension == scad.LENGTH -assert analysis.unit == scad.MM -``` - -Area and volume expressions can be inferred and analyzed. Persisted manufacturing -requirements currently accept final Length and Angle results only. - -## Propagation Methods - -### Worst Case - -`method="worst_case"` is the default and the safety-oriented validation method. - -- Affine chains preserve variable identity and combine coefficients exactly. Repeated use is not treated as an independent source, so `x - x` has zero propagated tolerance. -- Nonlinear chains use conservative interval propagation. -- Multiplication and division consider all endpoint sign combinations. -- Integer, negative, fractional, and varying powers validate their mathematical domains. -- `sin` and `cos` include interior extrema; `tan` rejects intervals crossing a discontinuity. -- `sqrt`, `asin`, and `acos` validate the entire input interval. -- Division rejects denominator intervals containing zero. -- `atan2` rejects tolerance regions containing its undefined origin. - -Conservative interval propagation can intentionally overestimate a strongly correlated nonlinear expression. It must not underestimate a safety bound. - -### RSS - -`method="rss"` uses first-order analytic sensitivities and root-sum-square combination: - -```python -result = scad.analyze_tolerance(clearance, method="rss") -``` - -Distinct variables are assumed independent. Repeated occurrences of the same variable are merged before RSS, so `x - x` still has zero sensitivity and `x + x` has twice the sensitivity of `x`. - -RSS validates the full declared tolerance interval before calculating the first-order estimate. A nominal point cannot hide a division singularity, trigonometric discontinuity, or invalid function domain elsewhere in the source range. - -Covariance matrices, correlation groups, probability distributions, and Monte Carlo analysis are not represented by the current API. Use `worst_case` when the independence assumption is unavailable or when a guaranteed envelope is required. - -## Check One Requirement - -`check_tolerance()` returns a result without raising when the derived tolerance exceeds the permitted deviations: - -```python -check = scad.check_tolerance( - clearance, - tolerance=(-0.25, 0.24), - method="worst_case", - name="axial_clearance", - tolerance_unit="mm", -) - -print(check.passed) -print(check.lower_margin, check.upper_margin) -``` - -A non-negative lower and upper margin means the requirement passes, subject to a -small floating-point comparison epsilon. Requirement deviations are converted -from `tolerance_unit` to the target's canonical unit before comparison. - -## Session Requirements And Automatic Validation - -Use `GraphSession.require_tolerance()` for design requirements that must travel with the model: - -```python -with scad.GraphSession() as session: - body = scad.make_box_rsolid(housing, 10.0, 10.0) - session.require_tolerance( - clearance, - (-0.25, 0.24), - method="worst_case", - name="axial_clearance", - requirement_id="req.axial_clearance", - tolerance_unit="mm", - ) - -report = session.validate_tolerances(raise_on_failure=True) -model_json = scad.export_model_json(session) -``` - -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. - -Declaring a requirement validates that the chain is complete and mathematically defined, but it still records a failing requirement so callers can inspect its margins. Export and replay are the enforcement boundaries. - -## Serialization - -Variable tolerances are stored on variable nodes in `expression_graph`: - -```json -{ - "expr_id": "var_width", - "kind": "var", - "name": "width", - "default": 1.0, - "unit": "in", - "tolerance": { - "lower_deviation": -0.1, - "upper_deviation": 0.1 - }, - "tolerance_unit": "mm" -} -``` - -Design requirements and their latest validation evidence are stored in the top-level `tolerance_graph`: - -```json -{ - "requirements": [ - { - "requirement_id": "req.axial_clearance", - "target_expr_id": "expr_clearance", - "tolerance": { - "lower_deviation": -0.25, - "upper_deviation": 0.24 - }, - "method": "worst_case", - "name": "axial_clearance", - "tolerance_unit": "mm", - "target_dimension": { - "length": 1, - "angle": 0 - } - } - ], - "validation": { - "passed": true, - "checks": [] - } -} -``` - -Validation evidence is recomputed during import; serialized evidence is not -trusted as an authority. The target expression dimension is inferred again and -must match `target_dimension`; `tolerance_unit` must have the same dimension. -Payloads created before units or `tolerance_graph` existed remain valid as legacy -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: - -- a source variable without a declared tolerance -- non-finite nominal values or deviations -- malformed signed lower/upper deviations -- unknown, malformed, non-finite, incompatible, overflowing, or underflowing units -- addition/subtraction or `atan2` with incompatible dimensions -- invalid powers, square roots, or trigonometric dimensions -- mixing unit-declared and legacy variables in one expression -- a requirement unit or persisted target dimension that disagrees with the target -- an Area, Volume, Dimensionless, or compound-dimension requirement target -- duplicate requirement IDs -- unknown or dangling expression references -- malformed, cyclic, duplicate-ID, or unsupported expression nodes -- an undefined expression anywhere in the declared tolerance interval -- an RSS derivative at a non-differentiable nominal point -- an unsupported propagation method - -See [Physical Units And Dimension Inference](physical-units.md) for the complete -unit registry, dimension algebra, custom-unit payload, and legacy behavior. diff --git a/skills/simplecadapi/references/docs/core/edge.md b/skills/simplecadapi/references/docs/core/edge.md deleted file mode 100644 index a81b10d2..00000000 --- a/skills/simplecadapi/references/docs/core/edge.md +++ /dev/null @@ -1,386 +0,0 @@ -# Edge - -## Overview - -`Edge` is the edge class in SimpleCAD API, representing a 1D geometric element connecting two vertices. Edges can be lines, arcs, splines, and other types of curves. It wraps OCP's Edge object and adds tag functionality. - -## Class Definition - -```python -class Edge(TaggedMixin): - """Edge class that wraps OCP's Edge and adds tag functionality""" -``` - -## Inheritance Relationships - -- Inherits from `TaggedMixin`, with tag and metadata functionality - -## Usage - -- Represent connections between two points -- Fundamental elements composing Wires and Faces -- Provide geometric information (length, vertices, etc.) -- Support tag management and queries - -## Constructor - -### `__init__(wrapped)` - -Initialize an edge object. - -**Parameters:** -- `wrapped` (OCP TopoDS_Edge): OCP edge object - -**Exceptions:** -- `ValueError`: Raised when the input edge object is invalid - -**Example:** -```python -from simplecadapi import make_line_redge, make_circle_redge - -# Create edges through the SimpleCAD functions -line_edge = make_line_redge(start=(0, 0, 0), end=(1, 1, 0)) -circle_edge = make_circle_redge(center=(0, 0, 0), radius=1.0) -``` - -## Main Properties - -- `wrapped`: Underlying OCP edge object -- `_tags`: Tag set (inherited from TaggedMixin) -- `_metadata`: Metadata dictionary (inherited from TaggedMixin) - -## Common Methods - -### `get_length()` - -Get the length of the edge. - -**Returns:** -- `float`: Edge length - -**Exceptions:** -- `ValueError`: Raised when length retrieval fails - -**Example:** -```python -from simplecadapi import make_line_redge, make_circle_redge -import math - -# Line edge -line = make_line_redge(start=(0, 0, 0), end=(3, 4, 0)) -line_length = line.get_length() -print(f"Line length: {line_length}") # 5.0 - -# Circle edge -circle = make_circle_redge(center=(0, 0, 0), radius=2.0) -circle_length = circle.get_length() -print(f"Circle circumference: {circle_length}") # approx 12.566 (2π * 2) -``` - -### `get_start_vertex()` - -Get the start vertex of the edge. - -**Returns:** -- `Vertex`: Start vertex object - -**Exceptions:** -- `ValueError`: Raised when vertex retrieval fails - -**Example:** -```python -from simplecadapi import make_line_redge - -line = make_line_redge(start=(1, 2, 3), end=(4, 5, 6)) -start_vertex = line.get_start_vertex() -start_coords = start_vertex.get_coordinates() -print(f"Start point coordinates: {start_coords}") # (1.0, 2.0, 3.0) -``` - -### `get_end_vertex()` - -Get the end vertex of the edge. - -**Returns:** -- `Vertex`: End vertex object - -**Exceptions:** -- `ValueError`: Raised when vertex retrieval fails - -**Example:** -```python -from simplecadapi import make_line_redge - -line = make_line_redge(start=(1, 2, 3), end=(4, 5, 6)) -end_vertex = line.get_end_vertex() -end_coords = end_vertex.get_coordinates() -print(f"End point coordinates: {end_coords}") # (4.0, 5.0, 6.0) -``` - -### Tagging and Metadata - -Use the functional public API `apply_tag(shape, tag)` and `list_tags(shape)` for tags. Use `set_metadata(key, value)` and `get_metadata(key, default=None)` for structured metadata. - -## Usage Examples - -### Creating Different Types of Edges - -```python -from simplecadapi import ( - make_line_redge, - make_circle_redge, - make_three_point_arc_redge, - make_spline_redge -) - -# Line edge -line = make_line_redge(start=(0, 0, 0), end=(5, 0, 0)) -apply_tag(line, "base_line") - -# Circle edge -circle = make_circle_redge(center=(0, 0, 0), radius=2.0) -apply_tag(circle, "full_circle") - -# Three-point arc edge -arc = make_three_point_arc_redge( - start=(0, 0, 0), - mid=(1, 1, 0), - end=(2, 0, 0) -) -apply_tag(arc, "arc_segment") - -# Spline edge: control_points are B-spline poles, not sample points -spline = make_spline_redge( - control_points=[(0, 0, 0), (1, 1, 0), (2, 1, 0), (3, 0, 0)] -) -apply_tag(spline, "smooth_curve") - -# Print edge info -edges = [line, circle, arc, spline] -for edge in edges: - print(f"Edge tags: {list_tags(edge)}, length: {edge.get_length():.3f}") -``` - -### Edge Analysis and Classification - -```python -from simplecadapi import make_line_redge -import math - -def analyze_edge_collection(): - """Analyze a collection of edges""" - - # Create multiple edges - edges = [ - make_line_redge(start=(0, 0, 0), end=(1, 0, 0)), # horizontal line - make_line_redge(start=(0, 0, 0), end=(0, 1, 0)), # vertical line - make_line_redge(start=(0, 0, 0), end=(1, 1, 0)), # diagonal line - make_line_redge(start=(0, 0, 0), end=(2, 0, 0)), # long horizontal line - make_line_redge(start=(0, 0, 0), end=(0, 2, 0)), # long vertical line - ] - - # Analyze each edge - for i, edge in enumerate(edges): - length = edge.get_length() - start_coords = edge.get_start_vertex().get_coordinates() - end_coords = edge.get_end_vertex().get_coordinates() - - # Compute the direction vector - direction = ( - end_coords[0] - start_coords[0], - end_coords[1] - start_coords[1], - end_coords[2] - start_coords[2] - ) - - # Classify edges - if abs(direction[0]) > 0 and abs(direction[1]) == 0: - apply_tag(edge, "horizontal") - elif abs(direction[0]) == 0 and abs(direction[1]) > 0: - apply_tag(edge, "vertical") - elif abs(direction[0]) > 0 and abs(direction[1]) > 0: - apply_tag(edge, "diagonal") - - # Classify by length - if length < 1.5: - apply_tag(edge, "short") - else: - apply_tag(edge, "long") - - # Add metadata - edge.set_metadata("length", length) - edge.set_metadata("direction", direction) - edge.set_metadata("index", i) - - print(f"Edge {i}: length={length:.3f}, tags={list_tags(edge)}") - -analyze_edge_collection() -``` - -### Building Edge Networks - -```python -from simplecadapi import make_line_redge - -def create_edge_network(): - """Create an edge network""" - - # Define nodes - nodes = [ - (0, 0, 0), # A - (2, 0, 0), # B - (2, 2, 0), # C - (0, 2, 0), # D - (1, 1, 0), # E (center point) - ] - - # Define connections - connections = [ - (0, 1), # A-B - (1, 2), # B-C - (2, 3), # C-D - (3, 0), # D-A - (0, 4), # A-E - (1, 4), # B-E - (2, 4), # C-E - (3, 4), # D-E - ] - - edges = [] - - for i, (start_idx, end_idx) in enumerate(connections): - start_point = nodes[start_idx] - end_point = nodes[end_idx] - - edge = make_line_redge(start=start_point, end=end_point) - - # Add connection info - apply_tag(edge, f"connection_{chr(65+start_idx)}{chr(65+end_idx)}") - - # Classify edges - if start_idx < 4 and end_idx < 4: - apply_tag(edge, "perimeter") - else: - apply_tag(edge, "internal") - - # Add metadata - edge.set_metadata("start_node", chr(65+start_idx)) - edge.set_metadata("end_node", chr(65+end_idx)) - edge.set_metadata("connection_index", i) - - edges.append(edge) - - return edges - -# Create the network -network_edges = create_edge_network() - -# Analyze the network -perimeter_edges = [e for e in network_edges if "perimeter" in list_tags(e)] -internal_edges = [e for e in network_edges if "internal" in list_tags(e)] - -print(f"Perimeter edge count: {len(perimeter_edges)}") -print(f"Internal edge count: {len(internal_edges)}") - -# Compute total length -total_length = sum(edge.get_length() for edge in network_edges) -print(f"Network total length: {total_length:.3f}") -``` - -### Edge Geometric Calculations - -```python -from simplecadapi import make_line_redge, make_circle_redge -import math - -def calculate_edge_properties(): - """Calculate edge geometric properties""" - - # Create different types of edges - line = make_line_redge(start=(0, 0, 0), end=(3, 4, 0)) - circle = make_circle_redge(center=(0, 0, 0), radius=5.0) - - # Line properties - line_length = line.get_length() - line_start = line.get_start_vertex().get_coordinates() - line_end = line.get_end_vertex().get_coordinates() - - # Compute the line midpoint - line_midpoint = ( - (line_start[0] + line_end[0]) / 2, - (line_start[1] + line_end[1]) / 2, - (line_start[2] + line_end[2]) / 2 - ) - - # Compute the line direction vector - line_direction = ( - line_end[0] - line_start[0], - line_end[1] - line_start[1], - line_end[2] - line_start[2] - ) - - # Normalize the direction vector - line_dir_length = math.sqrt(sum(x*x for x in line_direction)) - line_unit_direction = tuple(x / line_dir_length for x in line_direction) - - # Circle properties - circle_length = circle.get_length() # circumference - circle_radius = circle_length / (2 * math.pi) - - # Store computed results - line.set_metadata("midpoint", line_midpoint) - line.set_metadata("direction", line_direction) - line.set_metadata("unit_direction", line_unit_direction) - apply_tag(line, "calculated") - - circle.set_metadata("radius", circle_radius) - circle.set_metadata("circumference", circle_length) - apply_tag(circle, "calculated") - - print(f"Line length: {line_length:.3f}") - print(f"Line midpoint: {line_midpoint}") - print(f"Line unit direction: {line_unit_direction}") - print(f"Circle circumference: {circle_length:.3f}") - print(f"Circle radius: {circle_radius:.3f}") - -calculate_edge_properties() -``` - -## String Representation - -```python -from simplecadapi import make_line_redge - -edge = make_line_redge(start=(0, 0, 0), end=(3, 4, 0)) -apply_tag(edge, "example_edge") -edge.set_metadata("type", "line") - -print(edge) -``` - -Output: -``` -Edge: - length: 5.000 - vertices: - start: (0.0, 0.0, 0.0) - end: (3.0, 4.0, 0.0) - tags: [example_edge] - metadata: - type: line -``` - -## Relationships with Other Geometries - -- **Vertex**: Endpoints of edges -- **Wire**: Composed of multiple connected edges -- **Face**: Boundary defined by edges (via wires) -- **Solid**: Ultimately composed of faces formed by edges - -## Notes - -- Edge length is determined by its geometry and cannot be directly modified -- Circular edges are complete circles with identical start and end vertices -- Spline edge lengths are approximate values and may have precision errors -- Edge directionality may affect certain operations -- Tags and metadata do not affect edge geometry properties -- When retrieving vertices, for closed edges like circular edges, start and end vertices may be identical diff --git a/skills/simplecadapi/references/docs/core/face.md b/skills/simplecadapi/references/docs/core/face.md deleted file mode 100644 index 67301cab..00000000 --- a/skills/simplecadapi/references/docs/core/face.md +++ /dev/null @@ -1,545 +0,0 @@ -# Face - -## Overview - -`Face` is the face class in the SimpleCAD API, representing 2D surface geometry. A face is bounded by one or more wires, including an outer boundary and possibly inner boundaries (holes). It wraps the OCP Face object and adds tagging functionality. - -## Class Definition - -```python -class Face(TaggedMixin): - """Face class that wraps OCP's Face and adds tag functionality""" -``` - -## Inheritance - -- Inherits from `TaggedMixin`, providing tag and metadata functionality - -## Usage - -- Represent 2D surface areas -- Form the boundary of solids (Solid) -- Define cross-sections for sweep, extrude, and other operations -- Calculate geometric properties such as area and normal vectors - -## Constructor - -### `__init__(wrapped)` - -Initializes a face object. - -**Parameters:** -- `wrapped` (OCP TopoDS_Face): A OCP face object - -**Raises:** -- `ValueError`: When the input face object is invalid - -**Example:** -```python -from simplecadapi import ( - make_rectangle_rface, - make_circle_rface, - make_face_from_wire_rface, - make_rectangle_rwire -) - -# Create faces through the SimpleCAD functions -rectangle = make_rectangle_rface(width=5, height=3) -circle = make_circle_rface(center=(0, 0, 0), radius=2.0) - -# Create a face from a wire -wire = make_rectangle_rwire(width=4, height=4) -face_from_wire = make_face_from_wire_rface(wire) -``` - -## Main Properties - -- `wrapped`: The underlying OCP face object -- `_tags`: Tag set (inherited from TaggedMixin) -- `_metadata`: Metadata dictionary (inherited from TaggedMixin) - -## Common Methods - -### `get_area()` - -Get the area of the face. - -**Returns:** -- `float`: The area of the face - -**Raises:** -- `ValueError`: When area retrieval fails - -**Example:** -```python -from simplecadapi import make_rectangle_rface, make_circle_rface -import math - -# Rectangle face -rectangle = make_rectangle_rface(width=5, height=3) -rect_area = rectangle.get_area() -print(f"Rectangle area: {rect_area}") # 15.0 - -# Circle face -circle = make_circle_rface(center=(0, 0, 0), radius=2.0) -circle_area = circle.get_area() -expected_area = math.pi * 2.0 * 2.0 -print(f"Circle area: {circle_area:.3f}, expected: {expected_area:.3f}") -``` - -### `get_normal_at(u, v)` - -Get the normal vector of the face at the specified parameter position. - -**Parameters:** -- `u` (float, optional): U parameter, default 0.5 -- `v` (float, optional): V parameter, default 0.5 - -**Returns:** -- `simplecadapi.core.Vec3`: Normal vector - -**Raises:** -- `ValueError`: When normal vector retrieval fails - -**Example:** -```python -from simplecadapi import make_rectangle_rface - -rectangle = make_rectangle_rface(width=5, height=3) -normal = rectangle.get_normal_at() -print(f"Normal vector: ({normal.x:.3f}, {normal.y:.3f}, {normal.z:.3f})") -``` - -### `get_outer_wire()` - -Get the outer boundary wire of the face. - -**Returns:** -- `Wire`: Outer boundary wire object - -**Raises:** -- `ValueError`: When outer boundary wire retrieval fails - -**Example:** -```python -from simplecadapi import make_rectangle_rface - -rectangle = make_rectangle_rface(width=5, height=3) -outer_wire = rectangle.get_outer_wire() -edges = outer_wire.get_edges() -print(f"The outer boundary consists of {len(edges)} edges") -``` - -### Tagging and Metadata - -Use the functional public API `apply_tag(shape, tag)` and `list_tags(shape)` for tags. Use `set_metadata(key, value)` and `get_metadata(key, default=None)` for structured metadata. - -## Usage Examples - -### Creating Different Types of Faces - -```python -from simplecadapi import ( - make_rectangle_rface, - make_circle_rface, - make_face_from_wire_rface, - make_polyline_rwire -) - -# Rectangle face -rectangle = make_rectangle_rface(width=10, height=6) -apply_tag(rectangle, "rectangle") -apply_tag(rectangle, "quadrilateral") - -# Circle face -circle = make_circle_rface(center=(0, 0, 0), radius=3.0) -apply_tag(circle, "circle") -apply_tag(circle, "curved") - -# Complex polygon face -points = [ - (0, 0, 0), (4, 0, 0), (4, 3, 0), (2, 5, 0), (0, 3, 0), (0, 0, 0) -] -polygon_wire = make_polyline_rwire(points=points) -polygon = make_face_from_wire_rface(polygon_wire) -apply_tag(polygon, "polygon") -apply_tag(polygon, "complex") - -# Analyze face properties -faces = [rectangle, circle, polygon] -for face in faces: - area = face.get_area() - normal = face.get_normal_at() - outer_wire = face.get_outer_wire() - edges = outer_wire.get_edges() - tags = list_tags(face) - - print(f"Face type: {tags}") - print(f" Area: {area:.3f}") - print(f" Normal: ({normal.x:.3f}, {normal.y:.3f}, {normal.z:.3f})") - print(f" Edge count: {len(edges)}") - print() -``` - -### Geometric Analysis of Faces - -```python -from simplecadapi import make_rectangle_rface, make_circle_rface -import math - -def analyze_face_geometry(): - """Analyze face geometric properties""" - - # Create rectangles of different sizes - rectangles = [ - make_rectangle_rface(width=2, height=3), - make_rectangle_rface(width=4, height=4), - make_rectangle_rface(width=6, height=2) - ] - - # Create circles of different radii - circles = [ - make_circle_rface(center=(0, 0, 0), radius=1.0), - make_circle_rface(center=(0, 0, 0), radius=2.0), - make_circle_rface(center=(0, 0, 0), radius=3.0) - ] - - # Analyze rectangles - for i, rect in enumerate(rectangles): - area = rect.get_area() - outer_wire = rect.get_outer_wire() - edges = outer_wire.get_edges() - - # Compute perimeter - perimeter = sum(edge.get_length() for edge in edges) - - # Compute aspect ratio - lengths = [edge.get_length() for edge in edges] - lengths.sort() - aspect_ratio = lengths[1] / lengths[0] if lengths[0] > 0 else 1.0 - - apply_tag(rect, f"rectangle_{i}") - rect.set_metadata("area", area) - rect.set_metadata("perimeter", perimeter) - rect.set_metadata("aspect_ratio", aspect_ratio) - - if aspect_ratio == 1.0: - apply_tag(rect, "square") - elif aspect_ratio > 2.0: - apply_tag(rect, "elongated") - - print(f"Rectangle {i}: area={area:.3f}, perimeter={perimeter:.3f}, aspect ratio={aspect_ratio:.3f}") - - # Analyze circles - for i, circle in enumerate(circles): - area = circle.get_area() - outer_wire = circle.get_outer_wire() - edges = outer_wire.get_edges() - - # Compute circumference - perimeter = sum(edge.get_length() for edge in edges) - - # Compute radius from area - radius_from_area = math.sqrt(area / math.pi) - - # Compute radius from perimeter - radius_from_perimeter = perimeter / (2 * math.pi) - - apply_tag(circle, f"circle_{i}") - circle.set_metadata("area", area) - circle.set_metadata("perimeter", perimeter) - circle.set_metadata("radius_from_area", radius_from_area) - circle.set_metadata("radius_from_perimeter", radius_from_perimeter) - - if radius_from_area < 1.5: - apply_tag(circle, "small") - elif radius_from_area > 2.5: - apply_tag(circle, "large") - else: - apply_tag(circle, "medium") - - print(f"Circle {i}: area={area:.3f}, perimeter={perimeter:.3f}, radius={radius_from_area:.3f}") - -analyze_face_geometry() -``` - -### Faces with Holes - -```python -from simplecadapi import ( - make_rectangle_rface, - make_circle_rface, - make_face_from_wire_rface, - make_rectangle_rwire, - make_circle_rwire -) - -def create_face_with_holes(): - """Create a face with holes (conceptual example)""" - - # Create the outer boundary - outer_boundary = make_rectangle_rwire(width=10, height=8) - - # Create inner boundaries (holes) - hole1 = make_circle_rwire(center=(3, 2, 0), radius=1.0) - hole2 = make_circle_rwire(center=(7, 6, 0), radius=1.5) - - # Note: the current SimpleCAD version may not directly support - # multi-boundary faces; this example shows the concept and tag usage. - - # Main face - main_face = make_rectangle_rface(width=10, height=8) - apply_tag(main_face, "main_surface") - apply_tag(main_face, "with_holes") - - # Hole faces (for boolean operations) - hole_face1 = make_circle_rface(center=(3, 2, 0), radius=1.0) - apply_tag(hole_face1, "hole") - apply_tag(hole_face1, "circular") - hole_face1.set_metadata("hole_id", 1) - hole_face1.set_metadata("center", (3, 2, 0)) - hole_face1.set_metadata("radius", 1.0) - - hole_face2 = make_circle_rface(center=(7, 6, 0), radius=1.5) - apply_tag(hole_face2, "hole") - apply_tag(hole_face2, "circular") - hole_face2.set_metadata("hole_id", 2) - hole_face2.set_metadata("center", (7, 6, 0)) - hole_face2.set_metadata("radius", 1.5) - - # Compute effective area - main_area = main_face.get_area() - hole1_area = hole_face1.get_area() - hole2_area = hole_face2.get_area() - effective_area = main_area - hole1_area - hole2_area - - main_face.set_metadata("total_area", main_area) - main_face.set_metadata("hole_area", hole1_area + hole2_area) - main_face.set_metadata("effective_area", effective_area) - - print(f"Main face area: {main_area:.3f}") - print(f"Total hole area: {hole1_area + hole2_area:.3f}") - print(f"Effective area: {effective_area:.3f}") - - return main_face, [hole_face1, hole_face2] - -main_face, holes = create_face_with_holes() -``` - -### Face Transformation and Operations - -```python -from simplecadapi import ( - make_rectangle_rface, - translate_shape, - rotate_shape -) - -def transform_faces(): - """Transform faces""" - - # Create the base face - base_face = make_rectangle_rface(width=4, height=3) - apply_tag(base_face, "base") - apply_tag(base_face, "original") - - # Apply transforms - translated_face = translate_shape(base_face, offset=(6, 0, 0)) - apply_tag(translated_face, "translated") - - rotated_face = rotate_shape(base_face, axis=(0, 0, 1), angle=45) - apply_tag(rotated_face, "rotated") - - elevated_face = translate_shape(base_face, offset=(0, 0, 2)) - apply_tag(elevated_face, "elevated") - - # Collect all faces - all_faces = [base_face, translated_face, rotated_face, elevated_face] - - # Analyze transform results - for face in all_faces: - area = face.get_area() - normal = face.get_normal_at() - outer_wire = face.get_outer_wire() - edges = outer_wire.get_edges() - - # Compute bounding box - all_coords = [] - for edge in edges: - start_coords = edge.get_start_vertex().get_coordinates() - end_coords = edge.get_end_vertex().get_coordinates() - all_coords.extend([start_coords, end_coords]) - - if all_coords: - min_x = min(coord[0] for coord in all_coords) - max_x = max(coord[0] for coord in all_coords) - min_y = min(coord[1] for coord in all_coords) - max_y = max(coord[1] for coord in all_coords) - min_z = min(coord[2] for coord in all_coords) - max_z = max(coord[2] for coord in all_coords) - - face.set_metadata("bbox_min", (min_x, min_y, min_z)) - face.set_metadata("bbox_max", (max_x, max_y, max_z)) - - face.set_metadata("area", area) - face.set_metadata("normal", (normal.x, normal.y, normal.z)) - - print(f"Face tags: {list_tags(face)}") - print(f" Area: {area:.3f}") - print(f" Normal: ({normal.x:.3f}, {normal.y:.3f}, {normal.z:.3f})") - if face.get_metadata("bbox_min"): - print(f" Bounding box: {face.get_metadata('bbox_min')} to {face.get_metadata('bbox_max')}") - print() - -transform_faces() -``` - -### Face Classification and Filtering - -```python -from simplecadapi import make_rectangle_rface, make_circle_rface - -def classify_faces(): - """Classify and filter faces""" - - # Create different types of faces - faces = [] - - # Small rectangles - small_rects = [ - make_rectangle_rface(width=1, height=1), - make_rectangle_rface(width=2, height=1), - make_rectangle_rface(width=1, height=2) - ] - - # Large rectangles - large_rects = [ - make_rectangle_rface(width=5, height=4), - make_rectangle_rface(width=6, height=3), - make_rectangle_rface(width=4, height=6) - ] - - # Circles - circles = [ - make_circle_rface(center=(0, 0, 0), radius=1.0), - make_circle_rface(center=(0, 0, 0), radius=2.0), - make_circle_rface(center=(0, 0, 0), radius=3.0) - ] - - # Tag faces - for i, face in enumerate(small_rects): - apply_tag(face, "rectangle") - apply_tag(face, "small") - face.set_metadata("size_category", "small") - face.set_metadata("shape_type", "rectangle") - faces.append(face) - - for i, face in enumerate(large_rects): - apply_tag(face, "rectangle") - apply_tag(face, "large") - face.set_metadata("size_category", "large") - face.set_metadata("shape_type", "rectangle") - faces.append(face) - - for i, face in enumerate(circles): - apply_tag(face, "circle") - area = face.get_area() - if area < 10: - apply_tag(face, "small") - face.set_metadata("size_category", "small") - elif area > 20: - apply_tag(face, "large") - face.set_metadata("size_category", "large") - else: - apply_tag(face, "medium") - face.set_metadata("size_category", "medium") - face.set_metadata("shape_type", "circle") - faces.append(face) - - # Classification statistics - rectangles = [f for f in faces if "rectangle" in list_tags(f)] - circles = [f for f in faces if "circle" in list_tags(f)] - small_faces = [f for f in faces if "small" in list_tags(f)] - large_faces = [f for f in faces if "large" in list_tags(f)] - - print(f"Total faces: {len(faces)}") - print(f"Rectangle faces: {len(rectangles)}") - print(f"Circle faces: {len(circles)}") - print(f"Small faces: {len(small_faces)}") - print(f"Large faces: {len(large_faces)}") - - # Compute statistics - total_area = sum(f.get_area() for f in faces) - avg_area = total_area / len(faces) - - print(f"Total area: {total_area:.3f}") - print(f"Average area: {avg_area:.3f}") - - return faces - -classified_faces = classify_faces() -``` - -## String Representation - -```python -from simplecadapi import make_rectangle_rface - -face = make_rectangle_rface(width=5, height=3) -apply_tag(face, "example_face") -face.set_metadata("material", "steel") - -print(face) -``` - -Output: -``` -Face: - area: 15.000 - normal: [0.000, 0.000, 1.000] - outer_wire: - Wire: - edge_count: 4 - closed: True - edges: - edge_0: - length: 5.000 - vertices: - start: (0.0, 0.0, 0.0) - end: (5.0, 0.0, 0.0) - edge_1: - length: 3.000 - vertices: - start: (5.0, 0.0, 0.0) - end: (5.0, 3.0, 0.0) - edge_2: - length: 5.000 - vertices: - start: (5.0, 3.0, 0.0) - end: (0.0, 3.0, 0.0) - edge_3: - length: 3.000 - vertices: - start: (0.0, 3.0, 0.0) - end: (0.0, 0.0, 0.0) - tags: [example_face] - metadata: - material: steel -``` - -## Relationships with Other Geometry - -- **Wire (Wire)**: Boundary of the face -- **Edge (Edge)**: Indirectly associated through wires -- **Solid (Solid)**: Faces form the surfaces of a solid -- **Shell (Shell)**: A collection of surfaces composed of multiple faces - -## Notes - -- Faces must be closed, bounded by closed wires -- The face normal direction follows the right-hand rule -- Area calculation includes all regions bounded by the boundary -- Faces with holes require special treatment (outer boundary + inner boundary) -- Face orientation affects subsequent solid operations -- Complex faces may have self-intersection or degenerate cases -- The u, v parameter range is typically [0, 1] diff --git a/skills/simplecadapi/references/docs/core/physical-units.md b/skills/simplecadapi/references/docs/core/physical-units.md deleted file mode 100644 index 82ae2055..00000000 --- a/skills/simplecadapi/references/docs/core/physical-units.md +++ /dev/null @@ -1,202 +0,0 @@ -# Physical Units And Dimension Inference - -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. - -## Canonical CAD Units - -Declaration values are preserved on each `Var`, but evaluation converts them to a -single CAD coordinate system: - -| Dimension | Canonical unit | -| --- | --- | -| Dimensionless | `1` | -| Length | `mm` | -| Area | `mm^2` | -| Volume | `mm^3` | -| Angle | `deg` | - -Degrees are canonical because existing SimpleCAD rotation and angular APIs use -degrees. Trigonometric evaluation converts to radians internally and converts -inverse-trigonometric results back to degrees. - -```python -import math -import simplecadapi as scad - -width = scad.var("width", 1.0, unit="in") -angle = scad.var("angle", math.pi / 2, unit="rad") - -assert width.default == 1.0 -assert width.evaluate() == 25.4 -assert angle.evaluate() == 90.0 -assert math.isclose(scad.sin(angle).evaluate(), 1.0) -``` - -Bindings use the variable's declaration unit. `width.evaluate({"width": 2.0})` -therefore returns `50.8` millimeters for an inch-declared variable. - -## Declaring Units And Tolerances - -```python -width = scad.var( - "width", - 1.0, - unit="in", - tolerance=(-0.1, 0.2), - tolerance_unit="mm", -) -``` - -- `default` is in `unit`. -- `tolerance` is in `tolerance_unit`. -- `tolerance_unit` defaults to `unit` when a tolerance is present. -- Nominal and tolerance units may differ, but their dimensions must match. -- A `tolerance_unit` requires both `unit` and `tolerance`. -- Values must be finite and representable after canonical conversion. - -`width.default` and `width.tolerance` preserve declaration-space values. -`width.canonical_default` and `width.canonical_tolerance` expose values used by -geometry and tolerance propagation. - -## Built-In Units - -| Dimension | Symbols | -| --- | --- | -| Dimensionless | `1`, `%` | -| Length | `mm`, `cm`, `m`, `in`, `ft` | -| Area | `mm^2`, `cm^2`, `m^2`, `in^2`, `ft^2` | -| Volume | `mm^3`, `cm^3`, `m^3`, `in^3`, `ft^3` | -| Angle | `deg`, `rad` | - -Common singular/plural names are accepted by `get_unit()`, including -`millimeters`, `inches`, `feet`, `degrees`, `radians`, `square feet`, and -`cubic inches`. `ml` aliases `cm^3`. - -Use constants such as `MM`, `INCH`, `DEGREE`, `RADIAN`, `LENGTH`, and `ANGLE`, or -resolve strings: - -```python -assert scad.get_unit("inch") == scad.INCH -assert scad.convert_value(1.0, "in", "mm") == 25.4 -assert math.isclose(scad.convert_value(180.0, "deg", "rad"), math.pi) -``` - -Incompatible conversion raises `UnitValidationError`. - -## Dimension Algebra - -`Dimension` stores integer exponents for length and angle. Named dimensions are: - -- `DIMENSIONLESS = Dimension()` -- `LENGTH = Dimension(length=1)` -- `AREA = Dimension(length=2)` -- `VOLUME = Dimension(length=3)` -- `ANGLE = Dimension(angle=1)` - -`infer_dimension(expression)` applies these rules: - -| Operation | Rule | -| --- | --- | -| `a + b`, `a - b` | dimensions must match | -| `a * b` | add dimension exponents | -| `a / b` | subtract dimension exponents | -| `a ** n` | multiply exponents by constant integer `n` | -| `sqrt(a)` or `a ** 0.5` | every exponent must be even | -| unary `-a`, `abs(a)` | preserve dimension | -| `sin`, `cos`, `tan` | input must be Angle; result is Dimensionless | -| `asin`, `acos`, `atan` | input must be Dimensionless; result is Angle | -| `atan2(y, x)` | inputs must have the same dimension; result is Angle | - -Arbitrary and varying powers are permitted for dimensionless bases. A dimensioned -base requires a constant integer exponent, except `0.5` is accepted when all base -exponents are even. - -```python -width = scad.var("width", 30.0, unit="mm") -height = scad.var("height", 40.0, unit="mm") - -area = width * height -diagonal = scad.sqrt(width**2 + height**2) - -assert scad.infer_dimension(area) == scad.AREA -assert scad.infer_dimension(diagonal) == scad.LENGTH -assert diagonal.evaluate() == 50.0 -``` - -## Numeric Constants - -Numeric literals are dimensionless coefficients in multiplication and division. -For addition and subtraction, a literal adopts the other operand's dimension as a -contextual offset: - -```python -length = scad.var("length", 10.0, unit="mm") -assert scad.infer_dimension(length * 2.0) == scad.LENGTH -assert scad.infer_dimension(length + 2.0) == scad.LENGTH -``` - -The literal is already expressed in the canonical result unit. `length + 2.0` -therefore means two millimeters, not two units of `length.unit`. Prefer explicit -variables when declaration-unit intent must be retained. - -## Legacy Unitless Expressions - -Variables without `unit` retain the previous behavior: - -- `infer_dimension()` returns `None`. -- Trigonometric inputs and results use radians. -- Existing arbitrary expression and tolerance behavior remains available. -- A legacy variable cannot be mixed with a unit-declared variable in one - expression because no safe physical meaning can be inferred. - -Pure numeric constant expressions infer `Dimensionless`. - -## Custom Units - -Custom linear-scale units use the same canonical system: - -```python -thou = scad.Unit("thou", scad.LENGTH, 0.0254) -width = scad.var("width", 1000.0, unit=thou) -assert width.evaluate() == 25.4 -``` - -Built-in units serialize as symbols. Custom units serialize a definition: - -```json -{ - "symbol": "thou", - "dimension": {"length": 1, "angle": 0}, - "scale_to_canonical": 0.0254 -} -``` - -Units are scale-only. Offset units such as Celsius/Fahrenheit are not represented. - -## Validation Boundaries - -Unit and dimension validation runs when: - -1. A `Var`, `Dimension`, or `Unit` is created. -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. - -Malformed units, cyclic graphs, duplicate expression IDs, mixed legacy/typed -variables, incompatible dimensions, invalid roots, and invalid trigonometric inputs -are rejected before graph mutation or geometry replay. - -## Manufacturing Requirement Scope - -Area, volume, inverse length, and other compound dimensions can be inferred and -analyzed. Manufacturing requirements created by `check_tolerance()` or -`GraphSession.require_tolerance()` currently accept final `Length` and `Angle` -results only. This prevents an area or volume variation from being presented as a -linear dimension requirement without explicit engineering semantics. - -See [Dimension Tolerance Chains](dimension-tolerance-chains.md) for propagation, -RSS assumptions, enforcement boundaries, and serialized requirement fields. diff --git a/skills/simplecadapi/references/docs/core/serialization/README.md b/skills/simplecadapi/references/docs/core/serialization/README.md deleted file mode 100644 index ce3b5a6e..00000000 --- a/skills/simplecadapi/references/docs/core/serialization/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Serialization and Replay Operation Guides - -This directory documents how SimpleCADAPI serializes replayable modeling operations into the canonical low-level `model.json` operation graph. - -The long-form schema reference remains [`../operation_graph_json_spec.md`](../operation_graph_json_spec.md). These files are more practical, operation-by-operation guides intended for people comparing source code with exported JSON. - -## Recommended workflow - -```python -import json -import simplecadapi as scad -from simplecadapi import GraphSession, export_model_json, replay_model_json - -with GraphSession(graph_id="drilled_block") as session: - body = scad.make_box_rsolid(width=10, height=6, depth=2) - hole = scad.make_cylinder_rsolid( - radius=1, height=4, bottom_face_center=(0, 0, -1) - ) - result = scad.cut_rsolid(body, hole) - session.capture_result(value=result) - model_json = export_model_json(session=session) - -payload = json.loads(model_json) -rebuilt = replay_model_json(json_str=model_json) -``` - -Inspect these fields: - -- `payload["graph"]["nodes"]`: canonical operation nodes in topological order. -- `node["op"]`: stable replay operation name. -- `node["params"]`: numeric / JSON-compatible parameter snapshot. -- `node["param_exprs"]`: optional expression links into `expression_graph`. -- `node["inputs"]`: upstream node ids used by replay. -- `payload["leaf_ids"]`: explicit final result node ids. -- `payload["expression_graph"]`: expression DAG used by expression-backed parameters. -- `payload["tolerance_graph"]`: dimension-chain requirements and validation evidence. - -Use `session.capture_result(...)` when the final output should not be inferred -from all graph leaves, and treat `export_model_json(session=...)` as the -interchange boundary for direct graph workflows. Durable CAD/viewer products use -`@scad.part` or `@scad.assemble`, then `scad.capture(result, "out/product.scadpkg")` -to build and write one canonical self-contained package. No files are written -unless an export API is called. - -## Important rule: source API is not always graph API - -Many user-facing functions are convenience APIs. During an active `GraphSession`, they lower to canonical low-level nodes: - -| Source call | Serialized graph result | -| --- | --- | -| `make_box_rsolid(...)` | rectangle profile + `make_extrude_rsolid` | -| `make_cylinder_rsolid(...)` | circle face + `make_extrude_rsolid` | -| `make_sphere_rsolid(...)` | profile + `make_revolve_rsolid` | -| `make_cone_rsolid(...)` | profile + `make_revolve_rsolid` | -| `make_rectangle_rwire(...)` | line edges + `make_wire_from_edges_rwire` | -| `make_circle_rface(...)` | circle edge + wire + face | -| `make_polyline_rwire(...)` | line edges + wire | -| `linear_pattern_rsolidlist(...)` | explicit `make_translate_rshape` nodes | -| `radial_pattern_rsolidlist(...)` | explicit `make_rotate_rshape` nodes | -| `helical_sweep_rsolid(...)` | helix wire + profile face + `make_sweep_rsolid` | - -## Guides - -- [Primitive and profile operations](primitives-and-profiles.md) -- [Features, booleans, transforms, patterns, and selectors](features-booleans-transforms.md) -- [Expressions and replay behavior](expressions-and-replay.md) -- [Physical units and dimension inference](../physical-units.md) -- [Dimension tolerance chains](../dimension-tolerance-chains.md) - -## Examples - -The retained examples use the current replay and durable product contracts. See -[`../../../examples/08_constrained_sketch.py`](../../../examples/08_constrained_sketch.py) -for sketch promotion and replay, and -[`../../../examples/11_external_reference_gear_train.py`](../../../examples/11_external_reference_gear_train.py) -for cached parts, explicit external definitions, repeated/nested assemblies, and independent definition export. diff --git a/skills/simplecadapi/references/docs/core/serialization/expressions-and-replay.md b/skills/simplecadapi/references/docs/core/serialization/expressions-and-replay.md deleted file mode 100644 index fdd8be4c..00000000 --- a/skills/simplecadapi/references/docs/core/serialization/expressions-and-replay.md +++ /dev/null @@ -1,160 +0,0 @@ -# Expressions and Replay Behavior - -SimpleCADAPI stores expression-backed parameters in two places: - -1. `node.params`: numeric / JSON-compatible snapshot used by simple replay -2. `node.param_exprs`: references into the top-level `expression_graph` - -This lets consumers choose between: - -- pure geometric replay using only the numeric snapshots -- parameter-aware import using `param_exprs + expression_graph` - -## Source example - -```python -import simplecadapi as scad - -width = scad.var("width", 24.0, unit="mm", comment="plate width", tolerance=0.1) -height = scad.var("height", 12.0, unit="mm", comment="plate height", tolerance=0.1) -thickness = scad.var("thickness", 4.0, unit="mm", comment="plate thickness", tolerance=(-0.05, 0.1)) - -with scad.GraphSession() as session: - plate = scad.make_box_rsolid(width, height, thickness) - rib = scad.make_box_rsolid(width / 4.0, height, thickness * 2.0) - part = scad.union_rsolid(plate, rib) - session.require_tolerance(width + height, 0.2, tolerance_unit="mm", name="plate_envelope") - -model_json = scad.export_model_json(session) -``` - -Because `make_box_rsolid(...)` lowers to profile + extrude nodes, the expressions appear on the lowered line/profile/extrude nodes rather than on a `make_box` node. - -## Node-level JSON shape - -A node with expression-backed params may look like: - -```json -{ - "op": "make_extrude_rsolid", - "params": { - "direction": [0.0, 0.0, 1.0], - "distance": 4.0 - }, - "param_exprs": { - "distance": {"expr_id": "var_thickness"} - }, - "inputs": ["node_for_profile"], - "output_count": 1 -} -``` - -`params.distance` is the evaluated canonical snapshot. Unit-aware lengths are -stored in millimeters and angles in degrees. `param_exprs.distance` says the value -came from expression node `var_thickness` and preserves its declaration metadata. - -For tuple/list params, `param_exprs` mirrors the shape of the parameter and uses `null` where no expression is present: - -```json -{ - "params": { - "start": [-12.0, -6.0, 0.0], - "end": [12.0, -6.0, 0.0] - }, - "param_exprs": { - "start": [{"expr_id": "expr_a"}, {"expr_id": "expr_b"}, null], - "end": [{"expr_id": "expr_c"}, {"expr_id": "expr_b"}, null] - } -} -``` - -## Top-level expression graph - -`payload["expression_graph"]` contains expression nodes for variables, constants, and arithmetic operations. The exact ids are stable within one exported payload but should not be treated as human-authored names. - -Consumers that want parameterization should: - -1. Build an expression table from `expression_graph.nodes`. -2. For each operation node, inspect `param_exprs`. -3. Replace or annotate corresponding numeric `params` entries with expression references. -4. Keep numeric `params` as fallback evaluated values. - -Consumers that only want geometry can ignore `param_exprs` and `expression_graph`. - -Variable nodes may contain `unit`, `tolerance`, and `tolerance_unit`. Registered -units use string symbols; custom units use `{symbol, dimension, -scale_to_canonical}` objects. Import reconstructs the expression graph and reruns -dimension inference rather than trusting external dimension claims. - -Session/model payloads store derived-dimension requirements in `tolerance_graph`. -See [Physical Units](../physical-units.md) and [Dimension Tolerance -Chains](../dimension-tolerance-chains.md) for inference, propagation, and -validation semantics. - -## Replay policy in current implementation - -`replay_model_json(model_json)` currently uses the canonical low-level `graph` and the numeric values in `node.params`. - -That means replay is deterministic with respect to the exported snapshot. It does not currently re-solve expressions with changed variable values. - -Replay does validate stored tolerance requirements before rebuilding the nominal geometry. A failing tolerance chain blocks replay, but passing bounds do not cause replay to sample or regenerate limit geometry. - -In practical terms: - -```python -width = scad.var("width", 24.0) -with scad.GraphSession() as session: - box = scad.make_box_rsolid(width, 10, 2) - -payload = scad.export_model_json(session) -rebuilt = scad.replay_model_json(payload) -``` - -Replay rebuilds using width `24.0`, because that is the value stored in `params`. - -## Expression metadata is still important - -Even though replay uses snapshots today, `param_exprs` and `expression_graph` are important for external tools: - -- FreeCAD or CAD translators 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. - -## Leaf ids and replayed outputs - -The top-level `leaf_ids` field determines which node outputs are returned by replay: - -```json -{ - "leaf_ids": ["node_final", "node_auxiliary"] -} -``` - -Replay behavior: - -1. Execute every graph node in topological order. -2. Store each node output by `node_id`. -3. Return outputs for `leaf_ids` in order. - -If an example creates many independent showcase shapes, `leaf_ids` may contain many node ids. This is expected: the graph is not required to have a single final part. - -## Unsupported / lossy expression cases - -- Python callables are not serialized as expressions. -- Some discrete selector data, topology refs, and counts are intentionally treated as JSON data rather than scalar expressions. - -## Practical inspection snippet - -```python -import json - -payload = json.loads(model_json) -for node in payload["graph"]["nodes"]: - if node.get("param_exprs"): - print(node["node_id"], node["op"]) - print(" params:", node["params"]) - print(" param_exprs:", node["param_exprs"]) -``` - -Use this to show the source-to-JSON relationship for expression-backed dimensions. diff --git a/skills/simplecadapi/references/docs/core/serialization/features-booleans-transforms.md b/skills/simplecadapi/references/docs/core/serialization/features-booleans-transforms.md deleted file mode 100644 index 61273c06..00000000 --- a/skills/simplecadapi/references/docs/core/serialization/features-booleans-transforms.md +++ /dev/null @@ -1,502 +0,0 @@ -# Features, Booleans, Transforms, Patterns, and Selection Serialization - -This guide covers replayable feature operations, boolean operations, transforms, macro pattern lowering, and detail-feature selectors. - -## Extrude - -Source: - -```python -profile = scad.make_rectangle_rface(4.0, 2.0) -solid = scad.extrude_rsolid(profile, (0, 0, 1), 3.0) -``` - -Serialized node: - -```json -{ - "op": "make_extrude_rsolid", - "params": { - "direction": [0.0, 0.0, 1.0], - "distance": 3.0 - }, - "inputs": ["node_for_profile"], - "output_count": 1 -} -``` - -Replay effect: - -1. Replay the input profile node, which must output a `Wire` or `Face`. -2. Call `extrude_rsolid(profile, direction, distance)`. - -## Revolve - -Source: - -```python -profile = scad.make_polyline_rwire( - [(0.5, 0, 0), (1.2, 0, 0), (1.0, 0, 1.6), (0.5, 0, 1.6)], - closed=True, -) -solid = scad.revolve_rsolid( - profile, - axis=(0, 0, 1), - angle=360.0, - origin=(0, 0, 0), -) -``` - -Serialized node: - -```json -{ - "op": "make_revolve_rsolid", - "params": { - "axis": [0.0, 0.0, 1.0], - "angle": 360.0, - "origin": [0.0, 0.0, 0.0] - }, - "inputs": ["node_for_profile"], - "output_count": 1 -} -``` - -Replay effect: replays the profile and calls `revolve_rsolid(profile, axis, angle, origin)`. - -## Loft - -Source: - -```python -a = scad.make_rectangle_rwire(2.0, 1.0, center=(0, 0, 0)) -b = scad.make_rectangle_rwire(1.0, 0.5, center=(0, 0, 3)) -solid = scad.loft_rsolid([a, b], ruled=True) -``` - -Serialized node: - -```json -{ - "op": "make_loft_rsolid", - "params": { - "profile_count": 2, - "ruled": true - }, - "inputs": ["node_for_a", "node_for_b"], - "output_count": 1 -} -``` - -Replay effect: - -1. Replay all profile input nodes. -2. Call `loft_rsolid(profiles, ruled=...)`. - -Profile geometry is recovered from `inputs`; only count/options are stored in `params`. - -## Sweep - -Source: - -```python -profile = scad.make_circle_rface((0, 0, 0), 0.3, normal=(1, 0, 0)) -path = scad.make_polyline_rwire([(0, 0, 0), (2, 0, 1), (4, 1, 1)]) -solid = scad.sweep_rsolid(profile, path, is_frenet=False) -``` - -Serialized node: - -```json -{ - "op": "make_sweep_rsolid", - "params": {"is_frenet": false}, - "inputs": ["node_for_profile_face", "node_for_path_wire"], - "output_count": 1 -} -``` - -Replay effect: - -1. Replay profile face from input 0. -2. Replay path wire from input 1. -3. Call `sweep_rsolid(profile, path, is_frenet=...)`. - -## Twisted Sweep - -Source: - -```python -profile = scad.make_rectangle_rface(width=2.0, height=1.0) -solid = scad.twisted_sweep_rsolid( - profile=profile, - distance=8.0, - twist_angle=30.0, -) -``` - -Serialized node: - -```json -{ - "op": "make_twisted_sweep_rsolid", - "params": { - "axis": [0.0, 0.0, 1.0], - "origin": [0.0, 0.0, 0.0], - "distance": 8.0, - "twist_angle": 30.0, - "guide_radius": 1.0 - }, - "inputs": ["node_for_profile_face"], - "output_count": 1 -} -``` - -Replay reconstructs the continuous auxiliary-spine rotation law from the -recorded parameters and invokes `twisted_sweep_rsolid(...)`. No sampled loft -sections are stored or inferred. - -## Helical sweep macro lowering - -Source: - -```python -profile = scad.make_rectangle_rwire(0.25, 0.18) -solid = scad.helical_sweep_rsolid( - profile, - pitch=0.7, - height=2.2, - radius=0.9, -) -``` - -Lowered serialized graph: - -```text -profile wire - -> make_face_from_wire_rface -make_helix_redge - -> make_wire_from_edges_rwire -profile face + helix wire - -> make_sweep_rsolid(is_frenet=true) -``` - -There is no canonical `helical_sweep` node. Replay rebuilds the helix and sweeps along it. - -## Translate - -Source: - -```python -moved = scad.translate_shape(shape, (1.0, 2.0, 0.0)) -``` - -Serialized node: - -```json -{ - "op": "make_translate_rshape", - "params": {"vector": [1.0, 2.0, 0.0]}, - "inputs": ["node_for_shape"], - "output_count": 1 -} -``` - -Replay effect: replays input shape and calls `translate_shape(shape, vector)`. - -## Rotate - -Source: - -```python -rotated = scad.rotate_shape(shape, 90.0, axis=(0, 0, 1), origin=(0, 0, 0)) -``` - -Serialized node: - -```json -{ - "op": "make_rotate_rshape", - "params": { - "angle": 90.0, - "axis": [0.0, 0.0, 1.0], - "origin": [0.0, 0.0, 0.0] - }, - "inputs": ["node_for_shape"], - "output_count": 1 -} -``` - -Replay effect: replays input shape and calls `rotate_shape(shape, angle, axis, origin)`. - -Note: `rotate_shape(shape, 0.0)` returns the original shape and does not record a node. - -## Mirror - -Source: - -```python -mirrored = scad.mirror_shape( - shape, - plane_origin=(0, 0, 0), - plane_normal=(1, 0, 0), -) -``` - -Serialized node: - -```json -{ - "op": "make_mirror_rshape", - "params": { - "plane_origin": [0.0, 0.0, 0.0], - "plane_normal": [1.0, 0.0, 0.0] - }, - "inputs": ["node_for_shape"], - "output_count": 1 -} -``` - -Replay effect: replays input shape and calls `mirror_shape(shape, plane_origin, plane_normal)`. - -## Boolean union - -Source: - -```python -a = scad.make_box_rsolid(3, 2, 1) -b = scad.make_box_rsolid(3, 2, 1, bottom_face_center=(1.5, 0, 0)) -result = scad.union_rsolid(a, b) -``` - -Serialized node: - -```json -{ - "op": "make_union_rsolid", - "params": { - "input_count": 2, - "clean": true, - "glue": true, - "tol": 1e-7 - }, - "inputs": ["node_for_a", "node_for_b"], - "output_count": 1 -} -``` - -Replay effect: - -1. Replay all input solids. -2. Call `union_rsolid(all_solids)`. - -Important: `union_rsolid` expects one connected solid result. If inputs remain disconnected, runtime and replay both raise an error instead of returning a compound. - -## Boolean cut - -Source: - -```python -body = scad.make_box_rsolid(4, 4, 2) -tool = scad.make_cylinder_rsolid(0.8, 4, bottom_face_center=(0, 0, -1)) -result = scad.cut_rsolid(body, tool) -``` - -Serialized node: - -```json -{ - "op": "make_cut_rsolid", - "params": { - "tool_count": 1, - "input_count": 2 - }, - "inputs": ["node_for_body", "node_for_tool"], - "output_count": 1 -} -``` - -Replay effect: - -1. Replay first input as the body. -2. Replay remaining inputs as tools. -3. Call `cut_rsolid(body, tools)`. - -## Boolean intersection - -Source: - -```python -a = scad.make_box_rsolid(2, 2, 2) -b = scad.make_box_rsolid(2, 2, 2, bottom_face_center=(1, 0, 0)) -result = scad.intersect_rsolid(a, b) -``` - -Serialized node: - -```json -{ - "op": "make_intersect_rsolid", - "params": { - "input_count": 2 - }, - "inputs": ["node_for_a", "node_for_b"], - "output_count": 1 -} -``` - -Replay effect: replays inputs and calls `intersect_rsolid(first, rest)`. - -## Fillet - -Source with serializable QL selector: - -```python -from simplecadapi import ql as Q - -selector = Q.edges().where(Q.curve_type("line")).take(4) -result = scad.fillet_rsolid(solid, selector, 0.25) -``` - -Serialized node: - -```json -{ - "op": "make_fillet_rsolid", - "params": { - "radius": 0.25, - "edge_count": 4, - "selected_edges": [ - { - "graph_id": "graph_xxx", - "node_id": "node_xxx", - "output_slot": 0, - "kind": "EDGE", - "topo_id": "edge_...", - "selector_hint": {...} - } - ], - "selected_edge_node_ids": ["node_select_edge_0", "node_select_edge_1", "node_select_edge_2", "node_select_edge_3"] - }, - "inputs": ["node_for_solid", "node_select_edge_0", "node_select_edge_1", "node_select_edge_2", "node_select_edge_3"], - "output_count": 1 -} -``` - -Each QL-selected or indexed getter-selected edge is serialized as its own `make_select_redge` node whose `geo_selector` is fixed to the runtime-selected edge geometry. `geo_selector` does not contain tags or source indices; it uses geometry facts such as `geom_type`, `length`, `center`, endpoints, bbox, and `metadata_geo`. - -Replay edge resolution order: - -1. Geo select nodes from `selected_edge_node_ids` -2. Legacy/fallback `selection_query`, when present -3. Explicit topo refs in `selected_edges` -4. Legacy indices in `selected_edge_indices`, when select nodes are unavailable -5. `selector_hint` fallback - -Then replay calls `fillet_rsolid(solid, resolved_edges, radius)`. - -## Chamfer - -Source: - -```python -selector = Q.edges().order_by(Q.center_axis("z"), desc=True).take(4) -result = scad.chamfer_rsolid(solid, selector, 0.15) -``` - -Serialized node shape is the same as fillet, except: - -```json -{ - "op": "make_chamfer_rsolid", - "params": { - "distance": 0.15, - "edge_count": 4, - "selected_edges": [...], - "selected_edge_node_ids": [...] - }, - "inputs": ["node_for_solid", "node_select_edge_0", "..."] -} -``` - -Replay resolves edges using the same order and calls `chamfer_rsolid(solid, resolved_edges, distance)`. - -## Shell - -Source: - -```python -selector = Q.faces().order_by(Q.center_axis("z"), desc=True).take(1).exactly(1) -result = scad.shell_rsolid(solid, selector, 0.25) -``` - -Serialized node: - -```json -{ - "op": "make_shell_rsolid", - "params": { - "thickness": 0.25, - "removed_face_count": 1, - "selected_faces": [...], - "selected_face_node_ids": ["node_select_face_0"] - }, - "inputs": ["node_for_solid", "node_select_face_0"], - "output_count": 1 -} -``` - -The face select node uses `make_select_rface` with a tag-free `geo_selector` fixed to the runtime-selected face geometry. - -Replay face resolution order: - -1. Geo select nodes from `selected_face_node_ids` -2. Legacy/fallback `selection_query`, when present -3. Explicit topo refs in `selected_faces` -4. Legacy indices in `selected_face_indices`, when select nodes are unavailable -5. `selector_hint` fallback - -Then replay calls `shell_rsolid(solid, resolved_faces, thickness)`. - -## Linear pattern macro lowering - -Source: - -```python -copies = scad.linear_pattern_rsolidlist(seed, (1, 0, 0), count=3, spacing=2.0) -``` - -When recording is active, this does not emit a `linear_pattern` node. It emits one translate node per generated copy: - -```text -seed -> make_translate_rshape(vector=[0, 0, 0]) -seed -> make_translate_rshape(vector=[2, 0, 0]) -seed -> make_translate_rshape(vector=[4, 0, 0]) -``` - -Replay effect: each generated copy is replayed as an ordinary translated shape. - -## Radial pattern macro lowering - -Source: - -```python -copies = scad.radial_pattern_rsolidlist( - seed, - center=(0, 0, 0), - axis=(0, 0, 1), - count=4, - total_rotation_angle=360.0, -) -``` - -When recording is active, this emits explicit rotate nodes for non-zero rotations. The zero-angle first copy is the original shape and does not create a rotate node. - -```text -seed retained as first copy -seed -> make_rotate_rshape(angle=90) -seed -> make_rotate_rshape(angle=180) -seed -> make_rotate_rshape(angle=270) -``` - -Replay effect: copies are ordinary rotate operations, not a pattern macro. diff --git a/skills/simplecadapi/references/docs/core/serialization/primitives-and-profiles.md b/skills/simplecadapi/references/docs/core/serialization/primitives-and-profiles.md deleted file mode 100644 index aad091b5..00000000 --- a/skills/simplecadapi/references/docs/core/serialization/primitives-and-profiles.md +++ /dev/null @@ -1,465 +0,0 @@ -# Primitive and Profile Operation Serialization - -This guide covers replayable primitive/profile operations in the canonical operation graph. - -All examples assume: - -```python -import json -import simplecadapi as scad - -with scad.GraphSession() as session: - ... - -payload = json.loads(scad.export_model_json(session)) -``` - -In exported JSON, each operation appears in `payload["graph"]["nodes"]` as: - -```json -{ - "node_id": "node_xxxxxxxx", - "op": "make_line_redge", - "params": {...}, - "inputs": [], - "output_count": 1, - "tags": [...], - "display": {...}, - "param_exprs": {...}, - "context": {...} -} -``` - -`display`, `tags`, `context`, `semantic_delta`, and `topo_delta` are useful metadata. Replay primarily depends on `op`, `params`, and `inputs`. - -## Point - -Source: - -```python -p = scad.make_point_rvertex(1.0, 2.0, 3.0) -``` - -Serialized node: - -```json -{ - "op": "make_point_rvertex", - "params": {"x": 1.0, "y": 2.0, "z": 3.0}, - "inputs": [], - "output_count": 1 -} -``` - -Replay effect: calls `make_point_rvertex(x, y, z)` and returns a `Vertex`. - -## Line edge - -Source: - -```python -edge = scad.make_line_redge((0, 0, 0), (5, 0, 0)) -``` - -Serialized node: - -```json -{ - "op": "make_line_redge", - "params": {"start": [0.0, 0.0, 0.0], "end": [5.0, 0.0, 0.0]}, - "inputs": [], - "output_count": 1 -} -``` - -Replay effect: calls `make_line_redge(start, end)` and returns an `Edge`. - -### Segment aliases - -`make_segment_redge(start, end)` is an alias of `make_line_redge(...)` and records the same `make_line_redge` node. - -`make_segment_rwire(start, end)` lowers to: - -1. `make_line_redge` -2. `make_wire_from_edges_rwire` - -There is no canonical `make_segment_wire` node in model JSON. - -## Circle edge, wire, and face - -Source edge: - -```python -edge = scad.make_circle_redge((0, 0, 0), 2.0, normal=(0, 0, 1)) -``` - -Serialized node: - -```json -{ - "op": "make_circle_redge", - "params": { - "center": [0.0, 0.0, 0.0], - "radius": 2.0, - "normal": [0.0, 0.0, 1.0] - }, - "inputs": [], - "output_count": 1 -} -``` - -Replay effect: calls `make_circle_redge(center, radius, normal)`. - -Source wire: - -```python -wire = scad.make_circle_rwire((0, 0, 0), 2.0) -``` - -Lowered serialized graph: - -```text -make_circle_redge -> make_wire_from_edges_rwire -``` - -Source face: - -```python -face = scad.make_circle_rface((0, 0, 0), 2.0) -``` - -Lowered serialized graph: - -```text -make_circle_redge -> make_wire_from_edges_rwire -> make_face_from_wire_rface -``` - -There is no canonical `make_circle_wire` or `make_circle_face` node. - -## Three-point arc edge and wire - -Source edge: - -```python -arc = scad.make_three_point_arc_redge( - (0, 0, 0), - (1, 1, 0), - (2, 0, 0), -) -``` - -Serialized node: - -```json -{ - "op": "make_three_point_arc_redge", - "params": { - "start": [0.0, 0.0, 0.0], - "middle": [1.0, 1.0, 0.0], - "end": [2.0, 0.0, 0.0] - }, - "inputs": [], - "output_count": 1 -} -``` - -Replay effect: calls `make_three_point_arc_redge(start, middle, end)`. - -`make_three_point_arc_rwire(...)` lowers to: - -```text -make_three_point_arc_redge -> make_wire_from_edges_rwire -``` - -## Angle arc edge and wire - -Source edge: - -```python -arc = scad.make_angle_arc_redge( - center=(0, 0, 0), - radius=1.0, - start_angle=0.0, - end_angle=1.57, - normal=(0, 0, 1), -) -``` - -Serialized node: - -```json -{ - "op": "make_angle_arc_redge", - "params": { - "center": [0.0, 0.0, 0.0], - "radius": 1.0, - "start_angle": 0.0, - "end_angle": 1.57, - "normal": [0.0, 0.0, 1.0] - }, - "inputs": [], - "output_count": 1 -} -``` - -Replay effect: calls `make_angle_arc_redge(center, radius, start_angle, end_angle, normal)`. - -`make_angle_arc_rwire(...)` lowers to: - -```text -make_angle_arc_redge -> make_wire_from_edges_rwire -``` - -## Spline edge and wire - -Source edge: - -```python -fit = scad.fit_cubic_bspline_control_points( - [(0, 0, 0), (1, 1, 0), (2, 0, 0)], - tolerance=0.01, -) -spline = scad.make_spline_redge( - control_points=fit.control_points, - knots=fit.unique_knots, - multiplicities=fit.multiplicities, -) -``` - -Serialized node: - -```json -{ - "op": "make_spline_redge", - "params": { - "control_points": [[0.0, 0.0, 0.0], [0.6, 1.0, 0.0], [1.4, 1.0, 0.0], [2.0, 0.0, 0.0]], - "degree": 3, - "knots": [0.0, 1.0], - "multiplicities": [4, 4], - "weights": null, - "periodic": false - }, - "inputs": [], - "output_count": 1 -} -``` - -Replay effect: calls `make_spline_redge(control_points=..., degree=..., knots=..., multiplicities=..., weights=..., periodic=...)`. - -`make_spline_rwire(control_points=..., ...)` lowers to: - -```text -make_spline_redge -> make_wire_from_edges_rwire -``` - -`make_spline_redge` now stores an exact B-spline definition. It does not accept sampled/interpolated curve points directly; use `fit_cubic_bspline_control_points(...)` first when human/LLM-authored code starts from samples. - -## Helix edge and wire - -Source edge: - -```python -helix = scad.make_helix_redge( - pitch=0.7, - height=2.2, - radius=0.9, - center=(0, 0, 0), - dir=(0, 0, 1), -) -``` - -Serialized node: - -```json -{ - "op": "make_helix_redge", - "params": { - "pitch": 0.7, - "height": 2.2, - "radius": 0.9, - "center": [0.0, 0.0, 0.0], - "dir": [0.0, 0.0, 1.0] - }, - "inputs": [], - "output_count": 1 -} -``` - -Replay effect: calls `make_helix_redge(pitch, height, radius, center, dir)`. - -`make_helix_rwire(...)` lowers to: - -```text -make_helix_redge -> make_wire_from_edges_rwire -``` - -## Wire from edges - -Source: - -```python -a = scad.make_line_redge((0, 0, 0), (1, 0, 0)) -b = scad.make_line_redge((1, 0, 0), (1, 1, 0)) -wire = scad.make_wire_from_edges_rwire([a, b]) -``` - -Serialized node: - -```json -{ - "op": "make_wire_from_edges_rwire", - "params": {"edge_count": 2}, - "inputs": ["node_for_a", "node_for_b"], - "output_count": 1 -} -``` - -Replay effect: - -1. Replay each input edge node. -2. Collect input edge outputs in input order. -3. Call `make_wire_from_edges_rwire(edges)`. - -The actual edge geometry is not duplicated inside this node; it is recovered through `inputs`. - -## Face from wire - -Source: - -```python -face = scad.make_face_from_wire_rface(wire, normal=(0, 0, 1)) -``` - -Serialized node: - -```json -{ - "op": "make_face_from_wire_rface", - "params": {"normal": [0.0, 0.0, 1.0]}, - "inputs": ["node_for_wire"], - "output_count": 1 -} -``` - -Replay effect: - -1. Replay the input wire node. -2. Call `make_face_from_wire_rface(wire, normal=...)`. - -## Rectangle wire and face lowering - -Source: - -```python -wire = scad.make_rectangle_rwire(4.0, 2.0, center=(0, 0, 0)) -face = scad.make_rectangle_rface(4.0, 2.0, center=(0, 0, 0)) -``` - -Lowered serialized graph: - -```text -make_rectangle_rwire: - make_line_redge x4 -> make_wire_from_edges_rwire - -make_rectangle_rface: - make_line_redge x4 -> make_wire_from_edges_rwire -> make_face_from_wire_rface -``` - -There is no canonical `make_rectangle_wire` or `make_rectangle_face` node. - -## Polyline wire lowering - -Source: - -```python -wire = scad.make_polyline_rwire( - [(0, 0, 0), (1, 0, 0), (1, 1, 0)], - closed=False, -) -``` - -Lowered serialized graph: - -```text -make_line_redge x(number_of_segments) -> make_wire_from_edges_rwire -``` - -If `closed=True`, one additional closing line edge is emitted. - -There is no canonical `make_polyline_wire` node. - -## Box, cylinder, sphere, and cone lowering - -These user-facing primitive solids are intentionally lowered to canonical profile/feature operations. - -### Box - -Source: - -```python -box = scad.make_box_rsolid(4.0, 2.0, 1.0) -``` - -Lowered serialized graph: - -```text -make_line_redge x4 - -> make_wire_from_edges_rwire - -> make_face_from_wire_rface - -> make_extrude_rsolid -``` - -Replay effect: rebuilds the rectangular face, then extrudes it. - -There is no canonical `make_box` node. - -### Cylinder - -Source: - -```python -cyl = scad.make_cylinder_rsolid(1.0, 3.0) -``` - -Lowered serialized graph: - -```text -make_circle_redge - -> make_wire_from_edges_rwire - -> make_face_from_wire_rface - -> make_extrude_rsolid -``` - -There is no canonical `make_cylinder` node. - -### Sphere - -Source: - -```python -sphere = scad.make_sphere_rsolid(1.5, center=(0, 0, 0)) -``` - -Lowered serialized graph: - -```text -profile edges/wire/face -> make_revolve_rsolid -``` - -There is no canonical `make_sphere` node. - -### Cone / truncated cone - -Source: - -```python -cone = scad.make_cone_rsolid(1.2, 2.0, top_radius=0.4) -``` - -Lowered serialized graph: - -```text -profile edges/wire/face -> make_revolve_rsolid -``` - -There is no canonical `make_cone` node. diff --git a/skills/simplecadapi/references/docs/core/serialization/scalar-fields.md b/skills/simplecadapi/references/docs/core/serialization/scalar-fields.md deleted file mode 100644 index 7d2784e8..00000000 --- a/skills/simplecadapi/references/docs/core/serialization/scalar-fields.md +++ /dev/null @@ -1,13 +0,0 @@ -# Scalar Fields / SDF Status - -SDF and scalar field modeling are temporarily removed from the supported SimpleCADAPI surface. - -Current contract: - -- `simplecadapi.field` is not exported. -- `make_field_surface_rsolid` is not exported. -- `*_rscalarfield` APIs are not generated in public API docs. -- `make_field_surface_rsolid` is not a canonical graph op. -- Model JSON replay does not rebuild scalar field surfaces. - -Historical payloads or examples that rely on scalar field trees should be treated as unsupported until a new SDF contract is designed. diff --git a/skills/simplecadapi/references/docs/core/shell.md b/skills/simplecadapi/references/docs/core/shell.md deleted file mode 100644 index d8d570b3..00000000 --- a/skills/simplecadapi/references/docs/core/shell.md +++ /dev/null @@ -1,46 +0,0 @@ -# Shell - -## Overview - -`Shell` is the public wrapper for one connected set of faces. A shell may be open, such as a lofted side wall, or closed, such as a sewn surface boundary. It wraps an OCP `TopoDS_Shell` and participates in SimpleCAD tags, metadata, QL selection, transforms, and graph replay. - -## Topology and Properties - -- `get_faces(index=None)` returns all faces or one indexed face. -- `get_wires(index=None)` returns the Shell's free boundary wires. -- `get_edges(index=None)` returns unique edges across the shell faces. -- `get_area()` returns total face area. -- `is_closed()` reports whether the shell has no free boundary. -- `free_boundaries_rwirelist(shell)` returns the open boundary loops. -- `ql.shells()` selects shells from a shell or compatible topology scope. - -## Construction - -Use the public surface operations rather than constructing `Shell` from an OCP object directly: - -- [`loft_rshell`](../api/loft_rshell.md) lofts through Wire sections with optional Vertex endpoints and can name the start/end boundary Wires and side Faces. -- [`sew_faces_rshell`](../api/sew_faces_rshell.md) sews connected faces into one shell. -- [`fill_holes_rshell`](../api/fill_holes_rshell.md) fills every free boundary loop. -- [`make_solid_from_shell_rsolid`](../api/make_solid_from_shell_rsolid.md) converts one valid closed shell into an oriented solid. - -```python -import simplecadapi as scad - -lower = scad.make_circle_rwire((0, 0, 0), 2.0) -upper = scad.make_circle_rwire((0, 0, 5), 1.0) - -open_shell = scad.loft_rshell( - [lower, upper], - start_wire_tag="anchor.inlet", - end_wire_tag="anchor.outlet", - side_faces_tag="group.skin", -) -assert not open_shell.is_closed() -assert len(open_shell.get_wires()) == 2 -assert len(scad.ql.wires().where(scad.ql.tag("anchor.inlet")).resolve(open_shell)) == 1 - -closed_shell = scad.fill_holes_rshell(open_shell) -assert closed_shell.is_closed() -``` - -Use [`shell_rsolid`](../api/shell_rsolid.md) for the different operation that hollows a `Solid` by offsetting walls and removing selected faces. diff --git a/skills/simplecadapi/references/docs/core/simple_workplane.md b/skills/simplecadapi/references/docs/core/simple_workplane.md deleted file mode 100644 index 7d95b97a..00000000 --- a/skills/simplecadapi/references/docs/core/simple_workplane.md +++ /dev/null @@ -1,45 +0,0 @@ -# SimpleWorkplane - -`SimpleWorkplane` is a context manager for modeling in a temporary local coordinate frame. - -## Public constructor - -```python -SimpleWorkplane( - origin=(0, 0, 0), - normal=(0, 0, 1), - x_dir=(1, 0, 0), -) -``` - -## Main capabilities - -- Push a local coordinate frame for nested modeling operations. -- Automatically restore the previous frame when the context exits. -- Keep the public API shape-first: functions still return `Vertex`, `Edge`, `Wire`, `Face`, and `Solid` objects. -- Resolve point parameters relative to the active frame and vector parameters without applying frame translation. -- Compose nested workplanes as a chain: each child `origin`, `normal`, and `x_dir` is expressed in its parent frame. -- Record the fully composed frame on each `GraphSession` node so model JSON replay reproduces the same geometry outside the original context managers. -- Keep existing shape inputs in global coordinates. Entering a workplane does not move a shape; only the operation's point and vector parameters use the active frame. -- Bind declarative sketches to their creation frame, so they can be promoted after the workplane exits without changing position. - -## Example - -```python -import simplecadapi as scad - -with scad.SimpleWorkplane( - origin=(10, 20, 30), - normal=(0, 1, 0), - x_dir=(1, 0, 0), -): - with scad.SimpleWorkplane( - origin=(2, 3, 4), - normal=(1, 0, 0), - x_dir=(0, 1, 0), - ): - box = scad.make_box_rsolid(2, 4, 6) - moved = scad.translate_shape(box, (0, 0, 2)) - -print(moved.get_volume()) -``` diff --git a/skills/simplecadapi/references/docs/core/solid.md b/skills/simplecadapi/references/docs/core/solid.md deleted file mode 100644 index e36b57e5..00000000 --- a/skills/simplecadapi/references/docs/core/solid.md +++ /dev/null @@ -1,726 +0,0 @@ -# Solid - -## Overview - -`Solid` is the solid class in the SimpleCAD API, representing a 3D closed geometry. Solids have volume and are one of the most important geometry types in CAD modeling. It wraps the OCP Solid object and adds tagging functionality and automatic face tagging capability. - -## Class Definition - -```python -class Solid(TaggedMixin): - """Solid class that wraps OCP's Solid and adds tag functionality""" -``` - -## Inheritance - -- Inherits from `TaggedMixin`, providing tag and metadata functionality - -## Usage - -- Represent 3D solid objects -- Perform boolean operations (union, intersection, difference) -- Apply feature operations (fillets, chamfers, etc.) -- Calculate physical properties such as volume and surface area -- Generate manufacturing data - -## Constructor - -### `__init__(wrapped)` - -Initializes a solid object. - -**Parameters:** -- `wrapped` (Union[OCP TopoDS_Solid, Any]): A OCP solid object or other Shape object - -**Raises:** -- `ValueError`: When the input solid object is invalid - -**Example:** -```python -from simplecadapi import ( - make_box_rsolid, - make_cylinder_rsolid, - make_sphere_rsolid -) - -# Create solids through the SimpleCAD functions -box = make_box_rsolid(width=5, height=3, depth=2) -cylinder = make_cylinder_rsolid(center=(0, 0, 0), radius=2, height=4) -sphere = make_sphere_rsolid(center=(0, 0, 0), radius=1.5) -``` - -## Main Properties - -- `wrapped`: The underlying OCP solid object -- `_tags`: Tag set (inherited from TaggedMixin) -- `_metadata`: Metadata dictionary (inherited from TaggedMixin) -- `_face_tags`: Face tag dictionary (internal use) - -## Common Methods - -### `get_volume()` - -Get the volume of the solid. - -**Returns:** -- `float`: The volume of the solid - -**Raises:** -- `ValueError`: When volume retrieval fails - -**Example:** -```python -from simplecadapi import make_box_rsolid, make_cylinder_rsolid, make_sphere_rsolid -import math - -# Box volume -box = make_box_rsolid(width=2, height=3, depth=4) -box_volume = box.get_volume() -print(f"Box volume: {box_volume}") # 24.0 - -# Cylinder volume -cylinder = make_cylinder_rsolid(center=(0, 0, 0), radius=2, height=5) -cylinder_volume = cylinder.get_volume() -expected_volume = math.pi * 2**2 * 5 -print(f"Cylinder volume: {cylinder_volume:.3f}, expected: {expected_volume:.3f}") - -# Sphere volume -sphere = make_sphere_rsolid(center=(0, 0, 0), radius=1.5) -sphere_volume = sphere.get_volume() -expected_volume = (4/3) * math.pi * 1.5**3 -print(f"Sphere volume: {sphere_volume:.3f}, expected: {expected_volume:.3f}") -``` - -### `get_faces()` - -Get all faces that make up the solid. - -**Returns:** -- `List[Face]`: List of face objects - -**Raises:** -- `ValueError`: When face list retrieval fails - -**Example:** -```python -from simplecadapi import make_box_rsolid - -box = make_box_rsolid(width=4, height=3, depth=2) -faces = box.get_faces() - -print(f"The box has {len(faces)} faces") -for i, face in enumerate(faces): - area = face.get_area() - print(f"Face {i}: area {area:.3f}") -``` - -### `get_faces(index)` - -Get one face by explicit index. In an active `GraphSession`, this intentional -indexed pick is preserved as a graph geo select node. - -**Returns:** -- `Face`: The selected face object - -**Example:** -```python -from simplecadapi import make_box_rsolid - -box = make_box_rsolid(width=4, height=3, depth=2) -first_face = box.get_faces(0) -print(first_face.get_area()) -``` - -### `get_edges()` - -Get all edges that make up the solid. - -**Returns:** -- `List[Edge]`: List of edge objects - -**Raises:** -- `ValueError`: When edge list retrieval fails - -**Example:** -```python -from simplecadapi import make_box_rsolid - -box = make_box_rsolid(width=4, height=3, depth=2) -edges = box.get_edges() - -print(f"The box has {len(edges)} edges") -for i, edge in enumerate(edges): - length = edge.get_length() - print(f"Edge {i}: length {length:.3f}") -``` - -### `get_edges(index)` - -Get one edge by explicit index. In an active `GraphSession`, this intentional -indexed pick is preserved as a graph geo select node. - -**Returns:** -- `Edge`: The selected edge object - -**Example:** -```python -from simplecadapi import make_box_rsolid - -box = make_box_rsolid(width=4, height=3, depth=2) -first_edge = box.get_edges(0) -print(first_edge.get_length()) -``` - -### `auto_tag_faces(geometry_type)` - -Automatically add tags to faces. - -**Parameters:** -- `geometry_type` (str): Geometry type ("box", "cylinder", "sphere", "unknown") - -**Example:** -```python -from simplecadapi import make_box_rsolid, make_cylinder_rsolid - -# Box face tagging -box = make_box_rsolid(width=4, height=3, depth=2) -box.auto_tag_faces("box") - -faces = box.get_faces() -for face in faces: - print(f"Face tags: {list_tags(face)}") - -# Cylinder face tagging -cylinder = make_cylinder_rsolid(center=(0, 0, 0), radius=2, height=4) -cylinder.auto_tag_faces("cylinder") - -faces = cylinder.get_faces() -for face in faces: - print(f"Face tags: {list_tags(face)}") -``` - -### Tagging and Metadata - -Use the functional public API `apply_tag(shape, tag)` and `list_tags(shape)` for tags. Use `set_metadata(key, value)` and `get_metadata(key, default=None)` for structured metadata. - -## Usage Examples - -### Creating and Analyzing Basic Solids - -```python -from simplecadapi import ( - make_box_rsolid, - make_cylinder_rsolid, - make_sphere_rsolid -) - -def create_basic_solids(): - """Create and analyze basic solids""" - - # Create different types of solids - solids = [ - ("box", make_box_rsolid(width=4, height=3, depth=2)), - ("cylinder", make_cylinder_rsolid(center=(0, 0, 0), radius=2, height=4)), - ("sphere", make_sphere_rsolid(center=(0, 0, 0), radius=1.5)) - ] - - for name, solid in solids: - # Add basic tags - apply_tag(solid, name) - apply_tag(solid, "basic_geometry") - - # Auto-tag faces - solid.auto_tag_faces(name) - - # Get geometric properties - volume = solid.get_volume() - faces = solid.get_faces() - edges = solid.get_edges() - - # Compute surface area - total_surface_area = sum(face.get_area() for face in faces) - - # Analyze face distribution - face_areas = [face.get_area() for face in faces] - min_face_area = min(face_areas) - max_face_area = max(face_areas) - avg_face_area = sum(face_areas) / len(face_areas) - - # Store metadata - solid.set_metadata("volume", volume) - solid.set_metadata("surface_area", total_surface_area) - solid.set_metadata("face_count", len(faces)) - solid.set_metadata("edge_count", len(edges)) - solid.set_metadata("min_face_area", min_face_area) - solid.set_metadata("max_face_area", max_face_area) - solid.set_metadata("avg_face_area", avg_face_area) - - # Compute volume efficiency (volume/surface-area ratio) - volume_efficiency = volume / total_surface_area if total_surface_area > 0 else 0 - solid.set_metadata("volume_efficiency", volume_efficiency) - - print(f"{name.upper()} solid analysis:") - print(f" Volume: {volume:.3f}") - print(f" Surface area: {total_surface_area:.3f}") - print(f" Face count: {len(faces)}") - print(f" Edge count: {len(edges)}") - print(f" Volume efficiency: {volume_efficiency:.3f}") - print(f" Area range: {min_face_area:.3f} - {max_face_area:.3f}") - print() - -create_basic_solids() -``` - -### Boolean Operations Example - -```python -from simplecadapi import ( - make_box_rsolid, - make_cylinder_rsolid, - union_rsolid, - cut_rsolid, - intersect_rsolid -) - -def boolean_operations_example(): - """Boolean operations example""" - - # Create base geometries - box = make_box_rsolid(width=6, height=4, depth=3) - apply_tag(box, "base_box") - - cylinder = make_cylinder_rsolid(center=(3, 2, 0), radius=1, height=5) - apply_tag(cylinder, "cutting_cylinder") - - # Union operation - union_result = union_rsolid(box, cylinder) - apply_tag(union_result, "union_result") - apply_tag(union_result, "combined_geometry") - - # Difference operation (subtract the cylinder from the box) - cut_result = cut_rsolid(box, cylinder)[0] - apply_tag(cut_result, "cut_result") - apply_tag(cut_result, "with_hole") - - # Intersection operation - intersect_result = intersect_rsolid(box, cylinder)[0] - apply_tag(intersect_result, "intersect_result") - apply_tag(intersect_result, "common_volume") - - # Analyze results - operations = [ - ("original box", box), - ("original cylinder", cylinder), - ("union", union_result), - ("difference", cut_result), - ("intersection", intersect_result) - ] - - for name, solid in operations: - volume = solid.get_volume() - faces = solid.get_faces() - surface_area = sum(face.get_area() for face in faces) - - solid.set_metadata("operation_type", name) - solid.set_metadata("volume", volume) - solid.set_metadata("surface_area", surface_area) - - print(f"{name}:") - print(f" Volume: {volume:.3f}") - print(f" Surface area: {surface_area:.3f}") - print(f" Face count: {len(faces)}") - print(f" Tags: {list_tags(solid)}") - print() - -boolean_operations_example() -``` - -### Feature Operations Example - -```python -from simplecadapi import ( - make_box_rsolid, - fillet_rsolid, - chamfer_rsolid, - select_edges_by_tag -) - -def feature_operations_example(): - """Feature operations example""" - - # Create the base box - base_box = make_box_rsolid(width=8, height=6, depth=4) - apply_tag(base_box, "base_geometry") - base_box.auto_tag_faces("box") - - # Analyze the original geometry - original_volume = base_box.get_volume() - original_faces = base_box.get_faces() - original_edges = base_box.get_edges() - - print(f"Original geometry:") - print(f" Volume: {original_volume:.3f}") - print(f" Face count: {len(original_faces)}") - print(f" Edge count: {len(original_edges)}") - print() - - # Fillet operation - try: - filleted_box = fillet_rsolid(base_box, radius=0.5) - apply_tag(filleted_box, "filleted") - apply_tag(filleted_box, "rounded_edges") - - filleted_volume = filleted_box.get_volume() - filleted_faces = filleted_box.get_faces() - filleted_edges = filleted_box.get_edges() - - filleted_box.set_metadata("original_volume", original_volume) - filleted_box.set_metadata("volume_change", filleted_volume - original_volume) - filleted_box.set_metadata("volume_ratio", filleted_volume / original_volume) - - print(f"After fillet:") - print(f" Volume: {filleted_volume:.3f}") - print(f" Volume change: {filleted_volume - original_volume:.3f}") - print(f" Face count: {len(filleted_faces)}") - print(f" Edge count: {len(filleted_edges)}") - print() - - except Exception as e: - print(f"Fillet failed: {e}") - filleted_box = None - - # Chamfer operation - try: - chamfered_box = chamfer_rsolid(base_box, distance=0.3) - apply_tag(chamfered_box, "chamfered") - apply_tag(chamfered_box, "beveled_edges") - - chamfered_volume = chamfered_box.get_volume() - chamfered_faces = chamfered_box.get_faces() - chamfered_edges = chamfered_box.get_edges() - - chamfered_box.set_metadata("original_volume", original_volume) - chamfered_box.set_metadata("volume_change", chamfered_volume - original_volume) - chamfered_box.set_metadata("volume_ratio", chamfered_volume / original_volume) - - print(f"After chamfer:") - print(f" Volume: {chamfered_volume:.3f}") - print(f" Volume change: {chamfered_volume - original_volume:.3f}") - print(f" Face count: {len(chamfered_faces)}") - print(f" Edge count: {len(chamfered_edges)}") - print() - - except Exception as e: - print(f"Chamfer failed: {e}") - chamfered_box = None - - # Compare results - results = [("original", base_box)] - if filleted_box: - results.append(("fillet", filleted_box)) - if chamfered_box: - results.append(("chamfer", chamfered_box)) - - print("Feature operation comparison:") - for name, solid in results: - volume = solid.get_volume() - faces = solid.get_faces() - tags = list_tags(solid) - print(f" {name}: volume={volume:.3f}, face count={len(faces)}, tags={tags}") - -feature_operations_example() -``` - -### Creating Complex Geometry - -```python -from simplecadapi import ( - make_box_rsolid, - make_cylinder_rsolid, - make_sphere_rsolid, - union_rsolid, - cut_rsolid, - translate_shape, - rotate_shape -) - -def create_complex_geometry(): - """Create complex geometry""" - - # Create the main body - main_body = make_box_rsolid(width=12, height=8, depth=6) - apply_tag(main_body, "main_body") - apply_tag(main_body, "base_structure") - - # Create cylindrical holes - holes = [] - hole_positions = [(3, 2, 0), (9, 2, 0), (3, 6, 0), (9, 6, 0)] - - for i, (x, y, z) in enumerate(hole_positions): - hole = make_cylinder_rsolid(center=(x, y, z), radius=0.8, height=8) - apply_tag(hole, f"hole_{i}") - apply_tag(hole, "mounting_hole") - holes.append(hole) - - # Create a spherical feature - sphere_feature = make_sphere_rsolid(center=(6, 4, 6), radius=2) - apply_tag(sphere_feature, "sphere_feature") - apply_tag(sphere_feature, "decorative") - - # Create a cylindrical support - support_cylinder = make_cylinder_rsolid(center=(6, 4, 0), radius=1, height=4) - apply_tag(support_cylinder, "support_cylinder") - apply_tag(support_cylinder, "structural") - - # Combine geometries - complex_solid = union_rsolid(main_body, sphere_feature) - complex_solid = union_rsolid(complex_solid, support_cylinder) - - # Subtract holes - for hole in holes: - complex_solid = cut_rsolid(complex_solid, hole)[0] - - # Tag the complex solid - apply_tag(complex_solid, "complex_geometry") - apply_tag(complex_solid, "multi_feature") - apply_tag(complex_solid, "machined_part") - - # Analyze the complex solid - volume = complex_solid.get_volume() - faces = complex_solid.get_faces() - edges = complex_solid.get_edges() - - # Compute geometric complexity - face_count = len(faces) - edge_count = len(edges) - complexity_ratio = edge_count / face_count if face_count > 0 else 0 - - # Analyze face distribution - face_areas = [face.get_area() for face in faces] - total_surface_area = sum(face_areas) - - # Classify faces - small_faces = [f for f in faces if f.get_area() < 1.0] - large_faces = [f for f in faces if f.get_area() > 10.0] - medium_faces = [f for f in faces if 1.0 <= f.get_area() <= 10.0] - - # Store analysis results - complex_solid.set_metadata("volume", volume) - complex_solid.set_metadata("surface_area", total_surface_area) - complex_solid.set_metadata("face_count", face_count) - complex_solid.set_metadata("edge_count", edge_count) - complex_solid.set_metadata("complexity_ratio", complexity_ratio) - complex_solid.set_metadata("small_face_count", len(small_faces)) - complex_solid.set_metadata("medium_face_count", len(medium_faces)) - complex_solid.set_metadata("large_face_count", len(large_faces)) - - # Add complexity tags - if complexity_ratio < 5: - apply_tag(complex_solid, "simple_topology") - elif complexity_ratio < 10: - apply_tag(complex_solid, "moderate_topology") - else: - apply_tag(complex_solid, "complex_topology") - - print(f"Complex geometry analysis:") - print(f" Volume: {volume:.3f}") - print(f" Surface area: {total_surface_area:.3f}") - print(f" Face count: {face_count}") - print(f" Edge count: {edge_count}") - print(f" Complexity ratio: {complexity_ratio:.2f}") - print(f" Face distribution - small:{len(small_faces)}, medium:{len(medium_faces)}, large:{len(large_faces)}") - print(f" Tags: {list_tags(complex_solid)}") - - return complex_solid - -complex_geometry = create_complex_geometry() -``` - -### Solid Quality Analysis - -```python -from simplecadapi import make_box_rsolid, make_cylinder_rsolid, make_sphere_rsolid - -def analyze_solid_quality(): - """Analyze solid quality""" - - # Create test solids - test_solids = [ - ("small_box", make_box_rsolid(width=1, height=1, depth=1)), - ("large_box", make_box_rsolid(width=10, height=10, depth=10)), - ("thin_box", make_box_rsolid(width=10, height=10, depth=0.1)), - ("cylinder", make_cylinder_rsolid(center=(0, 0, 0), radius=2, height=5)), - ("sphere", make_sphere_rsolid(center=(0, 0, 0), radius=2)) - ] - - for name, solid in test_solids: - apply_tag(solid, name) - apply_tag(solid, "test_geometry") - - # Basic geometric properties - volume = solid.get_volume() - faces = solid.get_faces() - edges = solid.get_edges() - - # Compute quality metrics - surface_area = sum(face.get_area() for face in faces) - volume_to_surface_ratio = volume / surface_area if surface_area > 0 else 0 - - # Analyze topology complexity - face_count = len(faces) - edge_count = len(edges) - euler_characteristic = None # the simplified version does not compute the Euler characteristic - - # Face area distribution analysis - face_areas = [face.get_area() for face in faces] - if face_areas: - min_area = min(face_areas) - max_area = max(face_areas) - area_ratio = max_area / min_area if min_area > 0 else float('inf') - else: - min_area = max_area = area_ratio = 0 - - # Quality assessment - quality_score = 0 - quality_issues = [] - - # Volume check - if volume > 1e-6: - quality_score += 20 - else: - quality_issues.append("extremely small volume") - - # Face count check - if 4 <= face_count <= 100: - quality_score += 20 - elif face_count > 100: - quality_issues.append("too many faces") - else: - quality_issues.append("abnormal face count") - - # Area ratio check - if area_ratio < 1000: - quality_score += 20 - else: - quality_issues.append("excessive area variation") - - # Volume efficiency check - if volume_to_surface_ratio > 0.1: - quality_score += 20 - else: - quality_issues.append("low volume efficiency") - - # Edge count sanity check - if edge_count < face_count * 10: - quality_score += 20 - else: - quality_issues.append("too many edges") - - # Store quality data - solid.set_metadata("volume", volume) - solid.set_metadata("surface_area", surface_area) - solid.set_metadata("face_count", face_count) - solid.set_metadata("edge_count", edge_count) - solid.set_metadata("volume_to_surface_ratio", volume_to_surface_ratio) - solid.set_metadata("area_ratio", area_ratio) - solid.set_metadata("quality_score", quality_score) - solid.set_metadata("quality_issues", quality_issues) - - # Quality tags - if quality_score >= 80: - apply_tag(solid, "high_quality") - elif quality_score >= 60: - apply_tag(solid, "good_quality") - elif quality_score >= 40: - apply_tag(solid, "acceptable_quality") - else: - apply_tag(solid, "poor_quality") - - print(f"{name.upper()} quality analysis:") - print(f" Volume: {volume:.6f}") - print(f" Surface area: {surface_area:.3f}") - print(f" Face count: {face_count}") - print(f" Edge count: {edge_count}") - print(f" Volume efficiency: {volume_to_surface_ratio:.3f}") - print(f" Area ratio: {area_ratio:.2f}") - print(f" Quality score: {quality_score}/100") - if quality_issues: - print(f" Quality issues: {', '.join(quality_issues)}") - print(f" Quality grade: {[tag for tag in list_tags(solid) if 'quality' in tag]}") - print() - -analyze_solid_quality() -``` - -## String Representation - -```python -from simplecadapi import make_box_rsolid - -box = make_box_rsolid(width=5, height=3, depth=2) -apply_tag(box, "example_box") -box.auto_tag_faces("box") -box.set_metadata("material", "aluminum") - -print(box) -``` - -Output: -``` -Solid: - volume: 30.000 - face_count: 6 - edge_count: 12 - faces: - face_0: - area: 15.000 - normal: [0.000, 0.000, 1.000] - tags: [top] - face_1: - area: 15.000 - normal: [0.000, 0.000, -1.000] - tags: [bottom] - face_2: - area: 10.000 - normal: [0.000, 1.000, 0.000] - tags: [front] - face_3: - area: 10.000 - normal: [0.000, -1.000, 0.000] - tags: [back] - face_4: - area: 6.000 - normal: [1.000, 0.000, 0.000] - tags: [right] - face_5: - area: 6.000 - normal: [-1.000, 0.000, 0.000] - tags: [left] - tags: [example_box] - metadata: - material: aluminum -``` - -## Relationships with Other Geometry - -- **Face (Face)**: Boundary surfaces of a solid -- **Edge (Edge)**: Boundaries of faces -- **Shell (Shell)**: Solids can be decomposed into shells -- **Compound (Compound)**: Multiple solids can form a compound - -## Application Scenarios - -- **Mechanical design**: Part modeling -- **Architectural design**: Building components -- **Product design**: Industrial products -- **3D printing**: Prototype manufacturing -- **Simulation analysis**: Finite element analysis - -## Notes - -- Solids must be closed, valid geometry -- Boolean operations may change the solid's topology -- Complex solids may contain many faces and edges -- Feature operations may fail and require appropriate error handling -- Automatic face tagging depends on geometry regularity -- Solid quality directly affects the success rate and performance of subsequent operations diff --git a/skills/simplecadapi/references/docs/core/tagged_mixin.md b/skills/simplecadapi/references/docs/core/tagged_mixin.md deleted file mode 100644 index 0ba9a047..00000000 --- a/skills/simplecadapi/references/docs/core/tagged_mixin.md +++ /dev/null @@ -1,112 +0,0 @@ -# TaggedMixin - -## Overview - -`TaggedMixin` is the internal semantic binding and metadata mixin used by topology wrappers. Canonical tag ownership is source-preserving `TagBinding` data. `_tags` is only an effective-scope compatibility cache; user code must not treat it as writable truth. - -User code should not call member tag mutators. The public tag API is functional: - -- `apply_tag(shape, tag)` attaches one normalized tag. -- `apply_tag_rselection(scope, targets, tag, ...)` returns an independent semantic view and exposes explicit propagation policies. -- `list_tags(shape, scope=...)` returns tags in deterministic sorted order. -- `explain_tag(shape, tag, scope=...)` preserves binding and producer evidence. -- `select_faces_by_tag(...)`, `select_edges_by_tag(...)`, and QL predicates such as `ql.tag("role.*")` provide selection/query helpers. - -## Tagging Mental Model - -- Tags are normalized lowercase dot-separated semantic tokens. -- Examples: `role.mounting_surface`, `anchor.datum.primary`, `group.fasteners`, `face.top`, `edge.boundary`, `wire.outer`, `solid.boolean.cut`. -- New user assignments default to local topology propagation regardless of prefix. -- Downward inheritance is explicit and computed dynamically; bindings are not copied into every child. -- `effective` means local plus inherited and does not include lineage. -- `lineage` requires complete topology history and only follows derivations allowed by the binding policy. -- Numeric dimensions, measurements, and rich descriptive payloads belong in metadata, not tags. -- Geometry builders store structured geometry facts under `metadata["geo"]`. - -## Public Tag Usage - -```python -import simplecadapi as scad - -box = scad.make_box_rsolid(width=5, height=3, depth=2) -scad.apply_tag(box, "role.bracket") -box.auto_tag_faces("box") - -print(scad.list_tags(box)) -top_faces = [face for face in box.get_faces() if "face.top" in scad.list_tags(face)] -print(len(top_faces)) -``` - -## Explicit Propagation Example - -```python -import simplecadapi as scad - -body = scad.make_box_rsolid(width=10, height=10, depth=2) -tagged = scad.apply_tag_rselection( - scope=body, - targets=[body], - tag="role.mounting_plate", - topology_propagation=scad.TopologyPropagation.DOWNWARD, -) - -face_hits = scad.select_faces_by_tag( - solid=tagged, - tag="role.mounting_plate", - scope=scad.TagScope.INHERITED, -) -edge_hits = scad.select_edges_by_tag( - shape=tagged, - tag="role.mounting_plate", - scope=scad.TagScope.INHERITED, -) - -print(len(face_hits), len(edge_hits)) -``` - -## Auto Tags - -Primitives and modeling operations may attach normalized tags automatically: - -- Primitive tags such as `geom.primitive.box`, `geom.primitive.cylinder`, and `geom.primitive.sphere`. -- Face tags from `auto_tag_faces(...)`, such as `face.top`, `face.bottom`, `face.side`, and `face.surface`. -- Wire tags such as `wire.outer` and `wire.inner`. -- Operation-level categorical tags such as `solid.boolean.cut` may remain local annotations. - -Operation events and source roles are not tags. Proven `preserved`, `modified`, -or `generated` events and `body`/`tool` origins live in typed -`metadata["track"]`. Query them with `ql.operation_event(...)` and -`ql.origin_role(...)`. Missing correspondence remains `coverage="partial"` and -`status="unknown"`; it is never promoted to `generated` by default. - -## Metadata Methods - -`set_metadata(key, value)` and `get_metadata(key, default=None)` remain shape member methods for structured data. - -```python -import simplecadapi as scad - -part = scad.make_box_rsolid(10, 8, 5) -scad.apply_tag(part, "role.housing") -part.set_metadata("material", "6061-T6") -part.set_metadata("part_number", "mp-001-a") - -print(part.get_metadata("material")) -print(part.get_metadata("geo")) -``` - -## QL Queries - -```python -import simplecadapi as scad -from simplecadapi import ql as Q - -body = scad.make_box_rsolid(10, 10, 2) -scad.apply_tag(body, "role.mounting_plate") -body.auto_tag_faces("box") - -top_faces = Q.select(body.get_faces()).where(Q.tag("face.top")).all() -role_faces = Q.select(body.get_faces()).where(Q.tag("role.*", scope="effective")).all() - -print(len(top_faces), len(role_faces)) -``` diff --git a/skills/simplecadapi/references/docs/core/vertex.md b/skills/simplecadapi/references/docs/core/vertex.md deleted file mode 100644 index ac972ec2..00000000 --- a/skills/simplecadapi/references/docs/core/vertex.md +++ /dev/null @@ -1,287 +0,0 @@ -# Vertex - -## Overview - -`Vertex` is the vertex class in SimpleCAD API, representing a point in 3D space. It wraps OCP's Vertex object and adds tag functionality for identifying and managing specific vertices in geometries. - -## Class Definition - -```python -class Vertex(TaggedMixin): - """Vertex class that wraps OCP's Vertex and adds tag functionality""" -``` - -## Inheritance Relationships - -- Inherits from `TaggedMixin`, with tag and metadata functionality - -## Usage - -- Represent points in 3D space -- Serve as building elements for edges, wires, faces, and other geometries -- Provide vertex coordinate information -- Support tag management and queries - -## Constructor - -### `__init__(wrapped)` - -Initialize a vertex object. - -**Parameters:** -- `wrapped` (OCP TopoDS_Vertex): OCP vertex object - -**Exceptions:** -- `ValueError`: Raised when the input vertex object is invalid - -**Example:** -```python -from simplecadapi import make_point_rvertex - -# Create a vertex through the SimpleCAD function -vertex = make_point_rvertex(1.0, 2.0, 3.0) -``` - -## Main Properties - -- `wrapped`: Underlying OCP vertex object -- `_tags`: Tag set (inherited from TaggedMixin) -- `_metadata`: Metadata dictionary (inherited from TaggedMixin) - -## Common Methods - -### `get_coordinates()` - -Get the coordinates of the vertex. - -**Returns:** -- `Tuple[float, float, float]`: Vertex coordinates (x, y, z) - -**Exceptions:** -- `ValueError`: Raised when coordinate retrieval fails - -**Example:** -```python -from simplecadapi import make_point_rvertex - -vertex = make_point_rvertex(1.0, 2.0, 3.0) -coords = vertex.get_coordinates() -print(coords) # (1.0, 2.0, 3.0) -``` - -### Tagging and Metadata - -Use the functional public API `apply_tag(shape, tag)` and `list_tags(shape)` for tags. Use `set_metadata(key, value)` and `get_metadata(key, default=None)` for structured metadata. - -**Example:** -```python -from simplecadapi import apply_tag, list_tags, make_point_rvertex - -vertex = make_point_rvertex(0, 0, 0) -apply_tag(vertex, "role.origin") -apply_tag(vertex, "anchor.reference_point") - -if "role.origin" in list_tags(vertex): - print("This is the origin") -``` - -### Metadata Management Methods - -#### `set_metadata(key, value)` -Set metadata. - -**Example:** -```python -vertex = make_point_rvertex(0, 0, 0) -vertex.set_metadata("created_by", "user_input") -vertex.set_metadata("importance", "high") -``` - -#### `get_metadata(key, default=None)` -Get metadata. - -**Example:** -```python -vertex = make_point_rvertex(0, 0, 0) -vertex.set_metadata("created_by", "user_input") - -creator = vertex.get_metadata("created_by") -print(creator) # "user_input" - -unknown = vertex.get_metadata("unknown_key", "default_value") -print(unknown) # "default_value" -``` - -## Usage Examples - -### Creating and Using Vertices - -```python -from simplecadapi import make_point_rvertex - -# Create vertices -vertex1 = make_point_rvertex(0, 0, 0) -vertex2 = make_point_rvertex(1, 1, 1) - -# Get coordinates -coords1 = vertex1.get_coordinates() -coords2 = vertex2.get_coordinates() - -print(f"Vertex 1 coordinates: {coords1}") # Vertex 1 coordinates: (0.0, 0.0, 0.0) -print(f"Vertex 2 coordinates: {coords2}") # Vertex 2 coordinates: (1.0, 1.0, 1.0) -``` - -### Vertex Tag Management - -```python -from simplecadapi import make_point_rvertex - -# Create key points -origin = make_point_rvertex(0, 0, 0) -corner1 = make_point_rvertex(10, 0, 0) -corner2 = make_point_rvertex(10, 10, 0) -corner3 = make_point_rvertex(0, 10, 0) - -# Add tags -apply_tag(origin, "origin") -apply_tag(origin, "reference") - -apply_tag(corner1, "corner") -apply_tag(corner1, "x_axis") - -apply_tag(corner2, "corner") -apply_tag(corner2, "diagonal") - -apply_tag(corner3, "corner") -apply_tag(corner3, "y_axis") - -# Find all corner points -vertices = [origin, corner1, corner2, corner3] -corners = [v for v in vertices if "corner" in list_tags(v)] - -print(f"Found {len(corners)} corner points") -``` - -### Vertex Classification and Management - -```python -from simplecadapi import make_point_rvertex - -def create_grid_vertices(width, height, spacing): - """Create grid vertices""" - vertices = [] - - for i in range(width + 1): - for j in range(height + 1): - x = i * spacing - y = j * spacing - z = 0 - - vertex = make_point_rvertex(x, y, z) - - # Add position tags - if i == 0 and j == 0: - apply_tag(vertex, "origin") - elif i == 0: - apply_tag(vertex, "left_edge") - elif i == width: - apply_tag(vertex, "right_edge") - - if j == 0: - apply_tag(vertex, "bottom_edge") - elif j == height: - apply_tag(vertex, "top_edge") - - # Add corner tags - if (i == 0 or i == width) and (j == 0 or j == height): - apply_tag(vertex, "corner") - - # Add metadata - vertex.set_metadata("grid_position", (i, j)) - vertex.set_metadata("distance_from_origin", (x*x + y*y)**0.5) - - vertices.append(vertex) - - return vertices - -# Create a 5x3 grid -vertices = create_grid_vertices(5, 3, 1.0) - -# Find specific vertices -corners = [v for v in vertices if "corner" in list_tags(v)] -origin = [v for v in vertices if "origin" in list_tags(v)][0] - -print(f"Total grid vertices: {len(vertices)}") -print(f"Corner count: {len(corners)}") -print(f"Origin coordinates: {origin.get_coordinates()}") -``` - -### Vertex Distance Calculation - -```python -import math -from simplecadapi import make_point_rvertex - -def calculate_distance(vertex1, vertex2): - """Calculate the distance between two vertices""" - coords1 = vertex1.get_coordinates() - coords2 = vertex2.get_coordinates() - - dx = coords2[0] - coords1[0] - dy = coords2[1] - coords1[1] - dz = coords2[2] - coords1[2] - - return math.sqrt(dx*dx + dy*dy + dz*dz) - -# Create vertices -v1 = make_point_rvertex(0, 0, 0) -v2 = make_point_rvertex(3, 4, 0) -v3 = make_point_rvertex(0, 0, 5) - -# Calculate distances -dist12 = calculate_distance(v1, v2) -dist13 = calculate_distance(v1, v3) -dist23 = calculate_distance(v2, v3) - -print(f"Distance from v1 to v2: {dist12}") # 5.0 -print(f"Distance from v1 to v3: {dist13}") # 5.0 -print(f"Distance from v2 to v3: {dist23}") # approx 7.07 -``` - -## String Representation - -```python -from simplecadapi import make_point_rvertex - -vertex = make_point_rvertex(1.234, 5.678, 9.012) -apply_tag(vertex, "test_point") -vertex.set_metadata("created_by", "example") - -print(vertex) -``` - -Output: -``` -Vertex: - coordinates: [1.234, 5.678, 9.012] - tags: [test_point] - metadata: - created_by: example -``` - -## Relationships with Other Geometries - -Vertices are the fundamental elements that compose more complex geometries: - -- **Edge**: Defined by two vertices -- **Wire**: Composed of multiple connected edges, containing multiple vertices -- **Face**: Boundary defined by vertices -- **Solid**: Ultimately composed of vertices - -## Notes - -- Vertex objects wrap OCP's underlying vertices; do not modify coordinates directly -- Tags are of string type and are case-sensitive -- Metadata can store values of any type -- Vertex coordinates are read-only; to modify positions, create new vertices -- Floating-point coordinates may have precision issues; consider tolerance when comparing diff --git a/skills/simplecadapi/references/docs/core/wire.md b/skills/simplecadapi/references/docs/core/wire.md deleted file mode 100644 index aa85b181..00000000 --- a/skills/simplecadapi/references/docs/core/wire.md +++ /dev/null @@ -1,447 +0,0 @@ -# Wire - -## Overview - -`Wire` is the wire class in the SimpleCAD API, representing a 1D geometric path formed by connecting multiple edges. A wire can be open (different start and end points) or closed (forming a closed path). It wraps the OCP Wire object and adds tagging functionality. - -## Class Definition - -```python -class Wire(TaggedMixin): - """Wire class that wraps OCP's Wire and adds tag functionality""" -``` - -## Inheritance - -- Inherits from `TaggedMixin`, providing tag and metadata functionality - -## Usage - -- Represent continuous paths or contours -- Form the boundary of faces (Face) -- Define paths for sweep, extrude, and other operations -- Create complex geometric contours - -## Constructor - -### `__init__(wrapped)` - -Initializes a wire object. - -**Parameters:** -- `wrapped` (OCP TopoDS_Wire): A OCP wire object - -**Raises:** -- `ValueError`: When the input wire object is invalid - -**Example:** -```python -from simplecadapi import ( - make_rectangle_rwire, - make_circle_rwire, - make_polyline_rwire -) - -# Create wires through the SimpleCAD functions -rectangle = make_rectangle_rwire(width=5, height=3) -circle = make_circle_rwire(center=(0, 0, 0), radius=2.0) -polyline = make_polyline_rwire(points=[(0, 0, 0), (1, 1, 0), (2, 0, 0)]) -``` - -## Main Properties - -- `wrapped`: The underlying OCP wire object -- `_tags`: Tag set (inherited from TaggedMixin) -- `_metadata`: Metadata dictionary (inherited from TaggedMixin) - -## Common Methods - -### `get_edges()` - -Get all edges that make up the wire. - -**Returns:** -- `List[Edge]`: List of edge objects - -**Raises:** -- `ValueError`: When edge list retrieval fails - -**Example:** -```python -from simplecadapi import make_rectangle_rwire - -rectangle = make_rectangle_rwire(width=4, height=3) -edges = rectangle.get_edges() - -print(f"The rectangle consists of {len(edges)} edges") -for i, edge in enumerate(edges): - print(f"Edge {i}: length {edge.get_length():.3f}") -``` - -### `is_closed()` - -Check if the wire is closed. - -**Returns:** -- `bool`: Returns True if the wire is closed, False otherwise - -**Raises:** -- `ValueError`: When closure check fails - -**Example:** -```python -from simplecadapi import make_rectangle_rwire, make_polyline_rwire - -# Closed wire -rectangle = make_rectangle_rwire(width=5, height=3) -print(f"Rectangle is closed: {rectangle.is_closed()}") # True - -# Open wire -polyline = make_polyline_rwire(points=[(0, 0, 0), (1, 1, 0), (2, 0, 0)]) -print(f"Polyline is closed: {polyline.is_closed()}") # False -``` - -### Tagging and Metadata - -Use the functional public API `apply_tag(shape, tag)` and `list_tags(shape)` for tags. Use `set_metadata(key, value)` and `get_metadata(key, default=None)` for structured metadata. - -## Usage Examples - -### Creating Different Types of Wires - -```python -from simplecadapi import ( - make_rectangle_rwire, - make_circle_rwire, - make_polyline_rwire, - make_spline_rwire -) - -# Rectangle wire -rectangle = make_rectangle_rwire(width=10, height=6) -apply_tag(rectangle, "rectangle") -apply_tag(rectangle, "closed") - -# Circle wire -circle = make_circle_rwire(center=(0, 0, 0), radius=3.0) -apply_tag(circle, "circle") -apply_tag(circle, "closed") - -# Polyline -polyline = make_polyline_rwire(points=[ - (0, 0, 0), (2, 0, 0), (2, 2, 0), (1, 3, 0), (0, 2, 0) -]) -apply_tag(polyline, "polyline") -apply_tag(polyline, "open") - -# Spline wire: control_points are B-spline poles, not sample points -spline = make_spline_rwire( - control_points=[(0, 0, 0), (1, 2, 0), (3, 2, 0), (4, 0, 0)] -) -apply_tag(spline, "spline") -apply_tag(spline, "smooth") - -# Analyze wire properties -wires = [rectangle, circle, polyline, spline] -for wire in wires: - edges = wire.get_edges() - closed = wire.is_closed() - tags = list_tags(wire) - - print(f"Wire type: {tags}, edge count: {len(edges)}, closed: {closed}") -``` - -### Creating Complex Contours - -```python -from simplecadapi import make_polyline_rwire - -def create_complex_profile(): - """Create a complex contour wire""" - - # Define contour points - points = [ - (0, 0, 0), # start point - (10, 0, 0), # bottom edge - (10, 2, 0), # bottom right - (8, 2, 0), # inner notch 1 - (8, 4, 0), # - (10, 4, 0), # top right - (10, 6, 0), # right of top edge - (0, 6, 0), # left of top edge - (0, 4, 0), # top left - (2, 4, 0), # inner notch 2 - (2, 2, 0), # - (0, 2, 0), # bottom left - (0, 0, 0) # close back to start - ] - - profile = make_polyline_rwire(points=points) - apply_tag(profile, "complex_profile") - apply_tag(profile, "symmetric") - - # Add geometric info - edges = profile.get_edges() - total_length = sum(edge.get_length() for edge in edges) - - profile.set_metadata("total_length", total_length) - profile.set_metadata("point_count", len(points)) - profile.set_metadata("edge_count", len(edges)) - - return profile - -profile = create_complex_profile() -print(f"Complex profile: {list_tags(profile)}") -print(f"Total length: {profile.get_metadata('total_length'):.3f}") -print(f"Edge count: {profile.get_metadata('edge_count')}") -``` - -### Wire Analysis and Processing - -```python -from simplecadapi import make_rectangle_rwire, make_circle_rwire - -def analyze_wire_properties(): - """Analyze wire properties""" - - # Create different wires - rectangle = make_rectangle_rwire(width=6, height=4) - circle = make_circle_rwire(center=(0, 0, 0), radius=2.0) - - wires = [rectangle, circle] - - for i, wire in enumerate(wires): - # Basic properties - edges = wire.get_edges() - is_closed = wire.is_closed() - - # Compute total length - total_length = sum(edge.get_length() for edge in edges) - - # Analyze edges - edge_lengths = [edge.get_length() for edge in edges] - min_edge_length = min(edge_lengths) - max_edge_length = max(edge_lengths) - avg_edge_length = sum(edge_lengths) / len(edge_lengths) - - # Add tags and metadata - apply_tag(wire, f"wire_{i}") - apply_tag(wire, "analyzed") - - if is_closed: - apply_tag(wire, "closed") - else: - apply_tag(wire, "open") - - wire.set_metadata("total_length", total_length) - wire.set_metadata("edge_count", len(edges)) - wire.set_metadata("min_edge_length", min_edge_length) - wire.set_metadata("max_edge_length", max_edge_length) - wire.set_metadata("avg_edge_length", avg_edge_length) - - # Classify edges - for j, edge in enumerate(edges): - apply_tag(edge, f"wire_{i}_edge_{j}") - edge.set_metadata("parent_wire", i) - edge.set_metadata("position_in_wire", j) - - print(f"Wire {i}:") - print(f" Total length: {total_length:.3f}") - print(f" Edge count: {len(edges)}") - print(f" Closed: {is_closed}") - print(f" Shortest edge: {min_edge_length:.3f}") - print(f" Longest edge: {max_edge_length:.3f}") - print(f" Average edge length: {avg_edge_length:.3f}") - print() - -analyze_wire_properties() -``` - -### Wire Transformation and Operations - -```python -from simplecadapi import make_rectangle_rwire, translate_shape, rotate_shape - -def transform_wires(): - """Transform wires""" - - # Create the base rectangle - base_rect = make_rectangle_rwire(width=4, height=2) - apply_tag(base_rect, "base") - apply_tag(base_rect, "original") - - # Create transformed wires - translated_rect = translate_shape(base_rect, offset=(5, 0, 0)) - apply_tag(translated_rect, "translated") - - rotated_rect = rotate_shape(base_rect, axis=(0, 0, 1), angle=45) - apply_tag(rotated_rect, "rotated") - - # Collect all wires - all_wires = [base_rect, translated_rect, rotated_rect] - - # Analyze transform results - for wire in all_wires: - edges = wire.get_edges() - total_length = sum(edge.get_length() for edge in edges) - - # Compute bounding box (simplified) - all_coords = [] - for edge in edges: - start_coords = edge.get_start_vertex().get_coordinates() - end_coords = edge.get_end_vertex().get_coordinates() - all_coords.extend([start_coords, end_coords]) - - if all_coords: - min_x = min(coord[0] for coord in all_coords) - max_x = max(coord[0] for coord in all_coords) - min_y = min(coord[1] for coord in all_coords) - max_y = max(coord[1] for coord in all_coords) - - wire.set_metadata("bbox_min", (min_x, min_y)) - wire.set_metadata("bbox_max", (max_x, max_y)) - wire.set_metadata("bbox_width", max_x - min_x) - wire.set_metadata("bbox_height", max_y - min_y) - - wire.set_metadata("total_length", total_length) - - print(f"Wire tags: {list_tags(wire)}") - print(f" Total length: {total_length:.3f}") - if wire.get_metadata("bbox_min"): - print(f" Bounding box: {wire.get_metadata('bbox_min')} to {wire.get_metadata('bbox_max')}") - print() - -transform_wires() -``` - -### Building Wire Sequences - -```python -from simplecadapi import make_segment_rwire - -def create_wire_sequence(): - """Create a wire sequence""" - - # Create consecutive segments - segments = [] - - # Define waypoints - waypoints = [ - (0, 0, 0), - (2, 0, 0), - (2, 2, 0), - (0, 2, 0), - (0, 4, 0), - (4, 4, 0), - (4, 0, 0), - (6, 0, 0) - ] - - # Create consecutive segments - for i in range(len(waypoints) - 1): - start = waypoints[i] - end = waypoints[i + 1] - - segment = make_segment_rwire(start=start, end=end) - apply_tag(segment, f"segment_{i}") - apply_tag(segment, "path_segment") - - # Add direction info - direction = ( - end[0] - start[0], - end[1] - start[1], - end[2] - start[2] - ) - - if direction[0] > 0: - apply_tag(segment, "eastward") - elif direction[0] < 0: - apply_tag(segment, "westward") - - if direction[1] > 0: - apply_tag(segment, "northward") - elif direction[1] < 0: - apply_tag(segment, "southward") - - segment.set_metadata("start_point", start) - segment.set_metadata("end_point", end) - segment.set_metadata("direction", direction) - segment.set_metadata("sequence_index", i) - - segments.append(segment) - - # Analyze the sequence - total_path_length = sum(seg.get_edges(0).get_length() for seg in segments) - - print(f"Path segment count: {len(segments)}") - print(f"Total path length: {total_path_length:.3f}") - - # Classify by direction - eastward = [s for s in segments if "eastward" in list_tags(s)] - northward = [s for s in segments if "northward" in list_tags(s)] - - print(f"Eastward segments: {len(eastward)}") - print(f"Northward segments: {len(northward)}") - - return segments - -sequence = create_wire_sequence() -``` - -## String Representation - -```python -from simplecadapi import make_rectangle_rwire - -wire = make_rectangle_rwire(width=5, height=3) -apply_tag(wire, "example_rectangle") -wire.set_metadata("area", 15.0) - -print(wire) -``` - -Output: -``` -Wire: - edge_count: 4 - closed: True - edges: - edge_0: - length: 5.000 - vertices: - start: (0.0, 0.0, 0.0) - end: (5.0, 0.0, 0.0) - edge_1: - length: 3.000 - vertices: - start: (5.0, 0.0, 0.0) - end: (5.0, 3.0, 0.0) - edge_2: - length: 5.000 - vertices: - start: (5.0, 3.0, 0.0) - end: (0.0, 3.0, 0.0) - edge_3: - length: 3.000 - vertices: - start: (0.0, 3.0, 0.0) - end: (0.0, 0.0, 0.0) - tags: [example_rectangle] - metadata: - area: 15.0 -``` - -## Relationships with Other Geometry - -- **Edge (Edge)**: Components of a wire -- **Face (Face)**: Closed wires can define face boundaries -- **Solid (Solid)**: Can be created by sweeping or extruding wires - -## Notes - -- Wire edges must be continuous; endpoints of adjacent edges must coincide -- The start and end points of a closed wire must coincide -- Wire orientation affects certain operations (such as face normal direction) -- Complex wires may contain self-intersections and require special handling -- Wire length equals the sum of all edge lengths -- When creating faces, outer boundary wires should be counterclockwise; inner boundary wires should be clockwise diff --git a/skills/simplecadapi/references/docs/design/public-connectors.md b/skills/simplecadapi/references/docs/design/public-connectors.md deleted file mode 100644 index 835cdda0..00000000 --- a/skills/simplecadapi/references/docs/design/public-connectors.md +++ /dev/null @@ -1,82 +0,0 @@ -# Public Connector Refactor - -Status: complete - -## Decision - -An Assembly public connector is an interface declaration, not a second `Connector` object. - -Users create the real connector on the direct child component first, then mark that connector as public: - -```python -assembly = scad.set_public_connector_rassembly( - assembly, - public_connector_id="output_axis", - source_component_id="rotor", - source_connector_id="axis", -) -``` - -`set_public_connector_rassembly`: - -- does not create or clone a `Connector`; -- does not accept an offset or geometry; -- does not move the source component; -- records only the public interface name and the direct-child source reference; -- requires the source component to already exist and the source connector to already exist; -- requires public IDs to be unique within the Assembly. - -The source is a direct child component. A direct child Assembly may be used only through a connector that it exposes publicly; the public boundary remains one level at a time. - -## Runtime contract - -`Assembly` does not own a connector collection. Public declarations live in `Assembly.public_connectors` as immutable `PublicConnectorRef` values, while concrete `Connector` values remain owned by leaf `Part` instances. - -A public reference contains: - -```text -public_connector_id -source_component_id -source_connector_id -name (optional) -``` - -No offset is stored. The source connector owns its complete frame. - -Resolving a parent constraint against a child Assembly public connector returns the real source connector plus its composed frame. The frame includes each direct component placement encountered while crossing nested public boundaries. - -## Durable package contract - -`AssemblyDefinition` stores public connector declarations under `public_connectors`. Each declaration stores the public ID, direct-child source reference, optional name, and a resolved frame snapshot used for validation and standalone consumers. It does not use `anchor_kind="forwarded"`, `forwarded_from`, or an offset. - -The declaration and source connector are hashed as part of the Assembly interface. Changing the public name, source component, source connector, or resolved frame changes the Assembly interface hash and invalidates dependent builds. - -## Solver contract - -The solver resolves a public connector reference to the actual leaf connector and its world frame. Public declarations do not create a new rigid body, motion edge, or constraint. A public connector cannot make an internal component movable merely because a parent constraint references it; movement follows the existing assembly constraint graph. - -This deliberately removes the old special case that descended through forwarded connectors to mutate a nested leaf placement. Nested mechanisms must expose and solve their own constraints before a parent consumes their public interface. - -## Scene and exporters - -Scene records distinguish connector ownership from public declarations. A public record references the source connector snapshot and carries the resolved frame for validation. Exporters use the source connector for semantic ownership and the resolved public frame for sites/joint consumers. - -MJCF must not infer a joint from public exposure. Public declarations only identify externally visible sites/endpoints. Hinge/prismatic edges come from explicit assembly constraints. - -## Translator and replay - -The replay operation is `make_set_public_connector_rassembly`. Its parameters contain the public ID, source component ID, source connector ID, and optional name. There is no placement input and no offset branch. - -## Migration policy - -This is a clean cutover on the branch. Remove `forward_connector_rassembly`, the forwarded anchor kind, forwarded offsets, and translator/replay branches after all callers and durable schemas migrate. Do not leave aliases or deprecated compatibility paths. - -## Progress - -- [x] Confirm public semantics: declaration, no clone, no offset, direct child source. -- [x] Replace runtime Assembly public connector storage and resolution. -- [x] Migrate durable AssemblyDefinition and schemas. -- [x] Migrate solver and product-package construction. -- [x] Migrate scene compiler/validation and exporters. -- [x] Migrate serializer/replay and translators. -- [x] Migrate callers/tests and run end-to-end verification. diff --git a/skills/simplecadapi/references/docs/guides/README.md b/skills/simplecadapi/references/docs/guides/README.md deleted file mode 100644 index f238f063..00000000 --- a/skills/simplecadapi/references/docs/guides/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Engineering Guides - -- [STEP BREP Reverse Engineering](step-brep-reverse-engineering.md): full workflow from STEP inspection, geometric fingerprint analysis, feature-tree inference, and candidate iteration to geometric point-set, BREP topology, parameter history, and model replay acceptance. -- [Reconstruction Agent Test Prompt](reconstruction-agent-test-prompt.md): - compact, versioned run contract for controlled STEP reconstruction trials. -- [Reconstruction Agent Strategy](reconstruction-agent-strategy.md): - advisory inspection, feature-selection, Sketch, Boolean, and iteration tactics. -- [Persistent Cache and Product Build Workflow](cache-build-workflow.md): - durable `@part`/`@assemble` boundaries, PRT reuse, unified cache policy, - diagnostics, `.scadpkg` delivery, FreeCAD/AP242 targets, and optional Gmsh - volume meshing. - -The corresponding runnable module and examples live in: - -```text -src/simplecadapi/inspect/brep/ -``` diff --git a/skills/simplecadapi/references/docs/guides/cache-build-workflow.md b/skills/simplecadapi/references/docs/guides/cache-build-workflow.md deleted file mode 100644 index 7edc83f4..00000000 --- a/skills/simplecadapi/references/docs/guides/cache-build-workflow.md +++ /dev/null @@ -1,203 +0,0 @@ -# Persistent Cache and Product Build Workflow - -SimpleCADAPI uses one crash-safe content-addressed store for whole-part builds -and incremental assembly solves. The default root is `.simplecad/cache`; -`.simplecad/state` stores the latest part and assembly interface snapshots used -for incremental invalidation. - -## Product boundaries - -Use `@scad.part` for one physical, single-solid part. It returns a -`PartBuildResult` with the runtime `Part`, a durable `PartDefinition`, graph and -session state, replay payloads, interface differences, and a `CacheReport`. The -build key includes the definition ID and revision, normalized arguments, builder -source, declared file inputs, generator/ABI profile, and tolerance profile. - -```python -import simplecadapi as scad - - -@scad.part(id="mounting_plate", revision="1.0.0", cache="auto") -def build_plate(width: float = 30.0) -> scad.Part: - body = scad.make_box_rsolid(width=width, height=20.0, depth=3.0) - return scad.make_part_rpart(part_id="mounting_plate", body=body) - - -cold = build_plate() -warm = build_plate() -print(cold.cache_report.hit, warm.cache_report.hit) -``` - -Declare every non-Python input with `scad.file_input(...)`; undeclared file -reads cannot participate in the build key. In `read_only` or `read_write` mode, -repeated calls to the same decorated builder and build key reuse the same runtime -PRT in memory with zero cache I/O. Concurrent same-key calls share one build. - -A newly decorated builder or later process restores unchanged PRTs from the -durable part bundle. Restore validates the closed cache bundle, exact solid, -topology snapshot, durable definition, and interface hashes, then creates fresh -runtime objects and graph provenance. Corrupt bundles are quarantined and -rebuilt. `off` and `refresh` always execute the builder. - -Use `@scad.assemble` for an assembly whose external part or nested assembly -definitions are explicit. Repeated instances reference one immutable -definition. The incremental solver invalidates only components reached through -changed geometry, connector, binding, material, or nested public-connector -interfaces; cached placements still pass residual verification before reuse. - -```python -@scad.assemble(id="fixture", definitions=(warm,), cache="auto") -def build_fixture() -> scad.Assembly: - assembly = scad.make_assembly_rassembly(assembly_id="fixture") - return scad.add_component_rassembly( - assembly=assembly, - item=warm.value, - component_id="plate", - placement=scad.identity_placement_rplacement(), - ) - - -fixture = build_fixture() -print(fixture.solve_report.component_hits, fixture.solve_report.component_misses) -``` - -`@scad.part` and `@scad.assemble` are top-level product boundaries and each owns -its definition-local `GraphSession`; they cannot be nested inside another active -session. Use an explicit `GraphSession` for lower-level replayable geometry that -is not a durable part or assembly definition. - - -## Policy - -Policy precedence is explicit decorator argument, environment variables, -`[tool.simplecadapi.cache]` in the project `pyproject.toml`, then defaults. -Relative roots resolve against the project root. - -```toml -[tool.simplecadapi.cache] -mode = "read_write" # off | read_only | read_write | refresh -root = ".simplecad/cache" -verify_reads = true -quarantine_corrupt = true -lock_timeout_seconds = 30 -stale_lock_seconds = 300 -``` - -Environment overrides are `SIMPLECAD_CACHE_MODE`, `SIMPLECAD_CACHE_DIR`, -`SIMPLECAD_CACHE_VERIFY_READS`, `SIMPLECAD_CACHE_QUARANTINE_CORRUPT`, -`SIMPLECAD_CACHE_LOCK_TIMEOUT`, and `SIMPLECAD_CACHE_STALE_LOCK`. - -- `off`: bypass reads and writes. -- `read_only`: accept valid hits but never populate misses. -- `read_write`: read valid hits and atomically populate misses. -- `refresh`: recompute and replace entries without reading existing values. - -## Diagnostics and maintenance - -`simplecad-cache` prints one stable JSON object. `status`, `verify`, and the -default `prune` mode are read-only. Explicit mutation is required for repair, -pruning, and clearing. - -```bash -simplecad-cache status -simplecad-cache status --namespace part -simplecad-cache verify -simplecad-cache verify --repair -simplecad-cache prune -simplecad-cache prune --apply -simplecad-cache clear --namespace part --yes -``` - -`verify` always checks record schema/path, object presence, byte length, and -SHA-256, even when runtime `verify_reads` is disabled. `--repair` quarantines -invalid records and objects. `prune` reports unreferenced canonical objects; -`--apply` quarantines them. Namespace clearing preserves objects referenced by -other namespaces. Full clearing requires `--yes` and removes the cache root. - -Writers use per-key atomic locks, stale-lock recovery, atomic replacement, and -content-addressed object deduplication. Treat `.simplecad` as generated state: -do not commit it and do not use its internal files as a public interchange -format. - -## Product package export - -`PartBuildResult` and `AssemblyBuildResult` are captured and written as one -canonical product package by a single API call: - -```python -scad.capture(warm, "out/part.scadpkg") -scad.capture(fixture, "out/assembly.scadpkg") - -root = scad.load_product_package("out/assembly.scadpkg") -rebuilt = scad.materialize_definition(root) -``` - -Use `build_product_package(...)`, `encode_product_package(...)`, -`read_product_package(...)`, and `load_product_package(...)` only for explicit -in-memory package handling. `validate_product_package(...)` verifies every object -hash and size, the complete recursive definition graph, cycle/depth limits, and -rejects missing or unreferenced objects. Use `export_part_definition(...)` or -`export_assembly_definition(...)` only for low-level definition exchange or -inspection; neither is the product delivery format. - -## Downstream CAD and mesh targets - -Keep `.scadpkg` as the canonical SimpleCAD delivery artifact. Choose a -downstream target from the consumer contract: - -| Target | Use when | Preserved contract | Boundary | -| --- | --- | --- | --- | -| `.scadpkg` | Rebuild, replay, cache, or further SimpleCAD editing 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 | - -```python -package_path = assembly_package.artifact_paths["product"] - -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", -) -stl_report = scad.exporter.export_product_package_to_stl( - package_path, - "out/product.stl", -) -obj_report = scad.exporter.export_product_package_to_obj( - package_path, - "out/product.obj", -) -print(step_report.definition_ids, step_report.occurrence_count) -print(stl_report.solid_count, stl_report.triangle_count) -print(obj_report.vertex_count, obj_report.triangle_count) -``` - -STL and OBJ use the same direct OpenCASCADE tessellation and parameters. Set -`linear_deflection` to the maximum chordal deviation in product units and -`angular_deflection_degrees` to the curved-surface angular limit. Both formats -contain oriented triangles; OBJ preserves shared vertex indices while binary STL -stores each facet independently. No remeshing or optional dependency is involved. - -AP242 definition and occurrence metadata is stored in one standard -`PROPERTY_DEFINITION_REPRESENTATION`. Its named -`DESCRIPTIVE_REPRESENTATION_ITEM` records use -`SimpleCAD:definition::` and -`SimpleCAD:occurrence::`. Each description -is canonical sorted JSON containing durable IDs, revision, content hash, -connectors, constraints, grounding, name, and solved placement. -`ProductSTEPExportReport` reports the schema, definition IDs, occurrence -count, material IDs, metadata item count, and explicit limitations. - -For tetrahedral meshing, run the split example directly in dependency order: -`model.py` captures `.scadpkg`, `export_step.py` exports AP242 STEP, and -`export_fem_mesh.py` imports that STEP with Gmsh's OpenCASCADE kernel. The FEM -stage rejects imports with no 3D volumes, generates a dimension-3 mesh, writes -`.msh`, and always finalizes Gmsh. Install and invoke the optional dependency -with `uv run --extra gmsh python -examples/12_ap242_gmsh_volume_mesh/export_fem_mesh.py`; Gmsh is never imported -by the core SDK or product exporters. diff --git a/skills/simplecadapi/references/docs/guides/reconstruction-agent-strategy.md b/skills/simplecadapi/references/docs/guides/reconstruction-agent-strategy.md deleted file mode 100644 index 078d7ccc..00000000 --- a/skills/simplecadapi/references/docs/guides/reconstruction-agent-strategy.md +++ /dev/null @@ -1,155 +0,0 @@ -# Reconstruction Agent Strategy - -This guide is advisory. The normative run, evidence, classification, and -artifact rules are in -[`reconstruction-agent-test-prompt.md`](reconstruction-agent-test-prompt.md). - -## Investigate Economically - -Start with the cheapest evidence that can falsify the current hypothesis: - -```text -inspect_step_rsummary -inspect_step_entity_rdescriptor -inspect_topology_neighborhood_rdescriptor -inspect_section_rdescriptor -inspect_face_boundaries_rdescriptor -compare_global_properties_rdescriptor -``` - -Use compact boundary and section reports first. Request complete curve/surface -definitions only for entities selected by a specific hypothesis. Persist large -arrays directly to authorized parameter files instead of echoing them through -conversation context. - -Call `inspect_step_rsummary(..., include_parameter_groups=True)` once when -analytic radii or repeated carrier signatures may be informative. For exact -local evidence, use targeted curve/surface definition flags with explicit -control-point limits. An untrimmed carrier definition is incomplete without its -UV range, ordered trim-loop, and seam evidence. - -Useful focused interfaces include `inspect_topology_rdescriptor`, -`measure_entity_relation_rdescriptor`, `inspect_point_rdescriptor`, -`inspect_nearby_entities_rdescriptor`, `compare_entities_rdescriptor`, -`render_region_rpath`, and `compare_sections_rdescriptor`. Use -`make_surface_patch_rface` and `loft_rshell` only for construction, outside -inspection graphs. - -Treat repetition and symmetry as hypotheses. Verify positions, axes, spacing, -orientation, and adjacency on at least two units before patterning. - -## Choose A Feature Family - -Use observed carrier and section behavior: - -```text -shared axis + rotational sections -> revolve -stable translated profile -> extrude -profile transported along a path -> sweep -ordered changing section family -> Loft -verified equal angular/linear units -> one unit + pattern -several local signatures -> ordered mixed feature tree -none -> fitted freeform or transcription -``` - -A loop on a final planar face may be a later hole, slot, notch, or pocket rather -than part of the base profile. Inspect adjacent side carriers and operation -direction before folding loops into one profile. - -For each base region, opening, or local detail, record a compact provenance row: -observed boundary, adjacent carrier/continuation evidence, proposed operation, -direction or axis, confidence, and the section/entity check that could falsify -it before full construction. - -## Profile Authoring - -Prefer a declarative Sketch for a planar, editable design profile when the -available constraints represent the evidence. Record plane mapping, closure, -arc direction, spline definition, solve status, and remaining DOF. - -Use `make_sketch_rsketch`, stable `add_*_rsketch` entities, and evidence-backed -constraints. Promote with `make_face_from_sketch_rface` or -`make_wire_from_sketch_rwire`. A Sketch wrapping a prebuilt Wire does not recover -Sketch intent. Use `inner_profiles` only when adjacent-carrier evidence shows the -loops belong to the same generating profile. - -`add_arc_rsketch` follows the positive local angular sweep, so endpoint order is -meaningful. For exact splines, preserve degree, knots, multiplicities, weights, -and shared endpoint references. When only coordinates are known, label the -result coordinate-locked rather than claiming inferred parametric intent. - -Direct Wire construction is appropriate for: - -- non-planar paths and guides; -- exact freeform carrier/trim transcription; -- unsupported Sketch entities or relationships; -- report-derived geometry whose projection changes measured control data; -- a demonstrated Sketch-path regression. - -Sketch is an authoring preference, not an acceptance gate. Candidate-to-target -evidence decides reconstruction quality. - -When Sketch promotion may change measured geometry, build Wire and Sketch from -one parameter source, compare closure/area/bounds/segmentation first, then replay -complete candidates in fresh processes. Use cheap aggregate and bounded sampled -diagnostics to falsify hypotheses or localize differences, never as acceptance -gates. The trusted evaluator still runs strict material evidence for every solid -target. Prefer compact design intent over arbitrary point clouds, and never label -a polyline or fitted Loft as exact NURBS transcription. - -## Boolean Discipline - -Prefer a simple base followed by independent local additive/subtractive tools. -Overshoot through-cut tools intentionally rather than ending them coincidently. -Validate one representative feature before repeating it. - -If a Boolean fails: - -1. verify valid operands and positive-volume overlap; -2. remove accidental tangency/coincident terminal faces; -3. isolate and simplify the base/tool pair; -4. use `TrackingPolicy.GRAPH` only to reduce lineage cost, never to repair geometry; -5. use `cut_rsolid(..., skip_non_intersecting=False)` for strict diagnostics; -6. reconsider operation order after repeated failure. - -Never call a skipped or ineffective Cut a completed feature. -Prefer isolated or flat-list local cuts over whole-model complements, large -clipping constructions, or Boolean workarounds that obscure the failing feature. - -## Diagnostic Escalation - -Use expensive operations only when justified: - -- strict material comparison for every solid submitted to trusted evaluation; -- sampled boundary distance to localize approximation, not prove equality; -- material difference regions only from a strict component-bearing result; -- exact BREP comparison only after lower-tier geometry proof. - -`compare_material_rdescriptor(include_components=False)` is an estimate only. -Strict proof and reusable difference regions require `include_components=True`. -Start `compare_boundary_distance_rdescriptor` at no more than 200 samples and -scope it with face IDs when possible. Use `inspect_difference_regions_rdescriptor` -only with compatible cached evidence, and reserve `compare_steps_rbrepcomparison` -for a configured `exact_brep` attempt. - -Cache results by target hash, candidate hash, and arguments. Do not repeat an -unchanged expensive call. - -## Iteration Selection - -Record one compact row per iteration: - -- falsifiable hypothesis and changed parameters/operation order; -- replay, validity, target-kind, and STEP roundtrip status; -- global and focused diagnostic deltas; -- strongest acceptance proof attempted; -- provenance changes; -- evidence for the next decision. - -Preserve the best valid candidate. One parameter retry may retain a construction -strategy; repeated non-improvement should change the feature hypothesis rather -than continue blind tuning. - -Global similarity cannot override a locally falsified feature family. Conversely, -stop tuning credible serialization-only floating-point drift once the configured -contract gates pass. diff --git a/skills/simplecadapi/references/docs/guides/reconstruction-agent-test-prompt.md b/skills/simplecadapi/references/docs/guides/reconstruction-agent-test-prompt.md deleted file mode 100644 index e1735690..00000000 --- a/skills/simplecadapi/references/docs/guides/reconstruction-agent-test-prompt.md +++ /dev/null @@ -1,577 +0,0 @@ -# Reconstruction Agent Test Contract - -Contract ID: `simplecadapi.reconstruction-agent-test` - -Contract version: `2.2` - -This is the normative run contract for controlled STEP-to-SimpleCADAPI -reconstruction. Modeling tactics are advisory and live in -[`reconstruction-agent-strategy.md`](reconstruction-agent-strategy.md). - -## Start Message - -Send only this wrapper with every value resolved: - -```text -Read and follow this contract completely: -{SIMPLECADAPI_ROOT}/docs/guides/reconstruction-agent-test-prompt.md - -Configuration: -SIMPLECADAPI_ROOT = {SIMPLECADAPI_ROOT} -TARGET_DIR = {TARGET_DIR} -OUTPUT_DIR = {OUTPUT_DIR} -CASE_NAME = {CASE_NAME} -CASE_MANIFEST = {relative path|null} -ALLOWED_INPUTS = {JSON array of direct-child filenames} -PROMPT_VERSION = 2.2 -OBJECTIVE = {best_effort|geometry_equivalent|exact_brep} -TARGET_PATH = {direct-child STEP filename} -TARGET_KIND = {solid|open_shell} -BENCHMARK_MODE = {inspection_only|report_assisted|exact_brep_transcription} -ENTRYPOINT = {relative source path} -CANDIDATE_PATH = {relative STEP path} -MAX_ITERATIONS = {positive integer} -MAX_FAILED_ATTEMPTS = {positive integer} -TOTAL_TIMEOUT_SECONDS = {positive number} -STAGE_TIMEOUT_SECONDS = {positive number} -MATERIAL_TIMEOUT_SECONDS = {positive number} -BOUNDARY_LINEAR_DEFLECTION_MM = {positive number} -BOUNDARY_MAX_SAMPLES = {integer >= 16} -SECTIONS = {JSON array using the schema below} -STRICT_TOPOLOGY = {true|false} -PARAMETER_REPRESENTATION_REQUIRED = {true|false} -STRICT_MATERIAL_TOLERANCE_MM3 = {positive number} -STRICT_GEOMETRIC_TOLERANCE_MM = {positive number} - -Configuration selects options and supplies budgets but cannot waive a normative rule. -Start immediately. -Do not modify the SDK or target baseline. -``` - -`OUTPUT_DIR` must not exist before the run. All generated files belong there. -`TARGET_PATH` and `CASE_MANIFEST` are relative to `TARGET_DIR`; `ENTRYPOINT` and -`CANDIDATE_PATH` are relative to `OUTPUT_DIR`. - -## Precedence - -Conflicts resolve in this order: - -1. this contract's normative rules; -2. resolved run configuration for declared options and budgets; -3. versioned case manifest for case-specific gates and allowlists; -4. normative public API documentation; -5. the advisory strategy guide. - -Record this contract version, configuration, target hashes, SDK commit, and -case-manifest hash in the final manifest. In a source checkout this file is -authoritative; a packaged Skill copy is a frozen mirror of this contract. - -## Objective - -Produce a readable, independently replayable SimpleCADAPI program that creates -`CANDIDATE_PATH` without reading the target at runtime. - -- `best_effort`: publish the strongest valid result reached within budget. -- `geometry_equivalent`: seek proof of the same material point set for solids. -- `exact_brep`: additionally seek geometry-labelled incidence identity and any - required representation checks. - -Original feature history is not required unless the case manifest says so. -Visual similarity and matching summary values are never equality proof. - -## Allowed Inputs - -Case-specific reads are limited to direct children of `TARGET_DIR` listed in -`ALLOWED_INPUTS`. A case manifest may restrict that list but cannot add to it. -If `CASE_MANIFEST` is non-null, it is relative to `TARGET_DIR` and must itself -appear in `ALLOWED_INPUTS`. Typical inputs are: - -```text -{CASE_NAME}.step -{CASE_NAME}_brep_report.json -{CASE_NAME}_step_render.png -{CASE_NAME}_mesh_render.png -``` - -Do not search Git history, caches, temporary directories, deleted files, -previous reconstructions, other Agent outputs, or paths outside `TARGET_DIR` for -case solutions. SDK source, public docs, tests, and generic guidance are allowed. - -Mode permissions: - -| Mode | Target access | -|---|---| -| `inspection_only` | Approved `simplecadapi.inspect.brep` queries and supplied renders; no complete control arrays | -| `report_assisted` | Complete supplied report and targeted exact definitions | -| `exact_brep_transcription` | Complete carrier, trim, pcurve, and topology data | - -Transcribed values must be labelled as transcription. Different modes measure -different capabilities and must not be compared as equivalent experiments. - -In `inspection_only`, the approved target-reading interfaces are -`inspect_step_rsummary`, `inspect_step_entity_rdescriptor`, -`inspect_topology_neighborhood_rdescriptor`, `inspect_section_rdescriptor`, -`inspect_face_boundaries_rdescriptor`, and configured comparison/render calls. -Do not enable complete curve/surface definitions, directly traverse target -entities to recover complete definitions, or add/modify SDK operations, -inspection tools, plugins, or helper executables during the run. - -In `exact_brep_transcription`, declared target-derived regions may be copied to hash-pinned `.scadbrep` sidecars with `copy_step_region_rpath(...)`. Final replay -may load those declared sidecars with `load_brep_region_rshell(...)` or -`load_brep_region_rsolid(...)`, but must not read the target STEP. - -## Hard Constraints - -1. Final geometry uses public SimpleCADAPI modeling interfaces. -2. Do not edit SDK source, tests, tools, target files, or baselines. -3. Final replay must not read/import the target STEP. -4. Do not copy, encode, embed, or re-export target STEP bytes, except for - declared `.scadbrep` region snapshots in `exact_brep_transcription` mode. -5. Declared numeric parameter files are allowed when authorized by the mode. -6. Do not replace an open-shell target with a fabricated solid. -7. Do not use network services or external CAD applications. -8. Write only under `OUTPUT_DIR`; never overwrite an accepted iteration. -9. Participant replay may execute only `ENTRYPOINT` with the configured Python - interpreter. Trusted evaluator workers are separate from participant code. - -## Provenance - -Record provenance per significant parameter and final face/region when -available. Keep these dimensions separate: - -- evidence origin: `copied | inferred | fitted`; -- construction: `transcribed | fitted | analytic_feature`; -- topology origin: `retained | modified | generated`; -- runtime dependency: `independent | embedded_target_derived`. - -Orange/purple/blue rendering is only a derived visualization: - -- orange: exact target-derived transcription; -- purple: target-derived fit or Loft; -- blue: analytic/feature construction. - -Blue does not imply target independence. A face with an analytic carrier but -retained target trims/topology must not be described as recovered feature -history. - -## Required Loop - -1. Freeze and hash inputs; record mode, objective, target kind, and budgets. -2. Inspect bounded global facts and form one falsifiable construction hypothesis. -3. Build in a fresh process and write immutable iteration artifacts. -4. Require successful exit, a newly generated STEP, expected target kind, and a - valid BREP before counting a complete iteration. -5. Validate STEP write/reload. Record property and topology drift; do not publish - an invalid roundtrip. -6. Inspect cheap global diagnostics, then only probes that answer the next question. -7. Attempt the strongest applicable acceptance proof within budget. -8. Atomically promote the best valid iteration to the configured final paths. - -A failed replay or invalid BREP is a failed attempt, not a complete iteration. -Stop after `MAX_FAILED_ATTEMPTS`, `MAX_ITERATIONS`, total timeout, or three -consecutive non-improving complete iterations, whichever comes first. - -Each `SECTIONS` item has this closed schema: - -```json -{ - "id": "filename-safe-unique-token", - "origin": [0.0, 0.0, 0.0], - "normal": [0.0, 0.0, 1.0], - "tolerance": 1e-7, - "samples_per_edge": 16 -} -``` - -Section IDs must be unique and match `[A-Za-z0-9][A-Za-z0-9_.-]*`; normals -must be non-zero, tolerances positive, `samples_per_edge` must be a JSON integer -(not a boolean) with `samples_per_edge >= 4`. - -## Mechanical Gates - -### Replay - -- fresh process exits successfully; -- candidate is newly created at `CANDIDATE_PATH`; -- candidate bytes are not target bytes; -- BREP is valid and matches `TARGET_KIND`; -- target and baseline hashes remain unchanged. - -### STEP Persistence - -Write to a temporary sibling STEP, reload it with the public BREP loader, and -publish only after validation. Record before/after validity, root kind, bodies, -shells, faces, edges, vertices, edge classes, volume, total surface area, -centroid, material bounds, root bounds, and whether publication occurred. These -candidate-before/after measurements are serialization integrity checks. They are -not candidate-to-target similarity metrics and do not establish reconstruction -equivalence. - -### Strict Material Proof For Solids - -Strict material equality requires all of: - -```text -include_components=True -boolean_tolerance=None -method=bidirectional_cut -strict_equality_supported=true -boolean_result_valid=true -volume_balance.valid=true -missing_material.volume < STRICT_MATERIAL_TOLERANCE_MM3 -excess_material.volume < STRICT_MATERIAL_TOLERANCE_MM3 -``` - -A common-volume estimate, fuzzy Boolean, timeout, invalid Boolean result, or -missing directional Cut cannot prove equality. A material timeout leaves a valid -solid eligible for `approximation`; it is not `unsupported_or_incomplete`. -For regular solids, non-fuzzy bidirectional Cut residual volumes establish -tolerance-bounded material equivalence. They are not aggregate mass-property -comparisons and do not prove topology, representation, or literal boundary -identity. - -### Exact BREP Proof - -Requires proven geometry equivalence plus geometry-labelled Face/Edge/Vertex -incidence isomorphism and every case-required representation check. Evaluate it -only when requested and after lower-tier proof succeeds. -This is exactness under the evaluator's declared tolerance and evidence schema; -it does not recover or prove original CAD feature history. Any required -representation check must be defined by the trusted case manifest, not supplied -as a participant claim. - -### Open Shells - -Material proof does not apply. Preserve shell kind and do not fabricate material. -Until an exact boundary-set proof is configured, a valid replayable open shell is -`approximation` with reason `open_shell_equivalence_unproved`. A solid candidate -for an open-shell target is `unsupported_or_incomplete` with reason -`fabricated_solid_for_open_shell`. - -## Monotonic Classification - -Assign exactly one classification. Higher-tier failure never erases a proven lower tier. - -- `exact_brep`: all replay, persistence, strict material, incidence, and required - representation gates pass. -- `geometry_equivalent`: solid replay and strict material proof pass, but exact - topology was not requested, differs, or remains unproved. -- `approximation`: valid replayable candidate exists, but applicable equality is - disproved or unproved, including material timeout and valid open shells without - boundary-set proof. -- `unsupported_or_incomplete`: replay/candidate is invalid, no valid target-kind - candidate can be represented, or target kind is fabricated. If a valid - target-kind candidate exists but an equality-level feature is unavailable, - classify it as `approximation` instead. - -Never upgrade from render, global property, sampled boundary, or section metrics. -Global, boundary, and section metrics, including aggregate volume, total surface -area, bounding box, centroid, sampled distance, and section area, are diagnostics -for falsification and localization only. They never affect classification. - -`classify_benchmark_result` receives the unmodified process-local results from -`inspect_benchmark_step` and `run_comparison_bundle`; serialized or rebuilt -mappings are untrusted. Their path and SHA-256 bindings must still match the -current target and candidate files. Candidate -validity and solid/shell kind come from inspection `valid` and `counts` fields; -an open shell requires zero solids, at least one shell explicitly reported open, -and at least one face; -participant-declared kind or validity is not evidence. `exact_brep` additionally -requires the strict report's STEP-validity, directional-volume, geometric -point-set, geometry-labelled incidence, and hard-gate fields to agree. A claimed -strict stage status cannot establish it. - -### Evaluator Stage Schema And Units - -Worker-stage envelopes record `status`, `gate_passed`, `elapsed_seconds`, -`report`, `report_path`, and `error`. Successful global, boundary, individual -section, and aggregate-section diagnostics use `status=completed` and no -acceptance `checks`; worker errors remain `error` and retain their error details. -Every diagnostic envelope uses `gate_passed=null`, including on error. Completed -material and strict acceptance stages add boolean `checks` and use `passed` or -`failed`. Non-run stages add `reason`; -aggregate `sections` uses `reports` with one worker envelope per unique section -ID. `global` and `material` always appear; `boundary` and `sections` appear only -when diagnostics are requested; `strict` always appears but runs only for a -solid after proven material equality when strict topology is requested. - -- `global`: bounding-box/centroid lengths in mm, total surface area in mm2, - aggregate volume in mm3, integer topology counts, and dimensionless relative - deltas. It is diagnostic only. -- `material`: directional missing/excess volumes and tolerance in mm3, Boolean - and volume-balance validity, and tri-state `strict_point_set_equal`; - `relative_total_difference` is dimensionless. -- `boundary`: sampled-to-exact distances, approximate Hausdorff, p95, and linear - deflection in mm. It is diagnostic only. -- `sections`: plane coordinates, tolerance, perimeter, and Hausdorff in mm; - material area in mm2; integer sample/edge counts; relative area error is - dimensionless. The aggregate contains one stage envelope per unique section ID. - Sections are bounded diagnostic probes only. -- `strict`: directional differences and Boolean tolerance in mm3, geometric - tolerance in mm, validity, graph counts, point-set equality, labelled-incidence - isomorphism, and `hard_gate_passed`; exact classification also requires - trusted envelope check `checks.hard_gate=true`. - -Evaluator configuration, baseline/target paths and hashes, worker reports, -inspection reports, and representation checks are trusted-harness evidence. -Participant source and declared parameters are submission inputs, while its -self-reported evaluation, kind, validity, stage status, renders, and logs are -untrusted claims or diagnostics. - -## Artifact Contract - -Authoritative submission: - -```text -{ENTRYPOINT} -reconstruction_params.json # only when needed -``` - -Derived final artifacts: - -```text -{CANDIDATE_PATH} -rebuilt_brep_report.json -evaluation.json -iteration_log.json -artifact_manifest.json -``` - -The source and declared parameters are authoritative. STEP and model JSON are -derived. Trusted evaluator output overrides self-reported evaluation. Renders -and logs are diagnostic only. - -The manifest records paths, SHA-256, byte sizes, prompt/config/SDK identity, -classification, budget status, and authoritative/derived/diagnostic role. - -## Phase 2: Construct - -Create: - -```text -{OUTPUT_DIR}/{CASE_NAME}_rebuild_simplecadapi.py -``` - -The program must: - -- be readable and parameterized; -- run in a fresh process; -- export `{CASE_NAME}_rebuilt.step` under `OUTPUT_DIR`; -- produce a valid BREP; -- record supported feature operations in an explicit `GraphSession` and verify strict replay; -- clearly label exact transcription, fitting, and approximation. - -Prefer compact design intent over arbitrary point clouds. Do not describe a -polyline or fitted Loft as exact NURBS transcription. - -### Sketch-first profile policy - -Use a declarative Sketch as the default authoring representation for a planar -closed profile that drives: - -- an extrusion or revolution; -- an additive boss or subtractive hole, pocket, slot, notch, or through-cut; -- a planar section whose design intent is a named, editable profile. - -Build it with `make_sketch_rsketch(...)`, stable point/entity IDs, -`add_*_rsketch(...)`, and constraints supported by the reconstruction -evidence. Promote it with `make_face_from_sketch_rface(...)` or, when a feature -requires a section Wire, `make_wire_from_sketch_rwire(...)`. Use -`require_fully_constrained=True` when the intended dimensions and relations can -be represented without inventing unsupported design intent. - -Prefer dimensional and geometric constraints such as radius, distance, -horizontal/vertical, parallel, perpendicular, tangent, and concentric when -they are supported by evidence. If only recovered coordinates are known, -fixed points are allowed for deterministic replay, but label the result as a -coordinate-locked reconstruction rather than claiming recovered parametric -intent. - -Use `inner_profiles=(...)` only when topology and adjacent-carrier evidence -show that the loops belong to the same generating Sketch. Model a later hole, -slot, or pocket as its own ordered feature instead of folding its final-face -trace into the base Sketch. - -Before promoting a Sketch profile, verify: - -- the Sketch plane and local-to-world mapping; -- a closed non-construction loop with the intended entity segmentation; -- Arc sweep direction and minor/major choice; `add_arc_rsketch(...)` uses the - positive local angular sweep, so swapping endpoints changes the geometry; -- B-spline degree, knots, multiplicities, weights, and endpoint poles; use the - shared endpoint point refs as first/last poles when exact connectivity is - intended; -- solve status, remaining DOF, and diagnostics. - -Direct Wire construction is allowed only for a concrete reason: - -- a non-planar path, 3-D guide curve, Helix, or other path geometry; -- freeform carrier/trim geometry or exact BREP/NURBS transcription that is not - a planar design Sketch; -- an entity, constraint, or multi-loop relationship the current Sketch API - cannot represent faithfully; -- report-derived geometry whose projection onto a Sketch plane changes its - control data or measured geometry; -- a demonstrated kernel or modeling regression in the Sketch path. - -Do not force a spatial path, freeform surface boundary, or unsupported exact -transcription into a fake Sketch merely to satisfy Sketch-first. Record every -direct-Wire exception and its evidence in the iteration log. - -When a planar Wire exception is proposed, or when Sketch promotion may change -geometry, use the cheapest A/B sequence that can decide it: - -1. Keep one shared parameter source and independently build Wire and Sketch - profiles. -2. Compare profile closure, area, bounds, edge count, and ordered edge lengths. -3. If those agree, rebuild the complete Wire and Sketch candidates in fresh - processes and run `compare_global_properties`. -4. Only when the candidates are close enough, compare strict bidirectional - material and a bounded boundary distance. Do not run `compare_brep_strict` - solely for this A/B unless `exact_brep` was requested. -5. Prefer Sketch when it preserves or improves target evidence. Keep Wire when - Sketch introduces avoidable measured drift or changes the acceptance result, - and document the exception rather than hiding it. - -Candidate-to-target evidence remains the acceptance basis. Wire-to-Sketch A/B -selects the authoring strategy; it does not by itself prove reconstruction -quality. - -### Boolean construction policy - -Use the simplest direct feature sequence supported by the evidence. Prefer a -base feature followed by independent local additive or subtractive tools over -whole-model complements, large clipping constructions, or coincident Boolean -operands. - -For a through opening or slot, prefer a simple cutter that deliberately -overshoots both terminal sides. For multiple local cuts, validate one -representative base/tool pair before constructing all tools, then apply the -tools individually or as a flat list so the failing feature can be identified. - -If a Boolean fails: - -1. Verify that the base and tool are each valid solids and that the intended - overlap has positive volume, not only overlapping bounding boxes. -2. Remove exact tangencies and coincident end faces with small intentional tool - overshoot; do not change target dimensions merely to hide the failure. -3. Retry the isolated base/tool pair with a simpler tool and no unnecessary - upstream union or complement. -4. Use `TrackingPolicy.GRAPH` when topology lineage is unnecessary and history - tracking is the suspected cost. This does not repair wrong geometry or alter - intersection validation. -5. Use `skip_non_intersecting=False` for strict cut diagnostics when available; - it exposes a missed cut instead of silently accepting it. -6. After repeated failure, reconsider the operation order or feature-family - hypothesis. Do not replace a locally supported feature tree with a global - clipping construction solely as a Boolean workaround. - -Never classify a skipped or silently ineffective cut as a completed feature. - -## Phase 3: Iterate - -For each complete candidate iteration: - -1. Run the program in a fresh process and regenerate the STEP. -2. Require successful exit, a newly generated STEP, and valid BREP. -3. For every promoted Sketch used by the candidate, require a closed profile - and record solve status, DOF, and diagnostics. -4. Run `compare_global_properties`. -5. If global/material scale is clearly wrong, fix the construction before any - dense boundary or topology work. -6. Use sections or local diagnostics only to answer the next modeling question. -7. When the candidate is plausibly final, attempt one bounded - `compute_material_difference(include_components=true)` for the strict - material result. - -An attempt that fails to replay, does not generate a new STEP, or produces an -invalid BREP is a failed construction attempt, not a complete candidate -iteration. Record the failure and diagnostic evidence, but do not consume -`MAX_ITERATIONS` or count it toward the three non-improving complete iterations. -Do not make more than three consecutive failed construction attempts on the -same feature family or Boolean arrangement; revert to the best valid candidate -and change the hypothesis or operation order. - -One parameter-only retry may reuse the same construction strategy. A changed -feature family or construction method starts a new complete iteration only when -it produces a freshly replayed valid candidate. - -Stop blind tuning after three non-improving iterations. Preserve the best valid -candidate and report the blocker. Select the best candidate using material, -focused section/boundary, carrier, and global evidence together; global -properties alone must not override a locally falsified feature family. - -## Classification - -Assign exactly one classification. - -### exact_brep - -Complete reverse engineering — the best endpoint. Requires fresh replay, valid -BREP, strict bidirectional material equality, geometry-labelled incidence graph -isomorphism, and required representation checks. Minor parameter drift -attributable to export float error does not break topology identity. This is -expensive: evaluate it only when the candidate is near structure match, not as -a routine iteration step. - -### geometry_equivalent - -Requires fresh replay, valid BREP, and strict bidirectional material equality. -Boundary, section, seam, surface representation, and topology equality are not -additional requirements. A structure-matched candidate with float-level -parameter drift classifies here or as `exact_brep` — never as `approximation`. - -### approximation - -Use when a valid replayable candidate exists but strict material equality -fails or remains unproved (including Boolean timeout), AND optimization is -genuinely exhausted: no better feature operation order/combination is findable, -or the required operation type is not supported by the SDK. Record which reason -and its evidence. Report measured global and local errors without upgrading the -result based on visual similarity. A "looks close" result is not a valid stop -on its own. - -### unsupported_or_incomplete - -Use when no valid replayable candidate exists or the target cannot be -represented by the available SDK. Do not manufacture a success-shaped result. - -## Required Artifacts - -Keep the artifact set minimal: - -```text -{CASE_NAME}_rebuild_simplecadapi.py -{CASE_NAME}_reconstruction_params.json # only if needed -{CASE_NAME}_rebuilt.step -{CASE_NAME}_rebuilt_brep_report.json -{CASE_NAME}_evaluation.json -{CASE_NAME}_iteration_log.json -``` - -The iteration log records: - -- hypothesis and exact source/parameter change; -- replay and validity result; -- Sketch solve evidence and every direct-Wire exception; -- global errors; -- diagnostics actually used and why; -- strict material result or timeout when attempted; -- evidence selecting the next change. - -Optional renders or Scene packages may be generated for human inspection, but -they are not acceptance evidence. - -## Final Response - -Report concisely: - -- classification and reason codes; -- complete and failed iteration counts plus budget status; -- final construction and replay command; -- target kind, validity, and STEP roundtrip result; -- strict material status for solids or boundary diagnostic status for open shells; -- exact-topology status when requested; -- provenance summary and target runtime dependency; -- measured diagnostics and unresolved blockers; -- artifact paths. diff --git a/skills/simplecadapi/references/docs/guides/step-brep-reverse-engineering.md b/skills/simplecadapi/references/docs/guides/step-brep-reverse-engineering.md deleted file mode 100644 index c82bd9a8..00000000 --- a/skills/simplecadapi/references/docs/guides/step-brep-reverse-engineering.md +++ /dev/null @@ -1,265 +0,0 @@ -# STEP BREP Reverse Engineering - -This document is the normative STEP BREP reverse-engineering reference shipped -with the SDK (repo path `docs/guides/step-brep-reverse-engineering.md`). -The inspection APIs live in: - -```text -src/simplecadapi/inspect/brep/ -``` - -All of these functions are diagnostic APIs, not modeling -operations: they do not record graph nodes and must not run inside a -`GraphSession`. Export or obtain the geometry under test first, then call them -outside the modeling script: - -```python -from simplecadapi.inspect import brep - -report = brep.inspect_step_rbrepinspection(path="part.step") -summary = brep.inspect_step_rsummary(path="part.step") -face = brep.inspect_step_entity_rdescriptor( - path="part.step", - entity_id="face:0", -) -neighborhood = brep.inspect_topology_neighborhood_rdescriptor( - model_or_path="part.step", - entity_id="face:0", - depth=2, -) -section = brep.inspect_section_rdescriptor( - model_or_path="part.step", - origin=[0, 0, 10], - normal=[0, 0, 1], -) -comparison = brep.compare_global_properties_rdescriptor( - target="target.step", - current="candidate.step", -) -evaluation = brep.evaluate_reconstruction_rdescriptor( - target="target.step", - current="candidate.step", - replay_succeeded=True, -) -fit = brep.fit_face_analytic_rdescriptor( - model_or_path="part.step", - face_id="face:0", - tolerance=1.0e-3, -) -tracks = brep.track_section_contours_rdescriptor(sections=[section_a, section_b]) -image = brep.render_step_comparison_rpath( - target_step_path="target.step", - current_step_path="candidate.step", - output_path="comparison.png", -) -``` - -In `exact_brep_transcription` work, selected target faces can be copied outside -the modeling graph into a content-addressed `.scadbrep` sidecar: - -```python -snapshot = brep.copy_step_region_rpath( - path="target.step", - output_path="freeform-body.scadbrep", - face_ids=["face:0", "face:1", "face:2"], -) -``` - -The selected face IDs must form one connected, valid Shell. The snapshot keeps -the existing carrier surfaces, trims, pcurves, shared edges/vertices, -orientations, and tolerances. It does not infer feature history and remains -target-derived. Omit `face_ids` to snapshot one complete valid Solid. - -The replayable modeling program loads the hash-pinned sidecar without reading -the target STEP: - -```python -import simplecadapi as scad - -copied = scad.load_brep_region_rshell( - path="freeform-body.scadbrep", - sha256="sha256:...", -) -``` - -Model JSON records a relative sidecar path and SHA-256 but does not embed its -bytes; replay therefore resolves that path from the replay working directory. -GraphSession rejects absolute sidecar paths to avoid machine-specific model -JSON. Native BREP bytes are exact for the snapshot's pinned OCCT profile, not a -cross-version geometry hash. Use material and topology comparisons for -acceptance. - -`inspect_step_rsummary` returns entity counts, bounding box, material -volume/area, centroid, and surface/curve type statistics. -`inspect_step_entity_rdescriptor` uses stable zero-based IDs (`body:0`, -`face:0`, `edge:0`, `vertex:0`) and returns geometry type, analytic -parameters, measurements, and adjacency. To reuse an index across many -queries, load the model first: - -```python -model = brep.load_step_rbrepmodel(path="part.step") -summary = model.summary() -face = model.describe_entity("face:0") -neighbors = model.adjacency_details("face:0") -``` - -These IDs stay deterministic across repeated loads of the same unmodified -BREP, but they do not imply semantic correspondence between two different -models. Degenerate edges are reported uniformly as `DEGENERATE`, with the -underlying carrier type preserved in `underlying_curve_type`. - -## Mindset: APIs are not a pipeline - -The built-in inspect functions are composable APIs, not a fixed workflow, and -they do not guarantee coverage of every question. Reverse engineering has no -"standard pipeline": for a specific case, the agent must write case-by-case -inspection code as needed — load the model and traverse entities directly, -compose multiple queries, and write model-specific -sampling/projection/adjacency analysis — to obtain more detailed information -about that model that the built-in primitives do not cover. Primitives are the -starting point, not the endpoint. - -## Acceptance and stopping conditions (descending priority) - -1. **BREP topology identity = complete reverse engineering (best endpoint)**: - the geometric point set matches and the face-edge-vertex adjacency - structure matches. Reach it when you can. -2. **Identical BREP structure with slightly different parameters: - acceptable.** Export/serialization introduces floating-point error; minor - parameter-level deviations (last-digit differences in radii, distances, - etc.) are not failures and should not trigger further idle optimization. -3. **Structurally different but visually close BREP: a valid stopping - condition only when "genuinely unable to optimize further".** - "Genuinely unable to optimize further" is limited to the following two - reasons, with evidence recorded: - - no better feature operation order/combination can be found (feature-tree - hypotheses are exhausted); - - the required operation type is not yet supported by the SDK. - Otherwise, "looks close" is not a reason to stop; keep iterating. - -## Choosing an inspection strategy per problem - -There is no fixed reverse-engineering workflow to apply mechanically. First -clarify the current unknown and the acceptance evidence, then compose the -smallest set of primitives; for details the primitives do not cover, write -case-by-case inspection code for the model: - -| Question | Preferred primitives | -|---|---| -| Global size, mass properties, topology scale | `inspect_step_rsummary`, `compare_global_properties_rdescriptor` | -| Single face/edge parameters and adjacency | `inspect_step_entity_rdescriptor`, `inspect_topology_neighborhood_rdescriptor` | -| Map stable geometry IDs to visual entities | `render_entity_map_rpath` (opaque depth-preserving context with type-specific edge/face/point marks, distinct colors, and anchored `entity_id · geometry.type` callouts) | -| Section profile, wall thickness, or local cut | `inspect_section_rdescriptor`, `compare_sections_rdescriptor` | -| Test whether a face has an analytic carrier | `fit_face_analytic_rdescriptor` (require `accepted=True` and inspect residuals) | -| Track contour topology across ordered sections | `track_section_contours_rdescriptor` | -| Assembly tree and interface visualization | `inspect_step_components_rdescriptorlist`, `render_step_components_rpath` | -| Side-by-side multi-part observation | `render_step_components_colored_rpath` (direct `{component name: color name}` mapping, highlights multiple solids at once, with legend) | -| Where the difference is | `compare_material_rdescriptor`, `inspect_difference_regions_rdescriptor` | -| Local geometric error | `compare_boundary_distance_rdescriptor`, `compare_entities_rdescriptor` | -| Closure, manifoldness, edge uses, and tolerances | `inspect_topology_rdescriptor` | -| Material difference inside one ROI | `compare_material_region_rdescriptor` | -| Ordered section sweep | `compare_sections_batch_rdescriptor` | -| Atomic STEP write/reload evidence | `validate_step_roundtrip_rdescriptor` | -| Final exact-BREP gate | `compare_shapes_rbrepcomparison`, `compare_steps_rbrepcomparison` | -| Shared-scale visual comparison | `render_step_comparison_rpath` | -| Copy an exact connected face region | `copy_step_region_rpath`, then `load_brep_region_rshell` | - -Start from cheap, bounded facts; add boundary sampling, boolean difference, -sections, rendering, or strict topology comparison only when the current -question requires them. The generic schema registry and fixed dispatch have -been removed: pick and call these composable APIs directly per task. - -`inspect_topology_rdescriptor` reports generic BREP validity separately from -shell closure and manifoldness. It classifies face-local edge occurrences as -free, manifold, seam, non-manifold, orphan, degenerate, or orientation-defective, -and also reports wire closure, shell orientation, small faces, and tolerance -ranges. - -`validate_step_roundtrip_rdescriptor` writes to a temporary sibling, reloads -the STEP, checks property and topology-count drift, and replaces the destination -only after validation succeeds. - -`inspect_step_rbrepinspection()` keeps the full knot, multiplicity, control -point, and rational weight data of B-spline curves/surfaces in its report. -`inspect_step_entity_rdescriptor()` defaults to low-latency local -investigation and returns only degree and count summaries. For a single -B-spline/Bezier edge set `include_curve_definition=True`; for a B-spline/ -Bezier face set `include_surface_definition=True` and bound the control net -with `max_surface_control_points`. Surfaces return untrimmed carrier -definitions; trimming is still described by `u_range`, `v_range`, and the -face boundary. - -For an initial inventory, call `inspect_step_rsummary(..., -include_parameter_groups=True)` to get carrier groups by analytic radius or -B-spline degree, multi-solid canonical axes, and Face/Edge adjacency -signatures. Each group is bounded by `max_parameter_groups` and -`examples_per_group`. These only describe multiplicities; they do not infer -arrays, symmetry, or repeated features — validate pattern hypotheses with -spatial positions and spacing. - -For large outlines prefer `inspect_face_boundaries_rdescriptor(..., -compact=True)`. Compact mode keeps coedge order, orientation, type, length, -endpoints, and key parameters without returning 3D/UV sample arrays; request -detailed mode only when fitting or error measurement actually needs it. For -exact carriers add `include_curve_definitions=True` and optionally -`curve_definition_edge_ids=[...]`. - -`inspect_section_rdescriptor(..., compact=True)` still completes contour -connectivity, nesting, and area computation, but returns only endpoints/exact -lengths of each section edge plus a contour summary. Set -`connection_tolerance` explicitly when section endpoints have tiny gaps; -section-local edge indexes are not stable IDs across models. Use `face_ids` to -restrict a section to an already identified carrier set. Align contour samples -in case-specific extraction code only when a loft hypothesis requires it. - -Use `fit_face_analytic_rdescriptor(...)` when an imported face may be supported -by a plane, sphere, cylinder, or cone. Keep the candidate type, parameters, -residuals, and tolerance as evidence; do not treat the fit as recovered feature -history. Use `track_section_contours_rdescriptor(...)` on ordered section -results before selecting a loft strategy. Birth, death, split, or merge events -after the initial section make one global loft unsafe. - -Use `render_step_comparison_rpath(...)` for final visual comparison. It locks -both models to the union of their bounds so independent camera fitting cannot -hide size or placement differences. The rendered image remains diagnostic and -does not replace the strict BREP gate. - -After `compare_steps_rbrepcomparison(...)`, use -`comparison.to_error_summary()` to collect every failed validity, bounds, -material, topology, and carrier-type check. Errors are grouped by plausible -common root cause. One iteration may change multiple related operations or -code locations in a group, but must then rerun Direct modeling, strict replay, -STEP export, and the complete comparison. - -`compare_material_rdescriptor(..., include_components=False)` does a fast -volume estimate with a single intersection; subtracting a common volume can -lose a small residual on large-scale models and cannot by itself prove strict -material equality. For strict acceptance, difference-region localization, or -STEP difference export set `include_components=True` and -`boolean_tolerance=None`. Fuzzy booleans are diagnostic only. - -Rendering and image-section features need the optional dependency: - -```bash -uv sync --extra inspect -``` - -Performance principle: for closed solids, iterative acceptance prefers -validity, global properties, and bidirectional material difference to quickly -rule out large errors; but topology identity is the **best endpoint**, not an -optional extra — when the candidate is close in material and global -properties, check structural identity (see "Acceptance and stopping -conditions") and stop under the degraded conditions only after confirming -topology identity is unreachable. -`evaluate_reconstruction_rdescriptor()` includes global boundary sampling and -is not part of the cheap iteration path. -`compare_boundary_distance_rdescriptor`, `compare_sections_rdescriptor`, -`inspect_difference_regions_rdescriptor`, and local rendering should be called -per suspicious region as needed. - -`compare_boundary_distance_rdescriptor` defaults to at most 200 samples and -supports `target_face_ids`/`current_face_ids` local ranges. Set -`include_records=True` explicitly when handing results to -`inspect_difference_regions_rdescriptor`; then pass the result as -`boundary_result` to avoid recomputation. Center slices remain available via -`compare_step_slices_rslicecomparison` but are not a default step. diff --git a/skills/simplecadapi/references/docs/stdlib/README.md b/skills/simplecadapi/references/docs/stdlib/README.md deleted file mode 100644 index 17249b62..00000000 --- a/skills/simplecadapi/references/docs/stdlib/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# SimpleCAD Standard Library Index - -This index includes generated docs for standard part factory functions. Use these functions first when a task needs a standard mechanical part and does not require complex custom geometry changes. - -## Import Surfaces - -- Recommended package-level module export: `import simplecadapi as scad`, then call functions through submodules such as `scad.std.gear.(...)` and `scad.std.bearing.(...)`. -- Direct submodule import is also supported, for example `from simplecadapi.std.gear import make_spur_gear_rsolid` or `from simplecadapi.std.bearing import make_ball_bearing_rassembly`. - -## Usage Guidance - -- Prefer standard-library factories for standard bearings, gears, ring gears, and racks before hand-modeling profiles with core geometry APIs. -- Standard parts return normal SimpleCAD shapes or product assemblies, so they can be transformed, tagged, assembled, exported, or combined with core geometry operations. -- Switch to core geometry APIs only when the requested standard part needs substantial custom geometry beyond the factory parameters. - -## Bearing Assemblies - -- [build_ball_bearing](build_ball_bearing.md) *(from std/bearing.py)* `stdlib` -- [make_ball_bearing_rassembly](make_ball_bearing_rassembly.md) *(from std/bearing.py)* `stdlib` - -## External Gears - -- [make_helical_gear_rsolid](make_helical_gear_rsolid.md) *(from std/gear.py)* `stdlib` -- [make_herringbone_gear_rsolid](make_herringbone_gear_rsolid.md) *(from std/gear.py)* `stdlib` -- [make_spur_gear_rsolid](make_spur_gear_rsolid.md) *(from std/gear.py)* `stdlib` -- [make_straight_bevel_gear_rsolid](make_straight_bevel_gear_rsolid.md) *(from std/gear.py)* `stdlib` - -## Internal Ring Gears - -- [make_helical_ring_gear_rsolid](make_helical_ring_gear_rsolid.md) *(from std/gear.py)* `stdlib` -- [make_herringbone_ring_gear_rsolid](make_herringbone_ring_gear_rsolid.md) *(from std/gear.py)* `stdlib` -- [make_spur_ring_gear_rsolid](make_spur_ring_gear_rsolid.md) *(from std/gear.py)* `stdlib` - -## Cycloidal Reducer Discs - -- [make_cycloidal_disc_rsolid](make_cycloidal_disc_rsolid.md) *(from std/gear.py)* `stdlib` - -## Racks - -- [make_helical_rack_rsolid](make_helical_rack_rsolid.md) *(from std/gear.py)* `stdlib` -- [make_herringbone_rack_rsolid](make_herringbone_rack_rsolid.md) *(from std/gear.py)* `stdlib` -- [make_spur_rack_rsolid](make_spur_rack_rsolid.md) *(from std/gear.py)* `stdlib` diff --git a/skills/simplecadapi/references/docs/stdlib/build_ball_bearing.md b/skills/simplecadapi/references/docs/stdlib/build_ball_bearing.md deleted file mode 100644 index f340ed23..00000000 --- a/skills/simplecadapi/references/docs/stdlib/build_ball_bearing.md +++ /dev/null @@ -1,24 +0,0 @@ -# build_ball_bearing - -## API Definition - -```python -def build_ball_bearing(*, bore_diameter: float, outer_diameter: float, bearing_width: float, ball_diameter: float, ball_count: Optional[int] = None, raceway_clearance: float = 0.02, edge_chamfer: float = 0.0, assembly_id: str = 'std_ball_bearing', revision: str = '1.0.0', drive_angle_degrees: Optional[float] = None, fuse_rolling_elements: bool = True, rolling_element_fuse_overlap: float = 0.01, material: Optional[Material] = None, ground: Optional[str] = 'outer_ring', cache: object = 'off') -``` - -*Source: std/bearing.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.bearing.build_ball_bearing(...)`; direct submodule import: `from simplecadapi.std.bearing import build_ball_bearing` - -## Description - -Build one ball bearing as a reusable durable sub-assembly definition. - -Returns an ``AssemblyBuildResult`` whose definition re-declares the -standard library contract: public ``outer_axis``/``inner_axis`` connectors -over one internal ``inner_outer_revolute`` constraint, returned unsolved so -a parent assembly can drive both rings through external fixed constraints. -``ground`` selects the ring the nested definition grounds for its own -incremental solve (``"outer_ring"``, ``"inner_ring"``, or ``None``). diff --git a/skills/simplecadapi/references/docs/stdlib/make_ball_bearing_rassembly.md b/skills/simplecadapi/references/docs/stdlib/make_ball_bearing_rassembly.md deleted file mode 100644 index 4a349a0a..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_ball_bearing_rassembly.md +++ /dev/null @@ -1,28 +0,0 @@ -# make_ball_bearing_rassembly - -## API Definition - -```python -def make_ball_bearing_rassembly(bore_diameter: float, outer_diameter: float, bearing_width: float, ball_diameter: float, ball_count: Optional[int] = None, raceway_clearance: float = 0.02, edge_chamfer: float = 0.0, assembly_id: str = 'ball_bearing', drive_angle_degrees: Optional[float] = None, fuse_rolling_elements: bool = False, rolling_element_fuse_overlap: float = 0.01, material: Optional[Material] = None) -> Assembly -``` - -*Source: std/bearing.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.bearing.make_ball_bearing_rassembly(...)`; direct submodule import: `from simplecadapi.std.bearing import make_ball_bearing_rassembly` - -## Description - -Create a parameterized radial ball bearing assembly. - -With ``fuse_rolling_elements=False`` the factory returns separate -``outer_ring``, ``inner_ring``, and ``ball_*`` components. With -``fuse_rolling_elements=True`` all rolling elements are translated to -their authored pitch positions and unioned into the outer-ring body using -normal boolean mode (``glue=False``). The fused mode is intended for -simplified solver or export bodies; it deliberately embeds the balls into -the outer-race inner wall and therefore does not preserve the nominal -raceway clearance as a free gap. - -``material`` is assigned to the generated ring and rolling-element parts. diff --git a/skills/simplecadapi/references/docs/stdlib/make_cycloidal_disc_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_cycloidal_disc_rsolid.md deleted file mode 100644 index c85c561c..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_cycloidal_disc_rsolid.md +++ /dev/null @@ -1,104 +0,0 @@ -# make_cycloidal_disc_rsolid - -## API Definition - -```python -def make_cycloidal_disc_rsolid(n_lobes: int, ring_pin_pitch_radius: float, roller_radius: float, eccentricity: float, gear_height: float = 6.0, *, bore_radius: float = 0.0, output_pin_count: int = 0, output_pin_pitch_radius: float = 0.0, output_pin_clearance_radius: float = 0.0, output_pin_phase: float = 0.0, sample_count_per_lobe: int = 33, spline_tolerance: float = 0.005, max_control_points: int = 20) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_cycloidal_disc_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_cycloidal_disc_rsolid` - -## Description - -Create a cycloidal reducer disc for a one-tooth-difference pin ring. - -This is a single-disc geometric standard part. Real compact reducers often -stack two identical-lobe discs to balance output-pin side loads. In that -assembly-level pattern, separate two concepts that are easy to confuse: - -- Place the two input eccentric cam centers 180 degrees apart, for example -``(+e, 0)`` and ``(-e, 0)``, so their orbit loads oppose each other. -- Tooth-index the second cycloidal profile by half a lobe, not by a full -180 degree shape rotation. For a disc with ``n_lobes`` lobes, that -geometric body phase is ``180 / n_lobes`` degrees. A 10-lobe disc rotated -by 180 degrees is exactly five full lobe pitches and is visually and -mechanically equivalent to no tooth-index phase change. - -If output-pin clearance holes must stay aligned to one shared output pin -set, compensate the second disc's ``output_pin_phase`` by subtracting the -same body phase before rotating the finished disc body. - -## Parameters - -### n_lobes - -- **Type**: `int` -- **Description**: Number of cycloidal lobes. The matching fixed pin ring has - -### ``n_lobes + 1`` pins and gives a single-stage ``n_lobes - -- **Description**: 1`` reduction. - -### ring_pin_pitch_radius - -- **Type**: `float` -- **Description**: Radius of the fixed ring pin centers in mm. - -### roller_radius - -- **Type**: `float` -- **Description**: Radius of the fixed ring pins or rollers used to offset the profile. - -### eccentricity - -- **Type**: `float` -- **Description**: Input crank eccentricity in mm. - -### gear_height - -- **Type**: `float, default 6.0` -- **Description**: Disc thickness / extrusion height along Z in mm. - -### bore_radius - -- **Type**: `float, default 0.0` -- **Description**: Optional central bore radius. Zero leaves the disc unbored. - -### output_pin_count - -- **Type**: `int, default 0` -- **Description**: Optional number of circular output-pin clearance holes. - -### output_pin_pitch_radius - -- **Type**: `float, default 0.0` -- **Description**: Radius of the output-pin clearance hole centers in mm. - -### output_pin_clearance_radius - -- **Type**: `float, default 0.0` -- **Description**: Radius of each output-pin clearance hole in mm. - -### output_pin_phase - -- **Type**: `float, default 0.0` -- **Description**: Angular phase of the first output-pin clearance hole in degrees, in the unrotated disc's local frame. When a finished disc is rotated to create a tooth-index phase in a twin-disc stack, subtract that same rotation from ``output_pin_phase`` if the clearance holes should remain aligned to the same global output pins. - -### sample_count_per_lobe - -- **Type**: `int, default 33` -- **Description**: Number of analytic samples fitted into each lobe B-spline segment. - -### spline_tolerance - -- **Type**: `float, default 0.005` -- **Description**: Cubic B-spline fit tolerance in mm. - -### max_control_points - -- **Type**: `int, default 20` -- **Description**: Maximum poles allowed for each fitted lobe segment. diff --git a/skills/simplecadapi/references/docs/stdlib/make_helical_gear_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_helical_gear_rsolid.md deleted file mode 100644 index 8d248710..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_helical_gear_rsolid.md +++ /dev/null @@ -1,63 +0,0 @@ -# make_helical_gear_rsolid - -## API Definition - -```python -def make_helical_gear_rsolid(n_teeth: int, module: float, pressure_angle: float = 20.0, helix_angle: float = 30.0, gear_height: float = 8.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25, backlash: float = 0.0) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_helical_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_helical_gear_rsolid` - -## Description - -Create an involute helical gear. - -Non-zero helix angles use a continuous twisted sweep along the gear axis. -An auxiliary-spine rotation law preserves the profile while generating one -continuous side face per profile edge instead of one face per loft interval. - -## Parameters - -### n_teeth - -- **Type**: `int` -- **Description**: Number of teeth (>= 3). - -### module - -- **Type**: `float` -- **Description**: Gear module in mm. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### helix_angle - -- **Type**: `float, default 30` -- **Description**: Helix angle in degrees. - -### gear_height - -- **Type**: `float, default 8.0` -- **Description**: Gear thickness along Z in mm. - -### addendum_factor - -- **Type**: `float, default 1.0` -- **Description**: Tooth addendum as a multiple of module. - -### clearance_factor - -- **Type**: `float, default 0.25` -- **Description**: Root clearance beyond the addendum, as a multiple of module. - -### backlash - -- **Type**: `float, default 0.0` -- **Description**: Circumferential tooth-thickness reduction at the pitch circle in mm. diff --git a/skills/simplecadapi/references/docs/stdlib/make_helical_rack_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_helical_rack_rsolid.md deleted file mode 100644 index d5d6b9a6..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_helical_rack_rsolid.md +++ /dev/null @@ -1,44 +0,0 @@ -# make_helical_rack_rsolid - -## API Definition - -```python -def make_helical_rack_rsolid(module: float, n_teeth: int = 10, pressure_angle: float = 20.0, helix_angle: float = 25.0, rack_height: float = 8.0) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_helical_rack_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_helical_rack_rsolid` - -## Description - -Create a helical rack. - -## Parameters - -### module - -- **Type**: `float` -- **Description**: Gear module in mm (tooth pitch = pi * module). - -### n_teeth - -- **Type**: `int, default 10` -- **Description**: Number of teeth along the rack. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### helix_angle - -- **Type**: `float, default 25` -- **Description**: Helix angle in degrees. - -### rack_height - -- **Type**: `float, default 8.0` -- **Description**: Rack thickness along Z in mm. diff --git a/skills/simplecadapi/references/docs/stdlib/make_helical_ring_gear_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_helical_ring_gear_rsolid.md deleted file mode 100644 index a4cdcd82..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_helical_ring_gear_rsolid.md +++ /dev/null @@ -1,68 +0,0 @@ -# make_helical_ring_gear_rsolid - -## API Definition - -```python -def make_helical_ring_gear_rsolid(n_teeth: int, module: float, pressure_angle: float = 20.0, helix_angle: float = 25.0, gear_height: float = 8.0, rim_thickness: float = 3.0, backlash: float = 0.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_helical_ring_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_helical_ring_gear_rsolid` - -## Description - -Create an internal helical ring gear. - -The multi-loop ring face (outer rim plus internal tooth profile) is swept -with one continuous twist along the axis, producing one continuous side -face per profile edge per wire and no boolean subtraction. - -## Parameters - -### n_teeth - -- **Type**: `int` -- **Description**: Number of internal teeth (>= 3). - -### module - -- **Type**: `float` -- **Description**: Gear module in mm. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### helix_angle - -- **Type**: `float, default 25` -- **Description**: Helix angle in degrees. - -### gear_height - -- **Type**: `float, default 8.0` -- **Description**: Ring gear thickness along Z in mm. - -### rim_thickness - -- **Type**: `float, default 3.0` -- **Description**: Thickness of the rim beyond the tooth roots in mm. - -### backlash - -- **Type**: `float, default 0.0` -- **Description**: Circumferential tooth-space clearance at the pitch circle in mm. - -### addendum_factor - -- **Type**: `float, default 1.0` -- **Description**: Internal tooth addendum as a multiple of module. - -### clearance_factor - -- **Type**: `float, default 0.25` -- **Description**: Internal tooth root clearance beyond the addendum, as a multiple of module. diff --git a/skills/simplecadapi/references/docs/stdlib/make_herringbone_gear_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_herringbone_gear_rsolid.md deleted file mode 100644 index 9db0bacd..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_herringbone_gear_rsolid.md +++ /dev/null @@ -1,62 +0,0 @@ -# make_herringbone_gear_rsolid - -## API Definition - -```python -def make_herringbone_gear_rsolid(n_teeth: int, module: float, pressure_angle: float = 20.0, helix_angle: float = 32.0, gear_height: float = 10.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25, backlash: float = 0.0) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_herringbone_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_herringbone_gear_rsolid` - -## Description - -Create an involute herringbone (double-helical) gear. - -Each half uses a continuous twisted sweep with opposite handedness. The two -halves share the rotated center profile and are fused into one solid. - -## Parameters - -### n_teeth - -- **Type**: `int` -- **Description**: Number of teeth (>= 3). - -### module - -- **Type**: `float` -- **Description**: Gear module in mm. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### helix_angle - -- **Type**: `float, default 32` -- **Description**: Helix angle of each half in degrees. - -### gear_height - -- **Type**: `float, default 10.0` -- **Description**: Total gear thickness along Z in mm. - -### addendum_factor - -- **Type**: `float, default 1.0` -- **Description**: Tooth addendum as a multiple of module. - -### clearance_factor - -- **Type**: `float, default 0.25` -- **Description**: Root clearance beyond the addendum, as a multiple of module. - -### backlash - -- **Type**: `float, default 0.0` -- **Description**: Circumferential tooth-thickness reduction at the pitch circle in mm. diff --git a/skills/simplecadapi/references/docs/stdlib/make_herringbone_rack_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_herringbone_rack_rsolid.md deleted file mode 100644 index 98ca33c0..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_herringbone_rack_rsolid.md +++ /dev/null @@ -1,44 +0,0 @@ -# make_herringbone_rack_rsolid - -## API Definition - -```python -def make_herringbone_rack_rsolid(module: float, n_teeth: int = 10, pressure_angle: float = 20.0, helix_angle: float = 30.0, rack_height: float = 10.0) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_herringbone_rack_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_herringbone_rack_rsolid` - -## Description - -Create a herringbone rack. - -## Parameters - -### module - -- **Type**: `float` -- **Description**: Gear module in mm (tooth pitch = pi * module). - -### n_teeth - -- **Type**: `int, default 10` -- **Description**: Number of teeth along the rack. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### helix_angle - -- **Type**: `float, default 30` -- **Description**: Helix angle of each half in degrees. - -### rack_height - -- **Type**: `float, default 10.0` -- **Description**: Total rack thickness along Z in mm. diff --git a/skills/simplecadapi/references/docs/stdlib/make_herringbone_ring_gear_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_herringbone_ring_gear_rsolid.md deleted file mode 100644 index 0892ad70..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_herringbone_ring_gear_rsolid.md +++ /dev/null @@ -1,68 +0,0 @@ -# make_herringbone_ring_gear_rsolid - -## API Definition - -```python -def make_herringbone_ring_gear_rsolid(n_teeth: int, module: float, pressure_angle: float = 20.0, helix_angle: float = 30.0, gear_height: float = 10.0, rim_thickness: float = 3.0, backlash: float = 0.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_herringbone_ring_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_herringbone_ring_gear_rsolid` - -## Description - -Create an internal herringbone ring gear. - -The multi-loop ring face is swept as two continuous twisted-sweep halves -with opposite handedness sharing the rotated center section, then fused, -mirroring the external herringbone gear construction. - -## Parameters - -### n_teeth - -- **Type**: `int` -- **Description**: Number of internal teeth (>= 3). - -### module - -- **Type**: `float` -- **Description**: Gear module in mm. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### helix_angle - -- **Type**: `float, default 30` -- **Description**: Helix angle of each half in degrees. - -### gear_height - -- **Type**: `float, default 10.0` -- **Description**: Total ring gear thickness along Z in mm. - -### rim_thickness - -- **Type**: `float, default 3.0` -- **Description**: Thickness of the rim beyond the tooth roots in mm. - -### backlash - -- **Type**: `float, default 0.0` -- **Description**: Circumferential tooth-space clearance at the pitch circle in mm. - -### addendum_factor - -- **Type**: `float, default 1.0` -- **Description**: Internal tooth addendum as a multiple of module. - -### clearance_factor - -- **Type**: `float, default 0.25` -- **Description**: Internal tooth root clearance beyond the addendum, as a multiple of module. diff --git a/skills/simplecadapi/references/docs/stdlib/make_spur_gear_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_spur_gear_rsolid.md deleted file mode 100644 index f6c95c23..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_spur_gear_rsolid.md +++ /dev/null @@ -1,54 +0,0 @@ -# make_spur_gear_rsolid - -## API Definition - -```python -def make_spur_gear_rsolid(n_teeth: int, module: float, pressure_angle: float = 20.0, gear_height: float = 6.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25, backlash: float = 0.0) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_spur_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_spur_gear_rsolid` - -## Description - -Create an involute spur gear (straight teeth, helix angle = 0). - -## Parameters - -### n_teeth - -- **Type**: `int` -- **Description**: Number of teeth (>= 3). - -### module - -- **Type**: `float` -- **Description**: Gear module in mm (pitch diameter = module * n_teeth). - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### gear_height - -- **Type**: `float, default 6.0` -- **Description**: Gear thickness / extrusion height along Z in mm. - -### addendum_factor - -- **Type**: `float, default 1.0` -- **Description**: Tooth addendum as a multiple of module, matching FreeCAD's tooth height factor default. - -### clearance_factor - -- **Type**: `float, default 0.25` -- **Description**: Root clearance beyond the addendum, as a multiple of module. - -### backlash - -- **Type**: `float, default 0.0` -- **Description**: Circumferential tooth-thickness reduction at the pitch circle in mm. diff --git a/skills/simplecadapi/references/docs/stdlib/make_spur_rack_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_spur_rack_rsolid.md deleted file mode 100644 index 2a19a9e3..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_spur_rack_rsolid.md +++ /dev/null @@ -1,39 +0,0 @@ -# make_spur_rack_rsolid - -## API Definition - -```python -def make_spur_rack_rsolid(module: float, n_teeth: int = 10, pressure_angle: float = 20.0, rack_height: float = 6.0) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_spur_rack_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_spur_rack_rsolid` - -## Description - -Create a straight-tooth rack. - -## Parameters - -### module - -- **Type**: `float` -- **Description**: Gear module in mm (tooth pitch = pi * module). - -### n_teeth - -- **Type**: `int, default 10` -- **Description**: Number of teeth along the rack. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### rack_height - -- **Type**: `float, default 6.0` -- **Description**: Rack thickness along Z in mm. diff --git a/skills/simplecadapi/references/docs/stdlib/make_spur_ring_gear_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_spur_ring_gear_rsolid.md deleted file mode 100644 index 344be0ef..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_spur_ring_gear_rsolid.md +++ /dev/null @@ -1,59 +0,0 @@ -# make_spur_ring_gear_rsolid - -## API Definition - -```python -def make_spur_ring_gear_rsolid(n_teeth: int, module: float, pressure_angle: float = 20.0, gear_height: float = 6.0, rim_thickness: float = 3.0, backlash: float = 0.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_spur_ring_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_spur_ring_gear_rsolid` - -## Description - -Create an internal spur ring gear. - -## Parameters - -### n_teeth - -- **Type**: `int` -- **Description**: Number of internal teeth (>= 3). - -### module - -- **Type**: `float` -- **Description**: Gear module in mm. - -### pressure_angle - -- **Type**: `float, default 20` -- **Description**: Pressure angle in degrees. - -### gear_height - -- **Type**: `float, default 6.0` -- **Description**: Ring gear thickness along Z in mm. - -### rim_thickness - -- **Type**: `float, default 3.0` -- **Description**: Thickness of the rim beyond the tooth tips in mm. - -### backlash - -- **Type**: `float, default 0.0` -- **Description**: Circumferential tooth-space clearance at the pitch circle in mm. - -### addendum_factor - -- **Type**: `float, default 1.0` -- **Description**: Internal tooth addendum as a multiple of module. - -### clearance_factor - -- **Type**: `float, default 0.25` -- **Description**: Internal tooth root clearance beyond the addendum, as a multiple of module. diff --git a/skills/simplecadapi/references/docs/stdlib/make_straight_bevel_gear_rsolid.md b/skills/simplecadapi/references/docs/stdlib/make_straight_bevel_gear_rsolid.md deleted file mode 100644 index dfc3c2ec..00000000 --- a/skills/simplecadapi/references/docs/stdlib/make_straight_bevel_gear_rsolid.md +++ /dev/null @@ -1,26 +0,0 @@ -# make_straight_bevel_gear_rsolid - -## API Definition - -```python -def make_straight_bevel_gear_rsolid(n_teeth: int, module: float, pitch_angle: float = 45.0, pressure_angle: float = 20.0, face_width: float = 8.0, *, addendum_factor: float = 1.0, clearance_factor: float = 0.25, backlash: float = 0.0) -> Solid -``` - -*Source: std/gear.py* - -## Import Surface - -- standard library: `import simplecadapi as scad` then `scad.std.gear.make_straight_bevel_gear_rsolid(...)`; direct submodule import: `from simplecadapi.std.gear import make_straight_bevel_gear_rsolid` - -## Description - -Create a straight bevel gear with standard metric tooth proportions. - -The large-end transverse section uses the same analytic involute profile as -:func:`make_spur_gear_rsolid`. A similar small-end section is located on the -requested pitch cone and joined with ruled straight tooth surfaces. - -``face_width`` is measured along the pitch-cone generator. This factory -supplies nominal tooth geometry; a released pair still requires mating-gear, -mounting-distance, contact-pattern, backlash, material, heat-treatment, and -strength checks. diff --git a/skills/simplecadapi/references/docs/updates/2.0.2.md b/skills/simplecadapi/references/docs/updates/2.0.2.md deleted file mode 100644 index 86f66951..00000000 --- a/skills/simplecadapi/references/docs/updates/2.0.2.md +++ /dev/null @@ -1,106 +0,0 @@ -# SimpleCADAPI 2.0.2 Update Notes - -[Chinese](2.0.2.zh-CN.md) - -> **Experimental release notice:** The capabilities described below are still -> experimental. Breaking changes may be introduced in later releases, so this -> version is not recommended for immediate production use. - -SimpleCADAPI 2.0.2 expands the project from an OCP-native geometry API into an -end-to-end, inspectable CAD workflow. The release covers model creation, -parameter and tolerance reasoning, replayable persistence, cross-CAD -translation, browser inspection, assembly verification, and STEP reverse -engineering. - -## 1. Cross-CAD Translation - -Canonical model JSON can be translated into automation scripts for FreeCAD, -Fusion 360, and SolidWorks. The FreeCAD backend can also write an editable -`.FCStd` document when FreeCAD/FreeCADCmd is available, preserving sketches, -features, parts, assemblies, links, and source selections where supported. -Fusion 360 exports target its Python automation environment. The SolidWorks -backend emits automation scripts and can drive a STEP export via COM. A single -parameterized SimpleCAD model can therefore serve multiple downstream CAD -systems without maintaining separate scripts. - -## 2. Browser 3-D Viewer - -The `viewer/` application opens generated `.scene.zip` packages without -importing Python or OpenCascade. It renders GLB geometry and CAD edges, provides -orbit/pan/zoom inspection, exposes an assembly/component tree with per- -occurrence visibility controls, and lets users select faces, edges, and vertices -to inspect measured properties and semantic/topological identity. - -The Features view displays the replayable operation tree, parameters, output -counts, tags, and embedded source code, including the originating call and -highlighted source range. Scene packages also validate resource sizes and -SHA-256 metadata before loading referenced assets. - -## 3. Structured Persistence, Replay, and Source Mapping - -Modeling work recorded through `@model` or `GraphSession` can be exported as -canonical model/session JSON and replayed deterministically with -`import_model_json(...)` and `replay_model_json(...)`. A scene export can -package `scene.json`, `model/model.json`, embedded project-relative Python -sources, and GLB/entity assets into one portable artifact. - -Every recorded operation captures best-effort source provenance. A feature-tree -node can be traced to the Python file, function call, assignment target, and -line range that produced it. This provides a foundation for automation, -collaboration, regression testing, and versioned model review. - -## 4. Physical Units and Tolerance Analysis - -Unit-aware variables preserve declared units in the model graph while converting -CAD operations to canonical millimeters and degrees. Expressions infer -dimensions across arithmetic and supported trigonometric operations, reject -incompatible combinations, and retain their parameter graph for replay. - -Manufacturing tolerances can be propagated through dimension chains, analyzed -with nominal and bound results, and checked against explicit requirements. The -result supports unit conversion, dimensional chains, and assembly tolerance -studies without reducing the model to unexplained bare numbers. - -## 5. Standard Mechanical Parts and Gear Performance - -The standard library includes parameterized bolts and nuts, ball-bearing -assemblies, roller-chain sprockets, spur/helical/herringbone gears, internal -ring gears, racks, cycloidal discs, and bevel gears. These factories return -ordinary SimpleCAD shapes or assemblies, so results can be transformed, -tagged, combined, serialized, translated, and exported like custom geometry. - -Gear construction and standard-library graph tracking were also optimized; -representative gear workloads are reported to complete in about one-third of -their previous time. - -## 6. Assemblies, Meshes, and Collision Verification - -Parts, components, connectors, placements, and assemblies can be persisted as a -structured product tree with fixed, revolute, prismatic, gear, belt, and -rack-and-pinion constraints. Constraint solving and residual inspection make -assembly relationships measurable. Render meshes and edge meshes are generated -for scene assets and downstream inspection. - -The optional `simplecadapi[collision]` extra adds static, current-pose mesh -penetration checks through `python-fcl`, with configurable component scopes, -penetration tolerances, contact reporting, and non-fatal backend warnings. This -first verifier checks mesh contact penetration; it does not yet solve motion or -detect every complete-containment case. - -## 7. STEP Inspection and Reverse Engineering - -The `simplecad-brep` CLI and `simplecadapi.inverse_engineer.brep` API inspect -STEP BREP files and report volumes, surface areas, bounds, topology counts, and -geometric primitive labels. Bidirectional comparisons can apply a hard gate -based on geometric point-set equality and a geometry-labelled face-edge-vertex -incidence graph, rather than relying only on a volume delta. - -The toolkit also renders consistent STEP views and compares sampled physical -slices with XOR overlays. These diagnostics help verify whether a reconstructed -part agrees with the original in both geometry and topology. - -## Related Documentation - -- [STEP BREP reverse-engineering guide](../guides/step-brep-reverse-engineering.md) -- [Browser viewer README](../../viewer/README.md) -- [Core serialization and replay documentation](../core/serialization/README.md) diff --git a/skills/simplecadapi/references/docs/updates/2.0.4b1.md b/skills/simplecadapi/references/docs/updates/2.0.4b1.md deleted file mode 100644 index f3d11b33..00000000 --- a/skills/simplecadapi/references/docs/updates/2.0.4b1.md +++ /dev/null @@ -1,66 +0,0 @@ -# SimpleCADAPI 2.0.4b1 Update Notes - -[Chinese](2.0.4b1.zh-CN.md) - -> **Beta release notice:** These changes are being validated before the final -> 2.0.4 release. Review generated CAD documents before using them in production. - -SimpleCADAPI 2.0.4b1 improves FreeCAD document semantics, assembly reliability, -boolean-union behavior, and standard bearing reuse. - -## 1. Semantic FreeCAD Documents - -The FreeCAD translator now maps source assignment targets and modeling intent to -human-readable object labels while retaining canonical node identifiers for -stable replay and traceability. Translated documents organize visible geometry -into a product-oriented tree instead of exposing a flat list of graph operations. - -The Tree View exposes one resolved product root for assembly models, or the -standalone geometry roots for non-product models. Construction objects, -`App::Link` source definitions, and preview compounds remain available for -recomputation without appearing as duplicate top-level models. - -## 2. FreeCAD Assembly Stability - -Flexible `Assembly::AssemblyLink` occurrences now restore complete native Joint -ViewProviders for copied constraints. Activating a translated assembly keeps -solver-visible joints redrawable and avoids the previous joint-placement redraw -failure. - -Occurrence generation and final document persistence now preserve the intended -part, component, connector, joint, material, and visibility relationships in the -saved `.FCStd` document. - -## 3. Reliable Boolean Union Semantics - -`union_rsolid(...)` now defaults to the normal OCC fuse path. `glue=True` is an -optional optimization: if GlueShift returns multiple solids, SimpleCAD -automatically retries with GlueOff and uses the fallback operation's topology -history. - -Face-area contact and positive-volume overlap can produce one manifold solid -without callers introducing artificial overlap. Edge-only, vertex-only, and -point/curve tangencies remain explicit errors because they do not form one -manifold solid. Explicit fuzzy tolerances must be finite and non-negative; they -may bridge a real small gap when that approximation is intentional. - -## 4. Standard Fused Bearings and BLDC Migration - -`scad.std.bearing.make_ball_bearing_rassembly(...)` can fuse decorative rolling -elements into the outer-ring body while retaining the inner/outer revolute joint. -The fused mode exposes only `outer_ring` and `inner_ring` as solver bodies, -records its simplification in bearing metadata, and supports material assignment. -Internal Part identifiers are namespaced by `assembly_id`, allowing several -bearing sizes in one `GraphSession` without identifier collisions. - -The integrated BLDC actuator now uses the standard-library bearing factory for -all motor, interstage, planet, and output bearings. Its generated FreeCAD model -contains eleven bearing instances; each has one fused outer-ring solid, one -inner-ring solid, and no unconstrained ball bodies in FreeCAD Simulation. - -## 5. Verification - -The release adds regression coverage for face-touching unions, curved overlapping -inputs under glue optimization, non-manifold edge and tangent contact, invalid -fuzzy tolerances, fused standard bearings, repeated bearing definitions, BLDC -bearing contracts, and translated FreeCAD assembly activation. diff --git a/skills/simplecadapi/references/docs/updates/2.0.4b2.md b/skills/simplecadapi/references/docs/updates/2.0.4b2.md deleted file mode 100644 index b65adb7e..00000000 --- a/skills/simplecadapi/references/docs/updates/2.0.4b2.md +++ /dev/null @@ -1,136 +0,0 @@ -# SimpleCADAPI 2.0.4b2 Update Notes - -[Chinese](2.0.4b2.zh-CN.md) - -> **Beta release notice:** These changes are being validated before the final -> 2.0.4 release. Review reconstructed geometry and generated CAD documents -> before using them in production. - -SimpleCADAPI 2.0.4b2 adds an Agent-oriented STEP/BREP reconstruction workflow. -The release turns the existing inspection and strict-comparison utilities into -a focused, framework-neutral tool surface for iterative reconstruction. It also -adds replayable interpolated B-spline profiles for freeform and periodic input. - -## 1. Indexed STEP/BREP Inspection - -`simplecadapi.inverse_engineer.brep` now builds a bounded, cached `BRepModel` -for each STEP input. Bodies, Faces, Edges, and Vertices receive deterministic -zero-based identifiers such as `body:0`, `face:12`, and `edge:4`, allowing an -Agent to carry local topology references across inspection calls. - -The model summary reports validity, material-body counts, bounds, volume, -surface area, centroid, topology counts, and analytic surface/curve statistics. -Optional bounded groups expose repeated carrier parameters, canonical axes, and -adjacency signatures as evidence for a hypothesis; these groups do not infer a -pattern by themselves. - -Entity inspection reports geometry parameters, bounds, adjacency, endpoint -differentials, and optional exact B-spline or Bezier definitions. Surface -definitions remain explicitly separated from trim-loop evidence so an -untrimmed carrier cannot be mistaken for a complete Face. - -## 2. Framework-Neutral Agent Tools - -The new `agent_tool_schemas()` registry exposes 17 JSON-Schema-validated tools, -and `call_agent_tool(...)` dispatches them without depending on a particular -Agent framework: - -```text -get_model_summary inspect_entity -get_topology_neighborhood measure_relation -make_section extract_face_boundaries -probe_point render_region -compare_global_properties compare_boundary_distance -compute_material_difference compare_sections -build_difference_regions find_nearby_entities -compare_entities evaluate_result -compare_brep_strict -``` - -The `simplecad-brep tools` command prints the schemas. `simplecad-brep tool` -invokes one tool with an inline JSON object or an `--arguments-file`, so the same -contract is available to shell-driven Agents and external orchestrators. - -## 3. Targeted Diagnosis and Acceptance Gates - -Local query tools can expand a bounded topology neighborhood, measure supported -parallel/coplanar/coaxial/concentric/perpendicular/touching/tangent relations, -cut physical sections, extract ordered Face loops, and find the nearest indexed -entities to a point. Compact section and boundary modes preserve structural -evidence while omitting large sampled arrays. - -Candidate diagnostics now include: - -- global body, bounds, volume, area, centroid, and topology deltas; -- bidirectional sampled-boundary-to-exact-boundary distances; -- strict missing/excess material components from directional Boolean cuts; -- target/candidate section comparison on the same physical plane; -- ranked material or boundary difference regions and nearby entity lookup; -- local entity parameter and adjacency comparison. - -`evaluate_result(...)` applies replay, BREP validity, material, bounds, volume, -area, and boundary gates in one report. Strict geometry-labelled incidence -comparison remains opt-in. Fuzzy Boolean results are diagnostic only and cannot -claim strict material equality. - -## 4. Region Rendering Without Geometry Side Effects - -`render_region(...)` renders selected stable entities and an optional topology -neighborhood over a translucent context model. Existing full-model -`render_step_views(...)` output remains available for synchronized isometric and -orthographic inspection. - -Rendering now meshes a detached BREP copy. OpenCascade triangulation therefore -cannot alter the cached model's measured bounds or influence a later Agent -evaluation in the same process. - -## 5. Replayable Interpolated B-Splines - -The public modeling API adds: - -```text -make_interpolated_spline_redge(...) -make_interpolated_spline_rwire(...) -make_periodic_spline_rwire(...) -``` - -Open and periodic curves interpolate their input points through the OCP kernel, -validate minimum point counts and duplicate-point tolerances, and retain their -construction data in graph metadata. Canonical model JSON records and strictly -replays interpolated edges, including expression-valued points. Periodic -profiles can be promoted into replayable Faces and Loft workflows. - -## 6. Reconstruction Agent Workflow - -The new reconstruction specification defines three explicit operating modes: - -- **inspection-only reconstruction** restricts access to exact control arrays; -- **report-assisted reconstruction** permits targeted exact curve/surface data; -- **exact BREP transcription** permits complete carrier, trim, and topology - evidence while requiring the result to be labelled as transcription. - -The workflow requires isolated inputs and outputs, a written feature hypothesis, -Sketch-first planar profiles unless a documented exception applies, fresh-process -model replay, valid BREP output, and measured final classification. Expensive -Boolean, dense boundary, and strict-topology checks are delayed until cheaper -evidence shows that a candidate is close enough to justify them. - -## 7. Verification - -Regression coverage includes stable entity identifiers, bounded schemas, -compact sections and boundary definitions, cross-model relation semantics, -material-difference strictness, difference-region reuse, evaluation gates, -region-rendering side effects, interpolated-curve replay, expression retention, -and periodic-profile Loft replay. - -A real STEP round trip was also exercised with a replayable drilled solid. The -target and replayed STEP passed strict material, boundary, validity, and -geometry-labelled incidence gates after both full-model and highlighted-region -rendering. - -## Related Documentation - -- [Reconstruction Agent test specification](../guides/reconstruction-agent-test-prompt.md) -- [STEP BREP reverse-engineering guide](../guides/step-brep-reverse-engineering.md) -- [SimpleCADAPI Agent Skill BREP reference](../../skills/simplecadapi/references/inverse_engineer/brep-reverse-engineering.md) -- [Previous 2.0.4b1 update notes](2.0.4b1.md) diff --git a/skills/simplecadapi/references/docs/updates/2.0.4b3.md b/skills/simplecadapi/references/docs/updates/2.0.4b3.md deleted file mode 100644 index 077783d2..00000000 --- a/skills/simplecadapi/references/docs/updates/2.0.4b3.md +++ /dev/null @@ -1,129 +0,0 @@ -# SimpleCADAPI 2.0.4b3 Update Notes - -[Chinese](2.0.4b3.zh-CN.md) - -> **Beta release notice:** Validate generated definitions, assembly constraints, -> and manufacturing geometry before production use. - -SimpleCADAPI 2.0.4b3 adds reproducible product build boundaries and a persistent, -crash-safe cache spanning whole parts and incremental assembly solves. - -## 1. Durable part and assembly definitions - -`@scad.part` builds exactly one physical single-solid part and returns a -`PartBuildResult`: runtime `Part`, `PartDefinition`, graph/session state, model -and session JSON, interface differences, and a per-build `CacheReport`. Its -content-derived key covers normalized arguments, builder source, declared file -inputs, revision, tolerance profile, and generator/ABI profile. - -`@scad.assemble` requires explicit external `PartDefinition` or nested -`AssemblyDefinition` inputs. Repeated instances share immutable definitions; -closed validation rejects missing, unused, cyclic, conflicting, or incompatible -references. Definitions round-trip independently from process-local runtime -objects. - -## 2. Incremental assembly solve - -Assembly state records component dependencies and public connector interfaces. -Changes to geometry, connectors, connector bindings, material, or a nested -assembly's public connector declaration propagate only through affected dependency paths. -Unchanged component placements can be restored from cache, but every restored -placement still passes constraint-residual verification before it is accepted. - -## 3. PRT reuse - -In `read_only` and `read_write` modes, calls to the same decorated `@scad.part` -builder and build key reuse one runtime PRT with zero cache I/O. Concurrent -same-key calls share one build. `off` and `refresh` preserve their explicit -rebuild semantics. - -Durable whole-part bundles remain the cross-run boundary. A newly decorated -builder or later process restores an unchanged PRT from its validated bundle and -creates fresh runtime graph provenance. Corrupt records or objects degrade to -misses and are quarantined before recomputation. - -## 4. Crash-safe content store and policy - -The shared CAS uses canonical closed records, SHA-256 objects, atomic writes, -per-key locks, stale-lock recovery, and object deduplication. - -One `CachePolicy` controls part and assembly caching. Precedence is explicit API -argument, environment, `[tool.simplecadapi.cache]`, then defaults. The supported -modes are `off`, `read_only`, `read_write`, and `refresh`. - -## 5. Cache diagnostics CLI - -The new `simplecad-cache` command emits stable JSON: - -```text -simplecad-cache status [--namespace NAME] -simplecad-cache verify [--namespace NAME] [--repair] -simplecad-cache prune [--apply] -simplecad-cache clear [--namespace NAME] --yes -``` - -Inspection and default prune are read-only. Explicit `--repair`, `--apply`, or -`--yes` is required to mutate state. `verify` always validates record identity, -object presence, byte length, and SHA-256. Namespace clearing preserves objects -still referenced elsewhere. - -## 6. Product-package CAD translation - -Validated `.scadpkg` definition closures now translate to one editable FreeCAD -document or one XCAF-backed AP242 STEP file. FreeCAD output uses a -dependency-first definition registry so repeated parts, nested assemblies, -occurrence names, solved placements, materials, connectors, constraints, -grounding, revision, and content hashes survive in native document structure. - -AP242 output uses `AP242_MANAGED_MODEL_BASED_3D_ENGINEERING`, preserves evaluated -BREP and product occurrences, and writes materials, colors, density, plus named -definition/occurrence properties. The property descriptions contain canonical -sorted JSON for durable IDs and semantics. Feature history is not reconstructed -as AP242 features; `.scadpkg` remains the canonical replayable artifact. - -Product mesh export now shares one direct OpenCASCADE tessellation of evaluated -BREP solids. OBJ and binary STL contain the same oriented triangles; OBJ keeps -shared vertex indices while STL stores independent facets. The public accuracy -controls are `linear_deflection`, `angular_deflection_degrees`, and `relative`. -No remeshing dependency or Python 3.11 version gate is involved, so mesh export -works across the package's complete supported Python range. - -The scripts in `examples/12_ap242_gmsh_volume_mesh/` build one `.scadpkg` and -demonstrate every package exporter and translator as independent downstream -commands: AP242 STEP, STL, OBJ, FCStd, FreeCAD, Fusion 360, and SolidWorks. -The optional Gmsh stage continues from AP242 STEP to a tetrahedral `.msh` -without adding Gmsh to the core runtime dependency set. - -## 7. Native render crash isolation - -On macOS, VTK 9.5's Cocoa offscreen backend can terminate the interpreter with -`SIGSEGV` after repeated or concurrent render-window use. Inspection and SDK -screenshot calls now tessellate in the caller, then render through one-shot VTK -workers guarded by a cross-process lock. Completion markers distinguish a -finished image from a partial native crash; incomplete workers retry, while a -post-write teardown crash cannot terminate the modeling or test process. - -## 8. Verification - - -Regression coverage exercises artifact schema closure, deterministic IDs and -hashes, atomic concurrent write deduplication, corruption quarantine, all cache -modes, in-process same-key PRT reuse, concurrent PRT build deduplication, -cross-wrapper persistent part restore, interface invalidation, assembly -definition DAGs, incremental dependency propagation, residual verification, -nested connector changes, translator backend contracts, and generated API docs. - -The nested package smoke writes and reads a native FreeCAD hierarchy with shared -definitions and solved placements. AP242 round-trip checks the managed-model -schema, five-level product explorer records, material and color data, plus seven -named metadata property items for three definitions and four occurrences. The -Gmsh smoke imports AP242 as one 3D volume and generates a non-empty tetrahedral -mesh. - -## Related documentation - -- [Persistent cache and product build workflow](../guides/cache-build-workflow.md) -- [Product package STEP/STL export APIs](../api/export_product_package_to_step.md) -- [Editable FreeCAD product package API](../api/translate_product_package_to_fcstd.md) -- [Modeling workflows](../../skills/simplecadapi/references/MODELING_WORKFLOWS.md) -- [Previous 2.0.4b2 update notes](2.0.4b2.md) diff --git a/skills/simplecadapi/references/docs/updates/step-reverse-migration.md b/skills/simplecadapi/references/docs/updates/step-reverse-migration.md deleted file mode 100644 index ff905c79..00000000 --- a/skills/simplecadapi/references/docs/updates/step-reverse-migration.md +++ /dev/null @@ -1,50 +0,0 @@ -# STEP Reverse Implementation Migration - -This document records the selected implementation changes migrated from the -`STEP-reverse` branch. Later migration commits append numbered entries to this -same document. - -## 1. Analytic Face Fitting, Section Tracking, and Comparison Rendering - -Added three inspection APIs under `simplecadapi.inspect.brep`: - -- `fit_face_analytic_rdescriptor(...)` samples an indexed BREP face and fits - plane, sphere, cylinder, and cone carriers. It reports candidate parameters - and residual statistics as reconstruction evidence without asserting feature - history. -- `track_section_contours_rdescriptor(...)` matches closed contours across - ordered sections and reports continuation, birth, death, split, and merge - events. Its summary indicates when topology changes make a single global loft - unsafe. -- `render_step_comparison_rpath(...)` renders original and reconstructed STEP - models side by side with identical views, camera bounds, and scale so visual - size and placement differences are not hidden by per-model camera fitting. - -Added focused regression tests for cylindrical carrier fitting, contour birth -detection, and shared-view STEP comparison image generation. No bounded STEP -comparison, topology fingerprint, or public-export-only changes were included. - -Updated the bundled `simplecadapi` Skill with selection rules, reverse- -engineering usage guidance, API index entries, and exact reference pages for -the three inspection APIs. - -## 2. Grouped STEP/BREP Comparison Diagnostics - -Extended `BRepComparison` with structured diagnostic facts for STEP validity, -bounding boxes, material volume and bidirectional Boolean difference, -topology counts, Face-Edge topology, and surface/curve carrier types. The -strict geometric and topology hard gate remains unchanged. - -Added `to_error_summary()` and `write_error_summary_json(...)` to report every -failed comparison check instead of stopping at one reason. Each error includes -its code, expected and actual values, plausible causes, affected modeling -stages, and severity. Related errors are grouped by a plausible common root -cause, with an iteration policy that permits coordinated fixes within one -group before rerunning Direct modeling, strict replay, STEP export, and the -complete comparison. - -Added regression coverage for successful comparisons, simultaneous material -and placement failures, common-root-cause grouping, iteration-policy output, -and JSON artifact writing. Updated the bundled `simplecadapi` Skill API pages -and reverse-engineering guidance for the new comparison diagnostics and error -summary workflow. diff --git a/skills/simplecadapi/references/domains/assembly-and-product.md b/skills/simplecadapi/references/domains/assembly-and-product.md deleted file mode 100644 index 62bcbfff..00000000 --- a/skills/simplecadapi/references/domains/assembly-and-product.md +++ /dev/null @@ -1,108 +0,0 @@ -# Task Domain: Assembly and Product - -Compose multi-part products with explicit placement, connectors, and -declarative constraints; build durable definitions with `@part`/`@assemble`, -incremental solving, the persistent cache, and `.scadpkg` delivery. - -## Use when - -- The deliverable contains more than one physical part, repeated instances, or - nested subassemblies. -- Parts must be positioned by interfaces (axes, faces, datum connectors) rather - than raw transforms. -- The product needs motion semantics: hinges, sliders, gear meshes, rack and - pinion, belt drives, or loop-closing joints. -- The build needs durable definitions, whole-part caching, incremental - invalidation, or a canonical delivery package. - -## Do not use - -- 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`. -## Structure model - -- `Part` wraps exactly one `Solid` plus identity and optional material - (`make_part_rpart`, `assign_material_rpart`, `make_material_rmaterial`). -- `Assembly` holds component instances with placements - (`make_assembly_rassembly`, `add_component_rassembly`, - `place_component_rassembly`, `make_placement_rplacement`, - `identity_placement_rplacement`). -- Connectors live on leaf parts (`add_connector_rpart`, - `make_placement_connector_rconnector`, `make_edge_connector_rconnector`, - `make_face_connector_rconnector`, `make_vertex_connector_rconnector`). -- Public connectors are interface declarations, not cloned connectors - (`set_public_connector_rassembly`): they record a public id plus a direct - child component/connector reference, store no offset, and expose one nesting - level at a time. -- Declarative constraints express mating and motion - (`add_fixed_constraint_rassembly`, `add_revolute_constraint_rassembly`, - `add_prismatic_constraint_rassembly`, `add_gear_constraint_rassembly`, - `add_rack_pinion_constraint_rassembly`, `add_belt_constraint_rassembly`). -- `ground_component_rassembly` fixes components; `unground_component_rassembly` - releases them. The solver requires **at least one** grounded component to - seed placements; multiple grounded components are accepted but may - overconstrain or fail residuals — ground exactly the components that are - truly fixed in the product's frame. - -## Product boundaries - -- `@scad.part` for one physical single-solid product; `@scad.assemble` for an - assembly with explicit external definitions. Both own definition-local - `GraphSession`s and cannot be nested inside another active session. -- Repeated calls with the same build key reuse the runtime PRT in process; - durable part bundles restore unchanged PRTs across runs. -- The incremental solver invalidates only components reached through changed - geometry, connector, binding, material, or nested public-connector - interfaces; cached placements still pass residual verification. -- Inspect evidence with `solve_report.component_hits`, `component_misses`, - dirty instances, and `measure_constraint_residual_rconstraintresidual`; - `inspect_assembly_constraints_rconstraintreport` reports constraint status. - -## Canonical delivery - -- `capture(result, "out/product.scadpkg")` is the single public package write - boundary (its two required arguments are positional). -- The package embeds the definition closure, evaluated scene, canonical - occurrence graph, feature graphs, source snapshots, topology, connectors, - constraints, and materials. -- Package capture and `validate_product_package` enforce the v3 package - invariants; `solve_assembly_constraints_rassembly` returns the solved - assembly with its constraint report. Never hand-author package payloads. - -## API groups - -Read the exact page under `references/docs/api/` for every API used, plus -`references/docs/guides/cache-build-workflow.md` completely before configuring -persistent cache, writing a durable build, or running cache maintenance. - -- Product build: `part`, `assemble`, `file_input`, `resolve_cache_policy`, - `PartBuildResult`, `AssemblyBuildResult`, `AssemblySolveReport`, `CacheReport`. -- Cache: `CachePolicy`, `CacheMode`, `ContentAddressedStore`, - `simplecad-cache` CLI (status/verify/prune/clear). -- Packages: `capture`, `CaptureResult`, `ProductPackage`, - `build_product_package`, `read_product_package`, `load_product_package`, - `validate_product_package`. - -## Validation gates - -- Placement semantics: moving a component changes placement only; the part's - internal solid is never transformed. -- Solve report shows expected hits/misses; residuals within tolerance after - solving; grounded root is the intended fixed part. -- Public connector frames resolve through nested placements; changing a public - declaration changes the interface hash and invalidates dependents. -- Cache mutation (`verify --repair`, `prune --apply`, `clear`) requires explicit - confirmation; status/verify/default prune are read-only. - -## Failure modes - -- External dual-fixed constraints on nested subassemblies: the nested mechanism - must expose and solve its own constraints through public connectors before the - parent consumes them; a public declaration never makes an internal component - movable by itself. -- Duplicate component ids, cycles in subassembly references, or invalid - placements are rejected; fix the structure, not the symptom. -- Corrupt cache bundles are quarantined and rebuilt automatically; report the - quarantine rather than disabling the cache. diff --git a/skills/simplecadapi/references/domains/export-and-translation.md b/skills/simplecadapi/references/domains/export-and-translation.md deleted file mode 100644 index 3a692c8e..00000000 --- a/skills/simplecadapi/references/domains/export-and-translation.md +++ /dev/null @@ -1,93 +0,0 @@ -# Task Domain: Export and Translation - -Export validated product packages to neutral and mesh formats, and translate -them into editable external CAD backends. - -## 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 - -- Exporting before geometry and product validation passed: exports are - deliverables, not validation. -- Hand-editing exported files; fix the source, re-capture, re-export. - -## Target selection - -Choose the downstream target from the consumer contract: - -| Target | Use when | Preserved contract | Boundary | -| --- | --- | --- | --- | -| `.scadpkg` | Rebuild, replay, cache, or further SimpleCAD editing | 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 | -| MJCF | MuJoCo simulation | Canonical occurrence graph kinematics, joint sites from explicit constraints, equality/connect constraints for loop-closing joints | Simulation semantics, not manufacturing | - -## API groups - -Read the exact page under `references/docs/api/` for every API used: - -- Exporters (`scad.exporter`): `export_product_package_to_step`, - `export_product_package_to_stl`, `export_product_package_to_obj`, - `export_product_package_to_mjcf`. - - Report fields differ per format — read what the report actually carries: - `ProductSTEPExportReport` (output path, schema, definition ids, occurrence - count, material ids, metadata item count, limitations), - `ProductSTLExportReport` / `ProductOBJExportReport` (definition count, solid - count, vertex/triangle counts, deflection parameters, backend), - `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 `.scadpkg` package: `capture` the product - first, then export from the package path. -- STL and OBJ share one direct OpenCASCADE tessellation of the evaluated BREP; - both contain the same oriented triangles. Control curved-surface accuracy - with `linear_deflection` (chordal deviation in product units) and - `angular_deflection_degrees`. -- MJCF joint structure comes from explicit assembly constraints: hinge and - prismatic edges follow the constraint graph, and public connectors expose - sites/endpoints only — public exposure alone never implies a joint. - Loop-closing movable revolute/prismatic joints are emitted as - equality/connect constraints; gear/belt/rack-pinion couplings are emitted - as fixed-tendon equality constraints. -- Use `validate_step_roundtrip_rdescriptor` when a STEP export must survive - re-import (roundtrip-sensitive consumers). - -## Validation gates - -- 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; - exports are point-in-time deliverables. diff --git a/skills/simplecadapi/references/domains/part-modeling.md b/skills/simplecadapi/references/domains/part-modeling.md deleted file mode 100644 index 0a25bfee..00000000 --- a/skills/simplecadapi/references/domains/part-modeling.md +++ /dev/null @@ -1,89 +0,0 @@ -# Task Domain: Part Modeling - -Model one physical, single-solid mechanical part with the core geometry API: -primitives, profiles, 3D features, booleans, detail features, and transforms. - -## Use when - -- The deliverable is one physical part that will be manufactured or exported as - a single solid body. -- The request names brackets, plates, enclosures bodies, shafts, spacers, - bosses, flanges, blades, or any monolithic part geometry. -- An existing part source needs a geometry edit: new features, dimension - changes, repaired booleans, or re-selected detail edges. - -## Do not use - -- Constrained editable profiles as the design intent: use - `domains/sketch-and-features.md`. -- Multi-part products, connectors, or motion: use - `domains/assembly-and-product.md`. -- Standard gears, ring gears, racks, cycloidal discs, or bearings: use - `domains/standard-parts.md` first. -- Reading facts out of an existing STEP file: use - `domains/step-inspection.md`. - -## Inputs - -- A refined brief with units (SDK evaluates lengths in millimeters), overall - dimensions, named parameters, feature list, and validation targets - (`domains/requirement-refinement.md`). -- A chosen part-local coordinate convention - (`discipline/datums-and-coordinate-systems.md`). - -## Outputs - -- A positive-volume, closed `Solid`, or a `Part` via `make_part_rpart` when the - product boundary is needed. -- Semantic tags on mating/role surfaces and numeric facts in metadata. -- A replayable `GraphSession` model JSON when the flow must be replayable or - interchange-exported. - -## Required discipline - -- `discipline/mechanical-modeling.md` before designing construction strategy. -- `discipline/feature-ordering.md` before composing operation order. -- `discipline/geometric-validation.md` for the validation gates. - -## API groups - -Read the exact page under `references/docs/api/` for every API used: - -- Primitives: `make_box_rsolid`, `make_cylinder_rsolid`, `make_sphere_rsolid`, - `make_cone_rsolid`. -- Profiles: `make_circle_rface`, `make_rectangle_rface`, `make_face_from_wire_rface`, - `make_face_from_wires_rface`, `make_surface_patch_rface`, - `make_ruled_surface_rface`, `make_gordon_surface_rface`, - `make_cylindrical_surface_rface`. -- Features: `extrude_rsolid`, `revolve_rsolid`, `sweep_rsolid`, - `twisted_sweep_rsolid` (supports inner-wire profiles), `helical_sweep_rsolid`, - `loft_rsolid`, `loft_rshell`, `shell_rsolid`. -- Detail: `fillet_rsolid`, `chamfer_rsolid`. - -## Boolean discipline - -- `union_rsolid`, `cut_rsolid`, and `intersect_rsolid` accept mixed inputs - (standalone `Solid`, lists, nested sequences) and return exactly one `Solid`. -- `union_rsolid` defaults to `glue=False` with a conservative scale-relative - internal tolerance. If a union cannot produce exactly one merged solid it - fails explicitly; do not silently pick one piece. -- If a single merged solid is required and union fails, adjust placement so the - bodies really overlap (not merely touch), then recompute. -- Overshoot through-cut tools past the faces they enter and exit; coincident - tool/target faces are a classic kernel failure. -- `cut_rsolid` skips non-intersecting tools by default - (`skip_non_intersecting=True`); pass `skip_non_intersecting=False` for strict - diagnostics — a skipped cut is never a completed feature. - -## Validation gates - -- After each major step print small QL-derived facts: selected face count, top - face center, edge count, volume, bounding box. -- Validity is not positive volume, and `Solid` exposes no public - `is_valid`/closure predicate: run BREP validity/closure diagnostics with - `inspect_shape_rbrepinspection` / `inspect_step_rbrepinspection` from - `simplecadapi.inspect.brep` (outside `GraphSession`), and check - `Solid.get_volume() > 0` yourself. `Shell.is_closed` exists for shells. -- Verify every user-specified dimension with a targeted measurement, not only - aggregate properties. - diff --git a/skills/simplecadapi/references/domains/requirement-refinement.md b/skills/simplecadapi/references/domains/requirement-refinement.md deleted file mode 100644 index 1117da3c..00000000 --- a/skills/simplecadapi/references/domains/requirement-refinement.md +++ /dev/null @@ -1,95 +0,0 @@ -# Task Domain: Requirement Refinement - -Convert a user request — prose, reference images, technical drawings, or a -combination — into an actionable modeling brief before any geometry is written. - -## Use when - -- Every task starts here: any modeling, assembly, reconstruction, or export - request is refined into a brief first. -- Inputs conflict, are ambiguous, or mix modalities. - -## Do not use - -- As a user-facing form: the brief is internal Markdown notes; never ask the - user to fill out a schema. -- As a substitute for asking the one focused question that actually blocks the - work. - -## The brief must answer - -- What is being modeled: part, assembly, modification, inspection, or export - task. -- Units and coordinate convention (SDK evaluates lengths in millimeters and - angles in degrees while preserving declared units in model JSON). -- Overall dimensions and which missing dimensions are inferable. -- Required features: holes, slots, bosses, ribs, pockets, shells, threads, - patterns. -- Positioning control: faces, axes, origins, connectors, constraints, - interfaces. -- Output files requested: package, STEP, STL, OBJ, MJCF, FCStd, scripts. -- Validation targets: bounding box, solid count, labels/tags, dimensions, - mesh relations, replay count. - -## Brief format - -```text -CAD brief: -- Model: , -- Inputs: -- Units: -- Coordinate convention: -- Overall dimensions: -- Functional features: -- Positioning/mating: -- Parameters: -- Paths: -- Validation targets: -- Assumptions: -``` - -## Input precedence - -- Dimensioned sources win over image proportions. -- When two dimensioned sources conflict, flag the conflict; never silently - choose. -- An image without stated dimensions is design intent, not a spec: establish - scale from one stated dimension or a known object, or ask the one scaling - question when fit matters. -- Distinguish reproduction ("model this part") from inspiration ("something - like this"): reproduction raises fidelity expectations. - -## Technical drawings - -A drawing is a dimensioned contract: - -- Read the title block first: units, projection convention, revision. -- Identify each view and its model axes before extracting numbers; section - views are the source of truth for internal features. -- Convert every callout into a named parameter and a validation target; - expand `4X`, `TYP.`, thread/counterbore callouts into features plus checks. -- Never scale undimensioned geometry off the image. -- Cross-check features across views; prefer the dimensioned view and flag - disagreements. - -## Clarification policy - -Ask one focused question only when missing information affects fit, safety, -compliance, or makes the model impossible. Otherwise proceed with explicit, -reported assumptions. - -Ask when: no dimensions and no scale reference for a physical object; a mating -interface is described but unspecified; the part is safety-, load-, or -pressure-critical; output depends on a missing source file. - -Do not ask when: a default clearance or cosmetic radius suffices; -origin/orientation can be chosen and reported; the user asked for a first-pass -conceptual model. - -## Success criteria - -The brief is ready when it defines source path(s), units, coordinate system, -named parameters, feature plan, positioning intent, output paths, and -validation targets — and every assumption it carries is one worth reporting. - -Read `discipline/requirement-and-cad-brief.md` for the full discipline. diff --git a/skills/simplecadapi/references/domains/sketch-and-features.md b/skills/simplecadapi/references/domains/sketch-and-features.md deleted file mode 100644 index 58634139..00000000 --- a/skills/simplecadapi/references/domains/sketch-and-features.md +++ /dev/null @@ -1,88 +0,0 @@ -# Task Domain: Sketch and Features - -Author declarative, constraint-driven 2D profiles and promote them into -topology, when the design intent is an editable sketch rather than direct -geometry transcription. - -## Use when - -- The part's controlling dimensions are naturally expressed as geometric - constraints (coincidence, tangency, symmetry, equal radii, distances). -- The user asks for a parametric, editable profile whose constraints carry the - design intent. -- Reconstruction evidence supports a planar generating profile - (`domains/step-inspection.md` feeds this). - -## Do not use - -- Non-planar paths, guides, or exact freeform carrier transcription: build - `Wire`/`Edge` geometry directly in `domains/part-modeling.md`. -- Report-derived geometry whose projection would change measured control data. -- A sketch whose available constraints do not represent the evidence: direct - Wire construction is appropriate then. - -## Inputs - -- Plane mapping (which model plane the sketch lives on), closure requirements, - arc direction conventions, spline definitions, and known degrees of freedom. - -## Outputs - -- A solved `Sketch` promoted with `make_wire_from_sketch_rwire` or - `make_face_from_sketch_rface` into the topology layer. -- Promotion records `solve_snapshot` and `promotion_map` evidence; promoted - geometry receives `source_sketch`, `sketch_solve` metadata and entity tags. - -## API groups - -Read the exact page under `references/docs/api/` for every API used: - -- Document: `make_sketch_rsketch`, `add_point_rsketch`, `add_line_rsketch`, - `add_arc_rsketch`, `add_circle_rsketch`, `add_bspline_rsketch`. -- Entities: `get_sketch_entity_rsketchref`, `get_sketch_point_rsketchref`. -- Constraints: `constrain_coincident_rsketch`, `constrain_collinear_rsketch`, - `constrain_concentric_rsketch`, `constrain_connect_rsketch`, - `constrain_distance_rsketch`, `constrain_distance_x_rsketch`, - `constrain_distance_y_rsketch`, `constrain_diameter_rsketch`, - `constrain_radius_rsketch`, `constrain_length_rsketch`, - `constrain_equal_length_rsketch`, `constrain_equal_radius_rsketch`, - `constrain_angle_rsketch`, `constrain_parallel_rsketch`, - `constrain_perpendicular_rsketch`, `constrain_horizontal_rsketch`, - `constrain_vertical_rsketch`, `constrain_tangent_rsketch`, - `constrain_midpoint_rsketch`, `constrain_symmetric_rsketch`, - `constrain_point_on_rsketch`, `constrain_fix_rsketch`. -- Promotion: `make_wire_from_sketch_rwire`, `make_face_from_sketch_rface`. -- Diagnostics: `inspect_sketch_rsketchresult` (non-recording). - -## Construction rules - -- Sketch construction is functional: `add_*_rsketch` and - `constrain_*_rsketch` return an updated `Sketch` (cloned), leaving the input - untouched. (A private linear-edit runtime mode mutates internally; never - rely on it from your own code — always rebind the returned value.) -- Every sketch entity has a stable explicit id; constraints reference those ids. -- `add_arc_rsketch` follows the positive local angular sweep, so endpoint order - is meaningful. -- Solve is not a graph leaf: promotion runs the solver internally, so keep the - sketch fully constrained (or record remaining DOF) before promotion. -- The default solver backend is `py-slvs`; solve snapshots record - `backend`, `backend_version`, and `backend_status_code` for replay evidence. -- `inner_profiles` is valid only when adjacent-carrier evidence shows the loops - belong to the same generating profile. - -## Validation gates - -- Record plane mapping, closure, solve status, and remaining DOF in the brief. -- When sketch promotion may change measured geometry, build Wire and Sketch - from one parameter source and compare closure/area/bounds/segmentation before - promoting. -- A Sketch wrapping a prebuilt Wire does not recover sketch intent: do not - claim parametric intent for coordinate-locked transcription; label it as such. - -## Failure modes - -- 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. diff --git a/skills/simplecadapi/references/domains/standard-parts.md b/skills/simplecadapi/references/domains/standard-parts.md deleted file mode 100644 index 3795edcc..00000000 --- a/skills/simplecadapi/references/domains/standard-parts.md +++ /dev/null @@ -1,83 +0,0 @@ -# Task Domain: Standard Parts - -Use the parameterized standard-library factories before hand-modeling standard -mechanical components. - -## Use when - -- The request names gears, ring gears, racks, cycloidal discs, or ball - bearings, or a mechanism built from them (reducers, gearboxes, actuators). -- A part definition needs a durable standard-component building block. - -## Do not use - -- Substantial custom geometry beyond the factory parameters: switch to - `domains/part-modeling.md` and model it explicitly. -- Sourcing purchasable off-the-shelf STEP files: that is an external catalog - task, not this SDK. - -## Import surface - -```python -import simplecadapi as scad - -gear = scad.std.gear.make_spur_gear_rsolid(n_teeth=24, module=1.5, gear_height=8.0) -ring = scad.std.gear.make_spur_ring_gear_rsolid( - n_teeth=72, module=1.5, gear_height=8.0, rim_thickness=4.0, - backlash=0.08 * 1.5, -) -rack = scad.std.gear.make_spur_rack_rsolid(module=1.5, n_teeth=18) -bearing = scad.std.bearing.make_ball_bearing_rassembly( - bore_diameter=8.0, outer_diameter=22.0, bearing_width=7.0, ball_diameter=3.5, -) -``` - -Direct submodule import is also supported -(`from simplecadapi.std.gear import make_spur_gear_rsolid`). Always use keyword -arguments. - -## Factory catalog - -Read `references/docs/stdlib/README.md` for the index and the exact page -`references/docs/stdlib/.md` before calling any factory: - -- External gears: `make_spur_gear_rsolid`, `make_helical_gear_rsolid`, - `make_herringbone_gear_rsolid`, `make_straight_bevel_gear_rsolid`. -- Internal ring gears: `make_spur_ring_gear_rsolid`, - `make_helical_ring_gear_rsolid`, `make_herringbone_ring_gear_rsolid` - (helical/herringbone ring gears are built by direct multi-loop sweep). -- Racks: `make_spur_rack_rsolid`, `make_helical_rack_rsolid`, - `make_herringbone_rack_rsolid`. -- Cycloidal discs: `make_cycloidal_disc_rsolid`. -- Bearings: `make_ball_bearing_rassembly` returns a product `Assembly`; - `build_ball_bearing` is the durable sub-assembly builder (keyword-only - parameters, plus `revision`, `ground`, `cache` — default - `ground="outer_ring"`, `cache="off"`) for `@scad.assemble` definitions with - explicit bearing instances. - -## Integration rules - -- Standard parts return normal shapes or product assemblies: transform, tag, - assemble, cache, and export them like any other geometry. -- Mesh discipline: for a gear/ring pair, consistent `module`, center distance - derived from tooth counts, and explicit `backlash` (typical starting point - `0.05-0.1 * module`) are part of the design, not afterthoughts. -- Prefer `build_ball_bearing` over rebuilding bearings by hand inside product - definitions; it participates in incremental solves as one definition. - -## Validation gates - -- Verify tooth counts, module, center distances, and overall bounding boxes - with QL measurements after assembly. -- For gear meshes, confirm the intended kinematic constraint - (`add_gear_constraint_rassembly`) references the correct axes and ratio. -- Check bearing bore/outer diameters against the mated shaft and housing - geometry before final capture. - -## Failure modes - -- Backlash omitted or defaulted badly: mesh locks or interferes; set backlash - explicitly for ring-gear pairs. -- Bevel gear orientation: measure `make_straight_bevel_gear_rsolid` output - axes and faces with `ql` before constraining; do not assume the factory's - mounting orientation. diff --git a/skills/simplecadapi/references/domains/step-inspection.md b/skills/simplecadapi/references/domains/step-inspection.md deleted file mode 100644 index cbb8dc3b..00000000 --- a/skills/simplecadapi/references/domains/step-inspection.md +++ /dev/null @@ -1,113 +0,0 @@ -# Task Domain: STEP/BREP Inspection - -Extract bounded geometric facts from existing STEP files, compare targets and -candidates, and gather reconstruction evidence with the -`simplecadapi.inspect.brep` namespace. - -## Use when - -- The input is an existing `.step`/`.stp` file and the question is about its - geometry: counts, dimensions, carriers, sections, neighborhoods, components. -- A reconstruction candidate must be compared against a target STEP. -- Visual evidence (entity maps, region highlights, comparison renders) is - needed for review. - -## Do not use - -- Building or editing geometry: these functions are diagnostic, not modeling - operations. -- Any call inside `GraphSession`: inspection functions are rejected there. - Export or obtain the geometry first, then inspect outside the modeling - script. - -## Normative references - -- `references/inspect/brep-reverse-engineering.md` — read completely before any - inspection or target/candidate comparison work. -- `references/docs/guides/reconstruction-agent-strategy.md` — advisory tactics - only. -- `references/docs/guides/reconstruction-agent-test-prompt.md` — the controlled - run contract for reconstruction trials. - -## API groups - -Read the exact page under `references/docs/api/` for every API used: - -- Inventory: `inspect_step_rsummary` (entity counts, bounds, volume, area, - centroid, carrier statistics; `include_parameter_groups=True` for analytic - radius/degree groups), `inspect_step_rbrepinspection` (full knot/multiplicity - data). -- Local evidence: `inspect_step_entity_rdescriptor` (stable zero-based ids like - `face:0`), `inspect_topology_neighborhood_rdescriptor`, - `inspect_face_boundaries_rdescriptor` (prefer `compact=True`), - `inspect_section_rdescriptor`, `inspect_point_rdescriptor`, - `inspect_nearby_entities_rdescriptor`, `inspect_topology_rdescriptor`, - `measure_entity_relation_rdescriptor`, `measure_shape_mass_rtuple`. -- Reuse across queries: `load_step_rbrepmodel`, `load_step_rshape`, - `index_shape_rbrepmodel`, `clear_step_model_cache_rnone`. -- Comparison: `compare_global_properties_rdescriptor`, - `compare_material_rdescriptor`, `compare_boundary_distance_rdescriptor`, - `compare_entities_rdescriptor`, `compare_sections_rdescriptor`, - `inspect_difference_regions_rdescriptor`, `compare_shapes_rbrepcomparison`, - `compare_steps_rbrepcomparison`, `evaluate_reconstruction_rdescriptor`. -- Rendering: `render_entity_map_rpath`, `render_entity_kind_maps_rpath`, - `render_region_rpath`, `render_shape_views_rpath`, - `render_step_views_rpath`, `render_step_components_rpath`, - `render_step_components_colored_rpath`, `render_screenshot_rpath`, - `select_region_entities_rdescriptor`. -- Reconstruction evaluation: `fit_face_analytic_rdescriptor` (test whether a - sampled face is planar/spherical/cylindrical/conic; residuals are evidence, - not recovered feature history), `track_section_contours_rdescriptor` - (contour continuation/birth/death/split/merge across ordered sections), - `validate_step_roundtrip_rdescriptor`, `render_step_comparison_rpath` - (Original-vs-Reconstructed shared views/camera/scale). -- Benchmark/evaluation harness — a separate import surface at - `simplecadapi.inverse_engineer.brep` (not `inspect.brep`): - `EvaluationConfig`, `SectionEvaluationConfig`, `classify_benchmark_result`, - `inspect_benchmark_step`, `run_comparison_bundle`. Section results are - diagnostics, not acceptance gates. - -There is no fixed pipeline. Start with the cheapest evidence that can falsify -the current hypothesis; escalate only when the question requires it: - -| Question | Preferred primitives | -| --- | --- | -| Global size, mass, topology scale | `inspect_step_rsummary`, `compare_global_properties_rdescriptor` | -| Single face/edge parameters and adjacency | `inspect_step_entity_rdescriptor`, `inspect_topology_neighborhood_rdescriptor` | -| Map stable ids to visual entities | `render_entity_map_rpath` | -| Section profile, wall thickness | `inspect_section_rdescriptor`, `compare_sections_rdescriptor` | -| Assembly tree visualization | `inspect_step_components_rdescriptorlist`, `render_step_components_rpath` | -| Where the difference is | `compare_material_rdescriptor`, `inspect_difference_regions_rdescriptor` | -| Local geometric error | `compare_boundary_distance_rdescriptor`, `compare_entities_rdescriptor` | -| Final exact-BREP gate | `compare_shapes_rbrepcomparison`, `compare_steps_rbrepcomparison` | - -## Acceptance hierarchy - -1. BREP topology identity is the best endpoint (complete reconstruction). -2. Identical structure with minor float-level parameter drift from export is - acceptable and not a failure. -3. Structurally different but visually close is a valid stop only when no - better feature operation order/combination exists or the SDK lacks the - required operation type, with evidence recorded. - -## Validation gates - -- Strict material proof and reusable difference regions require - `compare_material_rdescriptor(include_components=True)`; the estimate mode is - diagnostic only. -- Start `compare_boundary_distance_rdescriptor` at ≤200 samples and scope by - face ids; pass results forward as `boundary_result` to avoid recomputation. -- After strict comparison, use `BRepComparison.to_error_summary()` to group - failed checks by plausible common root cause; fix related groups together, - then rerun a fresh replay/export/compare cycle. -- Visual similarity from `render_step_comparison_rpath` never replaces strict - BREP comparison. - -## Failure modes - -- Assuming entity ids imply semantic correspondence between two different - models: ids are stable per unmodified BREP only. -- Fuzzy boolean tolerance in comparison: diagnostic only, never an acceptance - gate. -- Untrimmed carrier definitions without UV range/trim-loop/seam evidence are - incomplete evidence. diff --git a/skills/simplecadapi/references/workflows/assembly-product-build.md b/skills/simplecadapi/references/workflows/assembly-product-build.md deleted file mode 100644 index d0cb6b09..00000000 --- a/skills/simplecadapi/references/workflows/assembly-product-build.md +++ /dev/null @@ -1,109 +0,0 @@ -# Workflow: Assembly and Product Build - -Compose a multi-part product with explicit placement, connectors, and -constraints; build it durably and capture the canonical package. - -## Goal and scope - -Use for products with more than one physical part, repeated instances, nested -subassemblies, motion semantics, or durable/cached builds. Not for monolithic -parts (`single-part-modeling.md`) or export-only requests -(`export-and-translation.md` runs from an existing package). - -## Task decomposition - -```yaml -goal: solved assembly captured as one .scadpkg -primary_domain: assembly-and-product -required_domains: - - requirement-refinement - - part-modeling # every component is still authored as a part - - assembly-and-product -optional_domains: - - sketch-and-features - - standard-parts - - export-and-translation -artifacts: - - one part file per physical part - - one assembly file composing them - - connectors on leaf parts; public declarations on subassemblies - - solved AssemblyBuildResult and package -validation_gates: - - each part passes single-part gates before assembly - - solve report hits/misses and residuals as expected - - grounded root is the intended fixed component - - package validation passes -repair_routes: - - constraint unsolved/conflicting -> assembly-and-product (constraint graph) - - placement wrong -> assembly-positioning discipline (datum/connector frames) - - part invalid -> back to part-modeling for that part -``` - -## Steps - -1. **Refine the requirement** (`domains/requirement-refinement.md`): product - structure, which parts are manufactured vs purchased vs standard, motion - requirements, materials, delivery targets. -2. **Decompose the product** (`discipline/mechanical-modeling.md`): one part - per file, one assembly file; group functional units as nested subassemblies - that are placed, reasoned about, or repeated as units. -3. **Author each part** via `single-part-modeling.md`; attach interface - connectors on leaf parts (`add_connector_rpart`, - `make_placement_connector_rconnector`, ...) at mating datums - (`discipline/assembly-positioning.md`). -4. **Compose the assembly** in the single assembly file: `@scad.assemble` - with explicit part definitions; `make_assembly_rassembly` + - `add_component_rassembly` with placements; expose subassembly interfaces - with `set_public_connector_rassembly` (declaration only — no offsets). -5. **Express mating and motion as constraints** - (`discipline/assembly-positioning.md`): fixed for the root, revolute / - prismatic for motion, gear / rack-pinion / belt for drivetrain relations, - ground the components that are truly fixed (at least one). -6. **Solve and read the evidence** (`solve_assembly_constraints_rassembly`, - `AssemblySolveReport`, `measure_constraint_residual_rconstraintresidual`, - `inspect_assembly_constraints_rconstraintreport`): hits, misses, dirty - instances, residuals. Nested mechanisms must solve their own constraints - before the parent consumes their public connectors. -7. **Validate positioning**: component placements realized as intended; - mating faces flush or offset as specified; axes aligned. Use QL queries on - the solved assembly, not eyeballing. -8. **Capture** (`domains/assembly-and-product.md`): - `capture(result, "out/.scadpkg")` — the single delivery boundary. -9. **Export** (`domains/export-and-translation.md`) only after validation. - -## API pages to read - -`make_part_rpart`, `add_connector_rpart`, `make_placement_rplacement`, -`identity_placement_rplacement`, `make_assembly_rassembly`, -`add_component_rassembly`, `place_component_rassembly`, -`set_public_connector_rassembly`, the `add_*_constraint_rassembly` family, -`ground_component_rassembly`, `solve_assembly_constraints_rassembly`, -`inspect_assembly_constraints_rconstraintreport`, -`measure_constraint_residual_rconstraintresidual`, `part`, `assemble`, -`capture`, plus `references/docs/guides/cache-build-workflow.md` in full when -caching is configured. - -## Validation gates - -- Solve report matches expectation (hits/misses/dirty), residuals within - tolerance. -- At least one grounded component, and only the truly-fixed ones grounded; - moving a component never transforms its internal solid. - -- Public connector frames resolve through nested placements; interface-hash - invalidation is expected when declarations change. -- `validate_product_package` (via capture) passes. - -## Failure routes - -- Dual-fixed external constraint on a nested subassembly → solve the nested - mechanism internally first; the parent consumes only public connectors. -- Duplicate component ids / cycles / invalid placements → fix the structure. -- Placement systematically wrong → datum or connector frame error; see - `discipline/assembly-positioning.md`. -- Cache lock timeouts → explicit lock ownership; report rather than disabling. - -## Deliverables - -Part and assembly file paths, package path, solve evidence printed, residuals, -positioning checks actually run, assumptions. diff --git a/skills/simplecadapi/references/workflows/export-and-translation.md b/skills/simplecadapi/references/workflows/export-and-translation.md deleted file mode 100644 index 864c9e06..00000000 --- a/skills/simplecadapi/references/workflows/export-and-translation.md +++ /dev/null @@ -1,83 +0,0 @@ -# Workflow: Export and Translation - -Take a validated product package and produce the requested downstream -deliverables. - -## Goal and scope - -Use when geometry and product validation already passed and the remaining -work is format conversion. If the model still needs work, route to the owning -modeling workflow first — exports are deliverables, never validation. - -## Task decomposition - -```yaml -goal: requested export files from a validated .scadpkg -primary_domain: export-and-translation -required_domains: - - requirement-refinement # which formats and why - - export-and-translation -optional_domains: - - step-inspection # roundtrip validation of exports -artifacts: - - refreshed package (capture re-run if sources changed) - - export reports per format -validation_gates: - - package is current (sources unchanged since capture) - - each export report read and printed - - roundtrip validation when the consumer re-imports STEP -repair_routes: - - stale export -> re-capture, re-export - - coarse mesh -> tighten deflection parameters - - backend missing -> report; no silent format substitution -``` - -## Steps - -1. **Confirm the package is current**: if any source changed since the last - `capture`, re-run the owning workflow's capture step. Exports are - point-in-time deliverables. -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. -3. **Export from the package path** (`scad.exporter.*` / - `scad.translator..*`), one call per target, keyword arguments. -4. **Read every report**: definition ids, occurrence/solid/triangle counts, - material items, limitations. Print the facts; never assume success from a - missing exception. -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. - -## API pages to read - -`capture` (when re-capturing), the exporter page(s) for every format -requested, the translator page(s) for every backend requested, and -`validate_step_roundtrip_rdescriptor` when roundtrip validation applies. - -## Validation gates - -- Export report counts match the model's expectation (solids, occurrences, - triangles). -- Tessellation accuracy chosen deliberately: `linear_deflection` in product - units, `angular_deflection_degrees` for curved surfaces; tighter for small - 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. - -## Failure routes - -- FreeCAD/FreeCADCmd missing → report the missing backend; offer STEP as the - neutral fallback and say so explicitly. -- 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 - `assembly-product-build.md`, do not hand-edit MJCF. - -## Deliverables - -Exported file paths, report facts per format, chosen parameters, unavailable -backends, and checks not run. diff --git a/skills/simplecadapi/references/workflows/single-part-modeling.md b/skills/simplecadapi/references/workflows/single-part-modeling.md deleted file mode 100644 index 139778cb..00000000 --- a/skills/simplecadapi/references/workflows/single-part-modeling.md +++ /dev/null @@ -1,98 +0,0 @@ -# Workflow: Single-Part Modeling - -Model one physical part from a refined brief to validated, optionally packaged -geometry. - -## Goal and scope - -Use for: new single-part models, dimension edits, feature additions, and part -repairs. Not for assemblies (use `assembly-product-build.md`), constrained -profiles as the core intent (use `sketch-feature-modeling.md`), or standard -components (check `standard-part-assembly.md` first). - -## Task decomposition - -```yaml -goal: validated single-solid part, optionally captured as .scadpkg -primary_domain: part-modeling -required_domains: - - requirement-refinement - - part-modeling -optional_domains: - - sketch-and-features # when the profile is constraint-driven - - standard-parts # when the part embeds a standard component - - export-and-translation # only when external formats are requested -artifacts: - - brief - - part source file (one part per file) - - Solid or Part - - GraphSession model JSON when replay is needed -validation_gates: - - positive-volume closed solid after every boolean/detail step - - every user-specified dimension measured - - bounding box matches the brief -repair_routes: - - boolean/fillet failure -> part-modeling (operation order, tool geometry) - - profile evidence weak -> sketch-and-features (constraints) or part-modeling (direct wires) -``` - -## Steps - -1. **Refine the requirement** (`domains/requirement-refinement.md`): units, - dimensions, features, coordinate convention, validation targets. Record - assumptions. -2. **Choose the construction strategy** - (`discipline/mechanical-modeling.md`): profile-driven (sketch + extrude / - revolve / sweep / loft) vs block-and-feature (base solid + subtractive - features). Pick the one that makes the spec's controlling dimensions direct - named parameters. Decide single solid vs part-of-assembly now. -3. **Fix the datum** (`discipline/datums-and-coordinate-systems.md`): origin, - base plane, up axis from the functional interface. -4. **Model incrementally** - (`discipline/feature-ordering.md`): base solid → major additions → - subtractive features → shell → through-wall holes → fillets/chamfers last. - One intentional operation per step, named parameters everywhere, keyword - arguments in every call. -5. **Ground every step** (`discipline/geometric-validation.md`): after each - major step print small QL-derived facts — selected face count, centers, - edge counts, volume, bounds. Tag role surfaces - (`role.mounting_surface`, `anchor.datum.primary`); keep numbers in - metadata. -6. **Optional product boundary**: if the part is a durable deliverable, wrap - with `@scad.part` and `capture(result, "out/.scadpkg")`. - (`domains/assembly-and-product.md`.) -7. **Export if requested** (`domains/export-and-translation.md`), only after - validation passes. - -## API pages to read - -`make_box_rsolid`, `make_cylinder_rsolid`, `extrude_rsolid`, -`revolve_rsolid`, `sweep_rsolid`, `loft_rsolid`, `cut_rsolid`, -`union_rsolid`, `fillet_rsolid`, `chamfer_rsolid`, `shell_rsolid`, -`translate_shape`, `rotate_shape`, `mirror_shape`, -`linear_pattern_rsolidlist`, `radial_pattern_rsolidlist`, `apply_tag`, -`list_tags`, `part`, `capture` — plus any other API the design names, each -from `references/docs/api/.md`. - -## Validation gates - -- One positive-volume, closed, valid solid after the final operation (per-solid - checks, never aggregate-only). -- Every dimension in the brief verified by a targeted measurement. -- Visual plausibility: proportions, wall thickness vs overall size, feature - positions vs edges. - -## Failure routes - -- Boolean fails or yields multiple bodies → `part-modeling` boolean - discipline: overlap, overshoot tools, isolate the failing pair. -- Fillet/chamfer fails → smaller radius, narrower edge selection, later in - order. -- Dimension mismatch → re-measure against the brief; fix the named parameter, - not the symptom. -- Repeated dead ends → `discipline/failure-and-repair.md`. - -## Deliverables - -Source file path, package path (if captured), QL validation facts actually -printed, assumptions made, and checks not run. diff --git a/skills/simplecadapi/references/workflows/sketch-feature-modeling.md b/skills/simplecadapi/references/workflows/sketch-feature-modeling.md deleted file mode 100644 index 39f88bc2..00000000 --- a/skills/simplecadapi/references/workflows/sketch-feature-modeling.md +++ /dev/null @@ -1,97 +0,0 @@ -# Workflow: Sketch-Feature Modeling - -Author a constraint-driven profile, promote it to topology, and build the part -from it with 3D features. - -## Goal and scope - -Use when the design intent is an editable sketch whose constraints carry the -meaning: plates with complex outlines, gasket profiles, brackets defined by -mating geometry, or any profile where dimensions are naturally relational. -Not for non-planar paths, exact freeform transcription, or block-and-feature -parts (use `single-part-modeling.md`). - -## Task decomposition - -```yaml -goal: part whose controlling profile is a solved, promotable Sketch -primary_domain: sketch-and-features -required_domains: - - requirement-refinement - - sketch-and-features - - part-modeling -optional_domains: - - assembly-and-product - - export-and-translation -artifacts: - - brief with plane mapping and constraint plan - - sketch entities and constraints with stable ids - - promoted Wire/Face - - feature-built Solid or Part -validation_gates: - - sketch solve status and remaining DOF recorded before promotion - - promotion preserved measured geometry (closure/area/bounds compare) - - post-feature solid gates from part-modeling -repair_routes: - - solve drift -> sketch-and-features (add constraints or record DOF) - - promotion changes geometry -> compare Wire vs Sketch from one parameter source - - downstream feature fails -> part-modeling -``` - -## Steps - -1. **Refine the requirement** (`domains/requirement-refinement.md`): include - the sketch plane mapping (which model plane the profile lives on), closure - requirements, and which dimensions are relational vs absolute. -2. **Plan entities and constraints** (`domains/sketch-and-features.md`): - choose stable entity ids, list evidence-backed constraints, and identify - the degrees of freedom that will remain free. -3. **Author the sketch functionally**: `make_sketch_rsketch` → `add_*_rsketch` - → `constrain_*_rsketch`, each returning an updated `Sketch`. Arc endpoint - order is meaningful (positive local angular sweep). -4. **Check the solve** (`inspect_sketch_rsketchresult`, diagnostic-only): - backend, status code, remaining DOF. Add constraints or record the free - DOF in the brief — never promote silently underconstrained geometry that - matters. -5. **Promote**: `make_face_from_sketch_rface` (or - `make_wire_from_sketch_rwire`) — promotion runs the solver internally and - records `solve_snapshot` / `promotion_map` evidence in the graph. -6. **Build features** (`domains/part-modeling.md`): extrude, revolve, sweep, - or loft the promoted profile; then booleans and detail features per - `discipline/feature-ordering.md`. -7. **Ground and validate** (`discipline/geometric-validation.md`): QL facts - after promotion and after each feature; verify brief dimensions. -8. **Package and export** as in `single-part-modeling.md` when needed. - -## API pages to read - -`make_sketch_rsketch`, `add_line_rsketch`, `add_arc_rsketch`, -`add_circle_rsketch`, the `constrain_*_rsketch` family used by the design, -`inspect_sketch_rsketchresult`, `make_face_from_sketch_rface`, -`make_wire_from_sketch_rwire`, then the feature APIs named in -`single-part-modeling.md`. - -## Validation gates - -- Solve status recorded; no unintended free DOF. -- When promotion could change measured geometry: build Wire and Sketch from - one parameter source and compare closure, area, bounds, segmentation before - promoting. -- Inner profiles used only with adjacent-carrier evidence that the loops share - one generating profile. -- Post-feature: positive-volume closed solid; brief dimensions measured. - -## Failure routes - -- Sketch solve fails or drifts → missing/contradictory constraints; check - status code and fix the constraint set, not the coordinates. -- Promotion invalid → profile not closed or self-intersecting; repair in the - sketch, re-promote. -- Feature on promoted geometry fails → `part-modeling` repair routes. -- A Sketch wrapping a prebuilt Wire is not parametric intent: label the result - coordinate-locked if that is what happened. - -## Deliverables - -Same as `single-part-modeling.md`, plus the recorded solve status and -remaining DOF. diff --git a/skills/simplecadapi/references/workflows/standard-part-assembly.md b/skills/simplecadapi/references/workflows/standard-part-assembly.md deleted file mode 100644 index 8c0d6ee2..00000000 --- a/skills/simplecadapi/references/workflows/standard-part-assembly.md +++ /dev/null @@ -1,98 +0,0 @@ -# Workflow: Standard-Part Assembly - -Build a mechanism composed of standard-library components — gears, ring gears, -racks, cycloidal discs, bearings — mated by explicit constraints. - -## Goal and scope - -Use for gearboxes, reducers, rack drives, cycloidal drives, and any assembly -whose components come from `scad.std.*` factories. Not for hand-modeled -components (author them via `single-part-modeling.md` first, then return -here) or standard parts requested alone with no assembly context -(`domains/standard-parts.md` suffices). - -## Task decomposition - -```yaml -goal: solved mechanism built from stdlib components and custom parts -primary_domain: standard-parts -required_domains: - - requirement-refinement - - standard-parts - - part-modeling # shafts, housings, carriers, spacers - - assembly-and-product -optional_domains: - - sketch-and-features - - export-and-translation # e.g. MJCF for simulation -artifacts: - - per-part files including stdlib-based definitions - - assembly file with kinematic constraints - - solved package -validation_gates: - - module/backlash/center-distance consistency per mesh - - kinematic constraints reference measured axes with correct ratios - - bearing seats match shaft/housing diameters - - solve report and residual gates from assembly-product-build -repair_routes: - - mesh interference or lock -> standard-parts (backlash, center distance) - - constraint conflict -> assembly-and-product - - custom interface mismatch -> part-modeling for that part -``` - -## Steps - -1. **Refine the requirement**: stages, ratios, torque-relevant sizes, motion - requirements, mounting interfaces, materials, and delivery targets. -2. **Select components** (`domains/standard-parts.md`): spur/helical/ - herringbone/bevel gears, ring gears, racks, cycloidal discs from - `scad.std.gear`; bearings from `scad.std.bearing` — prefer the durable - `build_ball_bearing` builder inside `@scad.assemble` definitions. Read the - exact stdlib page for each factory before calling it. -3. **Compute the kinematics explicitly**: center distance from tooth counts - and module, ratios per stage, backlash (typical starting point - `0.05–0.1 × module`) — these are named parameters, not afterthoughts. -4. **Author custom parts** (shafts, housings, carriers) via - `single-part-modeling.md`, with bearing seats and gear seats measured from - the selected stdlib components (QL queries, not assumed dimensions). -5. **Compose and constrain** (`assembly-product-build.md` steps 4–7): - `add_gear_constraint_rassembly` per mesh with the measured axes and ratio, - `add_rack_pinion_constraint_rassembly` for rack drives, - `add_revolute_constraint_rassembly` / `add_prismatic_constraint_rassembly` - for motion, `add_belt_constraint_rassembly` for belt relations, one - grounded root. -6. **Validate**: solve report and residuals; mesh clearances measured (not - assumed); bearing bores and outer diameters against mated geometry; overall - bounding box against the brief. -7. **Capture and export**: `capture` the package; export MJCF when simulation - is requested (kinematics come from the constraint graph; loop-closing - joints become equality/connect constraints). - -## API pages to read - -The stdlib pages for every factory used; the assembly pages listed in -`assembly-product-build.md`; `export_product_package_to_mjcf` when exporting -for simulation. - -## Validation gates - -- Every mesh: consistent module, computed center distance, explicit backlash, - measured clearance after solving. -- Every kinematic constraint references a measured axis with the intended - ratio. -- Bearing seats: bore against shaft, outer diameter against housing, measured - on the solved assembly. -- Assembly gates from `assembly-product-build.md` all pass. - -## Failure routes - -- Mesh locks or interferes → re-check backlash and center distance before - touching geometry. -- Bevel-gear orientation wrong → measure output axes with QL; do not assume - factory orientation. -- Nested subassembly constraint conflict → solve the subassembly internally - first (`assembly-product-build.md` failure routes). - -## Deliverables - -Component selection with parameters, per-part and assembly paths, package -path, kinematic verification evidence, solve/residual prints, assumptions. diff --git a/skills/simplecadapi/references/workflows/step-reconstruction.md b/skills/simplecadapi/references/workflows/step-reconstruction.md deleted file mode 100644 index 9d5041ed..00000000 --- a/skills/simplecadapi/references/workflows/step-reconstruction.md +++ /dev/null @@ -1,111 +0,0 @@ -# Workflow: STEP Reconstruction - -Rebuild an editable SimpleCAD model from an existing STEP file, with evidence -gathering, feature-tree inference, candidate construction, and tiered -acceptance. - -## Goal and scope - -Use when the deliverable is an editable/replayable model reproducing a target -`.step`/`.stp`. Not for read-only questions about a STEP file — those stay in -`domains/step-inspection.md` without reconstruction. - -## Task decomposition - -```yaml -goal: candidate model accepted against the target STEP -primary_domain: step-inspection -required_domains: - - requirement-refinement - - step-inspection - - part-modeling -optional_domains: - - sketch-and-features - - assembly-and-product # multi-component targets - - export-and-translation # re-export for comparison or delivery -artifacts: - - target evidence notes (summaries, entity descriptors, sections) - - feature-tree hypothesis with provenance rows - - candidate source and replayed model - - comparison evidence and acceptance verdict -validation_gates: - - replay succeeds in a fresh process - - STEP roundtrip of the candidate validates - - acceptance follows the hierarchy (topology identity > float drift > justified stop) -repair_routes: - - comparison fails -> step-inspection (localize) then part-modeling (fix feature) - - global similarity but locally falsified feature -> change the feature hypothesis -``` - -## Steps - -1. **Refine the requirement**: what fidelity is required (exact transcription - vs functional equivalence), which components are in scope, what acceptance - means here. -2. **Inventory the target economically** - (`domains/step-inspection.md`): `inspect_step_rsummary` (with - `include_parameter_groups=True` once), entity descriptors for specific - hypotheses, compact boundaries/sections. Persist large arrays to files, not - conversation context. Read - `references/inspect/brep-reverse-engineering.md` completely first. -3. **Infer feature families** from carrier and section behavior - (`references/docs/guides/reconstruction-agent-strategy.md`): - - ```text - shared axis + rotational sections -> revolve - stable translated profile -> extrude - profile transported along a path -> sweep - ordered changing section family -> loft - verified equal angular/linear units -> one unit + pattern - several local signatures -> ordered mixed feature tree - ``` - - Record a provenance row per region: observed boundary, adjacent-carrier - evidence, proposed operation, direction/axis, confidence, and the check - that could falsify it. A loop on a final planar face may be a later hole or - pocket, not part of the base profile. -4. **Build the candidate** via `single-part-modeling.md` or - `sketch-feature-modeling.md` (Sketch when constraints represent the - evidence; direct Wires for non-planar or exact transcription). Overshoot - through-cut tools; validate one representative feature before patterning. -5. **Replay in a fresh process**: `export_model_json` → - `replay_model_json`; then `validate_step_roundtrip_rdescriptor` on the - candidate's STEP export. -6. **Compare and iterate** (`domains/step-inspection.md`): - `compare_global_properties_rdescriptor` → scoped - `compare_boundary_distance_rdescriptor` (≤200 samples, face-id scoped) → - `compare_material_rdescriptor(include_components=True)` for strict proof → - `compare_steps_rbrepcomparison` for the exact gate. Use - `track_section_contours_rdescriptor` when section topology - (birth/death/split/merge) is the open question, - `fit_face_analytic_rdescriptor` to test carrier families, - `render_step_comparison_rpath` for shared-view visual evidence. After a - failed strict comparison, group causes with - `BRepComparison.to_error_summary()`, fix related groups together, rerun a - fresh cycle. -7. **Accept per the hierarchy** (`domains/step-inspection.md`): topology - identity is the endpoint; float-level serialization drift is acceptable; - a structurally different but visually close stop requires recorded evidence - that no better feature order exists or the SDK lacks the operation. - -## Validation gates - -- One compact iteration row per attempt: hypothesis, changed parameters, - replay/roundtrip status, diagnostic deltas, strongest proof attempted. -- Preserve the best valid candidate; repeated non-improvement changes the - feature hypothesis instead of blind parameter tuning. -- Global similarity never overrides a locally falsified feature. - -## Failure routes - -- No affordable evidence for a region → record the gap; do not invent - geometry and call it recovered. -- Candidate structurally different → re-open the feature-tree hypothesis - before accepting a visual-close stop. -- Reconstruction tooling absent (`inspect` extra not installed) → report the - missing capability rather than degrading silently. - -## Deliverables - -Candidate source path, replay evidence, comparison evidence with verdict and -its acceptance tier, provenance rows, and explicitly unrecovered regions. diff --git a/src/simplecadapi/auto_tools/__init__.py b/src/simplecadapi/auto_tools/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/simplecadapi/auto_tools/skill_pack.py b/src/simplecadapi/auto_tools/skill_pack.py deleted file mode 100644 index cf0da3a4..00000000 --- a/src/simplecadapi/auto_tools/skill_pack.py +++ /dev/null @@ -1,856 +0,0 @@ -#!/usr/bin/env python3 -"""Build a thin Agent Skills bundle for SimpleCAD API. - -This packager intentionally does not bundle SDK source code. -The generated skill contains SDK reference documents and generated API/core docs. -""" - -from __future__ import annotations - -import argparse -import re -import shutil -import subprocess -import sys -import tarfile -import textwrap -from dataclasses import dataclass -from email import message_from_string -from pathlib import Path -from typing import Sequence, cast - -try: - import tomllib # Python 3.11+ # type: ignore[import-not-found] -except ModuleNotFoundError: # pragma: no cover - tomllib = None # type: ignore[assignment] - -DEFAULT_PACKAGE_NAME = "simplecadapi" -DEFAULT_SKILL_NAME = "simplecadapi" -DEFAULT_LICENSE = "MIT" -DOCS_PATH = Path("docs") -LICENSE_PATH = Path("LICENSE") -SKILL_SOURCE_PATH = Path("docs/skill") - -SKILL_DOMAINS = ( - "requirement-refinement", - "part-modeling", - "sketch-and-features", - "assembly-and-product", - "standard-parts", - "step-inspection", - "export-and-translation", -) -SKILL_WORKFLOWS = ( - "single-part-modeling", - "sketch-feature-modeling", - "assembly-product-build", - "step-reconstruction", - "standard-part-assembly", - "export-and-translation", -) -SKILL_DISCIPLINES = ( - "mechanical-modeling", - "requirement-and-cad-brief", - "datums-and-coordinate-systems", - "feature-ordering", - "assembly-positioning", - "geometric-validation", - "failure-and-repair", - "manufacturing-boundaries", -) - -SKILL_NAME_PATTERN = re.compile(r"^(?!-)(?!.*--)[a-z0-9]+(?:-[a-z0-9]+)*$") - - -def _package_root_from(module_file: Path | str | None = None) -> Path: - target = Path(module_file) if module_file is not None else Path(__file__) - return target.resolve().parents[1] - - -def _is_source_checkout_root(project_root: Path) -> bool: - return (project_root / "pyproject.toml").exists() and ( - project_root / "src" / DEFAULT_PACKAGE_NAME - ).exists() - - -def _source_checkout_root(package_root: Path) -> Path | None: - src_dir = package_root.parent - project_root = src_dir.parent - - if src_dir.name != "src": - return None - if not _is_source_checkout_root(project_root): - return None - return project_root - - -def _skill_source_dir_for(project_root: Path) -> Path: - return project_root / SKILL_SOURCE_PATH - - -def _has_skill_layer(project_root: Path) -> bool: - skill_dir = _skill_source_dir_for(project_root) - return skill_dir.is_dir() and all( - (skill_dir / sub).is_dir() for sub in ("domains", "workflows", "discipline") - ) - - -def _default_project_root(module_file: Path | str | None = None) -> Path: - package_root = _package_root_from(module_file) - return _source_checkout_root(package_root) or package_root.parent - - -def _default_output_root(project_root: Path, cwd: Path | None = None) -> Path: - if _is_source_checkout_root(project_root): - return (project_root / "skills").resolve() - return ((cwd if cwd is not None else Path.cwd()) / "skills").resolve() - - -def _first_existing_path(candidates: Sequence[Path]) -> Path | None: - for path in candidates: - if path.exists(): - return path - return None - - -def _docs_root_for(project_root: Path) -> Path: - docs_root = _first_existing_path( - ( - project_root / DOCS_PATH, - project_root / "src" / DOCS_PATH, - ) - ) - return docs_root or (project_root / DOCS_PATH) - - -def _normalize_dist_name(name: str) -> str: - return re.sub(r"[-_.]+", "_", name).lower() - - -def _dist_info_dir(project_root: Path, package_name: str) -> Path | None: - candidates: list[Path] = [] - patterns = ( - f"{package_name}-*.dist-info", - f"{package_name.replace('-', '_')}-*.dist-info", - f"{_normalize_dist_name(package_name)}-*.dist-info", - ) - - for pattern in patterns: - for path in sorted(project_root.glob(pattern)): - if path not in candidates: - candidates.append(path) - - return candidates[0] if candidates else None - - -def _license_path_for(project_root: Path, package_name: str) -> Path | None: - dist_info_dir = _dist_info_dir(project_root, package_name) - candidates = [project_root / LICENSE_PATH] - if dist_info_dir is not None: - candidates.extend( - [ - dist_info_dir / "licenses" / LICENSE_PATH.name, - dist_info_dir / LICENSE_PATH.name, - ] - ) - return _first_existing_path(tuple(candidates)) - - -def _auto_docs_script_path_for(project_root: Path) -> Path | None: - return _first_existing_path( - ( - project_root - / "src" - / DEFAULT_PACKAGE_NAME - / "auto_tools" - / "auto_docs_gen.py", - project_root / DEFAULT_PACKAGE_NAME / "auto_tools" / "auto_docs_gen.py", - ) - ) - - -@dataclass(frozen=True) -class ProjectMetadata: - """Project metadata used for skill rendering.""" - - name: str - version: str - description: str - readme_text: str | None = None - - -@dataclass(frozen=True) -class BuildResult: - """Result object for completed build.""" - - skill_root: Path - archive_path: Path | None - - -def _load_project_metadata( - project_root: Path, - default_name: str = DEFAULT_PACKAGE_NAME, -) -> ProjectMetadata: - pyproject_path = project_root / "pyproject.toml" - - default_version = "0.0.0" - default_desc = "SimpleCAD SDK reference skill" - - if not pyproject_path.exists(): - return ProjectMetadata(default_name, default_version, default_desc) - - if tomllib is not None: - try: - data = tomllib.loads(pyproject_path.read_text(encoding="utf-8")) - project = data.get("project", {}) - return ProjectMetadata( - name=str(project.get("name") or default_name), - version=str(project.get("version") or default_version), - description=str(project.get("description") or default_desc), - readme_text=None, - ) - except Exception: - pass - - content = pyproject_path.read_text(encoding="utf-8") - name_match = re.search( - r'^\s*name\s*=\s*"(?P[^"]+)"\s*$', - content, - flags=re.MULTILINE, - ) - version_match = re.search( - r'^\s*version\s*=\s*"(?P[^"]+)"\s*$', - content, - flags=re.MULTILINE, - ) - description_match = re.search( - r'^\s*description\s*=\s*"(?P[^"]+)"\s*$', - content, - flags=re.MULTILINE, - ) - - return ProjectMetadata( - name=name_match.group("name") if name_match else default_name, - version=version_match.group("version") if version_match else default_version, - description=( - description_match.group("description") - if description_match - else default_desc - ), - readme_text=None, - ) - - -def _load_installed_metadata( - project_root: Path, - package_name: str = DEFAULT_PACKAGE_NAME, -) -> ProjectMetadata | None: - dist_info_dir = _dist_info_dir(project_root, package_name) - if dist_info_dir is None: - return None - - metadata_path = dist_info_dir / "METADATA" - if not metadata_path.exists(): - return None - - message = message_from_string(metadata_path.read_text(encoding="utf-8")) - payload = cast(str, message.get_payload()) - readme_text = payload.strip() or None - return ProjectMetadata( - name=message.get("Name", package_name), - version=message.get("Version", "0.0.0"), - description=message.get("Summary", "SimpleCAD SDK reference skill"), - readme_text=readme_text, - ) - - -def _ignore_common_noise(_: str, names: list[str]) -> list[str]: - ignored: list[str] = [] - for name in names: - if name in {"__pycache__", ".DS_Store"}: - ignored.append(name) - continue - if name.endswith(".pyc"): - ignored.append(name) - continue - # Keep the skill bundle English-only and reference-focused: drop - # deliberate Chinese release-note twins and internal design/history - # docs (the repo keeps them; the bundle does not ship them). - if name.endswith(".zh-CN.md"): - ignored.append(name) - continue - # docs/skill/ is copied separately into references/ top level by - # _copy_skill_layer; do not duplicate it under references/docs/. - if name == "skill": - ignored.append(name) - continue - if name in { - "architecture", - "rearchitecture_2_0.md", - "rearchitecture_2_0_requirements.md", - "operation_graph_json_spec.md", - "part_assembly_development_plan.md", - }: - ignored.append(name) - continue - return ignored - - -class SkillPackager: - """Build thin SDK skill bundle: SKILL.md plus reference docs.""" - - def __init__( - self, - project_root: Path, - output_root: Path, - skill_name: str, - license_name: str, - package_name: str | None = None, - package_version: str | None = None, - clean: bool = True, - refresh_docs: bool = False, - archive: bool = False, - quiet: bool = False, - ): - self.project_root = project_root.resolve() - self.output_root = output_root.resolve() - self.skill_name = skill_name - self.license_name = license_name - self.clean = clean - self.refresh_docs = refresh_docs - self.archive = archive - self.quiet = quiet - - self.skill_root = self.output_root / self.skill_name - self.references_dir = self.skill_root / "references" - self.docs_dir = self.references_dir / "docs" - - self.source_checkout = _is_source_checkout_root(self.project_root) - default_package_name = package_name or DEFAULT_PACKAGE_NAME - self.metadata = _load_project_metadata( - self.project_root, - default_name=default_package_name, - ) - if self.metadata.version == "0.0.0": - installed_metadata = _load_installed_metadata( - self.project_root, - package_name=default_package_name, - ) - if installed_metadata is not None: - self.metadata = installed_metadata - - self.package_name = package_name or self.metadata.name - self.package_version = package_version or self.metadata.version - self.source_docs = _docs_root_for(self.project_root) - self.source_license = _license_path_for(self.project_root, self.package_name) - - def log(self, message: str) -> None: - if not self.quiet: - print(message) - - def build(self) -> BuildResult: - self._validate_inputs() - - if self.refresh_docs: - self._refresh_api_docs() - - self._prepare_output_directory() - self._copy_reference_docs() - self._write_skill_markdown() - self._write_reference_files() - self._validate_generated_skill() - - archive_path = self._create_archive() if self.archive else None - return BuildResult(self.skill_root, archive_path) - - def _validate_inputs(self) -> None: - if len(self.skill_name) > 64: - raise ValueError("skill_name must be <= 64 characters") - if not SKILL_NAME_PATTERN.fullmatch(self.skill_name): - raise ValueError( - "skill_name must use lowercase letters, numbers, and single hyphens" - ) - - required = ( - self.source_docs, - self.source_docs / "api", - self.source_docs / "core", - self.source_docs / "stdlib", - ) - for path in required: - if not path.exists(): - raise FileNotFoundError(f"Missing required path: {path}") - - if self.source_license is None: - raise FileNotFoundError( - "Missing required license file in both project files and dist-info metadata" - ) - - def _refresh_api_docs(self) -> None: - if not self.source_checkout: - self.log( - "Using packaged docs from installed simplecadapi; skipped --refresh-docs outside source checkout." - ) - return - - script_path = _auto_docs_script_path_for(self.project_root) - if script_path is None: - raise FileNotFoundError(f"Cannot refresh docs, missing: {script_path}") - - self.log("Refreshing generated docs before packaging...") - try: - subprocess.run( - [sys.executable, str(script_path), "--quiet"], - cwd=str(self.project_root), - check=True, - ) - except subprocess.CalledProcessError as exc: - raise RuntimeError("Failed to refresh API docs") from exc - - def _prepare_output_directory(self) -> None: - if self.skill_root.exists() and self.clean: - self.log(f"Removing existing skill directory: {self.skill_root}") - shutil.rmtree(self.skill_root) - - self.references_dir.mkdir(parents=True, exist_ok=True) - self.docs_dir.mkdir(parents=True, exist_ok=True) - self.log(f"Writing skill bundle to: {self.skill_root}") - - def _copy_reference_docs(self) -> None: - self.log("Copying reference docs...") - target_docs = self.docs_dir - shutil.copytree( - self.source_docs, - target_docs, - dirs_exist_ok=True, - ignore=_ignore_common_noise, - ) - - if self.source_license is None: - raise FileNotFoundError( - "Missing required license file in both project files and dist-info metadata" - ) - shutil.copy2(self.source_license, self.references_dir / "LICENSE.txt") - - def _write_skill_markdown(self) -> None: - self.log("Generating SKILL.md...") - (self.skill_root / "SKILL.md").write_text( - self._build_skill_markdown(), - encoding="utf-8", - ) - - def _write_reference_files(self) -> None: - self.log("Generating overview references...") - (self.references_dir / "SDK_OVERVIEW.md").write_text( - self._build_project_overview(), - encoding="utf-8", - ) - self._copy_skill_layer() - inspection_reference = ( - self.source_docs / "guides" / "step-brep-reverse-engineering.md" - ) - destination = self.references_dir / "inspect" / "brep-reverse-engineering.md" - destination.parent.mkdir(parents=True, exist_ok=True) - if inspection_reference.exists(): - shutil.copy2(inspection_reference, destination) - else: - destination.write_text( - "# STEP/BREP Inspection\n\n" - "Use `simplecadapi.inspect.brep` outside GraphSession. " - "Select inspection primitives according to the case; do not " - "apply a fixed reverse-engineering pipeline.\n", - encoding="utf-8", - ) - - def _copy_skill_layer(self) -> None: - skill_source = _skill_source_dir_for(self.project_root) - if not _has_skill_layer(self.project_root): - raise FileNotFoundError( - "Task-routed skill layer is missing under docs/skill/ " - "(domains/, workflows/, discipline/)" - ) - self.log("Copying task-routed skill layer...") - shutil.copytree( - skill_source, - self.references_dir, - dirs_exist_ok=True, - ignore=_ignore_common_noise, - ) - (self.references_dir / "README.md").write_text( - self._build_skill_layer_readme(), - encoding="utf-8", - ) - - def _validate_generated_skill(self) -> None: - self.log("Validating generated skill...") - required = [ - self.skill_root / "SKILL.md", - self.references_dir / "SDK_OVERVIEW.md", - self.references_dir / "inspect" / "brep-reverse-engineering.md", - self.references_dir / "LICENSE.txt", - self.docs_dir / "api" / "README.md", - self.docs_dir / "core" / "README.md", - self.docs_dir / "stdlib" / "README.md", - ] - for name in SKILL_DOMAINS: - required.append(self.references_dir / "domains" / f"{name}.md") - for name in SKILL_WORKFLOWS: - required.append(self.references_dir / "workflows" / f"{name}.md") - for name in SKILL_DISCIPLINES: - required.append(self.references_dir / "discipline" / f"{name}.md") - - for path in required: - if not path.exists(): - raise FileNotFoundError(f"Generated skill is missing: {path}") - - forbidden = ( - self.skill_root / "assets" / "project_snapshot" / "src", - self.skill_root / "src", - ) - for path in forbidden: - if path.exists(): - raise ValueError(f"Thin skill must not include source code: {path}") - - frontmatter = self._parse_frontmatter( - (self.skill_root / "SKILL.md").read_text("utf-8") - ) - if frontmatter.get("name", "") != self.skill_name: - raise ValueError("SKILL.md frontmatter name does not match skill directory") - if not frontmatter.get("description", ""): - raise ValueError("SKILL.md frontmatter description is empty") - - def _create_archive(self) -> Path: - archive_path = self.output_root / f"{self.skill_name}.tar.gz" - self.log(f"Creating archive: {archive_path}") - with tarfile.open(archive_path, "w:gz") as tar: - tar.add(self.skill_root, arcname=self.skill_name) - return archive_path - - def _build_skill_markdown(self) -> str: - package_spec = self._package_spec() - guide_references = "" - if self._has_reconstruction_guides(): - guide_references = ( - " - `references/docs/guides/" - "reconstruction-agent-test-prompt.md`\n" - " - `references/docs/guides/" - "reconstruction-agent-strategy.md`\n" - ) - body = textwrap.dedent( - f"""\ - --- - name: {self.skill_name} - 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, durable product packages, model JSON replay, and CAD backend translation. - license: {self.license_name} - metadata: - project: {self.metadata.name} - version: {self.metadata.version} - package-name: {self.package_name} - package-version: {self.metadata.version} - --- - - # SimpleCAD SDK Skill - - Plan and route CAD tasks with the SimpleCADAPI SDK: classify the - request, load the workflow that owns it, follow its task-domain and - discipline references, and read exact API pages only for the APIs a - step names. - - ## Task routing - - Read exactly one workflow first, per the user's goal: - - | User goal | Workflow | - | --- | --- | - | Model one physical part | `references/workflows/single-part-modeling.md` | - | Constraint-driven profile as design intent | `references/workflows/sketch-feature-modeling.md` | - | Multi-part product, connectors, constraints, package | `references/workflows/assembly-product-build.md` | - | Rebuild an editable model from a STEP file | `references/workflows/step-reconstruction.md` | - | Mechanism from stdlib gears/bearings | `references/workflows/standard-part-assembly.md` | - | Export/translate a validated package | `references/workflows/export-and-translation.md` | - - Read-only questions about an existing STEP file do not need a - workflow: `references/domains/step-inspection.md` covers them - directly. - - ## Global rules (every task) - - 1. Refine the requirement into a brief before modeling - (`references/domains/requirement-refinement.md`). - 2. Use keyword arguments for every documented public API and - stdlib function, except the canonical durable export call - `capture(result, path)`, whose two required arguments are - positional. - 3. One part per file; one assembly file per product; parameters - live in the file that consumes them; exposed tunable parameters - are `var()`/`Var` declarations (optionally with `unit`, - `tolerance`). - 4. Booleans (`union_rsolid`, `cut_rsolid`, `intersect_rsolid`) - accept mixed inputs and return exactly one `Solid`; union - defaults to `glue=False` with a conservative scale-relative - tolerance and fails explicitly when it cannot produce one - merged solid. - 5. Build and validate incrementally: each major step prints small - QL-derived facts; grounding uses QL wherever possible; never - print whole solids or full model objects. - 6. Tags: attach with `apply_tag(shape=..., tag=...)` (LOCAL scope — - it never propagates downward); inspect with - `list_tags(shape=...)`; keep numeric facts in metadata, never in - tags. - 7. `@scad.part` for one physical single-solid product; - `@scad.assemble` for assemblies with explicit definitions. - Neither nests inside an active `GraphSession`. Durable delivery - is `capture(result, "out/product.scadpkg")` in one call. - 8. `simplecadapi.inspect.brep` is diagnostic-only and rejected - inside `GraphSession`; obtain/export geometry first, inspect - outside. - 9. Standard parts first: before hand-modeling a gear, ring gear, - rack, cycloidal disc, or bearing, check `scad.std.gear` / - `scad.std.bearing`. - 10. Read `references/docs/guides/cache-build-workflow.md` in full - before configuring persistent cache, durable builds, or cache - maintenance; cache mutation requires explicit confirmation. - - ## Boundaries - - - `.scadpkg` is the canonical durable product; STL/OBJ/MJCF are - point-in-time exports, never editable sources. - - Model JSON is the replay/interchange contract for explicit - `GraphSession` flows; never hand-author payloads. - - No claims of strength, fatigue, thermal, vibration, tolerance - compliance, or regulatory fitness without the corresponding - analysis actually run. - - ## Reading order - - ```text - SKILL.md (this router) - -> references/workflows/.md - -> the domains/ and discipline/ files the workflow names - -> references/docs/api|stdlib|core/.md for each API a step uses - ``` - - Do not read the full API index or stdlib index up front; the - workflow names what to load. Every API used still gets its exact - page read (`references/docs/api/.md`, - `references/docs/stdlib/.md`, - `references/docs/core/.md`). - - ## Example SDK usage - - ```python - import simplecadapi as scad - from simplecadapi import GraphSession, export_model_json, replay_model_json - - with GraphSession(graph_id="box") as session: - shape = scad.make_box_rsolid(width=10.0, height=20.0, depth=30.0) - session.capture_result(value=shape) - payload = export_model_json(session=session) - - rebuilt = replay_model_json(json_str=payload) - print(len(rebuilt)) - ``` - - ## References - - - `references/README.md` — skill layer structure - - `references/workflows/` — six goal-oriented workflows - - `references/domains/` — seven capability domains - - `references/discipline/` — modeling knowledge and invariants - - `references/SDK_OVERVIEW.md` — package-level map - - `references/inspect/brep-reverse-engineering.md` -{guide_references} - `references/docs/guides/cache-build-workflow.md` - - `references/docs/api/`, `references/docs/stdlib/`, `references/docs/core/` - """ - ) - return body.rstrip() + "\n" - - def _build_skill_layer_readme(self) -> str: - source = _skill_source_dir_for(self.project_root) / "README.md" - if source.is_file(): - return source.read_text(encoding="utf-8") - return ( - "# Skill Documentation Structure\n\n" - "domains/ workflows/ discipline/ layer; see SKILL.md for routing.\n" - ) - - def _has_reconstruction_guides(self) -> bool: - guides = self.source_docs / "guides" - return all( - (guides / name).is_file() - for name in ( - "reconstruction-agent-test-prompt.md", - "reconstruction-agent-strategy.md", - ) - ) - - def _build_project_overview(self) -> str: - package_spec = self._package_spec() - lines = [ - "# SDK Overview", - "", - f"- Project: `{self.metadata.name}`", - f"- Version: `{self.metadata.version}`", - f"- Package distribution: `{package_spec}`", - "", - "## What this skill bundles", - "", - "- Task router (`SKILL.md`) with six workflows", - "- Capability domains (`references/domains/`)", - "- Modeling discipline (`references/discipline/`)", - "- Generated API/stdlib/core references (`references/docs/`)", - "", - "## What this skill does not bundle", - "", - "- SDK source code (`src/simplecadapi`) is intentionally excluded.", - "- Environment/bootstrap workflows are intentionally not the focus here.", - "- Self-evolving or skill-local case packaging is intentionally excluded.", - "", - "## Main SDK surfaces", - "", - "- Geometry and modeling operations in `docs/api/`.", - "- Standard parts library in `docs/stdlib/`, including `scad.std.gear` gear, ring gear, rack, and cycloidal disc factories plus `scad.std.bearing` bearing assembly factories.", - "- Core shape/type semantics in `docs/core/`.", - "- Graph/model serialization and replay APIs.", - "- Expression, parameter, and semantic reference types.", - "- Functional tagging with `apply_tag(shape=..., tag=...)`, `list_tags(shape=...)`, and QL tag predicates.", - "", - "## Preferred replayable workflow", - "", - "- Record modeling steps inside `GraphSession` when you need replayable outputs.", - "- Export session/model payloads with `export_session_json()` and `export_model_json()`.", - "- Re-import or replay with `import_model_json()` and `replay_model_json()`.", - ] - return "\n".join(lines).rstrip() + "\n" - - def _package_spec(self) -> str: - if self.package_version: - return f"{self.package_name}=={self.package_version}" - return self.package_name - - @staticmethod - def _parse_frontmatter(content: str) -> dict[str, str]: - lines = content.splitlines() - if not lines or lines[0].strip() != "---": - raise ValueError("SKILL.md is missing YAML frontmatter start marker") - - data: dict[str, str] = {} - end_index = None - for index in range(1, len(lines)): - line = lines[index] - if line.strip() == "---": - end_index = index - break - if not line.strip() or line.startswith((" ", "\t")): - continue - if ":" not in line: - continue - key, value = line.split(":", 1) - data[key.strip()] = value.strip().strip('"').strip("'") - - if end_index is None: - raise ValueError("SKILL.md is missing YAML frontmatter end marker") - - return data - - -def _parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description="Package SimpleCAD API into a thin Agent Skills bundle" - ) - parser.add_argument( - "--project-root", - type=Path, - default=None, - help="Project root (default: source checkout root, or installed environment root)", - ) - parser.add_argument( - "--output-root", - type=Path, - default=None, - help="Output directory for generated skill bundle (default: repo skills/ in source checkout, otherwise ./skills)", - ) - parser.add_argument( - "--skill-name", - default=DEFAULT_SKILL_NAME, - help="Skill directory name and SKILL.md frontmatter name", - ) - parser.add_argument( - "--license-name", - default=DEFAULT_LICENSE, - help="License value written into SKILL.md frontmatter", - ) - parser.add_argument( - "--package-name", - default=None, - help="Runtime package name to install from PyPI (default: project.name)", - ) - parser.add_argument( - "--package-version", - default=None, - help="Runtime package version to install (default: project.version)", - ) - parser.add_argument( - "--refresh-docs", - action="store_true", - help="Refresh docs/api and docs/stdlib via auto_docs_gen.py before packaging", - ) - parser.add_argument( - "--no-clean", - action="store_true", - help="Do not remove existing output skill directory before packaging", - ) - parser.add_argument( - "--archive", - action="store_true", - help="Create .tar.gz after generation", - ) - parser.add_argument( - "--quiet", - action="store_true", - help="Reduce console output", - ) - return parser.parse_args() - - -def main() -> None: - args = _parse_args() - project_root = ( - args.project_root.resolve() - if args.project_root is not None - else _default_project_root() - ) - output_root = ( - args.output_root.resolve() - if args.output_root is not None - else _default_output_root(project_root) - ) - - packager = SkillPackager( - project_root=project_root, - output_root=output_root, - skill_name=args.skill_name, - license_name=args.license_name, - package_name=args.package_name, - package_version=args.package_version, - clean=not args.no_clean, - refresh_docs=args.refresh_docs, - archive=args.archive, - quiet=args.quiet, - ) - - try: - result = packager.build() - except Exception as exc: - print(f"Error: {exc}", file=sys.stderr) - raise SystemExit(1) from exc - - if not args.quiet: - print("Skill package generated successfully.") - print(f"Skill directory: {result.skill_root}") - if result.archive_path is not None: - print(f"Archive path: {result.archive_path}") - - -if __name__ == "__main__": - main() diff --git a/test/test_auto_docs_gen.py b/test/test_auto_docs_gen.py index fa7b5ec6..e05aac29 100644 --- a/test/test_auto_docs_gen.py +++ b/test/test_auto_docs_gen.py @@ -6,7 +6,7 @@ from pathlib import Path MODULE_PATH = ( - Path(__file__).resolve().parents[1] / "src/simplecadapi/auto_tools/auto_docs_gen.py" + Path(__file__).resolve().parents[1] / "tools/auto_docs_gen.py" ) MODULE_SPEC = importlib.util.spec_from_file_location( "simplecadapi_auto_docs_gen", @@ -21,7 +21,7 @@ MODULE_SPEC.loader.exec_module(auto_docs_gen) class TestAutoDocsGenPathResolution(unittest.TestCase): - def test_resolve_source_files_from_source_checkout(self): + def test_resolve_source_files_from_repo_checkout(self): with tempfile.TemporaryDirectory() as tmp_dir: project_root = Path(tmp_dir) (project_root / "pyproject.toml").write_text( @@ -29,7 +29,7 @@ class TestAutoDocsGenPathResolution(unittest.TestCase): encoding="utf-8", ) - module_file = project_root / "src/simplecadapi/auto_tools/auto_docs_gen.py" + module_file = project_root / "tools/auto_docs_gen.py" module_file.parent.mkdir(parents=True, exist_ok=True) module_file.write_text("", encoding="utf-8") @@ -44,23 +44,13 @@ class TestAutoDocsGenPathResolution(unittest.TestCase): self.assertEqual(resolved, expected) - def test_resolve_source_files_from_site_packages_install(self): + def test_resolve_source_files_outside_repo_fails_loud(self): with tempfile.TemporaryDirectory() as tmp_dir: - venv_root = Path(tmp_dir) / ".venv/lib/python3.12/site-packages" - module_file = venv_root / "simplecadapi/auto_tools/auto_docs_gen.py" - module_file.parent.mkdir(parents=True, exist_ok=True) + module_file = Path(tmp_dir) / "auto_docs_gen.py" module_file.write_text("", encoding="utf-8") - resolved = auto_docs_gen._resolve_source_files( - None, module_file=module_file - ) - package_root = venv_root / "simplecadapi" - expected = [ - (package_root / name).resolve() - for name in auto_docs_gen.DEFAULT_SOURCE_FILENAMES - ] - - self.assertEqual(resolved, expected) + with self.assertRaises(FileNotFoundError): + auto_docs_gen._resolve_source_files(None, module_file=module_file) def test_resolve_output_dirs_from_source_checkout_uses_repo_docs(self): with tempfile.TemporaryDirectory() as tmp_dir: @@ -70,32 +60,17 @@ class TestAutoDocsGenPathResolution(unittest.TestCase): encoding="utf-8", ) - module_file = project_root / "src/simplecadapi/auto_tools/auto_docs_gen.py" + module_file = project_root / "tools/auto_docs_gen.py" module_file.parent.mkdir(parents=True, exist_ok=True) module_file.write_text("", encoding="utf-8") resolved = auto_docs_gen._resolve_output_dirs(None, module_file=module_file) - self.assertEqual(resolved, [(project_root / "docs/api").resolve()]) - - def test_resolve_output_dirs_from_site_packages_install_uses_cwd(self): - with tempfile.TemporaryDirectory() as tmp_dir: - tmp_path = Path(tmp_dir) - workspace_root = tmp_path / "workspace" - workspace_root.mkdir() - - venv_root = tmp_path / ".venv/lib/python3.12/site-packages" - module_file = venv_root / "simplecadapi/auto_tools/auto_docs_gen.py" - module_file.parent.mkdir(parents=True, exist_ok=True) - module_file.write_text("", encoding="utf-8") - - resolved = auto_docs_gen._resolve_output_dirs( - None, - module_file=module_file, - cwd=workspace_root, + self.assertEqual( + resolved, + [(project_root / "docs/skill/references/docs/api").resolve()], ) - self.assertEqual(resolved, [(workspace_root / "docs/api").resolve()]) def test_default_source_files_include_v2_public_modules(self): with tempfile.TemporaryDirectory() as tmp_dir: @@ -219,7 +194,7 @@ class TestAutoDocsGenPathResolution(unittest.TestCase): def _module_name_for(self, file_path): return "inverse_engineer/brep/evaluation.py" - project_root = MODULE_PATH.parents[3] + project_root = MODULE_PATH.parents[1] source_file = ( project_root / "src/simplecadapi/inverse_engineer/brep/evaluation.py" ) @@ -296,7 +271,7 @@ class TestAutoDocsGenPathResolution(unittest.TestCase): def _module_name_for(self, file_path): return "inspect/brep/persistence.py" - project_root = MODULE_PATH.parents[3] + project_root = MODULE_PATH.parents[1] source_file = project_root / "src/simplecadapi/inspect/brep/persistence.py" with tempfile.TemporaryDirectory() as tmp_dir: output_dir = Path(tmp_dir) / "docs/api" @@ -338,7 +313,7 @@ class TestAutoDocsGenPathResolution(unittest.TestCase): encoding="utf-8", ) - module_file = project_root / "src/simplecadapi/auto_tools/auto_docs_gen.py" + module_file = project_root / "tools/auto_docs_gen.py" module_file.parent.mkdir(parents=True, exist_ok=True) module_file.write_text("", encoding="utf-8") @@ -347,7 +322,10 @@ class TestAutoDocsGenPathResolution(unittest.TestCase): module_file=module_file, ) - self.assertEqual(resolved, [(project_root / "docs/stdlib").resolve()]) + self.assertEqual( + resolved, + [(project_root / "docs/skill/references/docs/stdlib").resolve()], + ) class TestAutoDocsGenExtraction(unittest.TestCase): diff --git a/test/test_example_model_contract.py b/test/test_example_model_contract.py index 19330fee..d691e48a 100644 --- a/test/test_example_model_contract.py +++ b/test/test_example_model_contract.py @@ -1,6 +1,5 @@ """Structural checks for the example model/session contract.""" -import runpy import importlib.util import sys from pathlib import Path @@ -67,23 +66,6 @@ class TestExampleModelContract(unittest.TestCase): EXAMPLES / "out" / "hydraulic_rod_assembly", ) - def test_every_formal_example_has_one_scadpkg_contract(self): - runner = runpy.run_path(str(ROOT / "tools" / "run_examples.py")) - cases = runner["CASES"] - actual = {case.path: case.package_path for case in cases} - - self.assertEqual(actual, FORMAL_EXAMPLE_PACKAGES) - self.assertEqual(len(set(actual.values())), len(actual)) - self.assertTrue(all(path.endswith(".scadpkg") for path in actual.values())) - self.assertTrue(all(case.step_path.endswith(".step") for case in cases)) - self.assertTrue(all(case.fcstd_path.endswith(".FCStd") for case in cases)) - self.assertTrue( - all( - Path(case.step_path).stem == Path(case.package_path).stem - and Path(case.fcstd_path).stem == Path(case.package_path).stem - for case in cases - ) - ) def test_examples_do_not_use_removed_decorator_api(self): for path in _source_files(): diff --git a/test/test_make_export.py b/test/test_make_export.py deleted file mode 100644 index 8f3625bf..00000000 --- a/test/test_make_export.py +++ /dev/null @@ -1,76 +0,0 @@ -import importlib.util -import sys -import unittest -from pathlib import Path - - -MODULE_PATH = ( - Path(__file__).resolve().parents[1] / "src/simplecadapi/auto_tools/make_export.py" -) -MODULE_SPEC = importlib.util.spec_from_file_location( - "simplecadapi_make_export", - MODULE_PATH, -) -if MODULE_SPEC is None or MODULE_SPEC.loader is None: - raise RuntimeError(f"Unable to load module spec for {MODULE_PATH}") - -make_export = importlib.util.module_from_spec(MODULE_SPEC) -sys.modules[MODULE_SPEC.name] = make_export -MODULE_SPEC.loader.exec_module(make_export) - - -class TestMakeExportInventory(unittest.TestCase): - def test_collect_api_inventory_includes_all_supported_modules(self): - inventory = make_export.collect_api_inventory() - - self.assertIn("make_box_rsolid", inventory["operations"].functions) - self.assertIn("apply_tag", inventory["operations"].functions) - self.assertIn("list_tags", inventory["operations"].functions) - self.assertNotIn("set_tag", inventory["operations"].functions) - self.assertIn("make_n_hole_flange_rsolid", inventory["evolve"].functions) - self.assertNotIn("constraints", inventory) - self.assertNotIn("field", inventory) - self.assertIn("select", inventory["ql"].functions) - - def test_generate_init_file_excludes_removed_modules(self): - inventory = make_export.collect_api_inventory() - - content = make_export.generate_init_file(inventory) - - self.assertNotIn("from .constraints import (", content) - self.assertIn("from . import ql", content) - self.assertIn("from . import translator", content) - self.assertNotIn("create_field_surface", content) - self.assertIn("make_assembly_rassembly", content) - self.assertIn("make_part_rpart", content) - self.assertIn("make_material_rmaterial", content) - self.assertIn("add_revolute_constraint_rassembly", content) - self.assertIn("add_gear_constraint_rassembly", content) - self.assertIn("apply_tag", content) - self.assertIn("list_tags", content) - self.assertNotIn("set_tag", content) - self.assertNotIn('"field",', content) - self.assertIn('"ql",', content) - self.assertIn('"translator",', content) - - def test_target_symbols_include_product_semantics_but_exclude_removed_exports(self): - inventory = make_export.collect_api_inventory() - - symbols = make_export._target_symbols(inventory) - - self.assertIn("make_assembly_rassembly", symbols) - self.assertIn("make_part_rpart", symbols) - self.assertIn("make_material_rmaterial", symbols) - self.assertIn("add_prismatic_constraint_rassembly", symbols) - self.assertIn("add_rack_pinion_constraint_rassembly", symbols) - self.assertNotIn("PartHandle", symbols) - self.assertIn("apply_tag", symbols) - self.assertIn("list_tags", symbols) - self.assertNotIn("set_tag", symbols) - self.assertNotIn("field", symbols) - self.assertIn("ql", symbols) - self.assertIn("translator", symbols) - - -if __name__ == "__main__": - unittest.main() diff --git a/test/test_skill_build.py b/test/test_skill_build.py new file mode 100644 index 00000000..5ab2a3e3 --- /dev/null +++ b/test/test_skill_build.py @@ -0,0 +1,330 @@ +"""Tests for tools/skillbuild.py — conditional skill compilation.""" + +import importlib.util +import sys +from pathlib import Path + +import pytest + +MODULE_PATH = Path(__file__).resolve().parents[1] / "tools" / "skillbuild.py" +MODULE_SPEC = importlib.util.spec_from_file_location("skillbuild", MODULE_PATH) +if MODULE_SPEC is None or MODULE_SPEC.loader is None: + raise RuntimeError(f"Unable to load module spec for {MODULE_PATH}") + +skillbuild = importlib.util.module_from_spec(MODULE_SPEC) +sys.modules["skillbuild"] = skillbuild +MODULE_SPEC.loader.exec_module(skillbuild) + + +def make_project(tmp_path, files, targets=("omp", "generic"), outputs=None): + root = tmp_path / "proj" + source = root / "skill-src" + for relative, content in files.items(): + target = source / relative + target.parent.mkdir(parents=True, exist_ok=True) + target.write_text(content, encoding="utf-8") + output_table = outputs or {name: f"out/{name}" for name in targets} + output_lines = "\n".join( + f'{name} = "{value}"' for name, value in output_table.items() + ) + target_list = ", ".join(f'"{name}"' for name in targets) + (root / "skillproj.toml").write_text( + f'[skill]\nname = "demo"\nsource = "skill-src"\n\n' + f"[build]\ntargets = [{target_list}]\n\n" + f"[build.output]\n{output_lines}\n", + encoding="utf-8", + ) + return root + + +def load(root): + project = skillbuild.load_project(root) + files = skillbuild.collect_source_files( + project.source, frozenset(project.targets), project.root + ) + return project, files + + +def build_one(root, target): + project, files = load(root) + return project, skillbuild.build_target(project, files, target) + + +def read(path): + return path.read_text(encoding="utf-8") + + +SIMPLE = ( + "# Demo\n" + "\n" + "\n" + "omp-only line\n" + "\n" + "\n" + "other-harness line\n" + "\n" + "\n" + "shared line\n" +) + + +class TestConditionSemantics: + def test_positive_included_only_for_listed_target(self, tmp_path): + root = make_project(tmp_path, {"SKILL.md": SIMPLE}) + _, omp = build_one(root, "omp") + _, generic = build_one(root, "generic") + assert "omp-only line" in read(omp / "SKILL.md") + assert "omp-only line" not in read(generic / "SKILL.md") + + def test_negation_selects_complement(self, tmp_path): + root = make_project(tmp_path, {"SKILL.md": SIMPLE}) + _, omp = build_one(root, "omp") + _, generic = build_one(root, "generic") + assert "other-harness line" in read(generic / "SKILL.md") + assert "other-harness line" not in read(omp / "SKILL.md") + + def test_multi_positive_included_in_both(self, tmp_path): + content = ( + "\nshared block\n\n" + ) + root = make_project(tmp_path, {"a.md": content}) + _, omp = build_one(root, "omp") + _, generic = build_one(root, "generic") + assert "shared block" in read(omp / "a.md") + assert "shared block" in read(generic / "a.md") + + def test_mixed_positive_and_negation_never_contradictory(self): + # omp,!omp is rejected at parse time (duplicate name), so mixed + # expressions always mean "these positives minus these negatives". + with pytest.raises(skillbuild.SkillBuildError, match="duplicate"): + skillbuild.Condition.parse( + "omp,!omp", frozenset({"omp"}), "a.md:1" + ) + + +class TestOutputShape: + def test_markers_removed_even_when_block_kept(self, tmp_path): + root = make_project(tmp_path, {"a.md": SIMPLE}) + _, omp = build_one(root, "omp") + text = read(omp / "a.md") + assert "skill:if" not in text + assert "skill:endif" not in text + + def test_blank_runs_collapse_after_removal(self, tmp_path): + content = "above\n\n\ninside\n\n\nbelow\n" + root = make_project(tmp_path, {"a.md": content}) + _, omp = build_one(root, "omp") + assert read(omp / "a.md") == "above\n\nbelow\n" + + def test_files_without_directives_copied_verbatim(self, tmp_path): + plain = "byte\nidentical\ntext\n" + root = make_project(tmp_path, {"plain.md": plain, "a.md": SIMPLE}) + project, files = load(root) + skillbuild.build_target(project, files, "omp") + assert (project.root / "out/omp/plain.md").read_bytes() == plain.encode() + + def test_binary_file_copied_verbatim(self, tmp_path): + root = make_project(tmp_path, {"a.md": SIMPLE}) + binary = root / "skill-src" / "blob.bin" + binary.write_bytes(b"\xff\xfe\x00not-utf8") + project, files = load(root) + skillbuild.build_target(project, files, "omp") + copied = project.root / "out/omp/blob.bin" + assert copied.read_bytes() == b"\xff\xfe\x00not-utf8" + + def test_denied_entries_excluded(self, tmp_path): + root = make_project(tmp_path, {"a.md": SIMPLE}) + source = root / "skill-src" + (source / "__pycache__" / "junk.pyc").parent.mkdir(parents=True) + (source / "__pycache__" / "junk.pyc").write_text("x") + (source / ".hidden").write_text("x") + (source / ".DS_Store").write_text("x") + project, files = load(root) + output = skillbuild.build_target(project, files, "omp") + assert not (output / "__pycache__").exists() + assert not (output / ".hidden").exists() + assert not (output / ".DS_Store").exists() + + def test_subdirectory_layout_preserved(self, tmp_path): + root = make_project(tmp_path, {"refs/deep/nested.md": SIMPLE}) + project, files = load(root) + output = skillbuild.build_target(project, files, "omp") + assert (output / "refs/deep/nested.md").is_file() + + +class TestFences: + def test_directives_inside_fences_are_literal(self, tmp_path): + content = ( + "# Doc\n" + "\n" + "```text\n" + "\n" + "example marker\n" + "\n" + "```\n" + ) + root = make_project(tmp_path, {"a.md": content}) + _, omp = build_one(root, "omp") + _, generic = build_one(root, "generic") + for output in (omp, generic): + text = read(output / "a.md") + assert "example marker" in text + assert "" in text + + def test_fence_inside_block_scopes_correctly(self, tmp_path): + content = ( + "\n" + "```python\n" + "\n" + "```\n" + "\n" + ) + root = make_project(tmp_path, {"a.md": content}) + _, omp = build_one(root, "omp") + text = read(omp / "a.md") + assert "" in text # the fenced one is literal + assert text.count("skill:endif") == 1 + + +class TestFailLoud: + def test_unknown_target_name_rejected(self, tmp_path): + content = "\nx\n\n" + root = make_project(tmp_path, {"a.md": content}) + with pytest.raises(skillbuild.SkillBuildError, match="unknown target 'opm'"): + load(root) + + def test_unknown_check_runs_even_when_building_single_target(self, tmp_path): + content = "\nx\n\n" + root = make_project(tmp_path, {"a.md": content}) + project = skillbuild.load_project(root) + with pytest.raises(skillbuild.SkillBuildError, match="unknown target"): + skillbuild.collect_source_files( + project.source, frozenset(project.targets), project.root + ) + + def test_nested_if_rejected(self, tmp_path): + content = ( + "\n" + "\n" + "\n" + "\n" + ) + root = make_project(tmp_path, {"a.md": content}) + with pytest.raises(skillbuild.SkillBuildError, match="nested"): + load(root) + + def test_stray_endif_rejected(self, tmp_path): + root = make_project(tmp_path, {"a.md": "\n"}) + with pytest.raises(skillbuild.SkillBuildError, match="without matching"): + load(root) + + def test_unclosed_if_rejected(self, tmp_path): + root = make_project(tmp_path, {"a.md": "\nx\n"}) + with pytest.raises(skillbuild.SkillBuildError, match="unclosed"): + load(root) + + def test_endif_with_expression_rejected(self, tmp_path): + content = "\nx\n\n" + root = make_project(tmp_path, {"a.md": content}) + with pytest.raises(skillbuild.SkillBuildError, match="takes no expression"): + load(root) + + def test_empty_expression_rejected(self, tmp_path): + content = "\nx\n\n" + root = make_project(tmp_path, {"a.md": content}) + with pytest.raises(skillbuild.SkillBuildError): + load(root) + + def test_output_inside_source_rejected(self, tmp_path): + outputs = {"omp": "skill-src/out", "generic": "out/generic"} + root = make_project(tmp_path, {"a.md": SIMPLE}, outputs=outputs) + with pytest.raises(skillbuild.SkillBuildError, match="inside the source"): + skillbuild.load_project(root) + + def test_output_containing_source_rejected(self, tmp_path): + outputs = {"omp": ".", "generic": "out/generic"} + root = make_project(tmp_path, {"a.md": SIMPLE}, outputs=outputs) + with pytest.raises(skillbuild.SkillBuildError): + skillbuild.load_project(root) + + def test_shared_output_rejected(self, tmp_path): + outputs = {"omp": "out/x", "generic": "out/x"} + root = make_project(tmp_path, {"a.md": SIMPLE}, outputs=outputs) + with pytest.raises(skillbuild.SkillBuildError, match="share output"): + skillbuild.load_project(root) + + def test_missing_output_entry_rejected(self, tmp_path): + root = make_project(tmp_path, {"a.md": SIMPLE}) + config = root / "skillproj.toml" + config.write_text( + config.read_text(encoding="utf-8").replace( + 'generic = "out/generic"', "" + ), + encoding="utf-8", + ) + with pytest.raises(skillbuild.SkillBuildError, match="missing target 'generic'"): + skillbuild.load_project(root) + + def test_skill_md_frontmatter_name_mismatch_rejected(self, tmp_path): + content = "---\nname: wrong-name\n---\n\nbody\n" + root = make_project(tmp_path, {"SKILL.md": content}) + project, files = load(root) + with pytest.raises(skillbuild.SkillBuildError, match="frontmatter name"): + skillbuild.build_target(project, files, "omp") + + +class TestCli: + def test_default_builds_all_targets(self, tmp_path, capsys): + root = make_project(tmp_path, {"a.md": SIMPLE}) + code = skillbuild.main(["--project-root", str(root)]) + assert code == 0 + assert (root / "out/omp/a.md").is_file() + assert (root / "out/generic/a.md").is_file() + out = capsys.readouterr().out + assert "built omp" in out + assert "built generic" in out + + def test_single_target_flag(self, tmp_path): + root = make_project(tmp_path, {"a.md": SIMPLE}) + code = skillbuild.main(["--project-root", str(root), "--target", "omp"]) + assert code == 0 + assert (root / "out/omp/a.md").is_file() + assert not (root / "out/generic").exists() + + def test_unknown_cli_target_rejected(self, tmp_path, capsys): + root = make_project(tmp_path, {"a.md": SIMPLE}) + code = skillbuild.main(["--project-root", str(root), "--target", "nope"]) + assert code == 1 + assert "unknown --target 'nope'" in capsys.readouterr().err + + def test_check_writes_nothing(self, tmp_path, capsys): + root = make_project(tmp_path, {"a.md": SIMPLE}) + code = skillbuild.main(["--project-root", str(root), "--check"]) + assert code == 0 + assert "OK:" in capsys.readouterr().out + assert not (root / "out").exists() + + def test_check_detects_broken_tree(self, tmp_path, capsys): + root = make_project(tmp_path, {"a.md": "\n"}) + code = skillbuild.main(["--project-root", str(root), "--check"]) + assert code == 1 + assert "unclosed" in capsys.readouterr().err + + def test_project_root_discovered_by_walking_up(self, tmp_path, monkeypatch): + root = make_project(tmp_path, {"a.md": SIMPLE}) + nested = root / "skill-src" / "sub" + nested.mkdir(exist_ok=True) + monkeypatch.chdir(nested) + assert skillbuild.find_project_root(Path.cwd()) == root.resolve() + + +def test_live_project_config_builds(): + """The checked-in skillproj.toml must describe a buildable tree.""" + repo_root = MODULE_PATH.parents[1] + project = skillbuild.load_project(repo_root) + assert project.name == "simplecadapi" + files = skillbuild.collect_source_files( + project.source, frozenset(project.targets), project.root + ) + assert any(entry.relative == Path("SKILL.md") for entry in files) + assert all(not e.blocks for e in files), "live tree must stay harness-neutral" diff --git a/test/test_skill_pack.py b/test/test_skill_pack.py deleted file mode 100644 index b22b2ec3..00000000 --- a/test/test_skill_pack.py +++ /dev/null @@ -1,358 +0,0 @@ -import importlib.util -import sys -import tempfile -import unittest -from pathlib import Path - - -MODULE_PATH = ( - Path(__file__).resolve().parents[1] / "src/simplecadapi/auto_tools/skill_pack.py" -) -MODULE_SPEC = importlib.util.spec_from_file_location( - "simplecadapi_skill_pack", - MODULE_PATH, -) -if MODULE_SPEC is None or MODULE_SPEC.loader is None: - raise RuntimeError(f"Unable to load module spec for {MODULE_PATH}") - -skill_pack = importlib.util.module_from_spec(MODULE_SPEC) -sys.modules[MODULE_SPEC.name] = skill_pack -MODULE_SPEC.loader.exec_module(skill_pack) - - -def _make_skill_layer(project_root: Path) -> None: - """Create a minimal docs/skill tree so packager validation passes.""" - skill_dir = project_root / "docs/skill" - for sub, names in ( - ("domains", skill_pack.SKILL_DOMAINS), - ("workflows", skill_pack.SKILL_WORKFLOWS), - ("discipline", skill_pack.SKILL_DISCIPLINES), - ): - (skill_dir / sub).mkdir(parents=True, exist_ok=True) - for name in names: - (skill_dir / sub / f"{name}.md").write_text( - f"# {name}\n", - encoding="utf-8", - ) - - -class TestSkillPackPathResolution(unittest.TestCase): - def test_checked_in_skill_markdown_matches_generator(self): - project_root = MODULE_PATH.parents[3] - packager = skill_pack.SkillPackager( - project_root=project_root, - output_root=project_root / "unused-skill-output", - skill_name="simplecadapi", - license_name=skill_pack.DEFAULT_LICENSE, - quiet=True, - ) - - generated = packager._build_skill_markdown() - checked_in = (project_root / "skills/simplecadapi/SKILL.md").read_text( - encoding="utf-8" - ) - - self.assertEqual(checked_in, generated) - - def test_default_project_root_from_source_checkout(self): - with tempfile.TemporaryDirectory() as tmp_dir: - project_root = Path(tmp_dir) - (project_root / "pyproject.toml").write_text( - "[project]\nname = 'simplecadapi'\n", - encoding="utf-8", - ) - package_root = project_root / "src/simplecadapi" - module_file = package_root / "auto_tools/skill_pack.py" - module_file.parent.mkdir(parents=True, exist_ok=True) - module_file.write_text("", encoding="utf-8") - - resolved = skill_pack._default_project_root(module_file) - - self.assertEqual(resolved, project_root.resolve()) - - def test_default_project_root_from_site_packages_install(self): - with tempfile.TemporaryDirectory() as tmp_dir: - site_packages = Path(tmp_dir) / ".venv/lib/python3.12/site-packages" - module_file = site_packages / "simplecadapi/auto_tools/skill_pack.py" - module_file.parent.mkdir(parents=True, exist_ok=True) - module_file.write_text("", encoding="utf-8") - - resolved = skill_pack._default_project_root(module_file) - - self.assertEqual(resolved, site_packages.resolve()) - - def test_default_output_root_from_source_checkout(self): - with tempfile.TemporaryDirectory() as tmp_dir: - project_root = Path(tmp_dir) - (project_root / "pyproject.toml").write_text( - "[project]\nname = 'simplecadapi'\n", - encoding="utf-8", - ) - (project_root / "src/simplecadapi").mkdir(parents=True, exist_ok=True) - - resolved = skill_pack._default_output_root(project_root) - - self.assertEqual(resolved, (project_root / "skills").resolve()) - - def test_default_output_root_from_site_packages_install(self): - with tempfile.TemporaryDirectory() as tmp_dir: - tmp_path = Path(tmp_dir) - site_packages = tmp_path / ".venv/lib/python3.12/site-packages" - site_packages.mkdir(parents=True, exist_ok=True) - workspace_root = tmp_path / "workspace" - workspace_root.mkdir() - - resolved = skill_pack._default_output_root( - site_packages, - cwd=workspace_root, - ) - - self.assertEqual(resolved, (workspace_root / "skills").resolve()) - - def test_build_from_site_packages_layout_uses_metadata_readme(self): - with tempfile.TemporaryDirectory() as tmp_dir: - tmp_path = Path(tmp_dir) - site_packages = tmp_path / ".venv/lib/python3.12/site-packages" - docs_api = site_packages / "docs/api" - docs_core = site_packages / "docs/core" - docs_stdlib = site_packages / "docs/stdlib" - docs_api.mkdir(parents=True, exist_ok=True) - docs_core.mkdir(parents=True, exist_ok=True) - docs_stdlib.mkdir(parents=True, exist_ok=True) - (docs_api / "README.md").write_text("# API Docs\n", encoding="utf-8") - (docs_core / "README.md").write_text("# Core Docs\n", encoding="utf-8") - (docs_stdlib / "README.md").write_text( - "# Standard Library Docs\n", - encoding="utf-8", - ) - _make_skill_layer(site_packages) - dist_info = site_packages / "simplecadapi-2.0.2.dist-info" - (dist_info / "licenses").mkdir(parents=True, exist_ok=True) - (dist_info / "METADATA").write_text( - "Metadata-Version: 2.1\n" - "Name: simplecadapi\n" - "Version: 2.0.2\n" - "Summary: Demo package\n" - "\n" - "# Demo README\n" - "\n" - "Installed package readme body.\n", - encoding="utf-8", - ) - (dist_info / "licenses/LICENSE").write_text( - "MIT License\n", - encoding="utf-8", - ) - - output_root = tmp_path / "workspace/skills" - packager = skill_pack.SkillPackager( - project_root=site_packages, - output_root=output_root, - skill_name="simplecadapi", - license_name="MIT", - package_name="simplecadapi", - package_version="2.0.2", - refresh_docs=True, - quiet=True, - ) - - result = packager.build() - - self.assertTrue((result.skill_root / "SKILL.md").exists()) - self.assertTrue( - (result.skill_root / "references/docs/api/README.md").exists() - ) - self.assertTrue( - (result.skill_root / "references/docs/stdlib/README.md").exists() - ) - self.assertTrue( - ( - result.skill_root / "references/inspect/brep-reverse-engineering.md" - ).exists() - ) - overview = ( - result.skill_root / "references/SDK_OVERVIEW.md" - ).read_text(encoding="utf-8") - self.assertIn("# SDK Overview", overview) - self.assertIn("references/docs/", overview) - self.assertTrue( - (result.skill_root / "references/domains/part-modeling.md").exists() - ) - self.assertEqual( - (result.skill_root / "references/LICENSE.txt").read_text( - encoding="utf-8" - ), - "MIT License\n", - ) - self.assertFalse((result.skill_root / "scripts").exists()) - - def test_build_skill_markdown_routes_tasks_to_workflows(self): - with tempfile.TemporaryDirectory() as tmp_dir: - tmp_path = Path(tmp_dir) - project_root = tmp_path / "project" - docs_api = project_root / "docs/api" - docs_core = project_root / "docs/core" - docs_stdlib = project_root / "docs/stdlib" - docs_guides = project_root / "docs/guides" - docs_api.mkdir(parents=True, exist_ok=True) - docs_core.mkdir(parents=True, exist_ok=True) - docs_stdlib.mkdir(parents=True, exist_ok=True) - docs_guides.mkdir(parents=True, exist_ok=True) - (docs_api / "README.md").write_text("# API Docs\n", encoding="utf-8") - (docs_core / "README.md").write_text("# Core Docs\n", encoding="utf-8") - (docs_stdlib / "README.md").write_text( - "# Standard Library Docs\n", - encoding="utf-8", - ) - (docs_guides / "reconstruction-agent-test-prompt.md").write_text( - "# Reconstruction Contract\n", - encoding="utf-8", - ) - (docs_guides / "reconstruction-agent-strategy.md").write_text( - "# Reconstruction Strategy\n", - encoding="utf-8", - ) - (project_root / "README.md").write_text("# Demo\n", encoding="utf-8") - (project_root / "LICENSE").write_text("MIT\n", encoding="utf-8") - (project_root / "pyproject.toml").write_text( - "[project]\nname = 'simplecadapi'\nversion = '2.0.9'\ndescription = 'Demo package'\n", - encoding="utf-8", - ) - (project_root / "src/simplecadapi").mkdir(parents=True, exist_ok=True) - - packager = skill_pack.SkillPackager( - project_root=project_root, - output_root=tmp_path / "skills", - skill_name="simplecadapi", - license_name="MIT", - quiet=True, - ) - - content = packager._build_skill_markdown() - - # Routing table maps every workflow file. - for workflow in skill_pack.SKILL_WORKFLOWS: - self.assertIn(f"workflows/{workflow}.md", content) - # Router must not force-read full API indexes up front. - self.assertIn("Do not read the full API index", content) - self.assertIn("Task routing", content) - self.assertIn("Global rules", content) - # Global rules keep the load-bearing contracts. - self.assertIn("capture(result, path)", content) - self.assertIn("positional", content) - self.assertIn("@scad.part", content) - self.assertIn("@scad.assemble", content) - self.assertIn("scad.std.gear", content) - self.assertIn("scad.std.bearing", content) - self.assertIn("simplecadapi.inspect.brep", content) - self.assertIn("cache-build-workflow.md", content) - self.assertIn("GraphSession", content) - self.assertIn("export_model_json", content) - self.assertIn("replay_model_json", content) - # Verified behavior: union glue default and tag scope. - self.assertIn("glue=False", content) - self.assertIn("never propagates downward", content) - # Replaced legacy generated files are gone from the router. - self.assertNotIn("SDK_SURFACES.md", content) - self.assertNotIn("MODELING_WORKFLOWS.md", content) - self.assertNotIn("SDK_PACKAGE_SUMMARY.md", content) - self.assertNotIn("ModelResult", content) - self.assertNotIn("@model", content) - self.assertNotIn("scripts/", content) - - def test_build_copies_skill_layer_and_validates_all_pages(self): - with tempfile.TemporaryDirectory() as tmp_dir: - tmp_path = Path(tmp_dir) - project_root = tmp_path / "project" - docs_api = project_root / "docs/api" - docs_core = project_root / "docs/core" - docs_stdlib = project_root / "docs/stdlib" - docs_api.mkdir(parents=True, exist_ok=True) - docs_core.mkdir(parents=True, exist_ok=True) - docs_stdlib.mkdir(parents=True, exist_ok=True) - (docs_api / "README.md").write_text("# API Docs\n", encoding="utf-8") - (docs_core / "README.md").write_text("# Core Docs\n", encoding="utf-8") - (docs_stdlib / "README.md").write_text( - "# Standard Library Docs\n", - encoding="utf-8", - ) - skill_dir = project_root / "docs/skill" - for sub, names in ( - ("domains", skill_pack.SKILL_DOMAINS), - ("workflows", skill_pack.SKILL_WORKFLOWS), - ("discipline", skill_pack.SKILL_DISCIPLINES), - ): - (skill_dir / sub).mkdir(parents=True, exist_ok=True) - for name in names: - (skill_dir / sub / f"{name}.md").write_text( - f"# {name}\n", - encoding="utf-8", - ) - (project_root / "README.md").write_text("# Demo\n", encoding="utf-8") - (project_root / "LICENSE").write_text("MIT\n", encoding="utf-8") - (project_root / "pyproject.toml").write_text( - "[project]\nname = 'simplecadapi'\nversion = '2.0.9'\ndescription = 'Demo package'\n", - encoding="utf-8", - ) - (project_root / "src/simplecadapi").mkdir(parents=True, exist_ok=True) - - packager = skill_pack.SkillPackager( - project_root=project_root, - output_root=tmp_path / "skills", - skill_name="simplecadapi", - license_name="MIT", - quiet=True, - ) - - result = packager.build() - - refs = result.skill_root / "references" - for name in skill_pack.SKILL_DOMAINS: - self.assertTrue((refs / "domains" / f"{name}.md").is_file()) - for name in skill_pack.SKILL_WORKFLOWS: - self.assertTrue((refs / "workflows" / f"{name}.md").is_file()) - for name in skill_pack.SKILL_DISCIPLINES: - self.assertTrue((refs / "discipline" / f"{name}.md").is_file()) - # The skill layer is copied to references/ top level, not duplicated - # under references/docs/. - self.assertFalse((refs / "docs" / "skill").exists()) - self.assertTrue((refs / "README.md").is_file()) - - def test_build_fails_when_skill_layer_is_missing(self): - with tempfile.TemporaryDirectory() as tmp_dir: - tmp_path = Path(tmp_dir) - project_root = tmp_path / "project" - docs_api = project_root / "docs/api" - docs_core = project_root / "docs/core" - docs_stdlib = project_root / "docs/stdlib" - docs_api.mkdir(parents=True, exist_ok=True) - docs_core.mkdir(parents=True, exist_ok=True) - docs_stdlib.mkdir(parents=True, exist_ok=True) - (docs_api / "README.md").write_text("# API Docs\n", encoding="utf-8") - (docs_core / "README.md").write_text("# Core Docs\n", encoding="utf-8") - (docs_stdlib / "README.md").write_text( - "# Standard Library Docs\n", - encoding="utf-8", - ) - (project_root / "README.md").write_text("# Demo\n", encoding="utf-8") - (project_root / "LICENSE").write_text("MIT\n", encoding="utf-8") - (project_root / "pyproject.toml").write_text( - "[project]\nname = 'simplecadapi'\nversion = '2.0.9'\ndescription = 'Demo package'\n", - encoding="utf-8", - ) - (project_root / "src/simplecadapi").mkdir(parents=True, exist_ok=True) - - packager = skill_pack.SkillPackager( - project_root=project_root, - output_root=tmp_path / "skills", - skill_name="simplecadapi", - license_name="MIT", - quiet=True, - ) - - with self.assertRaises(FileNotFoundError): - packager.build() - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_ocp_core_no_cadquery.py b/tests/test_ocp_core_no_cadquery.py index 040456d7..42b8bed9 100644 --- a/tests/test_ocp_core_no_cadquery.py +++ b/tests/test_ocp_core_no_cadquery.py @@ -44,7 +44,7 @@ def test_ocp_native_face_wire_topology_and_extrude(): def test_runtime_source_has_no_cadquery_imports_in_runtime_package(): - runtime_files = [p for p in Path("src/simplecadapi").rglob("*.py") if "auto_tools" not in p.parts] + runtime_files = list(Path("src/simplecadapi").rglob("*.py")) forbidden = ("import cadquery", "from cadquery", "cadquery.occ_impl", ".cq_solid", ".cq_face", ".cq_edge", ".cq_wire", ".cq_vertex") for path in runtime_files: text = path.read_text() diff --git a/src/simplecadapi/auto_tools/auto_docs_gen.py b/tools/auto_docs_gen.py similarity index 97% rename from src/simplecadapi/auto_tools/auto_docs_gen.py rename to tools/auto_docs_gen.py index e55b8df5..83812c01 100644 --- a/src/simplecadapi/auto_tools/auto_docs_gen.py +++ b/tools/auto_docs_gen.py @@ -155,20 +155,16 @@ EXPORTED_CALLABLE_MODULES = frozenset( MISSING = object() -def _package_root_from(module_file: Path | str | None = None) -> Path: +def _repo_root_from(module_file: Path | str | None = None) -> Path: target = Path(module_file) if module_file is not None else Path(__file__) - return target.resolve().parents[1] + repo_root = target.resolve().parents[1] + if not (repo_root / "pyproject.toml").is_file(): + raise FileNotFoundError(f"project root not found above {target}") + return repo_root -def _source_checkout_root(package_root: Path) -> Path | None: - src_dir = package_root.parent - project_root = src_dir.parent - - if src_dir.name != "src": - return None - if not (project_root / "pyproject.toml").exists(): - return None - return project_root +def _package_root_from(module_file: Path | str | None = None) -> Path: + return _repo_root_from(module_file) / "src" / "simplecadapi" def _default_source_files(package_root: Path) -> List[Path]: @@ -198,25 +194,12 @@ def _default_stdlib_source_files(package_root: Path) -> List[Path]: return [package_root / name for name in DEFAULT_STDLIB_SOURCE_FILENAMES] -def _default_output_dirs(package_root: Path, cwd: Path | None = None) -> List[Path]: - project_root = _source_checkout_root(package_root) - if project_root is not None: - return [project_root / "docs/api"] - - base_dir = cwd if cwd is not None else Path.cwd() - return [base_dir / "docs/api"] +def _default_output_dirs(module_file: Path | str | None = None) -> List[Path]: + return [_repo_root_from(module_file) / "docs/skill/references/docs/api"] -def _default_stdlib_output_dirs( - package_root: Path, - cwd: Path | None = None, -) -> List[Path]: - project_root = _source_checkout_root(package_root) - if project_root is not None: - return [project_root / "docs/stdlib"] - - base_dir = cwd if cwd is not None else Path.cwd() - return [base_dir / "docs/stdlib"] +def _default_stdlib_output_dirs(module_file: Path | str | None = None) -> List[Path]: + return [_repo_root_from(module_file) / "docs/skill/references/docs/stdlib"] @dataclass @@ -1257,12 +1240,10 @@ def _resolve_source_files( def _resolve_output_dirs( cli_output_dirs: Sequence[str] | None, module_file: Path | str | None = None, - cwd: Path | None = None, ) -> List[Path]: if cli_output_dirs: return [Path(item).resolve() for item in cli_output_dirs] - package_root = _package_root_from(module_file) - return [path.resolve() for path in _default_output_dirs(package_root, cwd)] + return [path.resolve() for path in _default_output_dirs(module_file)] def _resolve_stdlib_source_files( @@ -1278,12 +1259,10 @@ def _resolve_stdlib_source_files( def _resolve_stdlib_output_dirs( cli_output_dirs: Sequence[str] | None, module_file: Path | str | None = None, - cwd: Path | None = None, ) -> List[Path]: if cli_output_dirs: return [Path(item).resolve() for item in cli_output_dirs] - package_root = _package_root_from(module_file) - return [path.resolve() for path in _default_stdlib_output_dirs(package_root, cwd)] + return [path.resolve() for path in _default_stdlib_output_dirs(module_file)] def main() -> None: diff --git a/tools/run_examples.py b/tools/run_examples.py deleted file mode 100644 index 4971d080..00000000 --- a/tools/run_examples.py +++ /dev/null @@ -1,308 +0,0 @@ -"""Run every documented example and validate each emitted product package.""" - -from __future__ import annotations - -import argparse -from concurrent.futures import ThreadPoolExecutor, as_completed -from dataclasses import dataclass -from datetime import datetime, timezone -import json -import os -from pathlib import Path -import signal -import subprocess -import sys -import time -from typing import Any - -import simplecadapi as scad -from simplecadapi.scene import read_scene_package - - -ROOT = Path(__file__).resolve().parents[1] -EXAMPLES = ROOT / "examples" -DEFAULT_TIMEOUT_SECONDS = 900 -DEFAULT_HEAVY_TIMEOUT_SECONDS = 1800 - - -@dataclass(frozen=True, slots=True) -class ExampleCase: - path: str - package_path: str - args: tuple[str, ...] = () - heavy: bool = False - - @property - def step_path(self) -> str: - return str(Path(self.package_path).with_suffix(".step")) - - @property - def fcstd_path(self) -> str: - return str(Path(self.package_path).with_suffix(".FCStd")) - - @property - def output_paths(self) -> tuple[str, str, str]: - return (self.package_path, self.step_path, self.fcstd_path) - - -CASES = ( - ExampleCase( - "examples/04_dimension_tolerance_chain.py", - "examples/out/dimension_tolerance_chain/dimension_tolerance_chain.scadpkg", - ), - ExampleCase( - "examples/08_constrained_sketch.py", - "examples/out/constrained_sketch/constrained_sketch.scadpkg", - heavy=True, - ), - ExampleCase( - "examples/09_naca0016_blade_freecad.py", - "examples/out/naca0016_blade/naca0016_blade.scadpkg", - heavy=True, - ), - ExampleCase( - "examples/10_part_assembly.py", - "examples/out/hydraulic_rod_assembly/hydraulic_rod_assembly.scadpkg", - heavy=True, - ), - ExampleCase( - "examples/11_external_reference_gear_train.py", - "examples/out/external_reference_gear_train/" - "nested_external_reference_gear_trains.scadpkg", - ), - ExampleCase( - "examples/7ep_caplcd_enclosure.py", - "examples/out/7ep_caplcd_enclosure/caplcd_enclosure_7ep.scadpkg", - ), - ExampleCase( - "examples/16_compact_two_stage_planetary_reducer/main.py", - "examples/out/compact_two_stage_planetary_reducer/" - "compact_two_stage_planetary_reducer.scadpkg", - heavy=True, - ), - ExampleCase( - "examples/20_integrated_bldc_joint_actuator/main.py", - "examples/out/integrated_bldc_joint_actuator/" - "integrated_bldc_joint_actuator.scadpkg", - heavy=True, - ), -) - - -def _kill_process_group(process: subprocess.Popen[str]) -> None: - try: - os.killpg(process.pid, signal.SIGKILL) - except ProcessLookupError: - pass - - -def _inspect_product_package(path: Path) -> dict[str, Any]: - package = scad.read_product_package(path) - scene = read_scene_package(package.scene_bytes) - manifest = package.manifest - scene_manifest = scene.manifest - if manifest["schema_version"] != "2.0": - raise ValueError("product package is not schema 2.0") - if scene_manifest["schema_version"] != "2.0": - raise ValueError("embedded scene is not schema 2.0") - if len(scene_manifest["product_assets"]) != len(manifest["objects"]): - raise ValueError("embedded scene definition closure is incomplete") - if not scene_manifest["feature_graph_assets"]: - raise ValueError("embedded scene has no feature graph assets") - if not scene_manifest["source_assets"]: - raise ValueError("embedded scene has no source assets") - return { - "path": str(path.relative_to(ROOT)), - "byte_length": path.stat().st_size, - "content_hash": manifest["content_hash"], - "root_definition_id": package.root_definition.definition_id, - "root_definition_kind": package.root_definition.definition_kind, - "definition_count": len(manifest["objects"]), - "feature_graph_asset_count": len(scene_manifest["feature_graph_assets"]), - "feature_count": len(scene_manifest["feature_index"]), - "source_asset_count": len(scene_manifest["source_assets"]), - "source_index_count": len(scene_manifest["source_index"]), - } - - -def _case_directory(run_dir: Path, case: ExampleCase) -> Path: - return run_dir / case.path.removesuffix(".py").replace("/", "__") - - -def _run_case( - case: ExampleCase, - *, - run_dir: Path, - timeout_seconds: int, - heavy_timeout_seconds: int, -) -> dict[str, Any]: - case_dir = _case_directory(run_dir, case) - case_dir.mkdir(parents=True, exist_ok=True) - timeout = heavy_timeout_seconds if case.heavy else timeout_seconds - command = [sys.executable, case.path, *case.args] - environment = dict(os.environ) - environment["PYTHONHASHSEED"] = "0" - output_paths = tuple(ROOT / path for path in case.output_paths) - previous_output_mtimes = { - path: path.stat().st_mtime_ns if path.exists() else None - for path in output_paths - } - started_at = datetime.now(timezone.utc) - started = time.monotonic() - print(f"[examples] starting {case.path} timeout={timeout}s", flush=True) - stdout = "" - stderr = "" - returncode: int | None = None - timed_out = False - error: str | None = None - package_inspection: dict[str, Any] | None = None - export_inspection: dict[str, dict[str, Any]] | None = None - try: - process = subprocess.Popen( - command, - cwd=ROOT, - env=environment, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - text=True, - errors="replace", - start_new_session=True, - ) - try: - stdout, stderr = process.communicate(timeout=timeout) - returncode = process.returncode - except subprocess.TimeoutExpired: - timed_out = True - _kill_process_group(process) - stdout, stderr = process.communicate() - except Exception as exc: # pragma: no cover - runner failure path - error = f"{exc.__class__.__name__}: {exc}" - - if returncode == 0 and not timed_out and error is None: - try: - for output_path in output_paths: - if not output_path.is_file(): - raise FileNotFoundError(f"expected example artifact: {output_path}") - if output_path.stat().st_size <= 0: - raise RuntimeError(f"example artifact is empty: {output_path}") - previous_mtime = previous_output_mtimes[output_path] - if ( - previous_mtime is not None - and output_path.stat().st_mtime_ns <= previous_mtime - ): - raise RuntimeError( - f"example artifact was not rewritten by this run: {output_path}" - ) - package_path = output_paths[0] - export_inspection = { - output_path.suffix: { - "path": str(output_path.relative_to(ROOT)), - "byte_length": output_path.stat().st_size, - } - for output_path in output_paths[1:] - } - package_inspection = _inspect_product_package(package_path) - except Exception as exc: - error = f"{exc.__class__.__name__}: {exc}" - - elapsed = time.monotonic() - started - (case_dir / "stdout.log").write_text(stdout, encoding="utf-8") - (case_dir / "stderr.log").write_text(stderr, encoding="utf-8") - status = "passed" - if timed_out: - status = "timeout" - elif error is not None or returncode != 0: - status = "failed" - record = { - "case": case.path, - "status": status, - "returncode": returncode, - "timed_out": timed_out, - "timeout_seconds": timeout, - "elapsed_seconds": round(elapsed, 3), - "started_at": started_at.isoformat(), - "stdout_log": str((case_dir / "stdout.log").relative_to(ROOT)), - "stderr_log": str((case_dir / "stderr.log").relative_to(ROOT)), - "package": package_inspection, - "exports": export_inspection, - "error": error, - } - print(f"[examples] {status} {case.path} elapsed={elapsed:.1f}s", flush=True) - return record - - -def _run_all(args: argparse.Namespace) -> int: - all_cases = {case.path: case for case in CASES} - selected = list(CASES) - if args.case: - unknown = set(args.case) - set(all_cases) - if unknown: - raise ValueError(f"unknown example cases: {sorted(unknown)}") - selected = [all_cases[path] for path in args.case] - run_id = datetime.now(timezone.utc).strftime("examples_%Y%m%dT%H%M%SZ") - run_dir = EXAMPLES / "out" / run_id - run_dir.mkdir(parents=True, exist_ok=False) - started_at = datetime.now(timezone.utc) - records: list[dict[str, Any]] = [] - with ThreadPoolExecutor(max_workers=args.workers) as executor: - futures = { - executor.submit( - _run_case, - case, - run_dir=run_dir, - timeout_seconds=args.timeout, - heavy_timeout_seconds=args.heavy_timeout, - ): case - for case in selected - } - for future in as_completed(futures): - case = futures[future] - try: - records.append(future.result()) - except Exception as exc: # pragma: no cover - runner failure path - records.append( - { - "case": case.path, - "status": "failed", - "error": f"runner worker {exc.__class__.__name__}: {exc}", - } - ) - records.sort(key=lambda record: record["case"]) - report = { - "run_id": run_id, - "started_at": started_at.isoformat(), - "finished_at": datetime.now(timezone.utc).isoformat(), - "root": str(ROOT), - "case_count": len(selected), - "passed": sum(record["status"] == "passed" for record in records), - "failed": sum(record["status"] == "failed" for record in records), - "timed_out": sum(record["status"] == "timeout" for record in records), - "cases": records, - } - report_path = run_dir / "execution_report.json" - report_path.write_text(json.dumps(report, indent=2, sort_keys=True) + "\n") - print(f"[examples] report={report_path}", flush=True) - print( - f"[examples] passed={report['passed']} failed={report['failed']} " - f"timed_out={report['timed_out']}", - flush=True, - ) - return 0 if report["failed"] == 0 and report["timed_out"] == 0 else 1 - - -def main() -> int: - parser = argparse.ArgumentParser() - parser.add_argument("--workers", type=int, default=1) - parser.add_argument("--timeout", type=int, default=DEFAULT_TIMEOUT_SECONDS) - parser.add_argument( - "--heavy-timeout", type=int, default=DEFAULT_HEAVY_TIMEOUT_SECONDS - ) - parser.add_argument("--case", action="append") - args = parser.parse_args() - if args.workers < 1: - parser.error("--workers must be at least 1") - return _run_all(args) - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tools/skillbuild.py b/tools/skillbuild.py new file mode 100755 index 00000000..8c3c7894 --- /dev/null +++ b/tools/skillbuild.py @@ -0,0 +1,458 @@ +#!/usr/bin/env python3 +"""Compile a skill tree into per-target harness builds. + +The tree layout is the filesystem under the source root configured in +skillproj.toml. This tool adds nothing, moves nothing, and invents no +layout. Its single job is conditional compilation: + + + harness-specific text + + +A block is included in the build for target T iff T appears as a +positive name and not as a negated name. An expression with only +negations includes every target not negated. There is no else and no +nesting: complementary blocks express else, and a nesting need means +the file should be split. + +Fail-loud contract: + - a block naming a target absent from skillproj.toml fails the build + (a one-character typo must never silently drop content); + - unpaired, nested, or malformed directives fail the build; + - directive-looking lines inside fenced code blocks are literal text; + - every build asserts the output contains no live directives; + - output directories must be disjoint from the source tree and must + not contain the project root. + +Usage: + python tools/skillbuild.py # build every target + python tools/skillbuild.py --target omp # build one target + python tools/skillbuild.py --check # validate only, no writes + +Archive a build with tar: + tar -C skills -czf simplecadapi.tar.gz simplecadapi +""" + +from __future__ import annotations + +import argparse +import os +import re +import shutil +import sys + +if sys.version_info >= (3, 11): + import tomllib +else: # pragma: no cover - Python 3.10 + import tomli as tomllib # type: ignore[no-redef] + +from dataclasses import dataclass +from pathlib import Path + +CONFIG_NAME = "skillproj.toml" +NAME_PATTERN = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$") +DIRECTIVE_PATTERN = re.compile(r"^\s*\s*$") +FENCE_PATTERN = re.compile(r"^\s{0,3}(?:`{3,}|~{3,})") +DENIED_DIR_NAMES = {"__pycache__"} + + +class SkillBuildError(Exception): + """A fatal, user-facing build error.""" + + +@dataclass(frozen=True) +class Condition: + """A parsed skill:if expression: positive names and negated names.""" + + positives: tuple[str, ...] + negatives: tuple[str, ...] + + @classmethod + def parse( + cls, + expression: str, + targets: "frozenset[str]", + where: str, + ) -> "Condition": + positives: list[str] = [] + negatives: list[str] = [] + seen: set[str] = set() + for token in expression.split(","): + token = token.strip() + if not token: + raise SkillBuildError( + f"{where}: empty name in conditional expression {expression!r}" + ) + negated = token.startswith("!") + name = token[1:] if negated else token + if not NAME_PATTERN.fullmatch(name): + raise SkillBuildError(f"{where}: invalid target name {name!r}") + if name not in targets: + declared = ", ".join(sorted(targets)) + raise SkillBuildError( + f"{where}: unknown target {name!r} (declared: {declared})" + ) + if name in seen: + raise SkillBuildError( + f"{where}: duplicate name {name!r} in expression {expression!r}" + ) + seen.add(name) + if negated: + negatives.append(name) + else: + positives.append(name) + if not positives and not negatives: + raise SkillBuildError( + f"{where}: empty conditional expression {expression!r}" + ) + return Condition(tuple(positives), tuple(negatives)) + + def includes(self, target: str) -> bool: + if target in self.negatives: + return False + return not self.positives or target in self.positives + + def describe(self) -> str: + parts = list(self.positives) + [f"!{name}" for name in self.negatives] + return ",".join(parts) + + +@dataclass(frozen=True) +class ConditionalBlock: + """One if..endif block; start/end are 0-based directive line indices.""" + + start: int + end: int + condition: Condition + + +@dataclass(frozen=True) +class SkillProject: + root: Path + name: str + source: Path + targets: tuple[str, ...] + outputs: dict + + +@dataclass(frozen=True) +class SourceFile: + path: Path + relative: Path + text: "str | None" # None -> binary, copied verbatim + blocks: "list[ConditionalBlock] | None" # None -> no directives + + +def find_project_root(start: Path) -> Path: + for candidate in (start.resolve(), *start.resolve().parents): + if (candidate / CONFIG_NAME).is_file(): + return candidate + raise SkillBuildError(f"no {CONFIG_NAME} found in {start} or any parent") + + +def load_project(root: Path) -> SkillProject: + config_path = root / CONFIG_NAME + if not config_path.is_file(): + raise SkillBuildError(f"missing {CONFIG_NAME} in {root}") + try: + data = tomllib.loads(config_path.read_text(encoding="utf-8")) + except tomllib.TOMLDecodeError as exc: + raise SkillBuildError(f"{config_path}: {exc}") from exc + + skill = data.get("skill") + if not isinstance(skill, dict): + raise SkillBuildError(f"{config_path}: missing [skill] table") + name = skill.get("name") + if not isinstance(name, str) or not NAME_PATTERN.fullmatch(name): + raise SkillBuildError( + f"{config_path}: [skill] name must be lowercase words joined by single hyphens" + ) + source_value = skill.get("source") + if not isinstance(source_value, str) or not source_value: + raise SkillBuildError(f"{config_path}: [skill] source is required") + source = (root / source_value).resolve() + if not source.is_dir(): + raise SkillBuildError(f"{config_path}: source directory not found: {source}") + + build = data.get("build") + if not isinstance(build, dict): + raise SkillBuildError(f"{config_path}: missing [build] table") + targets_value = build.get("targets") + if not isinstance(targets_value, list) or not targets_value: + raise SkillBuildError( + f"{config_path}: [build] targets must be a non-empty list" + ) + targets = [] + for item in targets_value: + if not isinstance(item, str) or not NAME_PATTERN.fullmatch(item): + raise SkillBuildError(f"{config_path}: invalid target name {item!r}") + if item in targets: + raise SkillBuildError(f"{config_path}: duplicate target {item!r}") + targets.append(item) + + outputs_value = build.get("output") + if not isinstance(outputs_value, dict): + raise SkillBuildError(f"{config_path}: missing [build.output] table") + outputs = {} + for target in targets: + entry = outputs_value.get(target) + if not isinstance(entry, str) or not entry: + raise SkillBuildError( + f"{config_path}: [build.output] is missing target {target!r}" + ) + outputs[target] = (root / entry).resolve() + + _validate_output_paths(root.resolve(), source, outputs) + return SkillProject(root.resolve(), name, source, tuple(targets), outputs) + + +def _validate_output_paths(root: Path, source: Path, outputs: dict) -> None: + seen = {} + for target, output in outputs.items(): + if output == root or output in root.parents: + raise SkillBuildError( + f"output for target {target!r} contains the project root: {output}" + ) + if output == source or output in source.parents: + raise SkillBuildError( + f"output for target {target!r} contains the source tree: {output}" + ) + if source in output.parents: + raise SkillBuildError( + f"output for target {target!r} is inside the source tree: {output}" + ) + if output in seen: + raise SkillBuildError( + f"targets {seen[output]!r} and {target!r} share output {output}" + ) + seen[output] = target + + +def _collect_blocks( + text: str, + targets: "frozenset[str]", + where: str, +) -> "list[ConditionalBlock] | None": + """Fence-aware directive scan; validates structure and target names.""" + lines = text.splitlines() + blocks: list[ConditionalBlock] = [] + open_block: "tuple[int, Condition] | None" = None + in_fence = False + for index, line in enumerate(lines): + if in_fence: + if FENCE_PATTERN.match(line): + in_fence = False + continue + if FENCE_PATTERN.match(line): + in_fence = True + continue + match = DIRECTIVE_PATTERN.match(line) + if match is None: + continue + kind, expression = match.group(1), match.group(2) + location = f"{where}:{index + 1}" + if kind == "if": + if open_block is not None: + raise SkillBuildError( + f"{location}: nested skill:if (nesting is not supported; " + "split the file)" + ) + open_block = (index, Condition.parse(expression, targets, location)) + else: + if expression: + raise SkillBuildError( + f"{location}: skill:endif takes no expression" + ) + if open_block is None: + raise SkillBuildError( + f"{location}: skill:endif without matching skill:if" + ) + start, condition = open_block + blocks.append(ConditionalBlock(start, index, condition)) + open_block = None + if open_block is not None: + raise SkillBuildError( + f"{where}:{open_block[0] + 1}: unclosed skill:if block" + ) + return blocks or None + + +def compile_text(text: str, target: str, blocks: "list[ConditionalBlock]") -> str: + """Resolve directives for one target; blank runs collapse to one line.""" + lines = text.splitlines() + drop = set() + for block in blocks: + drop.add(block.start) + drop.add(block.end) + if not block.condition.includes(target): + drop.update(range(block.start + 1, block.end)) + kept = [ + line for index, line in enumerate(lines) if index not in drop + ] + collapsed: list[str] = [] + for line in kept: + if not line.strip() and collapsed and not collapsed[-1].strip(): + continue + collapsed.append(line) + while collapsed and not collapsed[0].strip(): + collapsed.pop(0) + while collapsed and not collapsed[-1].strip(): + collapsed.pop() + if not collapsed: + return "" + return "\n".join(collapsed) + "\n" + + +def collect_source_files( + source: Path, + targets: "frozenset[str]", + root: Path, +) -> "list[SourceFile]": + """Walk the source tree, validating every file's directives.""" + files: list[SourceFile] = [] + for dirpath, dirnames, filenames in os.walk(source): + dirnames[:] = sorted( + name for name in dirnames + if not name.startswith(".") and name not in DENIED_DIR_NAMES + ) + for filename in sorted(filenames): + if filename.startswith("."): + continue + path = Path(dirpath) / filename + relative = path.relative_to(source) + where = str(path.relative_to(root)) + raw = path.read_bytes() + try: + text = raw.decode("utf-8") + except UnicodeDecodeError: + files.append(SourceFile(path, relative, None, None)) + continue + files.append( + SourceFile(path, relative, text, _collect_blocks(text, targets, where)) + ) + return files + + +def _frontmatter_name(text: str) -> "str | None": + lines = text.splitlines() + if not lines or lines[0].strip() != "---": + return None + for line in lines[1:]: + if line.strip() == "---": + return None + if line.startswith("name:"): + return line.split(":", 1)[1].strip() + return None + + +def verify_output(output: Path, project: SkillProject, target: str) -> None: + """Assert the built tree contains no live directives and a sane SKILL.md.""" + for path in sorted(p for p in output.rglob("*") if p.is_file()): + try: + text = path.read_bytes().decode("utf-8") + except UnicodeDecodeError: + continue + where = f"{path.relative_to(project.root)} (target {target!r})" + blocks = _collect_blocks(text, frozenset(project.targets), where) + if blocks: + raise SkillBuildError( + f"{where}:{blocks[0].start + 1}: directive survived compilation" + ) + skill_md = output / "SKILL.md" + if skill_md.is_file(): + declared = _frontmatter_name(skill_md.read_text(encoding="utf-8")) + if declared is not None and declared != project.name: + raise SkillBuildError( + f"target {target!r}: SKILL.md frontmatter name {declared!r} " + f"does not match [skill] name {project.name!r}" + ) + + +def build_target( + project: SkillProject, + source_files: "list[SourceFile]", + target: str, +) -> Path: + output = project.outputs[target] + if output.exists(): + shutil.rmtree(output) + output.mkdir(parents=True) + included = 0 + excluded = 0 + for entry in source_files: + destination = output / entry.relative + destination.parent.mkdir(parents=True, exist_ok=True) + if entry.text is None or entry.blocks is None: + shutil.copyfile(entry.path, destination) + continue + destination.write_bytes( + compile_text(entry.text, target, entry.blocks).encode("utf-8") + ) + for block in entry.blocks: + if block.condition.includes(target): + included += 1 + else: + excluded += 1 + verify_output(output, project, target) + print( + f"built {target}: {len(source_files)} files -> " + f"{output.relative_to(project.root)} " + f"({included + excluded} blocks: {included} kept, {excluded} dropped)" + ) + return output + + +def main(argv=None) -> int: + parser = argparse.ArgumentParser( + prog="skillbuild", + description="Compile a skill tree into per-target harness builds", + ) + parser.add_argument( + "--project-root", + type=Path, + default=None, + help="project root containing skillproj.toml (default: search upward)", + ) + parser.add_argument( + "--target", + action="append", + default=None, + help="build only this target (repeatable; default: all)", + ) + parser.add_argument( + "--check", + action="store_true", + help="validate the tree without writing outputs", + ) + args = parser.parse_args(argv) + + try: + root = args.project_root.resolve() if args.project_root else find_project_root(Path.cwd()) + project = load_project(root) + source_files = collect_source_files( + project.source, frozenset(project.targets), project.root + ) + if args.check: + conditional = sum(1 for entry in source_files if entry.blocks) + print( + f"OK: {len(source_files)} files, {conditional} with conditional " + f"blocks, targets: {', '.join(project.targets)}" + ) + return 0 + selected = args.target or list(project.targets) + for target in selected: + if target not in project.outputs: + declared = ", ".join(project.targets) + raise SkillBuildError( + f"unknown --target {target!r} (declared: {declared})" + ) + for target in selected: + build_target(project, source_files, target) + except SkillBuildError as exc: + print(f"error: {exc}", file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main())