dsh-cad 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,9 +4,10 @@
4
4
 
5
5
  [![homepage](https://img.shields.io/badge/homepage-dsh--cad-4D6BFE)](https://lau-mars.github.io/dsh-cad/)
6
6
  [![npm](https://img.shields.io/npm/v/dsh-cad)](https://www.npmjs.com/package/dsh-cad)
7
- [![dsh plugin](https://img.shields.io/badge/dsh-plugin-4D6BFE)](https://github.com/deepseek-ai/deepseek-harness)
7
+ [![dsh](https://img.shields.io/npm/v/@deepseek-ai%2Fdsh?label=dsh)](https://www.npmjs.com/package/@deepseek-ai/dsh)
8
8
  [![Node](https://img.shields.io/badge/node-%3E%3D%2022-4D6BFE)](https://nodejs.org/)
9
- [![OCCT](https://img.shields.io/badge/kernel-OCCT-4D6BFE)](https://github.com/donalffons/opencascade.js)
9
+ [![occt.ts](https://img.shields.io/npm/v/occt.ts)](https://www.npmjs.com/package/occt.ts)
10
+ [![ansatz](https://img.shields.io/npm/v/ansatz-wasm?label=ansatz)](https://www.npmjs.com/package/ansatz-wasm)
10
11
  [![License: MIT](https://img.shields.io/badge/license-MIT-4D6BFE)](./LICENSE)
11
12
 
12
13
  English | [简体中文](./README.zh-CN.md)
@@ -32,10 +33,11 @@ back — 2 solids, 3 products, 2 assembly usages, 1,125.00 mm³:
32
33
 
33
34
  | Capability | Description |
34
35
  | --- | --- |
35
- | ⚙️ Single-kernel architecture | **occt.ts as the primary modeling kernel** (true B-splines, native shell/draft, centroid); opencascade.js stays only as the fallback backend; the v0.8 "no editing after shell" seam is gone — fillet/chamfer/boolean keep working after shelling |
36
+ | ⚙️ Single-kernel architecture | **occt.ts as the primary modeling kernel** (true B-splines, native shell/draft, centroid); opencascade.js stays only as the fallback backend; the old "no editing after shell" seam is gone — fillet/chamfer/boolean keep working after shelling |
36
37
  | 🔍 CAD viewing | STL / OBJ / STEP / IGES / BREP / DCPRT (3D), DXF / SVG (2D); interactive in-chat card (orbit / zoom / wireframe / pan) |
37
38
  | 🧭 CAD editor interactions | Onshape-style ViewCube (26-zone click-to-orient), hover/click face & edge picking with live measurement (area mm² / length mm), Faces+Edges / Faces / Wireframe render modes, switchable BRep demo parts (bracket / flange / shaft) |
38
39
  | 🏗️ Parametric modeling | Primitives, profile extrusion, **loft**, **sweep**, **revolve**, booleans, all-edge fillet/chamfer, **shell**, **draft**, **patterns** (linear/circular), transforms; profiles take **curve segments** (arcs/circles exact BRep; B-splines sampled approximation) — exact OCCT BRep, not a mesh approximation |
40
+ | ✏️ Named sketches | Standalone named profiles (Sketch1…) kept in the document (`cad_sketch_new` / `edit` / `list` / `delete`); extrude/revolve/sweep reference them **by name**, and `cad_sketch_edit` rewrites the definition in place + replays the log, rebuilding every dependent feature — the parametric loop. Sketches render as Onshape-style **blue curves + plane frame** in the viewport (refreshing live on edit), listed in a left-side **feature tree** (sketches + features, eye-toggle visibility, click-to-highlight bodies) over the Part tab |
39
41
  | 🗂️ Codex-style document tabs | The resident display panel gets a tab strip with a "+" menu: **Part** (Part Studio, the default) / **Assembly** (instance insert/move/remove) / **Drawing** (true hidden-line sheets); tabs are closable and keep their state |
40
42
  | 📁 Multi-document file space | Named documents per workspace (`.dsh-cad/docs/`), each session bound to its own active document — new sessions start empty instead of inheriting leftovers; a folder button in the panel lists every document (preview / delete), and `cad_doc_new` / `cad_doc_open` manage the modeling target from chat |
41
43
  | 📐 Engineering drawings | GB first-angle layout: front / top / left views + isometric, true OCCT hidden-line removal via the **occt.ts** kernel (an npm dependency, dashed); sheet frame, title block, overall dimensions, standard scale series; exports SVG / DXF |
@@ -61,10 +63,9 @@ The installer applies the bundled `cordis.patch.yml` (declared in the `dsh.bundl
61
63
 
62
64
  ### Version requirements
63
65
 
64
- - **Node.js** ≥ 22
65
- - **dsh CLI** (`@deepseek-ai/dsh`): this plugin is developed against **0.1.0-rc.7**
66
- (minimum supported version, declared in the `engines` field of `package.json`);
67
- recommended **≥ 0.1.1-rc.2** (verified 2026-08-31)
66
+ - **Node.js** and **dsh CLI** (`@deepseek-ai/dsh`): minimum versions live in
67
+ the badge row above and the `engines` field of `package.json` — kept out of
68
+ the prose so they never go stale
68
69
 
69
70
  ### Install from source (dev mode)
70
71
 
@@ -73,7 +74,7 @@ git clone https://github.com/LAU-MARS/dsh-cad.git
73
74
  cd dsh-cad
74
75
  npm install && npm run build && npm test # deps include occt.ts (true-HLR drawing kernel, ~20MB wasm)
75
76
 
76
- npm install -g @deepseek-ai/dsh@^0.1.1-rc.2 pnpm # requires Node ≥ 22
77
+ npm install -g @deepseek-ai/dsh pnpm
77
78
  dsh web # let the first launch init the profile, then Ctrl-C
78
79
 
79
80
  dsh plugin --profile web add /path/to/dsh-cad
@@ -101,14 +102,18 @@ Set `DEEPSEEK_API_KEY` and you are ready — for example:
101
102
  | `cad_view` | Open a CAD file and render an interactive viewer card |
102
103
  | `cad_info` | Read-only geometry metadata (format / counts / bounding box / units / layers) |
103
104
  | `cad_create_prim` | Primitives (mm, Z-up); `at` for placement, `axis` for orientation (exact axis-angle rotation) |
104
- | `cad_extrude_profile` | Extrude a closed XY-plane polygon along +Z into a solid |
105
+ | `cad_sketch_new` | Create a named sketch (Sketch1…): {start, segments} / {circle} / flat points loop — referenced by name from the profile features |
106
+ | `cad_sketch_edit` | Redefine a sketch (回改): the definition op is rewritten in place and the log replayed — every referencing feature rebuilds |
107
+ | `cad_sketch_list` | List the document's sketches (name / form / size) |
108
+ | `cad_sketch_delete` | Delete a sketch (refused while features still reference it) |
109
+ | `cad_extrude_profile` | Extrude a closed XY-plane profile along +Z into a solid — inline points/segments/circle or a named sketch (`sketch`) |
105
110
  | `cad_loft` | Loft: skin a solid through successive closed sections (each a [x,y,z,…] loop in its own plane); sections may differ in shape and point count; `ruled` for straight sides |
106
- | `cad_revolve` | Solid of revolution: revolve a closed profile around an axis (profile coords = (radius, height); curve segments supported — rounded rims exact); optional `angle` |
111
+ | `cad_revolve` | Solid of revolution: revolve a closed profile around an axis (profile coords = (radius, height); curve segments supported — rounded rims exact); optional `angle`; accepts a named sketch |
107
112
  | `cad_chamfer` | Chamfer: bevel every sharp edge with one equal distance (mm) |
108
113
  | `cad_pattern` | Pattern: linear (`delta` spacing) or circular (principal axis + `at` point + sweep angle); creates copy bodies, fuse afterwards for one body |
109
114
  | `cad_shell` | Shell: hollow to a wall thickness (inward, outer skin preserved); `open` lists outward normals of the faces to open (empty = sealed). Runs on the occt.ts kernel; the result is a HOSTED body |
110
115
  | `cad_draft` | Draft: tilt the walls `angle` degrees about a neutral plane (mold release); `direction` is the pull direction, walls auto-selected by default. Runs on the occt.ts kernel; the result is a HOSTED body |
111
- | `cad_sweep` | Sweep: pipe a closed 2D profile along a 3D [x,y,z,…] path; the profile is auto-placed on the start plane, so no manual orientation |
116
+ | `cad_sweep` | Sweep: pipe a closed 2D profile along a 3D [x,y,z,…] path; the profile is auto-placed on the start plane, so no manual orientation; accepts a named sketch |
112
117
  | `cad_boolean` | fuse / cut / common (classic hole punching: plate cut cylinder) |
113
118
  | `cad_fillet` | Constant-radius fillet on all sharp edges |
114
119
  | `cad_transform` | Translate / Euler rotate / mirror |
@@ -168,7 +173,7 @@ cad_view(path) modeling tools (cad_create_prim, …)
168
173
  ```
169
174
 
170
175
  - **Two workers**: import (occt-import-js, read-only STEP/IGES/BREP) and modeling
171
- (opencascade.js 1.1.1, full OCCT) are separate, both lazily started; the `_N`
176
+ (opencascade.js, full OCCT) are separate, both lazily started; the `_N`
172
177
  suffix convention of embind overloaded constructors is wrapped in
173
178
  `src/modeling/occt-adapter.cjs` (all verified at runtime)
174
179
  - **Zero-copy pipeline**: modeling scenes use zero base64 / zero large JSON arrays /
@@ -183,9 +188,10 @@ cad_view(path) modeling tools (cad_create_prim, …)
183
188
  without MEMFS, tessellation with built-in feature-edge extraction, and a
184
189
  `hasError()`/`lastError()` error contract. Geometry crosses kernels as STEP
185
190
  bytes and the projected segments are remapped into the sheet frame. Kernel
186
- dist resolution: `DSH_OCCTJS_DIST` env var → `node_modules/occt.ts/dist`
187
- (npm, default) → `<repo>/../opencascade-ts/dist` (sibling checkout) → `vendor/`
188
- → `node_modules/opencascade-ts`
191
+ dist resolution: `DSH_OCCTJS_DIST` env var → Node's own resolution of the
192
+ `occt.ts` dependency (walks up every parent node_modules — npm/yarn flat and
193
+ pnpm symlink layouts all hit) → `<repo>/../opencascade-ts/dist` (sibling
194
+ checkout) → `vendor/` → `node_modules/opencascade-ts`
189
195
  - **Constraint solving (Ansatz)**: the solver is the npm dependency
190
196
  **`ansatz-wasm`** (a wasm-bindgen build, single package ~538KB, zero deps) —
191
197
  installing dsh-cad pulls it automatically, and `npm install ansatz-wasm` alone
@@ -198,15 +204,15 @@ cad_view(path) modeling tools (cad_create_prim, …)
198
204
  exponential-map rotation, radians). Solver capability is staged
199
205
  (point-distance-to-origin today) — the plumbing contract is finished and needs
200
206
  no changes as it grows
201
- - **Single-kernel architecture (v0.9)**: the primary modeling kernel is now
202
- **occt.ts >= 0.5.0** — primitives, curve-segment profiles (TRUE B-spline
207
+ - **Single-kernel architecture**: the primary modeling kernel is
208
+ **occt.ts** — primitives, curve-segment profiles (TRUE B-spline
203
209
  interpolation), loft/sweep/revolve, booleans, fillet/chamfer, shell/draft,
204
210
  mirror (composed as scale(-1) + a π rotation) and centroid all live in one
205
211
  session; engineering-drawing HLR takes the shape directly (zero STEP hops);
206
- editing after shelling is seamless (the v0.8 hosted-body seam is deleted).
212
+ editing after shelling is seamless (the old hosted-body seam is deleted).
207
213
  opencascade.js remains as the FALLBACK backend (auto-selected when occt.ts
208
214
  cannot load). Assembly STEP export writes a **structured document** (occt.ts
209
- ≥ 0.7.0 `writeStepDocument`): one root product plus one named, placed child
215
+ `writeStepDocument`): one root product plus one named, placed child
210
216
  per instance — instance separation survives the file (STL stays a single
211
217
  fused mesh; the fallback backend also fuses). Instance separation stays in
212
218
  the assembly scene/document for the fuse paths.
@@ -218,7 +224,7 @@ cad_view(path) modeling tools (cad_create_prim, …)
218
224
  ## Tests
219
225
 
220
226
  ```sh
221
- npm test # 41 tests: converters / modeling worker (exact volume assertions) / DCPRT round-trip / FreeCAD executor / image profiles / binary pipeline
227
+ npm test # full suite: converters / modeling worker (exact volume assertions) / DCPRT round-trip / FreeCAD + Onshape executors / image profiles / binary pipeline / document persistence
222
228
  node test/m0-kernel-check.cjs # OCCT kernel API smoke test
223
229
  node test/route-check.mjs # JSON scene routing layer
224
230
  node test/visual/serve.mjs # browser card/tab visual verification page (http://127.0.0.1:3987)
package/README.zh-CN.md CHANGED
@@ -4,9 +4,10 @@
4
4
 
5
5
  [![homepage](https://img.shields.io/badge/homepage-dsh--cad-4D6BFE)](https://lau-mars.github.io/dsh-cad/)
6
6
  [![npm](https://img.shields.io/npm/v/dsh-cad)](https://www.npmjs.com/package/dsh-cad)
7
- [![dsh plugin](https://img.shields.io/badge/dsh-plugin-4D6BFE)](https://github.com/deepseek-ai/deepseek-harness)
7
+ [![dsh](https://img.shields.io/npm/v/@deepseek-ai%2Fdsh?label=dsh)](https://www.npmjs.com/package/@deepseek-ai/dsh)
8
8
  [![Node](https://img.shields.io/badge/node-%3E%3D%2022-4D6BFE)](https://nodejs.org/)
9
- [![OCCT](https://img.shields.io/badge/kernel-OCCT-4D6BFE)](https://github.com/donalffons/opencascade.js)
9
+ [![occt.ts](https://img.shields.io/npm/v/occt.ts)](https://www.npmjs.com/package/occt.ts)
10
+ [![ansatz](https://img.shields.io/npm/v/ansatz-wasm?label=ansatz)](https://www.npmjs.com/package/ansatz-wasm)
10
11
  [![License: MIT](https://img.shields.io/badge/license-MIT-4D6BFE)](./LICENSE)
11
12
 
12
13
  [English](./README.md) | 简体中文
@@ -29,13 +30,14 @@
29
30
 
30
31
  | 能力 | 说明 |
31
32
  | --- | --- |
32
- | ⚙️ 单内核架构 | **occt.ts 为主建模内核**(真 BSpline、抽壳/拔模原生、质心),opencascade.js 仅作为加载失败时的降级后端;v0.8 的「抽壳后不可编辑」接缝消失——抽壳/拔模后可继续圆角/倒角/布尔 |
33
+ | ⚙️ 单内核架构 | **occt.ts 为主建模内核**(真 BSpline、抽壳/拔模原生、质心),opencascade.js 仅作为加载失败时的降级后端;旧版的「抽壳后不可编辑」接缝消失——抽壳/拔模后可继续圆角/倒角/布尔 |
33
34
  | 🔍 CAD 查看 | STL / OBJ / STEP / IGES / BREP / DCPRT(3D),DXF / SVG(2D),对话内嵌交互卡片(轨道旋转 / 缩放 / 线框 / 平移) |
34
35
  | 🧭 CAD 编辑器交互 | Onshape 风格 ViewCube(26 区域点击定向)、悬停/点选面与边实时测量(面积 mm² / 长度 mm)、面+边 / 面 / 线框三种渲染模式、支架 / 法兰 / 轴 BRep 示例件一键切换 |
35
36
  | 🏗️ 参数化建模 | 基本体、轮廓拉伸、**放样**、**扫掠**、**旋转体**、布尔、全边圆角/倒角、**抽壳**、**拔模**、**阵列(线性/圆周)**、变换;轮廓支持**曲线段**(圆弧/圆为精确 BRep,B 样条为采样近似)—— OCCT 精确 BRep,非网格近似 |
37
+ | ✏️ 命名草图 | 文档中独立的可命名轮廓(Sketch1…):`cad_sketch_new` / `edit` / `list` / `delete`;拉伸/旋转/扫掠**按名字引用**,`cad_sketch_edit` 原位改写定义并全量重放,所有引用特征级联重建——参数化闭环。草图以 Onshape 式**蓝色曲线 + 平面框**在视口中实时渲染(回改即刷新),并列于零件页签左侧的**特征树**(草图 + 特征、眼睛显隐、点选高亮实体) |
36
38
  | 🗂️ Codex 式文档页签 | 右侧显示区页签栏 + 「+」菜单:**零件**(Part Studio,默认)/ **装配体**(实例插入/移动/移除)/ **工程图**(真实隐藏线图纸),页签可关闭、常驻不丢状态 |
37
39
  | 📁 多文档 file 空间 | 工作区命名的建模文档(`.dsh-cad/docs/`),每个会话绑定自己的活动文档——新会话从空文档开始,不再继承历史遗留零件;面板上的文件夹按钮列出全部文档(预览 / 删除),对话中用 `cad_doc_new` / `cad_doc_open` 切换建模目标 |
38
- | 📐 工程图 | GB 第一角布局:主视图 / 俯视图 / 左视图 + 轴测图,**occt.ts** 内核(npm 依赖,OCCT 7.9)真实隐藏线消除(虚线);图框、标题栏、总尺寸标注、标准比例系列;导出 SVG / DXF |
40
+ | 📐 工程图 | GB 第一角布局:主视图 / 俯视图 / 左视图 + 轴测图,**occt.ts** 内核(npm 依赖)真实隐藏线消除(虚线);图框、标题栏、总尺寸标注、标准比例系列;导出 SVG / DXF |
39
41
  | 🔗 约束求解与运动 | 集成 **Ansatz** 几何约束求解器(**`ansatz-wasm` 一条命令即可**:`npm install ansatz-wasm`,零 Rust 工具链 / 零原生二进制 / 零依赖):实体/约束建模(装配实例 ↔ rigid3 位姿自动映射)、求解回写、DOF/残差/冗余/建议全量诊断(面向 LLM 的中文报告)、参数扫描运动学(`cad_constraint` / `cad_solve` / `cad_motion`) |
40
42
  | 📐 几何测量 | 精确体积(mm³)、包围盒、三角统计、DXF 图层 |
41
43
  | 📤 按需导出 | STEP(参数化)/ STL(网格),仅在用户要求时写文件 |
@@ -58,10 +60,8 @@ dsh plugin --profile web add dsh-cad
58
60
 
59
61
  ### 版本要求
60
62
 
61
- - **Node.js** ≥ 22
62
- - **dsh CLI**(`@deepseek-ai/dsh`):本项目开发基于 **0.1.0-rc.7**
63
- (最低支持版本,已在 `package.json` 的 `engines` 字段声明);
64
- 建议 **≥ 0.1.1-rc.2**(2026-08-31 实测通过)
63
+ - **Node.js** 与 **dsh CLI**(`@deepseek-ai/dsh`)的最低版本以顶部徽章和
64
+ `package.json` 的 `engines` 字段为准——正文不再写具体版本号,避免过时
65
65
 
66
66
  ### 从源码安装(开发模式)
67
67
 
@@ -70,7 +70,7 @@ git clone https://github.com/LAU-MARS/dsh-cad.git
70
70
  cd dsh-cad
71
71
  npm install && npm run build && npm test # 依赖含 occt.ts(工程图真实消隐内核,~20MB wasm)
72
72
 
73
- npm install -g @deepseek-ai/dsh@^0.1.1-rc.2 pnpm # 需要 Node ≥ 22
73
+ npm install -g @deepseek-ai/dsh pnpm
74
74
  dsh web # 首次启动初始化 profile 后 Ctrl-C
75
75
 
76
76
  dsh plugin --profile web add /path/to/dsh-cad
@@ -96,14 +96,18 @@ patch 内容以包根目录的 `cordis.patch.yml` 随包分发,安装器经同
96
96
  | `cad_view` | 打开 CAD 文件,渲染交互式查看器卡片 |
97
97
  | `cad_info` | 只读几何元信息(格式/数量/包围盒/单位/图层) |
98
98
  | `cad_create_prim` | 基本体(mm,Z-up),`at` 定位、`axis` 定向(精确轴角旋转) |
99
- | `cad_extrude_profile` | XY 平面闭合多边形沿 +Z 拉伸成实体 |
99
+ | `cad_sketch_new` | 新建命名草图(Sketch1…):{start, segments} / {circle} / 平面点列——供轮廓特征按名引用 |
100
+ | `cad_sketch_edit` | 回改草图:定义 op 原位改写 + 日志全量重放,所有引用特征级联重建 |
101
+ | `cad_sketch_list` | 列出文档草图(名称 / 形式 / 规模) |
102
+ | `cad_sketch_delete` | 删除草图(仍被特征引用时拒绝) |
103
+ | `cad_extrude_profile` | XY 平面闭合轮廓沿 +Z 拉伸成实体——内联点列/曲线段/圆,或引用命名草图(`sketch`) |
100
104
  | `cad_loft` | 放样:多个闭合截面(各自平面内的 [x,y,z…] 环)蒙皮成体,截面形状/点数可不同,`ruled` 直纹 |
101
- | `cad_revolve` | 旋转体:闭合轮廓绕轴回转(profile 坐标 = (半径, 高度),支持曲线段——圆角轮缘精确),`angle` 角度可选 |
105
+ | `cad_revolve` | 旋转体:闭合轮廓绕轴回转(profile 坐标 = (半径, 高度),支持曲线段——圆角轮缘精确),`angle` 角度可选;可引用命名草图 |
102
106
  | `cad_chamfer` | 倒角:全锐边等距离斜切(mm) |
103
107
  | `cad_pattern` | 阵列:线性(delta 间距)或圆周(主轴 + at 轴点 + 总角度),生成副本体,可再 fuse 合并 |
104
108
  | `cad_shell` | 抽壳:壁厚向内生长、外表面保留;`open` 为开口面的外法向列表(空 = 封闭内腔)。经 occt.ts 内核执行,结果为**托管体** |
105
109
  | `cad_draft` | 拔模:壁面绕中性面倾斜 `angle` 度(脱模斜度),`direction` 为拔模方向,默认自动选平行于该方向的壁面。经 occt.ts 内核执行,结果为**托管体** |
106
- | `cad_sweep` | 扫掠:闭合 2D 轮廓沿 3D 路径([x,y,z…])扫出实体;轮廓自动置于路径起点垂面,无需手工定向 |
110
+ | `cad_sweep` | 扫掠:闭合 2D 轮廓沿 3D 路径([x,y,z…])扫出实体;轮廓自动置于路径起点垂面,无需手工定向;可引用命名草图 |
107
111
  | `cad_boolean` | fuse / cut / common(经典打孔:plate cut cylinder) |
108
112
  | `cad_fillet` | 全锐边等半径圆角 |
109
113
  | `cad_transform` | 平移 / 欧拉旋转 / 镜像 |
@@ -160,7 +164,7 @@ cad_view(path) 建模工具(cad_create_prim 等)
160
164
  浏览器卡片 + 常驻 "3D" 页签(three.js / SVG,Z-up,XYZ 轴)
161
165
  ```
162
166
 
163
- - **两个 worker**:导入(occt-import-js,只读 STEP/IGES/BREP)与建模(opencascade.js 1.1.1,
167
+ - **两个 worker**:导入(occt-import-js,只读 STEP/IGES/BREP)与建模(opencascade.js,
164
168
  完整 OCCT)分离,均惰性启动;embind 重载构造器的 `_N` 后缀约定封装在
165
169
  `src/modeling/occt-adapter.cjs`(全部经运行时实证)
166
170
  - **直通管道**:建模场景零 base64 / 零 JSON 大数组 / 零每步落盘(磁盘镜像 1.5s 防抖,
@@ -171,8 +175,9 @@ cad_view(path) 建模工具(cad_create_prim 等)
171
175
  `hiddenLines()` 真实消隐线、STEP/BRep 字节级 `readStep`/`readBrep`/`writeStep`/
172
176
  `writeBrep`(无需 MEMFS)、自带特征边提取的网格化、`hasError()`/`lastError()`
173
177
  错误契约。几何以 STEP 字节跨内核交换,投影线段重映射进图纸坐标系。内核 dist
174
- 解析顺序:`DSH_OCCTJS_DIST` 环境变量 → `node_modules/occt.ts/dist`(npm,
175
- 默认)→ `<repo>/../opencascade-ts/dist`(兄弟检出)→ `vendor/` →
178
+ 解析顺序:`DSH_OCCTJS_DIST` 环境变量 → Node 自带的 `occt.ts` 依赖解析(沿所有
179
+ 父级 node_modules 向上查——npm/yarn 扁平安装与 pnpm 符号链接布局都能命中)→
180
+ `<repo>/../opencascade-ts/dist`(兄弟检出)→ `vendor/` →
176
181
  `node_modules/opencascade-ts`
177
182
  - **约束求解(Ansatz)**:求解器是 npm 依赖 **`ansatz-wasm`**(wasm-bindgen
178
183
  构建,单包 ~538KB、零依赖)——安装 dsh-cad 即自动获得,也可单独
@@ -182,12 +187,12 @@ cad_view(path) 建模工具(cad_create_prim 等)
182
187
  原样透出给 LLM。装配实例位姿(平移 + XYZ 欧拉度)与求解器 rigid3(平移 + 指数映射
183
188
  旋转,弧度)双向映射。求解器能力按阶段推进(当前支持点到原点距离),管道契约
184
189
  已就绪、无需随求解器成长改动
185
- - **单内核架构(v0.9)**:建模主内核切换为 **occt.ts ≥0.5.0**——prims/曲线段轮廓
190
+ - **单内核架构**:建模主内核为 **occt.ts**——prims/曲线段轮廓
186
191
  (真 BSpline 插值)/放样/扫掠/旋转/布尔/圆角/倒角/抽壳/拔模/镜像(scale(-1)+
187
192
  旋转 π 组合)/质心全在一个会话内,工程图 HLR 直接吃 shape(零 STEP 中转),
188
- 抽壳后继续编辑无缝(v0.8 的托管接缝删除)。opencascade.js 保留为**降级后端**
193
+ 抽壳后继续编辑无缝(旧托管接缝已删除)。opencascade.js 保留为**降级后端**
189
194
  (occt.ts 加载失败时自动启用)。装配体 STEP 导出为**结构化文档**(occt.ts
190
- ≥ 0.7.0 `writeStepDocument`):一个根产品 + 每实例一个命名、带位姿的子产品——
195
+ `writeStepDocument`):一个根产品 + 每实例一个命名、带位姿的子产品——
191
196
  实例分离在文件中保留(STL 仍为单一熔合网格;降级后端同样走 fuse)。fuse
192
197
  路径下实例分离仅保留在装配场景/文档中。面选择按 `describe()` 平面法向
193
198
  匹配(±法向取外侧投影最大者)
@@ -197,7 +202,7 @@ cad_view(path) 建模工具(cad_create_prim 等)
197
202
  ## 测试
198
203
 
199
204
  ```sh
200
- npm test # 41 项:转换器 / 建模 worker(体积精确断言)/ DCPRT 往返 / FreeCAD 执行器 / 图片轮廓 / 二进制管道 / 文档持久化
205
+ npm test # 全套:转换器 / 建模 worker(体积精确断言)/ DCPRT 往返 / FreeCAD + Onshape 执行器 / 图片轮廓 / 二进制管道 / 文档持久化
201
206
  node test/m0-kernel-check.cjs # OCCT 内核 API 冒烟
202
207
  node test/route-check.mjs # JSON 场景路由层
203
208
  node test/visual/serve.mjs # 浏览器卡片/页签视觉验证页(http://127.0.0.1:3987)
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: dsh-cad
3
+ name: 'dsh-cad'