dsh-cad 0.8.0 → 0.9.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 +11 -8
- package/README.zh-CN.md +9 -7
- package/lib/client.js +21 -21
- package/lib/client.js.map +3 -3
- package/lib/modeling/modeling-worker.cjs +91 -54
- package/lib/modeling/occt-adapter.cjs +1 -1
- package/lib/modeling/occt-bridge.cjs +70 -4
- package/lib/tools/cad-model.js +3 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ switchable demo parts (bracket / flange / shaft):
|
|
|
29
29
|
|
|
30
30
|
| Capability | Description |
|
|
31
31
|
| --- | --- |
|
|
32
|
+
| ⚙️ 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 |
|
|
32
33
|
| 🔍 CAD viewing | STL / OBJ / STEP / IGES / BREP / DCPRT (3D), DXF / SVG (2D); interactive in-chat card (orbit / zoom / wireframe / pan) |
|
|
33
34
|
| 🧭 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) |
|
|
34
35
|
| 🏗️ 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 |
|
|
@@ -131,7 +132,7 @@ versioned URL), and the "3D" tab tracks the latest model in real time.
|
|
|
131
132
|
|
|
132
133
|
## Connectors (roadmap)
|
|
133
134
|
|
|
134
|
-
Modeling
|
|
135
|
+
Modeling primarily runs on the **occt.ts kernel** (opencascade.js as the fallback backend) (OCCT in the browser —
|
|
135
136
|
zero install). The connectors below refer to **external CAD engines** acting as
|
|
136
137
|
executors for the same tool family, planned for future support:
|
|
137
138
|
|
|
@@ -192,13 +193,15 @@ cad_view(path) modeling tools (cad_create_prim, …)
|
|
|
192
193
|
exponential-map rotation, radians). Solver capability is staged
|
|
193
194
|
(point-distance-to-origin today) — the plumbing contract is finished and needs
|
|
194
195
|
no changes as it grows
|
|
195
|
-
- **
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
196
|
+
- **Single-kernel architecture (v0.9)**: the primary modeling kernel is now
|
|
197
|
+
**occt.ts >= 0.5.0** — primitives, curve-segment profiles (TRUE B-spline
|
|
198
|
+
interpolation), loft/sweep/revolve, booleans, fillet/chamfer, shell/draft,
|
|
199
|
+
mirror (composed as scale(-1) + a π rotation) and centroid all live in one
|
|
200
|
+
session; engineering-drawing HLR takes the shape directly (zero STEP hops);
|
|
201
|
+
editing after shelling is seamless (the v0.8 hosted-body seam is deleted).
|
|
202
|
+
opencascade.js remains as the FALLBACK backend (auto-selected when occt.ts
|
|
203
|
+
cannot load). Assembly STEP export degrades to a fused single solid (no
|
|
204
|
+
compound binding); instance separation stays in the assembly scene/document.
|
|
202
205
|
Face selection matches `describe()` plane normals (outermost along ±normal)
|
|
203
206
|
- **Client**: esbuild single-file CJS factory (three.js inlined ~560KB, react provided
|
|
204
207
|
by the host module table), Z-up CAD convention, empty scene with XYZ axis labels
|
package/README.zh-CN.md
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
| 能力 | 说明 |
|
|
29
29
|
| --- | --- |
|
|
30
|
+
| ⚙️ 单内核架构 | **occt.ts 为主建模内核**(真 BSpline、抽壳/拔模原生、质心),opencascade.js 仅作为加载失败时的降级后端;v0.8 的「抽壳后不可编辑」接缝消失——抽壳/拔模后可继续圆角/倒角/布尔 |
|
|
30
31
|
| 🔍 CAD 查看 | STL / OBJ / STEP / IGES / BREP / DCPRT(3D),DXF / SVG(2D),对话内嵌交互卡片(轨道旋转 / 缩放 / 线框 / 平移) |
|
|
31
32
|
| 🧭 CAD 编辑器交互 | Onshape 风格 ViewCube(26 区域点击定向)、悬停/点选面与边实时测量(面积 mm² / 长度 mm)、面+边 / 面 / 线框三种渲染模式、支架 / 法兰 / 轴 BRep 示例件一键切换 |
|
|
32
33
|
| 🏗️ 参数化建模 | 基本体、轮廓拉伸、**放样**、**扫掠**、**旋转体**、布尔、全边圆角/倒角、**抽壳**、**拔模**、**阵列(线性/圆周)**、变换;轮廓支持**曲线段**(圆弧/圆为精确 BRep,B 样条为采样近似)—— OCCT 精确 BRep,非网格近似 |
|
|
@@ -127,7 +128,7 @@ patch 内容以包根目录的 `cordis.patch.yml` 随包分发,安装器经同
|
|
|
127
128
|
|
|
128
129
|
## 连接器(规划中)
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
建模主要由 **occt.ts** 内核承担(opencascade.js 为降级后端)(浏览器内的 OCCT 内核,零安装);
|
|
131
132
|
下表连接器指未来以**外部 CAD 引擎作为执行器**驱动同一工具族:
|
|
132
133
|
|
|
133
134
|
| 连接器 | 套件 | 平台 | 状态 |
|
|
@@ -177,12 +178,13 @@ cad_view(path) 建模工具(cad_create_prim 等)
|
|
|
177
178
|
原样透出给 LLM。装配实例位姿(平移 + XYZ 欧拉度)与求解器 rigid3(平移 + 指数映射
|
|
178
179
|
旋转,弧度)双向映射。求解器能力按阶段推进(当前支持点到原点距离),管道契约
|
|
179
180
|
已就绪、无需随求解器成长改动
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
`describe()`
|
|
181
|
+
- **单内核架构(v0.9)**:建模主内核切换为 **occt.ts ≥0.5.0**——prims/曲线段轮廓
|
|
182
|
+
(真 BSpline 插值)/放样/扫掠/旋转/布尔/圆角/倒角/抽壳/拔模/镜像(scale(-1)+
|
|
183
|
+
旋转 π 组合)/质心全在一个会话内,工程图 HLR 直接吃 shape(零 STEP 中转),
|
|
184
|
+
抽壳后继续编辑无缝(v0.8 的托管接缝删除)。opencascade.js 保留为**降级后端**
|
|
185
|
+
(occt.ts 加载失败时自动启用)。装配体 STEP 导出因无 compound 绑定降级为
|
|
186
|
+
fuse 单体(实例分离保留在装配场景/文档中)。面选择按 `describe()` 平面法向
|
|
187
|
+
匹配(±法向取外侧投影最大者)
|
|
186
188
|
- **客户端**:esbuild 单文件 CJS 工厂(three.js 内联 ~560KB,react 由宿主模块表提供),
|
|
187
189
|
Z-up CAD 惯例,带 XYZ 轴标签与地面网格的空场景常驻显示
|
|
188
190
|
|