@faicad/faijs 0.18.3 → 0.22.2
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/dist/api/api-namespace.d.ts.map +1 -1
- package/dist/api/api-namespace.js +4 -1
- package/dist/api/api-namespace.js.map +1 -1
- package/dist/api/brep-mirror/joinery-brep.d.ts +1 -1
- package/dist/api/brep-mirror/joinery-brep.d.ts.map +1 -1
- package/dist/api/brep-mirror/joinery-brep.js +22 -20
- package/dist/api/brep-mirror/joinery-brep.js.map +1 -1
- package/dist/api/generated/script-face-manifest.d.ts +4 -0
- package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
- package/dist/api/generated/script-face-manifest.js.map +1 -1
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/knurl.d.ts.map +1 -1
- package/dist/api/knurl.js +1 -0
- package/dist/api/knurl.js.map +1 -1
- package/dist/api/primitives.d.ts +4 -3
- package/dist/api/primitives.d.ts.map +1 -1
- package/dist/api/primitives.js +9 -3
- package/dist/api/primitives.js.map +1 -1
- package/dist/api/profile.d.ts +34 -5
- package/dist/api/profile.d.ts.map +1 -1
- package/dist/api/profile.js +168 -186
- package/dist/api/profile.js.map +1 -1
- package/dist/api/punch-hole.d.ts +77 -0
- package/dist/api/punch-hole.d.ts.map +1 -0
- package/dist/api/punch-hole.js +207 -0
- package/dist/api/punch-hole.js.map +1 -0
- package/dist/api/sketch-on-face.d.ts +85 -0
- package/dist/api/sketch-on-face.d.ts.map +1 -0
- package/dist/api/sketch-on-face.js +136 -0
- package/dist/api/sketch-on-face.js.map +1 -0
- package/dist/api/sketch-on-plane.d.ts +87 -0
- package/dist/api/sketch-on-plane.d.ts.map +1 -0
- package/dist/api/sketch-on-plane.js +106 -0
- package/dist/api/sketch-on-plane.js.map +1 -0
- package/dist/api/surface/arg-spec.d.ts +8 -0
- package/dist/api/surface/arg-spec.d.ts.map +1 -1
- package/dist/api/surface/arg-spec.js.map +1 -1
- package/dist/api/transform.d.ts +5 -5
- package/dist/api/transform.d.ts.map +1 -1
- package/dist/api/transform.js +12 -10
- package/dist/api/transform.js.map +1 -1
- package/dist/api/xml-dom.d.ts +27 -0
- package/dist/api/xml-dom.d.ts.map +1 -0
- package/dist/api/xml-dom.js +45 -0
- package/dist/api/xml-dom.js.map +1 -0
- package/dist/boolean/csg-backend.d.ts +6 -6
- package/dist/boolean/csg-backend.d.ts.map +1 -1
- package/dist/boolean/csg-backend.js +9 -9
- package/dist/boolean/csg-backend.js.map +1 -1
- package/dist/boolean/csg-core.d.ts +10 -10
- package/dist/boolean/csg-core.d.ts.map +1 -1
- package/dist/boolean/csg-core.js +24 -24
- package/dist/boolean/csg-core.js.map +1 -1
- package/dist/boolean/extrude-helpers.d.ts +8 -8
- package/dist/boolean/extrude-helpers.d.ts.map +1 -1
- package/dist/boolean/extrude-helpers.js +13 -13
- package/dist/boolean/extrude-helpers.js.map +1 -1
- package/dist/brep/brep-ops.d.ts +24 -10
- package/dist/brep/brep-ops.d.ts.map +1 -1
- package/dist/brep/brep-ops.js +46 -18
- package/dist/brep/brep-ops.js.map +1 -1
- package/dist/brep/brep-topology.d.ts.map +1 -1
- package/dist/brep/brep-topology.js +3 -1
- package/dist/brep/brep-topology.js.map +1 -1
- package/dist/brep/export/export-model.d.ts +79 -0
- package/dist/brep/export/export-model.d.ts.map +1 -0
- package/dist/brep/export/export-model.js +335 -0
- package/dist/brep/export/export-model.js.map +1 -0
- package/dist/brep/primitives-brep.d.ts.map +1 -1
- package/dist/brep/primitives-brep.js +3 -1
- package/dist/brep/primitives-brep.js.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.js +4 -2
- package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
- package/dist/browser-host/csg-worker-protocol.d.ts +3 -3
- package/dist/browser-host/csg-worker-protocol.d.ts.map +1 -1
- package/dist/browser-host/csg-worker-protocol.js.map +1 -1
- package/dist/browser-host/csg-worker.js +3 -3
- package/dist/browser-host/csg-worker.js.map +1 -1
- package/dist/browser-host/inline-csg-backend.d.ts +3 -3
- package/dist/browser-host/inline-csg-backend.d.ts.map +1 -1
- package/dist/browser-host/inline-csg-backend.js +3 -3
- package/dist/browser-host/inline-csg-backend.js.map +1 -1
- package/dist/browser-host/worker-csg-backend.d.ts +3 -3
- package/dist/browser-host/worker-csg-backend.d.ts.map +1 -1
- package/dist/browser-host/worker-csg-backend.js.map +1 -1
- package/dist/cad-runtime/direct-executor.d.ts +4 -0
- package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
- package/dist/cad-runtime/direct-executor.js +17 -1
- package/dist/cad-runtime/direct-executor.js.map +1 -1
- package/dist/cad-runtime/ports.d.ts +3 -3
- package/dist/cad-runtime/ports.d.ts.map +1 -1
- package/dist/cad-runtime/ports.js.map +1 -1
- package/dist/cad-runtime/runtime.d.ts +24 -1
- package/dist/cad-runtime/runtime.d.ts.map +1 -1
- package/dist/cad-runtime/runtime.js +53 -3
- package/dist/cad-runtime/runtime.js.map +1 -1
- package/dist/define-op.d.ts +22 -0
- package/dist/define-op.d.ts.map +1 -1
- package/dist/define-op.js +15 -0
- package/dist/define-op.js.map +1 -1
- package/dist/env-agnostic.d.ts +7 -7
- package/dist/env-agnostic.d.ts.map +1 -1
- package/dist/env-agnostic.js +3 -3
- package/dist/env-agnostic.js.map +1 -1
- package/dist/geometry2d/adapt.d.ts +46 -0
- package/dist/geometry2d/adapt.d.ts.map +1 -0
- package/dist/geometry2d/adapt.js +41 -0
- package/dist/geometry2d/adapt.js.map +1 -0
- package/dist/geometry2d/bbox2d.d.ts +82 -0
- package/dist/geometry2d/bbox2d.d.ts.map +1 -0
- package/dist/geometry2d/bbox2d.js +123 -0
- package/dist/geometry2d/bbox2d.js.map +1 -0
- package/dist/geometry2d/blueprint-sketcher.d.ts +27 -0
- package/dist/geometry2d/blueprint-sketcher.d.ts.map +1 -0
- package/dist/geometry2d/blueprint-sketcher.js +29 -0
- package/dist/geometry2d/blueprint-sketcher.js.map +1 -0
- package/dist/geometry2d/blueprint.d.ts +102 -0
- package/dist/geometry2d/blueprint.d.ts.map +1 -0
- package/dist/geometry2d/blueprint.js +225 -0
- package/dist/geometry2d/blueprint.js.map +1 -0
- package/dist/geometry2d/blueprints.d.ts +58 -0
- package/dist/geometry2d/blueprints.d.ts.map +1 -0
- package/dist/geometry2d/blueprints.js +72 -0
- package/dist/geometry2d/blueprints.js.map +1 -0
- package/dist/geometry2d/bridge/lift-on-plane.d.ts +50 -0
- package/dist/geometry2d/bridge/lift-on-plane.d.ts.map +1 -0
- package/dist/geometry2d/bridge/lift-on-plane.js +78 -0
- package/dist/geometry2d/bridge/lift-on-plane.js.map +1 -0
- package/dist/geometry2d/bridge/on-surface.d.ts +98 -0
- package/dist/geometry2d/bridge/on-surface.d.ts.map +1 -0
- package/dist/geometry2d/bridge/on-surface.js +94 -0
- package/dist/geometry2d/bridge/on-surface.js.map +1 -0
- package/dist/geometry2d/bridge/plane.d.ts +69 -0
- package/dist/geometry2d/bridge/plane.d.ts.map +1 -0
- package/dist/geometry2d/bridge/plane.js +96 -0
- package/dist/geometry2d/bridge/plane.js.map +1 -0
- package/dist/geometry2d/canned-blueprints.d.ts +44 -0
- package/dist/geometry2d/canned-blueprints.d.ts.map +1 -0
- package/dist/geometry2d/canned-blueprints.js +94 -0
- package/dist/geometry2d/canned-blueprints.js.map +1 -0
- package/dist/geometry2d/compound-blueprint.d.ts +72 -0
- package/dist/geometry2d/compound-blueprint.d.ts.map +1 -0
- package/dist/geometry2d/compound-blueprint.js +95 -0
- package/dist/geometry2d/compound-blueprint.js.map +1 -0
- package/dist/geometry2d/curve2d.d.ts +298 -0
- package/dist/geometry2d/curve2d.d.ts.map +1 -0
- package/dist/geometry2d/curve2d.js +1110 -0
- package/dist/geometry2d/curve2d.js.map +1 -0
- package/dist/geometry2d/index.d.ts +22 -0
- package/dist/geometry2d/index.d.ts.map +1 -0
- package/dist/geometry2d/index.js +21 -0
- package/dist/geometry2d/index.js.map +1 -0
- package/dist/geometry2d/organise.d.ts +28 -0
- package/dist/geometry2d/organise.d.ts.map +1 -0
- package/dist/geometry2d/organise.js +108 -0
- package/dist/geometry2d/organise.js.map +1 -0
- package/dist/geometry2d/pen-sketcher.d.ts +365 -0
- package/dist/geometry2d/pen-sketcher.d.ts.map +1 -0
- package/dist/geometry2d/pen-sketcher.js +520 -0
- package/dist/geometry2d/pen-sketcher.js.map +1 -0
- package/dist/geometry2d/point.d.ts +44 -0
- package/dist/geometry2d/point.d.ts.map +1 -0
- package/dist/geometry2d/point.js +57 -0
- package/dist/geometry2d/point.js.map +1 -0
- package/dist/geometry2d/svg-ellipse.d.ts +74 -0
- package/dist/geometry2d/svg-ellipse.d.ts.map +1 -0
- package/dist/geometry2d/svg-ellipse.js +163 -0
- package/dist/geometry2d/svg-ellipse.js.map +1 -0
- package/dist/lang/code-to-args.d.ts +29 -3
- package/dist/lang/code-to-args.d.ts.map +1 -1
- package/dist/lang/code-to-args.js +41 -2
- package/dist/lang/code-to-args.js.map +1 -1
- package/dist/lang/codegen.d.ts +45 -1
- package/dist/lang/codegen.d.ts.map +1 -1
- package/dist/lang/codegen.js +135 -6
- package/dist/lang/codegen.js.map +1 -1
- package/dist/lang/host-arg.d.ts +6 -0
- package/dist/lang/host-arg.d.ts.map +1 -1
- package/dist/lang/host-arg.js.map +1 -1
- package/dist/lang/metadata-extractor.d.ts +25 -0
- package/dist/lang/metadata-extractor.d.ts.map +1 -1
- package/dist/lang/metadata-extractor.js +289 -25
- package/dist/lang/metadata-extractor.js.map +1 -1
- package/dist/lang/parse-error.d.ts +7 -1
- package/dist/lang/parse-error.d.ts.map +1 -1
- package/dist/lang/parse-error.js.map +1 -1
- package/dist/lang/security-scanner.d.ts +9 -1
- package/dist/lang/security-scanner.d.ts.map +1 -1
- package/dist/lang/security-scanner.js +38 -1
- package/dist/lang/security-scanner.js.map +1 -1
- package/dist/lang/symbol-table.generated.d.ts +3 -0
- package/dist/lang/symbol-table.generated.d.ts.map +1 -1
- package/dist/lang/symbol-table.generated.js +3 -0
- package/dist/lang/symbol-table.generated.js.map +1 -1
- package/dist/mesh/io.d.ts +62 -9
- package/dist/mesh/io.d.ts.map +1 -1
- package/dist/mesh/io.js +124 -17
- package/dist/mesh/io.js.map +1 -1
- package/dist/mesh/threemf-loader.d.ts +15 -0
- package/dist/mesh/threemf-loader.d.ts.map +1 -0
- package/dist/mesh/threemf-loader.js +163 -0
- package/dist/mesh/threemf-loader.js.map +1 -0
- package/dist/mesh/transform.d.ts +2 -2
- package/dist/mesh/transform.d.ts.map +1 -1
- package/dist/mesh/transform.js +3 -3
- package/dist/mesh/transform.js.map +1 -1
- package/dist/mesh/types.d.ts +2 -2
- package/dist/mesh/types.d.ts.map +1 -1
- package/dist/mesh/types.js.map +1 -1
- package/dist/node-host/cli.d.ts.map +1 -1
- package/dist/node-host/cli.js +53 -26
- package/dist/node-host/cli.js.map +1 -1
- package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
- package/dist/occt-kernel/occtKernel.js +4 -2
- package/dist/occt-kernel/occtKernel.js.map +1 -1
- package/dist/occt-kernel/topologyExt.d.ts.map +1 -1
- package/dist/occt-kernel/topologyExt.js +4 -1
- package/dist/occt-kernel/topologyExt.js.map +1 -1
- package/dist/runtime-state.d.ts +18 -0
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +23 -0
- package/dist/runtime-state.js.map +1 -1
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +1 -1
- package/dist/sdk.js.map +1 -1
- package/dist/tolerance.d.ts +38 -0
- package/dist/tolerance.d.ts.map +1 -0
- package/dist/tolerance.js +40 -0
- package/dist/tolerance.js.map +1 -0
- package/dist/topology/naming/score.js +3 -3
- package/dist/topology/naming/score.js.map +1 -1
- package/dist/units.d.ts +248 -0
- package/dist/units.d.ts.map +1 -0
- package/dist/units.js +397 -0
- package/dist/units.js.map +1 -0
- package/package.json +19 -2
package/dist/api/transform.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type { Shape } from '../mesh/types.js';
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function assertTranslateParams(params: Record<string, unknown>): void;
|
|
27
27
|
/**
|
|
28
|
-
* Validate rotate_euler parameters: `
|
|
28
|
+
* Validate rotate_euler parameters: `angles` must be a vec3, and `pivot`
|
|
29
29
|
* (if provided) must also be a vec3.
|
|
30
30
|
* @param params - the raw rotate_euler operation parameters.
|
|
31
31
|
*/
|
|
@@ -63,7 +63,7 @@ export declare const translate: ((input: Shape, params: Record<string, unknown>)
|
|
|
63
63
|
__faijs__dualOp?: import("../define-op.js").DualOpMeta;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
|
-
* 绕轴旋转几何体。
|
|
66
|
+
* 绕轴旋转几何体。angles 为欧拉角(度,XYZ 顺序)。
|
|
67
67
|
* @group 变换
|
|
68
68
|
* @inputs 1
|
|
69
69
|
* @async false
|
|
@@ -72,11 +72,11 @@ export declare const translate: ((input: Shape, params: Record<string, unknown>)
|
|
|
72
72
|
* @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。
|
|
73
73
|
* @returns Shape 旋转后的几何。
|
|
74
74
|
* @param input - 目标几何。type:Shape required:true
|
|
75
|
-
* @param params.
|
|
75
|
+
* @param params.angles - 欧拉角(度,XYZ 顺序)。type:[x,y,z] required:true
|
|
76
76
|
* @param params.pivot - 旋转中心。type:[x,y,z] 默认 原点
|
|
77
77
|
* @example
|
|
78
|
-
* const p2 = cad.rotate_euler(part0, {
|
|
79
|
-
* const p3 = cad.rotate_euler(part0, {
|
|
78
|
+
* const p2 = cad.rotate_euler(part0, { angles: [0, 0, 45] })
|
|
79
|
+
* const p3 = cad.rotate_euler(part0, { angles: [0, 0, 45], pivot: [0,0,0] })
|
|
80
80
|
*/
|
|
81
81
|
export declare const rotate_euler: ((input: Shape, params: Record<string, unknown>) => Promise<Shape>) & {
|
|
82
82
|
__faijs__dualOp?: import("../define-op.js").DualOpMeta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/api/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAQ,MAAM,eAAe,CAAA;AAqBhD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAKxE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQvE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQzE;AA0FD;;;;;;;;;;;;;IAaI;AACJ,eAAO,MAAM,SAAS;;
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/api/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAQ,MAAM,eAAe,CAAA;AAqBhD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAKxE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQvE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQzE;AA0FD;;;;;;;;;;;;;IAaI;AACJ,eAAO,MAAM,SAAS;;CAiBpB,CAAA;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY;;CAgBvB,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK;;CAkBhB,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO;;CAkBlB,CAAA"}
|
package/dist/api/transform.js
CHANGED
|
@@ -36,12 +36,12 @@ export function assertTranslateParams(params) {
|
|
|
36
36
|
assertVec3(params.offset, 'translate.offset');
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Validate rotate_euler parameters: `
|
|
39
|
+
* Validate rotate_euler parameters: `angles` must be a vec3, and `pivot`
|
|
40
40
|
* (if provided) must also be a vec3.
|
|
41
41
|
* @param params - the raw rotate_euler operation parameters.
|
|
42
42
|
*/
|
|
43
43
|
export function assertRotateParams(params) {
|
|
44
|
-
assertVec3(params.
|
|
44
|
+
assertVec3(params.angles, 'rotate_euler.angles');
|
|
45
45
|
if (params.pivot !== undefined && params.pivot !== null) {
|
|
46
46
|
assertVec3(params.pivot, 'rotate_euler.pivot');
|
|
47
47
|
}
|
|
@@ -136,7 +136,7 @@ function transformBrep(op, input, params) {
|
|
|
136
136
|
// rotate_euler(任意欧拉角+pivot)/ scale3d(非等比):内核无单次 WithHistory 可表达 →
|
|
137
137
|
// L1 rotate/scale + identity 面演化(既有语义,face-evolution.ordering.test.ts 钉住)。
|
|
138
138
|
if (op === 'rotate_euler') {
|
|
139
|
-
resultSolid = rotateBrep(kernel, inputSolid, params.
|
|
139
|
+
resultSolid = rotateBrep(kernel, inputSolid, params.angles, params.pivot);
|
|
140
140
|
}
|
|
141
141
|
else {
|
|
142
142
|
resultSolid = scaleBrep(kernel, inputSolid, params.factor, params.center);
|
|
@@ -187,10 +187,11 @@ export const translate = defineOp({
|
|
|
187
187
|
// D11: `translate(p, 10, 0, 0)` == `translate(p, { offset: [10, 0, 0] })`;
|
|
188
188
|
// `offset` is a vec3 slot sitting after the single leading Shape argument.
|
|
189
189
|
slotMap: { keys: ['offset'], vec3Keys: ['offset'], shapeArity: 1 },
|
|
190
|
+
paramDims: { offset: 'length' },
|
|
190
191
|
naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } },
|
|
191
192
|
});
|
|
192
193
|
/**
|
|
193
|
-
* 绕轴旋转几何体。
|
|
194
|
+
* 绕轴旋转几何体。angles 为欧拉角(度,XYZ 顺序)。
|
|
194
195
|
* @group 变换
|
|
195
196
|
* @inputs 1
|
|
196
197
|
* @async false
|
|
@@ -199,11 +200,11 @@ export const translate = defineOp({
|
|
|
199
200
|
* @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。
|
|
200
201
|
* @returns Shape 旋转后的几何。
|
|
201
202
|
* @param input - 目标几何。type:Shape required:true
|
|
202
|
-
* @param params.
|
|
203
|
+
* @param params.angles - 欧拉角(度,XYZ 顺序)。type:[x,y,z] required:true
|
|
203
204
|
* @param params.pivot - 旋转中心。type:[x,y,z] 默认 原点
|
|
204
205
|
* @example
|
|
205
|
-
* const p2 = cad.rotate_euler(part0, {
|
|
206
|
-
* const p3 = cad.rotate_euler(part0, {
|
|
206
|
+
* const p2 = cad.rotate_euler(part0, { angles: [0, 0, 45] })
|
|
207
|
+
* const p3 = cad.rotate_euler(part0, { angles: [0, 0, 45], pivot: [0,0,0] })
|
|
207
208
|
*/
|
|
208
209
|
export const rotate_euler = defineOp({
|
|
209
210
|
name: 'rotate_euler',
|
|
@@ -211,7 +212,7 @@ export const rotate_euler = defineOp({
|
|
|
211
212
|
if (!input)
|
|
212
213
|
throw new Error('[stdlib/rotate_euler] no input geometry');
|
|
213
214
|
assertRotateParams(params);
|
|
214
|
-
return cad.rotate_euler(input, params.
|
|
215
|
+
return cad.rotate_euler(input, params.angles, params.pivot);
|
|
215
216
|
},
|
|
216
217
|
brep: (input, params) => {
|
|
217
218
|
if (!input)
|
|
@@ -219,8 +220,9 @@ export const rotate_euler = defineOp({
|
|
|
219
220
|
assertRotateParams(params);
|
|
220
221
|
return transformBrep('rotate_euler', input, params);
|
|
221
222
|
},
|
|
222
|
-
// D11: `rotate_euler(p, 0, 0, 45)` == `rotate_euler(p, {
|
|
223
|
-
slotMap: { keys: ['
|
|
223
|
+
// D11: `rotate_euler(p, 0, 0, 45)` == `rotate_euler(p, { angles: [0, 0, 45] })`.
|
|
224
|
+
slotMap: { keys: ['angles'], vec3Keys: ['angles'], shapeArity: 1 },
|
|
225
|
+
paramDims: { angles: 'angle', pivot: 'length' },
|
|
224
226
|
naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } },
|
|
225
227
|
});
|
|
226
228
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/api/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE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AAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;QACjE,mBAAmB,CAAC,MAAM,CAAC,CAAA;QAC3B,OAAO,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IAChD,CAAC;IACD,kDAAkD;IAClD,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;IAC3C,wEAAwE;IACxE,iEAAiE;IACjE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;IAClE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,EAAgB;CAC3E,CAAC,CAAA","sourcesContent":["/**\n * stdlib transform — 变换对象库函数(translate/rotate_euler/scale/scale3d)\n *\n * 平台分层(narrowing plan Phase 5,D11 + 2026-09-28 D 批降级):\n * - `translate` / `scale`:**中立 op**(不再声明 `engines:['occt']`)。BREP 路径按引擎\n * 能力**静态定轨**(读与 dispatchPath 同源的能力集,非运行时探测):\n * - occt(声明 `translateWithHistory` / `scaleWithHistory`)→ 走 face-evolution.ts 的\n * `translateWithHashEvolution` / `scaleWithHashEvolution` 权威面演化(历史路径),\n * 产 hash 面映射并传播 roleTable;\n * - brepkit(未声明该二核函数,但裸 `kernel.translate` / `kernel.scale` 是真实现)→\n * L1 `translateBrep` / `scaleBrep`:几何精确,**另加 identityHashEvolution**。\n * 变换不改变面数/顺序,恒等映射真实成立(非伪造)——挂恒等面演化并传播 roleTable,\n * 选面/命名在降级路径不丢(区别于 boolean/chamfer 这种毁面重造、严禁伪造的情形)。\n * - `rotate_euler` / `scale3d`:**中立 op**——内核无单次 WithHistory 可表达\n * (任意欧拉+pivot / 非等比),走 `rotateBrep` / `scaleBrep` + identity 面演化\n * (只用 L1,跨引擎一致,不声明 engines)。\n *\n * dispatchPath 静态判定 brep/mesh,\n * BREP 路径用 brepOf(input) 取输入实体、fromBrep 登记输出实体。\n */\n\nimport type { Shape, Vec3 } from '../mesh/types'\nimport { cad } from '../mesh'\nimport { translateBrep, rotateBrep, scaleBrep, solidToShape } from '../brep/brep-ops'\nimport {\n identityEvolution,\n identityHashEvolution,\n scaleWithHashEvolution,\n translateWithHashEvolution,\n} from '../brep/face-evolution'\nimport type { HashEvolution } from '../brep/face-evolution'\nimport { getBrepApi } from '../brep/handle-bridge'\nimport { getBackends } from '../runtime-state'\nimport { engineCapabilitySet } from '../cad-runtime/backend-dispatch'\nimport { fromBrep, brepOf, inputRoleTable } from '../shape'\nimport { propagateAllOrigins } from '../topology/naming/roles'\nimport type { RoleTable } from '../topology/naming/types'\nimport type { Provenance } from '../topology/naming/lineage'\nimport { defineOp } from '../sdk'\nimport { assertVec3, assertPositiveNumber } from './assert'\nimport type { BrepHandle } from '../brep/engine/types'\n\n/**\n * Validate translate parameters: `offset` must be a vec3.\n * @param params - the raw translate operation parameters.\n */\nexport function assertTranslateParams(params: Record<string, unknown>): void {\n assertVec3(params.offset, 'translate.offset')\n}\n\n/**\n * Validate rotate_euler parameters: `anglesDeg` must be a vec3, and `pivot`\n * (if provided) must also be a vec3.\n * @param params - the raw rotate_euler operation parameters.\n */\nexport function assertRotateParams(params: Record<string, unknown>): void {\n assertVec3(params.anglesDeg, 'rotate_euler.anglesDeg')\n if (params.pivot !== undefined && params.pivot !== null) {\n assertVec3(params.pivot, 'rotate_euler.pivot')\n }\n}\n\n/**\n * Validate scale parameters (brepjs contract, §4.6 裁决 2): `factor` must be a\n * positive number (uniform). The non-uniform array form belongs to `scale3d` —\n * any `scale(p, { factor: [x,y,z] })` call throws an explicit `E_ARGS_FORM`\n * error pointing at `scale3d` (error hint ≠ compatibility).\n * @param params - the raw scale operation parameters.\n */\nexport function assertScaleParams(params: Record<string, unknown>): void {\n if (Array.isArray(params.factor)) {\n throw new Error(\n '[faijs/args] scale: E_ARGS_FORM: uniform scaling takes a single number ' +\n '(scale(p, s, { center? })). Non-uniform scaling uses scale3d(p, [x,y,z]).',\n )\n }\n assertPositiveNumber(params.factor, 'scale.factor')\n}\n\n/**\n * Validate scale3d parameters (P6: factor locked to Vec3): `factor` must be a\n * vec3. The uniform scalar form belongs to `scale` — any `scale3d(p, 2)` call\n * throws an explicit `E_ARGS_FORM` error pointing at `scale` (§4.6 裁决 2).\n * @param params - the raw scale3d operation parameters.\n */\nexport function assertScale3dParams(params: Record<string, unknown>): void {\n if (typeof params.factor === 'number') {\n throw new Error(\n '[faijs/args] scale3d: E_ARGS_FORM: factor must be a vec3 [x, y, z]. ' +\n 'Uniform scaling now uses scale(p, 2) (§4.6 裁决 2).',\n )\n }\n assertVec3(params.factor, 'scale3d.factor')\n}\n\n/**\n * BREP 路径:变换 solid + 面演化 + roleTable 传播 + 三角化 + fromBrep 登记。\n *\n * 静态双轨:\n * - 引擎声明 `translateWithHistory` / `scaleWithHistory`(occt)→ 权威历史路径\n * (`translateWithHashEvolution` / `scaleWithHashEvolution`),产内核给出的面映射 + roleTable。\n * - 引擎只声明裸方法(brepkit:裸 `translate`/`scale` 是真实现,但无 `*WithHistory`)→\n * L1 裸调用 + identityHashEvolution。变换是刚体变换、面数/顺序保持不变,恒等映射\n * **真实成立**(非伪造;由 brep/face-evolution.ordering.test.ts 钉住)——因此 brepkit\n * 降级路径保留恒等面演化与 roleTable 传播,选面/命名不因降级而丢失。\n * `rotate_euler` / `scale3d` 走 `rotateBrep` / `scaleBrep` + identity 面演化(既有语义,跨引擎中性)。\n * @param op - the transform operation name.\n * @param input - the input geometry.\n * @param params - the operation parameters.\n * @returns the transformed Shape.\n */\nfunction transformBrep(op: string, input: Shape, params: Record<string, unknown>): Shape {\n // L1 面:translateBrep/rotateBrep/scaleBrep/identityHashEvolution 只用 L1(D12)。\n const kernel = getBrepApi()\n const inputSolid = brepOf(input) as BrepHandle | undefined\n if (!inputSolid) throw new Error('[stdlib/transform] input is not BREP')\n\n // 静态双轨(无运行时 try-catch 回退——按引擎**声明**的能力集在执行前定轨):\n // - occt(声明 *WithHistory)→ 权威历史路径(产内核面映射 + roleTable)。\n // - brepkit(裸 translate/scale 是真实现,无 *WithHistory)→ L1 裸调用 + identityHashEvolution。\n // 变换不改变面数/顺序,恒等映射真实成立(非伪造),故仍挂恒等面演化与 roleTable 传播。\n const caps = engineCapabilitySet(getBackends().config.brepCapabilities)\n const hasTranslateHistory = caps.has('translateWithHistory')\n const hasScaleHistory = caps.has('scaleWithHistory')\n\n let resultSolid: BrepHandle\n // 面演化(hash 键):权威路径用内核映射,降级/中立路径用 identity 恒等映射。\n let historyEvolution: HashEvolution\n\n if (op === 'translate') {\n if (hasTranslateHistory) {\n // 权威映射:内核 translateWithHistory(1:1 全覆盖,实测见 evolution-bindings.test.ts)\n const r = translateWithHashEvolution(kernel, inputSolid, params.offset as Vec3)\n resultSolid = r.result\n historyEvolution = r.evolution\n } else {\n // brepkit 降级:L1 裸 translate(几何精确)+ identity(变换保面序,真实正确)。\n resultSolid = translateBrep(kernel, inputSolid, params.offset as Vec3)\n historyEvolution = identityHashEvolution(kernel, inputSolid, resultSolid)\n }\n } else if (op === 'scale') {\n if (hasScaleHistory) {\n // 权威映射:内核 scaleWithHistory(仅均匀 —— assertScaleParams 已保证 factor 是 number)\n const r = scaleWithHashEvolution(\n kernel,\n inputSolid,\n (params.center as Vec3 | undefined) ?? [0, 0, 0],\n params.factor as number,\n )\n resultSolid = r.result\n historyEvolution = r.evolution\n } else {\n // brepkit 降级:L1 裸 scale(几何精确)+ identity(变换保面序,真实正确)。\n const center = (params.center as Vec3 | undefined) ?? [0, 0, 0]\n resultSolid = scaleBrep(kernel, inputSolid, params.factor as number, center)\n historyEvolution = identityHashEvolution(kernel, inputSolid, resultSolid)\n }\n } else {\n // rotate_euler(任意欧拉角+pivot)/ scale3d(非等比):内核无单次 WithHistory 可表达 →\n // L1 rotate/scale + identity 面演化(既有语义,face-evolution.ordering.test.ts 钉住)。\n if (op === 'rotate_euler') {\n resultSolid = rotateBrep(kernel, inputSolid, params.anglesDeg as Vec3, params.pivot as Vec3 | undefined)\n } else {\n resultSolid = scaleBrep(kernel, inputSolid, params.factor as number | Vec3, params.center as Vec3 | undefined)\n }\n historyEvolution = identityHashEvolution(kernel, inputSolid, resultSolid)\n }\n\n // 变换面 1:1 保留——沿演化传播 roleTable(所有 origin),跨引擎一致(含 brepkit 降级路径)。\n const inputTable = inputRoleTable(input) as RoleTable | undefined\n let roleTable: RoleTable | undefined\n if (inputTable && inputTable.size > 0) {\n roleTable = propagateAllOrigins(inputTable, historyEvolution)\n }\n\n return fromBrep(solidToShape(kernel, resultSolid), {\n solid: resultSolid,\n // 变换维护拓扑,面 ordinal 不变 → 挂 identity 面演化(供显示/选面,跨引擎一致)。\n faceEvolution: identityEvolution(kernel, resultSolid),\n roleTable,\n })\n}\n\n/**\n * 平移几何体。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name translate\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 平移后的几何,装配的相对位置靠成员的变换语句表达。\n * @param input - 目标几何。type:Shape required:true\n * @param params.offset - 平移向量(mm)。type:[x,y,z] required:true\n * @example\n * const p1 = cad.translate(part0, { offset: [10, 0, 0] })\n */\nexport const translate = defineOp({\n name: 'translate',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/translate] no input geometry')\n assertTranslateParams(params)\n return cad.translate(input, params.offset as Vec3)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/translate] no input geometry')\n assertTranslateParams(params)\n return transformBrep('translate', input, params)\n },\n // D11: `translate(p, 10, 0, 0)` == `translate(p, { offset: [10, 0, 0] })`;\n // `offset` is a vec3 slot sitting after the single leading Shape argument.\n slotMap: { keys: ['offset'], vec3Keys: ['offset'], shapeArity: 1 },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n\n/**\n * 绕轴旋转几何体。anglesDeg 为欧拉角(度,XYZ 顺序)。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name rotate_euler\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 旋转后的几何。\n * @param input - 目标几何。type:Shape required:true\n * @param params.anglesDeg - 欧拉角(度,XYZ 顺序)。type:[x,y,z] required:true\n * @param params.pivot - 旋转中心。type:[x,y,z] 默认 原点\n * @example\n * const p2 = cad.rotate_euler(part0, { anglesDeg: [0, 0, 45] })\n * const p3 = cad.rotate_euler(part0, { anglesDeg: [0, 0, 45], pivot: [0,0,0] })\n */\nexport const rotate_euler = defineOp({\n name: 'rotate_euler',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/rotate_euler] no input geometry')\n assertRotateParams(params)\n return cad.rotate_euler(input, params.anglesDeg as Vec3, params.pivot as Vec3 | undefined)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/rotate_euler] no input geometry')\n assertRotateParams(params)\n return transformBrep('rotate_euler', input, params)\n },\n // D11: `rotate_euler(p, 0, 0, 45)` == `rotate_euler(p, { anglesDeg: [0, 0, 45] })`.\n slotMap: { keys: ['anglesDeg'], vec3Keys: ['anglesDeg'], shapeArity: 1 },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n\n/**\n * 等比缩放几何体(brepjs 契约,§4.6 裁决 2)。factor 只收 number;不动点默认\n * 原点(与 vendored `scale(shape, factor, { center? })` 一致),`center` 可选。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name scale\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 缩放后的几何。\n * @param input - 目标几何。type:Shape required:true\n * @param params.factor - 等比缩放系数(> 0)。type:number required:true\n * @param params.center - 缩放不动点(p 保持不动)。type:[x,y,z] 默认 [0,0,0](原点)\n * @example\n * const p4 = cad.scale(part0, 2)\n * const p5 = cad.scale(part0, { factor: 2, center: [10, 0, 0] })\n */\nexport const scale = defineOp({\n name: 'scale',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale] no input geometry')\n assertScaleParams(params)\n return cad.scale(input, params.factor as number, params.center as Vec3 | undefined)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale] no input geometry')\n assertScaleParams(params)\n return transformBrep('scale', input, params)\n },\n // L3 schema: factor/center for codegen/UI panels.\n schema: { factor: 'number', center: 'vec3?' },\n // D11(§4.6):`scale(p, 2)` == `scale(p, { factor: 2 })`(标量槽);尾参 options\n // ({center})经 dual-form-args 尾参合并并入。\n slotMap: { keys: ['factor'], shapeArity: 1 },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n\n/**\n * 非等比缩放几何体(faijs 语义,§1.4.4 裁决 2)。factor 定死 vec3 — 等比缩放请用\n * `scale(p, s)`,`scale3d(p, [x,y,z])` 才可非等比。`center` 为不动点(默认原点)。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name scale3d\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 缩放后的几何。\n * @param input - 目标几何。type:Shape required:true\n * @param params.factor - 三轴缩放系数(均 > 0)。type:[x,y,z] required:true\n * @param params.center - 缩放不动点。type:[x,y,z] 默认 [0,0,0](原点)\n * @example\n * const p4 = cad.scale3d(part0, { factor: [2, 1, 1] })\n * const p5 = cad.scale3d(part0, [2, 1, 1], { center: [10, 0, 0] })\n */\nexport const scale3d = defineOp({\n name: 'scale3d',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale3d] no input geometry')\n assertScale3dParams(params)\n return cad.scale3d(input, params.factor as Vec3, params.center as Vec3 | undefined)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale3d] no input geometry')\n assertScale3dParams(params)\n return transformBrep('scale3d', input, params)\n },\n // L3 schema: factor/center for codegen/UI panels.\n schema: { factor: 'vec3', center: 'vec3?' },\n // D11(裁决 2):`scale3d(p, [1,2,3])` == `scale3d(p, { factor: [1,2,3] })`;\n // 标量 factor(如 `scale(p, 2)`)由 assertScale3dParams 拒绝并提示 `scale`。\n slotMap: { keys: ['factor'], vec3Keys: ['factor'], shapeArity: 1 },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n"]}
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/api/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;G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AC3B,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAc,EAAE,MAAM,CAAC,MAA0B,CAAC,CAAA;IACrF,CAAC;IACD,IAAI,EAAE,CAAC,KAAY,EAAE,MAA+B,EAAE,EAAE;QACtD,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;QACjE,mBAAmB,CAAC,MAAM,CAAC,CAAA;QAC3B,OAAO,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IAChD,CAAC;IACD,kDAAkD;IAClD,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;IAC3C,wEAAwE;IACxE,iEAAiE;IACjE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;IAClE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,EAAgB;CAC3E,CAAC,CAAA","sourcesContent":["/**\n * stdlib transform — 变换对象库函数(translate/rotate_euler/scale/scale3d)\n *\n * 平台分层(narrowing plan Phase 5,D11 + 2026-09-28 D 批降级):\n * - `translate` / `scale`:**中立 op**(不再声明 `engines:['occt']`)。BREP 路径按引擎\n * 能力**静态定轨**(读与 dispatchPath 同源的能力集,非运行时探测):\n * - occt(声明 `translateWithHistory` / `scaleWithHistory`)→ 走 face-evolution.ts 的\n * `translateWithHashEvolution` / `scaleWithHashEvolution` 权威面演化(历史路径),\n * 产 hash 面映射并传播 roleTable;\n * - brepkit(未声明该二核函数,但裸 `kernel.translate` / `kernel.scale` 是真实现)→\n * L1 `translateBrep` / `scaleBrep`:几何精确,**另加 identityHashEvolution**。\n * 变换不改变面数/顺序,恒等映射真实成立(非伪造)——挂恒等面演化并传播 roleTable,\n * 选面/命名在降级路径不丢(区别于 boolean/chamfer 这种毁面重造、严禁伪造的情形)。\n * - `rotate_euler` / `scale3d`:**中立 op**——内核无单次 WithHistory 可表达\n * (任意欧拉+pivot / 非等比),走 `rotateBrep` / `scaleBrep` + identity 面演化\n * (只用 L1,跨引擎一致,不声明 engines)。\n *\n * dispatchPath 静态判定 brep/mesh,\n * BREP 路径用 brepOf(input) 取输入实体、fromBrep 登记输出实体。\n */\n\nimport type { Shape, Vec3 } from '../mesh/types'\nimport { cad } from '../mesh'\nimport { translateBrep, rotateBrep, scaleBrep, solidToShape } from '../brep/brep-ops'\nimport {\n identityEvolution,\n identityHashEvolution,\n scaleWithHashEvolution,\n translateWithHashEvolution,\n} from '../brep/face-evolution'\nimport type { HashEvolution } from '../brep/face-evolution'\nimport { getBrepApi } from '../brep/handle-bridge'\nimport { getBackends } from '../runtime-state'\nimport { engineCapabilitySet } from '../cad-runtime/backend-dispatch'\nimport { fromBrep, brepOf, inputRoleTable } from '../shape'\nimport { propagateAllOrigins } from '../topology/naming/roles'\nimport type { RoleTable } from '../topology/naming/types'\nimport type { Provenance } from '../topology/naming/lineage'\nimport { defineOp } from '../sdk'\nimport { assertVec3, assertPositiveNumber } from './assert'\nimport type { BrepHandle } from '../brep/engine/types'\n\n/**\n * Validate translate parameters: `offset` must be a vec3.\n * @param params - the raw translate operation parameters.\n */\nexport function assertTranslateParams(params: Record<string, unknown>): void {\n assertVec3(params.offset, 'translate.offset')\n}\n\n/**\n * Validate rotate_euler parameters: `angles` must be a vec3, and `pivot`\n * (if provided) must also be a vec3.\n * @param params - the raw rotate_euler operation parameters.\n */\nexport function assertRotateParams(params: Record<string, unknown>): void {\n assertVec3(params.angles, 'rotate_euler.angles')\n if (params.pivot !== undefined && params.pivot !== null) {\n assertVec3(params.pivot, 'rotate_euler.pivot')\n }\n}\n\n/**\n * Validate scale parameters (brepjs contract, §4.6 裁决 2): `factor` must be a\n * positive number (uniform). The non-uniform array form belongs to `scale3d` —\n * any `scale(p, { factor: [x,y,z] })` call throws an explicit `E_ARGS_FORM`\n * error pointing at `scale3d` (error hint ≠ compatibility).\n * @param params - the raw scale operation parameters.\n */\nexport function assertScaleParams(params: Record<string, unknown>): void {\n if (Array.isArray(params.factor)) {\n throw new Error(\n '[faijs/args] scale: E_ARGS_FORM: uniform scaling takes a single number ' +\n '(scale(p, s, { center? })). Non-uniform scaling uses scale3d(p, [x,y,z]).',\n )\n }\n assertPositiveNumber(params.factor, 'scale.factor')\n}\n\n/**\n * Validate scale3d parameters (P6: factor locked to Vec3): `factor` must be a\n * vec3. The uniform scalar form belongs to `scale` — any `scale3d(p, 2)` call\n * throws an explicit `E_ARGS_FORM` error pointing at `scale` (§4.6 裁决 2).\n * @param params - the raw scale3d operation parameters.\n */\nexport function assertScale3dParams(params: Record<string, unknown>): void {\n if (typeof params.factor === 'number') {\n throw new Error(\n '[faijs/args] scale3d: E_ARGS_FORM: factor must be a vec3 [x, y, z]. ' +\n 'Uniform scaling now uses scale(p, 2) (§4.6 裁决 2).',\n )\n }\n assertVec3(params.factor, 'scale3d.factor')\n}\n\n/**\n * BREP 路径:变换 solid + 面演化 + roleTable 传播 + 三角化 + fromBrep 登记。\n *\n * 静态双轨:\n * - 引擎声明 `translateWithHistory` / `scaleWithHistory`(occt)→ 权威历史路径\n * (`translateWithHashEvolution` / `scaleWithHashEvolution`),产内核给出的面映射 + roleTable。\n * - 引擎只声明裸方法(brepkit:裸 `translate`/`scale` 是真实现,但无 `*WithHistory`)→\n * L1 裸调用 + identityHashEvolution。变换是刚体变换、面数/顺序保持不变,恒等映射\n * **真实成立**(非伪造;由 brep/face-evolution.ordering.test.ts 钉住)——因此 brepkit\n * 降级路径保留恒等面演化与 roleTable 传播,选面/命名不因降级而丢失。\n * `rotate_euler` / `scale3d` 走 `rotateBrep` / `scaleBrep` + identity 面演化(既有语义,跨引擎中性)。\n * @param op - the transform operation name.\n * @param input - the input geometry.\n * @param params - the operation parameters.\n * @returns the transformed Shape.\n */\nfunction transformBrep(op: string, input: Shape, params: Record<string, unknown>): Shape {\n // L1 面:translateBrep/rotateBrep/scaleBrep/identityHashEvolution 只用 L1(D12)。\n const kernel = getBrepApi()\n const inputSolid = brepOf(input) as BrepHandle | undefined\n if (!inputSolid) throw new Error('[stdlib/transform] input is not BREP')\n\n // 静态双轨(无运行时 try-catch 回退——按引擎**声明**的能力集在执行前定轨):\n // - occt(声明 *WithHistory)→ 权威历史路径(产内核面映射 + roleTable)。\n // - brepkit(裸 translate/scale 是真实现,无 *WithHistory)→ L1 裸调用 + identityHashEvolution。\n // 变换不改变面数/顺序,恒等映射真实成立(非伪造),故仍挂恒等面演化与 roleTable 传播。\n const caps = engineCapabilitySet(getBackends().config.brepCapabilities)\n const hasTranslateHistory = caps.has('translateWithHistory')\n const hasScaleHistory = caps.has('scaleWithHistory')\n\n let resultSolid: BrepHandle\n // 面演化(hash 键):权威路径用内核映射,降级/中立路径用 identity 恒等映射。\n let historyEvolution: HashEvolution\n\n if (op === 'translate') {\n if (hasTranslateHistory) {\n // 权威映射:内核 translateWithHistory(1:1 全覆盖,实测见 evolution-bindings.test.ts)\n const r = translateWithHashEvolution(kernel, inputSolid, params.offset as Vec3)\n resultSolid = r.result\n historyEvolution = r.evolution\n } else {\n // brepkit 降级:L1 裸 translate(几何精确)+ identity(变换保面序,真实正确)。\n resultSolid = translateBrep(kernel, inputSolid, params.offset as Vec3)\n historyEvolution = identityHashEvolution(kernel, inputSolid, resultSolid)\n }\n } else if (op === 'scale') {\n if (hasScaleHistory) {\n // 权威映射:内核 scaleWithHistory(仅均匀 —— assertScaleParams 已保证 factor 是 number)\n const r = scaleWithHashEvolution(\n kernel,\n inputSolid,\n (params.center as Vec3 | undefined) ?? [0, 0, 0],\n params.factor as number,\n )\n resultSolid = r.result\n historyEvolution = r.evolution\n } else {\n // brepkit 降级:L1 裸 scale(几何精确)+ identity(变换保面序,真实正确)。\n const center = (params.center as Vec3 | undefined) ?? [0, 0, 0]\n resultSolid = scaleBrep(kernel, inputSolid, params.factor as number, center)\n historyEvolution = identityHashEvolution(kernel, inputSolid, resultSolid)\n }\n } else {\n // rotate_euler(任意欧拉角+pivot)/ scale3d(非等比):内核无单次 WithHistory 可表达 →\n // L1 rotate/scale + identity 面演化(既有语义,face-evolution.ordering.test.ts 钉住)。\n if (op === 'rotate_euler') {\n resultSolid = rotateBrep(kernel, inputSolid, params.angles as Vec3, params.pivot as Vec3 | undefined)\n } else {\n resultSolid = scaleBrep(kernel, inputSolid, params.factor as number | Vec3, params.center as Vec3 | undefined)\n }\n historyEvolution = identityHashEvolution(kernel, inputSolid, resultSolid)\n }\n\n // 变换面 1:1 保留——沿演化传播 roleTable(所有 origin),跨引擎一致(含 brepkit 降级路径)。\n const inputTable = inputRoleTable(input) as RoleTable | undefined\n let roleTable: RoleTable | undefined\n if (inputTable && inputTable.size > 0) {\n roleTable = propagateAllOrigins(inputTable, historyEvolution)\n }\n\n return fromBrep(solidToShape(kernel, resultSolid), {\n solid: resultSolid,\n // 变换维护拓扑,面 ordinal 不变 → 挂 identity 面演化(供显示/选面,跨引擎一致)。\n faceEvolution: identityEvolution(kernel, resultSolid),\n roleTable,\n })\n}\n\n/**\n * 平移几何体。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name translate\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 平移后的几何,装配的相对位置靠成员的变换语句表达。\n * @param input - 目标几何。type:Shape required:true\n * @param params.offset - 平移向量(mm)。type:[x,y,z] required:true\n * @example\n * const p1 = cad.translate(part0, { offset: [10, 0, 0] })\n */\nexport const translate = defineOp({\n name: 'translate',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/translate] no input geometry')\n assertTranslateParams(params)\n return cad.translate(input, params.offset as Vec3)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/translate] no input geometry')\n assertTranslateParams(params)\n return transformBrep('translate', input, params)\n },\n // D11: `translate(p, 10, 0, 0)` == `translate(p, { offset: [10, 0, 0] })`;\n // `offset` is a vec3 slot sitting after the single leading Shape argument.\n slotMap: { keys: ['offset'], vec3Keys: ['offset'], shapeArity: 1 },\n paramDims: { offset: 'length' },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n\n/**\n * 绕轴旋转几何体。angles 为欧拉角(度,XYZ 顺序)。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name rotate_euler\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 旋转后的几何。\n * @param input - 目标几何。type:Shape required:true\n * @param params.angles - 欧拉角(度,XYZ 顺序)。type:[x,y,z] required:true\n * @param params.pivot - 旋转中心。type:[x,y,z] 默认 原点\n * @example\n * const p2 = cad.rotate_euler(part0, { angles: [0, 0, 45] })\n * const p3 = cad.rotate_euler(part0, { angles: [0, 0, 45], pivot: [0,0,0] })\n */\nexport const rotate_euler = defineOp({\n name: 'rotate_euler',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/rotate_euler] no input geometry')\n assertRotateParams(params)\n return cad.rotate_euler(input, params.angles as Vec3, params.pivot as Vec3 | undefined)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/rotate_euler] no input geometry')\n assertRotateParams(params)\n return transformBrep('rotate_euler', input, params)\n },\n // D11: `rotate_euler(p, 0, 0, 45)` == `rotate_euler(p, { angles: [0, 0, 45] })`.\n slotMap: { keys: ['angles'], vec3Keys: ['angles'], shapeArity: 1 },\n paramDims: { angles: 'angle', pivot: 'length' },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n\n/**\n * 等比缩放几何体(brepjs 契约,§4.6 裁决 2)。factor 只收 number;不动点默认\n * 原点(与 vendored `scale(shape, factor, { center? })` 一致),`center` 可选。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name scale\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 缩放后的几何。\n * @param input - 目标几何。type:Shape required:true\n * @param params.factor - 等比缩放系数(> 0)。type:number required:true\n * @param params.center - 缩放不动点(p 保持不动)。type:[x,y,z] 默认 [0,0,0](原点)\n * @example\n * const p4 = cad.scale(part0, 2)\n * const p5 = cad.scale(part0, { factor: 2, center: [10, 0, 0] })\n */\nexport const scale = defineOp({\n name: 'scale',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale] no input geometry')\n assertScaleParams(params)\n return cad.scale(input, params.factor as number, params.center as Vec3 | undefined)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale] no input geometry')\n assertScaleParams(params)\n return transformBrep('scale', input, params)\n },\n // L3 schema: factor/center for codegen/UI panels.\n schema: { factor: 'number', center: 'vec3?' },\n // D11(§4.6):`scale(p, 2)` == `scale(p, { factor: 2 })`(标量槽);尾参 options\n // ({center})经 dual-form-args 尾参合并并入。\n slotMap: { keys: ['factor'], shapeArity: 1 },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n\n/**\n * 非等比缩放几何体(faijs 语义,§1.4.4 裁决 2)。factor 定死 vec3 — 等比缩放请用\n * `scale(p, s)`,`scale3d(p, [x,y,z])` 才可非等比。`center` 为不动点(默认原点)。\n * @group 变换\n * @inputs 1\n * @async false\n * @qual ok\n * @name scale3d\n * @deprecated **`../3d_editor` 消费面**(原 `@deprecated` 措辞已于 2026-09-22 校正):该 op 为编辑器应用提供(承载拖拽与时间线语句),不属 faijs 平台面,但**不是废弃项**——它服务真实负载。**变更其 API 形态必须同步更新 `../3d_editor`**(见 `docs/plans/2026-09-22-topology-identity-development-plan.md` §2)。faijs 平台面不提供等价 op(需要时须按平台需求另行设计,不得直接搬用本 op)。\n * @returns Shape 缩放后的几何。\n * @param input - 目标几何。type:Shape required:true\n * @param params.factor - 三轴缩放系数(均 > 0)。type:[x,y,z] required:true\n * @param params.center - 缩放不动点。type:[x,y,z] 默认 [0,0,0](原点)\n * @example\n * const p4 = cad.scale3d(part0, { factor: [2, 1, 1] })\n * const p5 = cad.scale3d(part0, [2, 1, 1], { center: [10, 0, 0] })\n */\nexport const scale3d = defineOp({\n name: 'scale3d',\n mesh: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale3d] no input geometry')\n assertScale3dParams(params)\n return cad.scale3d(input, params.factor as Vec3, params.center as Vec3 | undefined)\n },\n brep: (input: Shape, params: Record<string, unknown>) => {\n if (!input) throw new Error('[stdlib/scale3d] no input geometry')\n assertScale3dParams(params)\n return transformBrep('scale3d', input, params)\n },\n // L3 schema: factor/center for codegen/UI panels.\n schema: { factor: 'vec3', center: 'vec3?' },\n // D11(裁决 2):`scale3d(p, [1,2,3])` == `scale3d(p, { factor: [1,2,3] })`;\n // 标量 factor(如 `scale(p, 2)`)由 assertScale3dParams 拒绝并提示 `scale`。\n slotMap: { keys: ['factor'], vec3Keys: ['factor'], shapeArity: 1 },\n naming: { kind: 'kernel', newFaces: { via: 'byAdjacency' } } as Provenance,\n})\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XML DOM access, env-agnostic.
|
|
3
|
+
*
|
|
4
|
+
* Browsers (and workers) ship native DOMParser/XMLSerializer; only headless
|
|
5
|
+
* node (unit tests, CLI, scripts) lacks them. `@xmldom/xmldom` is therefore
|
|
6
|
+
* loaded lazily via dynamic import so it never enters the browser bundle —
|
|
7
|
+
* a static `import { DOMParser } from '@xmldom/xmldom'` here would surface
|
|
8
|
+
* the CJS module in Vite-served browser graphs and break on ESM named-export
|
|
9
|
+
* resolution.
|
|
10
|
+
*
|
|
11
|
+
* Note the behavioral difference at the error boundary: native DOMParser
|
|
12
|
+
* reports malformed XML via a <parsererror> document, xmldom throws. Callers
|
|
13
|
+
* must treat "no usable content" as the failure signal, not the throw.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Parse an XML string into a DOM Document (native in the browser, xmldom on node).
|
|
17
|
+
* @param xml - the XML source text to parse.
|
|
18
|
+
* @returns the parsed DOM Document.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseXmlDocument(xml: string): Promise<Document>;
|
|
21
|
+
/**
|
|
22
|
+
* Serialize a DOM node back to an XML string (native in the browser, xmldom on node).
|
|
23
|
+
* @param el - the DOM element to serialize.
|
|
24
|
+
* @returns the XML markup string for the element.
|
|
25
|
+
*/
|
|
26
|
+
export declare function serializeXmlNode(el: Element): Promise<string>;
|
|
27
|
+
//# sourceMappingURL=xml-dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-dom.d.ts","sourceRoot":"","sources":["../../src/api/xml-dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQrE;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAUnE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XML DOM access, env-agnostic.
|
|
3
|
+
*
|
|
4
|
+
* Browsers (and workers) ship native DOMParser/XMLSerializer; only headless
|
|
5
|
+
* node (unit tests, CLI, scripts) lacks them. `@xmldom/xmldom` is therefore
|
|
6
|
+
* loaded lazily via dynamic import so it never enters the browser bundle —
|
|
7
|
+
* a static `import { DOMParser } from '@xmldom/xmldom'` here would surface
|
|
8
|
+
* the CJS module in Vite-served browser graphs and break on ESM named-export
|
|
9
|
+
* resolution.
|
|
10
|
+
*
|
|
11
|
+
* Note the behavioral difference at the error boundary: native DOMParser
|
|
12
|
+
* reports malformed XML via a <parsererror> document, xmldom throws. Callers
|
|
13
|
+
* must treat "no usable content" as the failure signal, not the throw.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Parse an XML string into a DOM Document (native in the browser, xmldom on node).
|
|
17
|
+
* @param xml - the XML source text to parse.
|
|
18
|
+
* @returns the parsed DOM Document.
|
|
19
|
+
*/
|
|
20
|
+
export async function parseXmlDocument(xml) {
|
|
21
|
+
const Native = globalThis.DOMParser;
|
|
22
|
+
if (Native) {
|
|
23
|
+
return new Native().parseFromString(xml, 'application/xml');
|
|
24
|
+
}
|
|
25
|
+
const { DOMParser } = await import('@xmldom/xmldom');
|
|
26
|
+
// xmldom's Document type conflicts with lib.dom; cast across the boundary.
|
|
27
|
+
return new DOMParser().parseFromString(xml, 'application/xml');
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Serialize a DOM node back to an XML string (native in the browser, xmldom on node).
|
|
31
|
+
* @param el - the DOM element to serialize.
|
|
32
|
+
* @returns the XML markup string for the element.
|
|
33
|
+
*/
|
|
34
|
+
export async function serializeXmlNode(el) {
|
|
35
|
+
const Native = globalThis.XMLSerializer;
|
|
36
|
+
if (Native) {
|
|
37
|
+
return new Native().serializeToString(el);
|
|
38
|
+
}
|
|
39
|
+
const { XMLSerializer } = await import('@xmldom/xmldom');
|
|
40
|
+
// xmldom's own Node/Element types conflict with lib.dom (its .d.ts resolves
|
|
41
|
+
// `Node` to the global in DOM-lib projects), so type the call structurally.
|
|
42
|
+
const ser = new XMLSerializer();
|
|
43
|
+
return ser.serializeToString(el);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=xml-dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xml-dom.js","sourceRoot":"","sources":["../../src/api/xml-dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW;IAChD,MAAM,MAAM,GAAI,UAA8C,CAAC,SAAS,CAAA;IACxE,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,IAAI,MAAM,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;IAC7D,CAAC;IACD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACpD,2EAA2E;IAC3E,OAAO,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAwB,CAAA;AACvF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAW;IAChD,MAAM,MAAM,GAAI,UAAsD,CAAC,aAAa,CAAA;IACpF,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,IAAI,MAAM,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;IAC3C,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACxD,4EAA4E;IAC5E,4EAA4E;IAC5E,MAAM,GAAG,GAAG,IAAI,aAAa,EAAkD,CAAA;IAC/E,OAAO,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;AAClC,CAAC","sourcesContent":["/**\n * XML DOM access, env-agnostic.\n *\n * Browsers (and workers) ship native DOMParser/XMLSerializer; only headless\n * node (unit tests, CLI, scripts) lacks them. `@xmldom/xmldom` is therefore\n * loaded lazily via dynamic import so it never enters the browser bundle —\n * a static `import { DOMParser } from '@xmldom/xmldom'` here would surface\n * the CJS module in Vite-served browser graphs and break on ESM named-export\n * resolution.\n *\n * Note the behavioral difference at the error boundary: native DOMParser\n * reports malformed XML via a <parsererror> document, xmldom throws. Callers\n * must treat \"no usable content\" as the failure signal, not the throw.\n */\n\n// Referenced through globalThis so the dynamic import's xmldom type names\n// cannot shadow the lib.dom globals inside this module.\ntype NativeDomParser = typeof globalThis.DOMParser\ntype NativeXmlSerializer = typeof globalThis.XMLSerializer\n\n/**\n * Parse an XML string into a DOM Document (native in the browser, xmldom on node).\n * @param xml - the XML source text to parse.\n * @returns the parsed DOM Document.\n */\nexport async function parseXmlDocument(xml: string): Promise<Document> {\n const Native = (globalThis as { DOMParser?: NativeDomParser }).DOMParser\n if (Native) {\n return new Native().parseFromString(xml, 'application/xml')\n }\n const { DOMParser } = await import('@xmldom/xmldom')\n // xmldom's Document type conflicts with lib.dom; cast across the boundary.\n return new DOMParser().parseFromString(xml, 'application/xml') as unknown as Document\n}\n\n/**\n * Serialize a DOM node back to an XML string (native in the browser, xmldom on node).\n * @param el - the DOM element to serialize.\n * @returns the XML markup string for the element.\n */\nexport async function serializeXmlNode(el: Element): Promise<string> {\n const Native = (globalThis as { XMLSerializer?: NativeXmlSerializer }).XMLSerializer\n if (Native) {\n return new Native().serializeToString(el)\n }\n const { XMLSerializer } = await import('@xmldom/xmldom')\n // xmldom's own Node/Element types conflict with lib.dom (its .d.ts resolves\n // `Node` to the global in DOM-lib projects), so type the call structurally.\n const ser = new XMLSerializer() as { serializeToString(node: unknown): string }\n return ser.serializeToString(el)\n}\n"]}
|
|
@@ -39,14 +39,14 @@ export declare function computeSplit(mesh: ManifoldMeshData, normal: [number, nu
|
|
|
39
39
|
* Split a mesh by a plane and cut a dovetail groove via the current backend.
|
|
40
40
|
* @param mesh The mesh to split.
|
|
41
41
|
* @param planeNormal The cutting plane normal (unit vector).
|
|
42
|
-
* @param
|
|
42
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
43
43
|
* @param planeCenter A point on the cutting plane.
|
|
44
44
|
* @param widthDir The width direction within the cutting plane (unit vector).
|
|
45
45
|
* @param bboxWidthOnWidthDir The model bounding-box width along the width direction.
|
|
46
46
|
* @param groove The dovetail groove parameters.
|
|
47
47
|
* @returns The front/back halves plus the wedge mesh (or null when no wedge).
|
|
48
48
|
*/
|
|
49
|
-
export declare function computeDovetailSplit(mesh: ManifoldMeshData, planeNormal: [number, number, number],
|
|
49
|
+
export declare function computeDovetailSplit(mesh: ManifoldMeshData, planeNormal: [number, number, number], planeDistance: number, planeCenter: [number, number, number], widthDir: [number, number, number], bboxWidthOnWidthDir: number, groove: DovetailGrooveParams): Promise<{
|
|
50
50
|
front: ManifoldMeshData;
|
|
51
51
|
back: ManifoldMeshData;
|
|
52
52
|
wedge: ManifoldMeshData | null;
|
|
@@ -55,14 +55,14 @@ export declare function computeDovetailSplit(mesh: ManifoldMeshData, planeNormal
|
|
|
55
55
|
* Split a mesh by a plane and cut dowel tenons via the current backend.
|
|
56
56
|
* @param mesh The mesh to split.
|
|
57
57
|
* @param planeNormal The cutting plane normal (unit vector).
|
|
58
|
-
* @param
|
|
58
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
59
59
|
* @param planeCenter A point on the cutting plane.
|
|
60
60
|
* @param widthDir The width direction within the cutting plane (unit vector).
|
|
61
61
|
* @param dowel The dowel split parameters.
|
|
62
62
|
* @param selectedSections Optional list of section indices to place tenons on.
|
|
63
63
|
* @returns The front/back halves plus the wedge mesh (or null when no wedge).
|
|
64
64
|
*/
|
|
65
|
-
export declare function computeDowelSplit(mesh: ManifoldMeshData, planeNormal: [number, number, number],
|
|
65
|
+
export declare function computeDowelSplit(mesh: ManifoldMeshData, planeNormal: [number, number, number], planeDistance: number, planeCenter: [number, number, number], widthDir: [number, number, number], dowel: DowelSplitParams, selectedSections?: number[] | null): Promise<{
|
|
66
66
|
front: ManifoldMeshData;
|
|
67
67
|
back: ManifoldMeshData;
|
|
68
68
|
wedge: ManifoldMeshData | null;
|
|
@@ -71,14 +71,14 @@ export declare function computeDowelSplit(mesh: ManifoldMeshData, planeNormal: [
|
|
|
71
71
|
* Split a mesh by a plane and cut straight tenons via the current backend.
|
|
72
72
|
* @param mesh The mesh to split.
|
|
73
73
|
* @param planeNormal The cutting plane normal (unit vector).
|
|
74
|
-
* @param
|
|
74
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
75
75
|
* @param planeCenter A point on the cutting plane.
|
|
76
76
|
* @param widthDir The width direction within the cutting plane (unit vector).
|
|
77
77
|
* @param tenon The straight-tenon split parameters.
|
|
78
78
|
* @param selectedSections Optional list of section indices to place tenons on.
|
|
79
79
|
* @returns The front/back halves plus the wedge mesh (or null when no wedge).
|
|
80
80
|
*/
|
|
81
|
-
export declare function computeStraightTenonSplit(mesh: ManifoldMeshData, planeNormal: [number, number, number],
|
|
81
|
+
export declare function computeStraightTenonSplit(mesh: ManifoldMeshData, planeNormal: [number, number, number], planeDistance: number, planeCenter: [number, number, number], widthDir: [number, number, number], tenon: StraightTenonSplitParams, selectedSections?: number[] | null): Promise<{
|
|
82
82
|
front: ManifoldMeshData;
|
|
83
83
|
back: ManifoldMeshData;
|
|
84
84
|
wedge: ManifoldMeshData | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csg-backend.d.ts","sourceRoot":"","sources":["../../src/boolean/csg-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,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AyB,CAC7C,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACrC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACrC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAClC,KAAK,EAAE,wBAAwB,EAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,GACjC,OAAO,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAAE,CAAC,CAW9F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AAID,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAIpE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAA"}
|
|
@@ -58,18 +58,18 @@ export async function computeSplit(mesh, normal, offset) {
|
|
|
58
58
|
* Split a mesh by a plane and cut a dovetail groove via the current backend.
|
|
59
59
|
* @param mesh The mesh to split.
|
|
60
60
|
* @param planeNormal The cutting plane normal (unit vector).
|
|
61
|
-
* @param
|
|
61
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
62
62
|
* @param planeCenter A point on the cutting plane.
|
|
63
63
|
* @param widthDir The width direction within the cutting plane (unit vector).
|
|
64
64
|
* @param bboxWidthOnWidthDir The model bounding-box width along the width direction.
|
|
65
65
|
* @param groove The dovetail groove parameters.
|
|
66
66
|
* @returns The front/back halves plus the wedge mesh (or null when no wedge).
|
|
67
67
|
*/
|
|
68
|
-
export async function computeDovetailSplit(mesh, planeNormal,
|
|
68
|
+
export async function computeDovetailSplit(mesh, planeNormal, planeDistance, planeCenter, widthDir, bboxWidthOnWidthDir, groove) {
|
|
69
69
|
const backend = await getBackend();
|
|
70
70
|
const result = await backend.splitDovetail(mesh, {
|
|
71
71
|
planeNormal,
|
|
72
|
-
|
|
72
|
+
planeDistance,
|
|
73
73
|
planeCenter,
|
|
74
74
|
widthDir,
|
|
75
75
|
bboxWidthOnWidthDir,
|
|
@@ -81,18 +81,18 @@ export async function computeDovetailSplit(mesh, planeNormal, planeOriginOffset,
|
|
|
81
81
|
* Split a mesh by a plane and cut dowel tenons via the current backend.
|
|
82
82
|
* @param mesh The mesh to split.
|
|
83
83
|
* @param planeNormal The cutting plane normal (unit vector).
|
|
84
|
-
* @param
|
|
84
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
85
85
|
* @param planeCenter A point on the cutting plane.
|
|
86
86
|
* @param widthDir The width direction within the cutting plane (unit vector).
|
|
87
87
|
* @param dowel The dowel split parameters.
|
|
88
88
|
* @param selectedSections Optional list of section indices to place tenons on.
|
|
89
89
|
* @returns The front/back halves plus the wedge mesh (or null when no wedge).
|
|
90
90
|
*/
|
|
91
|
-
export async function computeDowelSplit(mesh, planeNormal,
|
|
91
|
+
export async function computeDowelSplit(mesh, planeNormal, planeDistance, planeCenter, widthDir, dowel, selectedSections) {
|
|
92
92
|
const backend = await getBackend();
|
|
93
93
|
const result = await backend.splitDowel(mesh, {
|
|
94
94
|
planeNormal,
|
|
95
|
-
|
|
95
|
+
planeDistance,
|
|
96
96
|
planeCenter,
|
|
97
97
|
widthDir,
|
|
98
98
|
dowel,
|
|
@@ -104,18 +104,18 @@ export async function computeDowelSplit(mesh, planeNormal, planeOriginOffset, pl
|
|
|
104
104
|
* Split a mesh by a plane and cut straight tenons via the current backend.
|
|
105
105
|
* @param mesh The mesh to split.
|
|
106
106
|
* @param planeNormal The cutting plane normal (unit vector).
|
|
107
|
-
* @param
|
|
107
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
108
108
|
* @param planeCenter A point on the cutting plane.
|
|
109
109
|
* @param widthDir The width direction within the cutting plane (unit vector).
|
|
110
110
|
* @param tenon The straight-tenon split parameters.
|
|
111
111
|
* @param selectedSections Optional list of section indices to place tenons on.
|
|
112
112
|
* @returns The front/back halves plus the wedge mesh (or null when no wedge).
|
|
113
113
|
*/
|
|
114
|
-
export async function computeStraightTenonSplit(mesh, planeNormal,
|
|
114
|
+
export async function computeStraightTenonSplit(mesh, planeNormal, planeDistance, planeCenter, widthDir, tenon, selectedSections) {
|
|
115
115
|
const backend = await getBackend();
|
|
116
116
|
const result = await backend.splitStraightTenon(mesh, {
|
|
117
117
|
planeNormal,
|
|
118
|
-
|
|
118
|
+
planeDistance,
|
|
119
119
|
planeCenter,
|
|
120
120
|
widthDir,
|
|
121
121
|
tenon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csg-backend.js","sourceRoot":"","sources":["../../src/boolean/csg-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,eAAe;AAEf,IAAI,QAAQ,GAAsB,IAAI,CAAA;AAEtC;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAmB;IAC/C,QAAQ,GAAG,OAAO,CAAA;AACpB,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,UAAU;IACvB,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,yBAAyB;IACzB,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAA;IAC/E,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAA;IACjC,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,iCAAiC;AAEjC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA0B,EAC1B,SAA2B;IAE3B,MAAM,OAAO,GAAG,MAAM,UAAU,EAAE,CAAA;IAClC,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;GAMG;AACH,M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AK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAA;AACxE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,IAAsB,EACtB,WAAqC,EACrC,aAAqB,EACrB,WAAqC,EACrC,QAAkC,EAClC,KAA+B,EAC/B,gBAAkC;IAElC,MAAM,OAAO,GAAG,MAAM,UAAU,EAAE,CAAA;IAClC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE;QACpD,WAAW;QACX,aAAa;QACb,WAAW;QACX,QAAQ;QACR,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAA;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAA;AACxE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,8CAA8C;IAC9C,8DAA8D;AAChE,CAAC;AAED,6BAA6B;AAE7B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA","sourcesContent":["/**\n * csg-backend — 可注入的 CSG 后端\n *\n * 提供 computeBoolean / computeSplit / computeDovetailSplit / computeDowelSplit / computeStraightTenonSplit\n * 等异步函数,与 csg.ts 的 API 一致。\n *\n * Node 环境:默认使用 InlineCsgBackend(主线程直跑 manifold-3d)。\n * 浏览器环境:通过 setCsgBackend() 注入 WorkerCsgBackend。\n *\n * F1 修复:不静态 import browser-host/inline-csg-backend(L1 不依赖 L3)。\n * 改为延迟动态 import,仅在未注入后端时按需加载。\n */\n\nimport type { CsgBackend } from '../cad-runtime/ports'\nimport type {\n ManifoldMeshData,\n BooleanOperation,\n DovetailGrooveParams,\n DowelSplitParams,\n StraightTenonSplitParams,\n} from './geo-convert'\n\n// ── 后端实例管理 ──\n\nlet _backend: CsgBackend | null = null\n\n/**\n * Inject the CSG backend used by the browser host (e.g. WorkerCsgBackend).\n * @param backend The backend instance to install as the current CSG backend.\n */\nexport function setCsgBackend(backend: CsgBackend): void {\n _backend = backend\n}\n\n/**\n * 获取当前 CSG 后端。\n * F1 修复:延迟动态 import InlineCsgBackend,避免 L1 静态依赖 L3。\n */\nasync function getBackend(): Promise<CsgBackend> {\n if (_backend) return _backend\n // 延迟加载——仅在实际需要时才拉入 L3 代码\n const { InlineCsgBackend } = await import('../browser-host/inline-csg-backend')\n _backend = new InlineCsgBackend()\n return _backend\n}\n\n// ── CSG 操作 API(与 csg.ts 签名一致)──\n\n/**\n * Apply a boolean operation across several meshes via the current backend.\n * @param meshes The input meshes to combine.\n * @param operation The boolean operation to perform (union/subtract/intersect).\n * @returns The resulting mesh of the boolean operation.\n */\nexport async function computeBoolean(\n meshes: ManifoldMeshData[],\n operation: BooleanOperation,\n): Promise<ManifoldMeshData> {\n const backend = await getBackend()\n return backend.boolean(operation, meshes)\n}\n\n/**\n * Split a mesh by a plane via the current backend.\n * @param mesh The mesh to split.\n * @param normal The plane normal (unit vector).\n * @param offset The plane offset along the normal.\n * @returns The front and back halves of the split.\n */\nexport async function computeSplit(\n mesh: ManifoldMeshData,\n normal: [number, number, number],\n offset: number,\n): Promise<{ front: ManifoldMeshData; back: ManifoldMeshData }> {\n const backend = await getBackend()\n const result = await backend.splitPlane(mesh, { normal, offset })\n return { front: result.front, back: result.back }\n}\n\n/**\n * Split a mesh by a plane and cut a dovetail groove via the current backend.\n * @param mesh The mesh to split.\n * @param planeNormal The cutting plane normal (unit vector).\n * @param planeDistance The cutting plane offset along the normal.\n * @param planeCenter A point on the cutting plane.\n * @param widthDir The width direction within the cutting plane (unit vector).\n * @param bboxWidthOnWidthDir The model bounding-box width along the width direction.\n * @param groove The dovetail groove parameters.\n * @returns The front/back halves plus the wedge mesh (or null when no wedge).\n */\nexport async function computeDovetailSplit(\n mesh: ManifoldMeshData,\n planeNormal: [number, number, number],\n planeDistance: number,\n planeCenter: [number, number, number],\n widthDir: [number, number, number],\n bboxWidthOnWidthDir: number,\n groove: DovetailGrooveParams,\n): Promise<{ front: ManifoldMeshData; back: ManifoldMeshData; wedge: ManifoldMeshData | null }> {\n const backend = await getBackend()\n const result = await backend.splitDovetail(mesh, {\n planeNormal,\n planeDistance,\n planeCenter,\n widthDir,\n bboxWidthOnWidthDir,\n groove,\n })\n return { front: result.front, back: result.back, wedge: result.wedge }\n}\n\n/**\n * Split a mesh by a plane and cut dowel tenons via the current backend.\n * @param mesh The mesh to split.\n * @param planeNormal The cutting plane normal (unit vector).\n * @param planeDistance The cutting plane offset along the normal.\n * @param planeCenter A point on the cutting plane.\n * @param widthDir The width direction within the cutting plane (unit vector).\n * @param dowel The dowel split parameters.\n * @param selectedSections Optional list of section indices to place tenons on.\n * @returns The front/back halves plus the wedge mesh (or null when no wedge).\n */\nexport async function computeDowelSplit(\n mesh: ManifoldMeshData,\n planeNormal: [number, number, number],\n planeDistance: number,\n planeCenter: [number, number, number],\n widthDir: [number, number, number],\n dowel: DowelSplitParams,\n selectedSections?: number[] | null,\n): Promise<{ front: ManifoldMeshData; back: ManifoldMeshData; wedge: ManifoldMeshData | null }> {\n const backend = await getBackend()\n const result = await backend.splitDowel(mesh, {\n planeNormal,\n planeDistance,\n planeCenter,\n widthDir,\n dowel,\n selectedSections,\n })\n return { front: result.front, back: result.back, wedge: result.wedge }\n}\n\n/**\n * Split a mesh by a plane and cut straight tenons via the current backend.\n * @param mesh The mesh to split.\n * @param planeNormal The cutting plane normal (unit vector).\n * @param planeDistance The cutting plane offset along the normal.\n * @param planeCenter A point on the cutting plane.\n * @param widthDir The width direction within the cutting plane (unit vector).\n * @param tenon The straight-tenon split parameters.\n * @param selectedSections Optional list of section indices to place tenons on.\n * @returns The front/back halves plus the wedge mesh (or null when no wedge).\n */\nexport async function computeStraightTenonSplit(\n mesh: ManifoldMeshData,\n planeNormal: [number, number, number],\n planeDistance: number,\n planeCenter: [number, number, number],\n widthDir: [number, number, number],\n tenon: StraightTenonSplitParams,\n selectedSections?: number[] | null,\n): Promise<{ front: ManifoldMeshData; back: ManifoldMeshData; wedge: ManifoldMeshData | null }> {\n const backend = await getBackend()\n const result = await backend.splitStraightTenon(mesh, {\n planeNormal,\n planeDistance,\n planeCenter,\n widthDir,\n tenon,\n selectedSections,\n })\n return { front: result.front, back: result.back, wedge: result.wedge }\n}\n\n/**\n * Terminate the worker held by the backend, if any.\n * The InlineCsgBackend owns no worker to terminate; the WorkerCsgBackend\n * termination logic is managed by the browser host.\n */\nexport function terminateWorker(): void {\n // InlineCsgBackend has no worker to terminate\n // WorkerCsgBackend termination is managed by the browser host\n}\n\n// ── 纯函数重导出(从 geo-convert)──\n\nexport { geoToManifoldMesh, manifoldMeshToGeo } from './geo-convert'\n\n// ── 类型重导出 ──\n\nexport type {\n ManifoldMeshData,\n BooleanOperation,\n DovetailGrooveParams,\n DowelSplitParams,\n StraightTenonSplitParams,\n} from './geo-convert'\n"]}
|
|
@@ -95,38 +95,38 @@ export declare function createWedge(Manifold: ManifoldCtor, Mesh: MeshCtor, plan
|
|
|
95
95
|
* Returns an array of components, each being a Set of vertex indices.
|
|
96
96
|
* @param upper The upper mesh to scan for cap faces.
|
|
97
97
|
* @param normal The cutting plane normal.
|
|
98
|
-
* @param
|
|
98
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
99
99
|
* @returns An array of components, each a Set of vertex indices on the cap.
|
|
100
100
|
*/
|
|
101
|
-
export declare function detectCapComponents(upper: ManifoldInstance, normal: Vec3,
|
|
101
|
+
export declare function detectCapComponents(upper: ManifoldInstance, normal: Vec3, planeDistance: number): Set<number>[];
|
|
102
102
|
/**
|
|
103
103
|
* Compute the actual extent of the model's cross-section at the cutting plane
|
|
104
104
|
* along the width direction.
|
|
105
105
|
* @param upper The upper mesh to measure.
|
|
106
106
|
* @param normal The cutting plane normal.
|
|
107
|
-
* @param
|
|
107
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
108
108
|
* @param widthDir The width direction along which to measure.
|
|
109
109
|
* @param comp Optional connected component to restrict the measurement to.
|
|
110
110
|
* @returns The cross-section extent along the width direction (0 when none found).
|
|
111
111
|
*/
|
|
112
|
-
export declare function computeCrossSectionWidth(upper: ManifoldInstance, normal: Vec3,
|
|
112
|
+
export declare function computeCrossSectionWidth(upper: ManifoldInstance, normal: Vec3, planeDistance: number, widthDir: Vec3, comp?: Set<number>): number;
|
|
113
113
|
/**
|
|
114
114
|
* Compute the centroid of vertices lying on the cutting plane.
|
|
115
115
|
* @param upper The upper mesh to scan.
|
|
116
116
|
* @param normal The cutting plane normal.
|
|
117
|
-
* @param
|
|
117
|
+
* @param planeDistance The cutting plane offset along the normal.
|
|
118
118
|
* @param fallback The centroid fallback when no vertex lies on the plane.
|
|
119
119
|
* @param comp Optional connected component to restrict the measurement to.
|
|
120
120
|
* @returns The computed centroid, or the fallback when none is found.
|
|
121
121
|
*/
|
|
122
|
-
export declare function computeCrossSectionCentroid(upper: ManifoldInstance, normal: Vec3,
|
|
122
|
+
export declare function computeCrossSectionCentroid(upper: ManifoldInstance, normal: Vec3, planeDistance: number, fallback: Vec3, comp?: Set<number>): Vec3;
|
|
123
123
|
/**
|
|
124
124
|
* Perform the dovetail split using boolean operations.
|
|
125
125
|
* @param Manifold - the Manifold constructor from the manifold module.
|
|
126
126
|
* @param Mesh - the Mesh constructor from the manifold module.
|
|
127
127
|
* @param original - the original manifold to split.
|
|
128
128
|
* @param normal - the cutting plane normal (unit vector).
|
|
129
|
-
* @param
|
|
129
|
+
* @param planeDistance - the plane equation origin offset along the normal.
|
|
130
130
|
* @param planeCenter - a point on the cutting plane used to center the wedge.
|
|
131
131
|
* @param widthDirInput - the width direction in the cutting plane (will be normalized).
|
|
132
132
|
* @param bboxWidthOnWidthDir - the model's bounding-box width along widthDir, used as a fallback cross-section width.
|
|
@@ -134,7 +134,7 @@ export declare function computeCrossSectionCentroid(upper: ManifoldInstance, nor
|
|
|
134
134
|
* @param keepOriginal - when true, the original manifold is not deleted after splitting (default false).
|
|
135
135
|
* @returns a tuple of the split upper manifold, lower manifold, and the trimmed wedge mesh data (or null when empty).
|
|
136
136
|
*/
|
|
137
|
-
export declare function dovetailBooleanSplit(Manifold: ManifoldCtor, Mesh: MeshCtor, original: ManifoldInstance, normal: Vec3,
|
|
137
|
+
export declare function dovetailBooleanSplit(Manifold: ManifoldCtor, Mesh: MeshCtor, original: ManifoldInstance, normal: Vec3, planeDistance: number, planeCenter: Vec3, widthDirInput: Vec3, bboxWidthOnWidthDir: number, groove: {
|
|
138
138
|
depth: number;
|
|
139
139
|
depthTolerance: number;
|
|
140
140
|
width: number;
|
|
@@ -181,7 +181,7 @@ export declare function createStraightTenon(Manifold: ManifoldCtor, Mesh: MeshCt
|
|
|
181
181
|
* @param Mesh - the Mesh constructor from the manifold module.
|
|
182
182
|
* @param original - the original manifold to split.
|
|
183
183
|
* @param normal - the cutting plane normal (unit vector).
|
|
184
|
-
* @param
|
|
184
|
+
* @param planeDistance - the plane equation origin offset along the normal.
|
|
185
185
|
* @param planeCenter - a point on the cutting plane used to center the joinery.
|
|
186
186
|
* @param widthDirInput - the width direction in the cutting plane (will be normalized).
|
|
187
187
|
* @param shape - the joinery shape: 'dowel' or 'tenon'.
|
|
@@ -190,7 +190,7 @@ export declare function createStraightTenon(Manifold: ManifoldCtor, Mesh: MeshCt
|
|
|
190
190
|
* @param selectedSections - optional list of indices selecting which cap sections receive joinery placement; null or empty means a single placement at the overall cross-section centroid.
|
|
191
191
|
* @returns a tuple of the split upper manifold, lower manifold, and the generated joinery mesh data (or null).
|
|
192
192
|
*/
|
|
193
|
-
export declare function dowelOrTenonBooleanSplit(Manifold: ManifoldCtor, Mesh: MeshCtor, original: ManifoldInstance, normal: Vec3,
|
|
193
|
+
export declare function dowelOrTenonBooleanSplit(Manifold: ManifoldCtor, Mesh: MeshCtor, original: ManifoldInstance, normal: Vec3, planeDistance: number, planeCenter: Vec3, widthDirInput: Vec3, shape: 'dowel' | 'tenon', params: {
|
|
194
194
|
size: number;
|
|
195
195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