parapoly-runtime 1.0.3 → 1.0.4

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.
@@ -1,3 +1,6 @@
1
+ > ⚠️ 注意:
2
+ > 不要直接调用 Text2CADFacade.ts 的实现或接口信息。所有对 Text2CADFacade 的使用应通过规范化的 API 或文档说明进行,避免直接依赖其源码细节。
3
+
1
4
  ---
2
5
  applyTo: "**/code3d-workspace-config.json,**/package.json,**/*.code3d.js,**/.parapoly/**,**/*.part3d"
3
6
  description: "Code3D / 国基3D / 国基CAD 项目工作区规范:项目结构、模块编写、编译流程、多色组装等。适用于所有 code3d 3D 建模项目。"
@@ -1040,4 +1043,4 @@ if (!is_visible) {
1040
1043
 
1041
1044
  **与 Extrude/Revolve IIFE 的配合**:Extrude/Revolve IIFE 中会先 `node.set_archived(false)` 取消归档(用于 `to_wires_shape()`),操作完成后再 `node.set_archived(true)` 重新归档。即使在 sketch 创建时已设置 `archived=true`,操作 IIFE 的归档流程仍然正确执行。
1042
1045
 
1043
- **`end_sketch()` 后的 `selected_node`**:`PartBlock3dDocument.end_sketch()` 将 `this.selected_node = node`(sketch 节点),因此 `block3d_doc.selected_node.set_archived(true)` 可以正确定位到刚创建的 sketch
1046
+ **`end_sketch()` 后的 `selected_node`**:`PartBlock3dDocument.end_sketch()` 将 `this.selected_node = node`(sketch 节点),因此 `block3d_doc.selected_node.set_archived(true)` 可以正确定位到刚创建的 sketch.
@@ -1,3 +1,6 @@
1
+ > ⚠️ 注意:
2
+ > 不要直接调用 Text2CADFacade.ts 的实现或接口信息。所有对 Text2CADFacade 的使用应通过规范化的 API 或文档说明进行,避免直接依赖其源码细节。
3
+
1
4
  ---
2
5
  applyTo: "**/*.code3d.js"
3
6
  ---
@@ -1,3 +1,6 @@
1
+ > ⚠️ 注意:
2
+ > 不要直接调用 Text2CADFacade.ts 的实现或接口信息。所有对 Text2CADFacade 的使用应通过规范化的 API 或文档说明进行,避免直接依赖其源码细节。
3
+
1
4
  ---
2
5
  applyTo: "**/*.part3d,**/*.part3d.js,**/Part3dCodeExporter*,**/part3d/**"
3
6
  description: "Part3D 编辑器与 .part3d/.part3d.js 导出规范。涵盖 Part3dCodeExporter 架构、特征导出模式、sketch 可见度、颜色格式等。"
@@ -1,3 +1,6 @@
1
+ > ⚠️ 注意:
2
+ > 不要直接调用 Text2CADFacade.ts 的实现或接口信息。所有对 Text2CADFacade 的使用应通过规范化的 API 或文档说明进行,避免直接依赖其源码细节。
3
+
1
4
  ---
2
5
  applyTo: "**/*.sketch3d,**/*.sketch3d.js,**/SketchCodeExporter*,**/sketch3d/**,**/sketch_node/**"
3
6
  description: "Sketch3D 草图编辑器与 .sketch3d/.sketch3d.js 导出规范。涵盖 SketchCodeExporter 架构、几何导出、约束导出、可见度处理等。"
@@ -245,4 +248,4 @@ sk_node.set_op_feature_node_id(id)
245
248
  2. 确认约束类型:`packages/parapoly-runtime/src/types/Constraint.ts` (`ConstraintType` 枚举)
246
249
  3. 确认 API:`packages/parapoly-runtime/src/part/PartBlock3dDocument.ts` 中的 sketch 方法
247
250
  4. 更新 `SketchCodeExporter.ts` 中对应分支
248
- 5. 注意约束参数的 `second >= 0` 条件判断(区分单目/双目约束)
251
+ 5. 注意约束参数的 `second >= 0` 条件判断(区分单目/双目约束)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parapoly-runtime",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
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",
@@ -1,5 +1,5 @@
1
1
  declare module "parapoly-runtime" {
2
- export type BooleanOp = "union" | "cut" | "common";
2
+ export type BooleanOp = "union" | "difference" | "intersection";
3
3
 
4
4
  export type AxisDir = "x" | "y" | "z";
5
5
 
@@ -33,6 +33,18 @@ declare module "parapoly-runtime" {
33
33
  private _parameters: Array<FacadeParameter>;
34
34
  private _lastBuildResult: FacadeBuildResult | null;
35
35
  constructor();
36
+ /**
37
+ * Reset the facade to a fresh empty document.
38
+ */
39
+ reset(): this;
40
+ /**
41
+ * Load a .part3d JSON payload into the facade document.
42
+ */
43
+ loadPart3d(json: string, recompile?: boolean, color?: string): this;
44
+ /**
45
+ * Load a .block3d JSON payload into the facade document.
46
+ */
47
+ loadBlock3d(json: string): this;
36
48
  /**
37
49
  * Create a box centered at origin. Parameters: x-size, y-size (height), z-size (depth).
38
50
  */
@@ -1735,7 +1747,7 @@ declare module "parapoly-runtime" {
1735
1747
  public getChildByIndex(index: number): Node;
1736
1748
  public clearComponents(): void;
1737
1749
  public clearChildren(): void;
1738
- public static visit_node(node: Node, preVisitMethod?: any, postVisitMethod?: any): void;
1750
+ public static visit_node(node: Node, preVisitMethod?: ((node: any) => void) | null, postVisitMethod?: ((node: any) => void) | null): void;
1739
1751
  public to_json(options?: ObjectToJsonOptions): any;
1740
1752
  public clone(options?: ObjectToJsonOptions, to_options?: ObjectToJsonOptions): Node;
1741
1753
  public static create(obj?: any, options?: ObjectCreateOptions): Node;
@@ -2958,6 +2970,7 @@ declare module "parapoly-runtime" {
2958
2970
  exportDocData = "exportDocData",
2959
2971
  exportLog = "exportLog",
2960
2972
  exportBlocklyPngs = "exportBlocklyPngs",
2973
+ exportCode3dJs = "exportCode3dJs",
2961
2974
  export3mf = "export3mf",
2962
2975
  exportStep = "exportStep",
2963
2976
  exportIges = "exportIges",