parapoly-runtime 1.0.4 → 1.0.5

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.
@@ -292,6 +292,9 @@ let main = function(params) {
292
292
  2. **入口文件不需要外层包裹** — 根文档本身不会被 `run_node`
293
293
  3. **需要 boolean 运算的部件放在 `booleanEnabled=true` 的内层 group**
294
294
  4. **每个颜色一个 `push_node(..., true)` group** — 同色部件可合并到一个 group
295
+ 5. **有效布尔运算必须使用一个容器** — 也就是把 `union / difference / intersection` 相关几何放进同一个 `push_node(..., true)` 组里;不要把差集/交集拆散到多个独立 group,否则结果不稳定或不生效。
296
+
297
+ > 经验总结:示例里的布尔运算之所以有效,是因为它把所有布尔体都收拢在同一个容器 group 中执行。后续新建布尔模型时,优先遵循这一模式。
295
298
 
296
299
  ### 禁止:嵌套 booleanEnabled=true group 做差集
297
300
 
@@ -53,6 +53,15 @@ The last parameter is always a color string (typically `"#ffc658"`).
53
53
  - `"difference"` — Subtract/cut shape from parent
54
54
  - `"intersection"` — Keep only overlapping region
55
55
 
56
+ **经验总结(重要)**:有效的布尔运算必须放在同一个容器组内执行。也就是用一层 `push_node(..., true)` 包住需要做 `union / difference / intersection` 的几何,再把子形体放进去;不要把布尔体散落到多个独立 group 里,否则差集/交集往往不会按预期生效。
57
+
58
+ ```javascript
59
+ block3d_doc.push_node("union", "object1", "#ffc658", true)
60
+ block3d_doc.box("union", 1, 1, 1, "#ffc658")
61
+ block3d_doc.sphere("difference", 0.6, "#ffc658")
62
+ block3d_doc.pop_node()
63
+ ```
64
+
56
65
  ### Grouping (push_node / pop_node)
57
66
 
58
67
  ```javascript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parapoly-runtime",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "ParaPoly 3D CAD Runtime — CSG modeling, sketch, and project builder",
5
5
  "main": "./parapoly_runtime.js",
6
6
  "types": "./parapoly_runtime.d.ts",