@faicad/faijs 0.13.2 → 0.16.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/dist/api/api-namespace.d.ts +7 -0
- package/dist/api/api-namespace.d.ts.map +1 -1
- package/dist/api/api-namespace.js +44 -17
- package/dist/api/api-namespace.js.map +1 -1
- package/dist/api/boolean.d.ts +19 -0
- package/dist/api/boolean.d.ts.map +1 -1
- package/dist/api/boolean.js +71 -12
- package/dist/api/boolean.js.map +1 -1
- package/dist/api/chamfer.d.ts.map +1 -1
- package/dist/api/chamfer.js +12 -8
- package/dist/api/chamfer.js.map +1 -1
- package/dist/api/compound-geom.d.ts +45 -0
- package/dist/api/compound-geom.d.ts.map +1 -0
- package/dist/api/compound-geom.js +85 -0
- package/dist/api/compound-geom.js.map +1 -0
- package/dist/api/edge-ref.d.ts.map +1 -1
- package/dist/api/edge-ref.js +7 -4
- package/dist/api/edge-ref.js.map +1 -1
- package/dist/api/engrave.d.ts.map +1 -1
- package/dist/api/engrave.js +1 -0
- package/dist/api/engrave.js.map +1 -1
- package/dist/api/extrude.d.ts.map +1 -1
- package/dist/api/extrude.js +131 -3
- package/dist/api/extrude.js.map +1 -1
- package/dist/api/face-ref.d.ts.map +1 -1
- package/dist/api/face-ref.js +7 -4
- package/dist/api/face-ref.js.map +1 -1
- package/dist/api/fillet.d.ts.map +1 -1
- package/dist/api/fillet.js +6 -5
- package/dist/api/fillet.js.map +1 -1
- package/dist/api/generated/cad/script-face.d.ts +1 -1
- package/dist/api/generated/cad/script-face.d.ts.map +1 -1
- package/dist/api/generated/cad/script-face.js +1 -2
- package/dist/api/generated/cad/script-face.js.map +1 -1
- package/dist/api/generated/operations.js +16 -16
- package/dist/api/generated/operations.js.map +1 -1
- package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
- package/dist/api/generated/script-face-manifest.js +0 -2
- package/dist/api/generated/script-face-manifest.js.map +1 -1
- package/dist/api/generated/script-face.d.ts +1 -7
- package/dist/api/generated/script-face.d.ts.map +1 -1
- package/dist/api/generated/script-face.js +2 -4
- package/dist/api/generated/script-face.js.map +1 -1
- package/dist/api/generated/sketching.js +1 -1
- package/dist/api/generated/sketching.js.map +1 -1
- package/dist/api/generated/topology.d.ts +0 -56
- package/dist/api/generated/topology.d.ts.map +1 -1
- package/dist/api/generated/topology.js +19 -68
- package/dist/api/generated/topology.js.map +1 -1
- package/dist/api/import-brep.d.ts +36 -0
- package/dist/api/import-brep.d.ts.map +1 -0
- package/dist/api/import-brep.js +72 -0
- package/dist/api/import-brep.js.map +1 -0
- package/dist/api/import-step.d.ts +28 -0
- package/dist/api/import-step.d.ts.map +1 -0
- package/dist/api/import-step.js +57 -0
- package/dist/api/import-step.js.map +1 -0
- package/dist/api/index.d.ts +8 -12
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +22 -16
- package/dist/api/index.js.map +1 -1
- package/dist/api/internal/compat-op.d.ts.map +1 -1
- package/dist/api/internal/compat-op.js +2 -1
- package/dist/api/internal/compat-op.js.map +1 -1
- package/dist/api/internal/compat-projection.d.ts +3 -1
- package/dist/api/internal/compat-projection.d.ts.map +1 -1
- package/dist/api/internal/compat-projection.js +8 -5
- package/dist/api/internal/compat-projection.js.map +1 -1
- package/dist/api/internal/replica-role-table.d.ts +36 -0
- package/dist/api/internal/replica-role-table.d.ts.map +1 -0
- package/dist/api/internal/replica-role-table.js +73 -0
- package/dist/api/internal/replica-role-table.js.map +1 -0
- package/dist/api/internal/result-unwrap.d.ts +3 -1
- package/dist/api/internal/result-unwrap.d.ts.map +1 -1
- package/dist/api/internal/result-unwrap.js +2 -2
- package/dist/api/internal/result-unwrap.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/occt-kernel-bridge.d.ts +105 -27
- package/dist/api/occt-kernel-bridge.d.ts.map +1 -1
- package/dist/api/occt-kernel-bridge.js +255 -41
- package/dist/api/occt-kernel-bridge.js.map +1 -1
- package/dist/api/pattern.d.ts +32 -0
- package/dist/api/pattern.d.ts.map +1 -0
- package/dist/api/pattern.js +85 -0
- package/dist/api/pattern.js.map +1 -0
- package/dist/api/place.d.ts +35 -0
- package/dist/api/place.d.ts.map +1 -0
- package/dist/api/place.js +113 -0
- package/dist/api/place.js.map +1 -0
- package/dist/api/primitives.d.ts.map +1 -1
- package/dist/api/primitives.js +10 -3
- package/dist/api/primitives.js.map +1 -1
- package/dist/api/replicate.d.ts +145 -0
- package/dist/api/replicate.d.ts.map +1 -0
- package/dist/api/replicate.js +351 -0
- package/dist/api/replicate.js.map +1 -0
- package/dist/api/revolve.d.ts +36 -0
- package/dist/api/revolve.d.ts.map +1 -0
- package/dist/api/revolve.js +165 -0
- package/dist/api/revolve.js.map +1 -0
- package/dist/api/screw.d.ts.map +1 -1
- package/dist/api/screw.js +1 -0
- package/dist/api/screw.js.map +1 -1
- package/dist/api/sdf.d.ts.map +1 -1
- package/dist/api/sdf.js +1 -0
- package/dist/api/sdf.js.map +1 -1
- package/dist/api/sketch.d.ts.map +1 -1
- package/dist/api/sketch.js +1 -0
- package/dist/api/sketch.js.map +1 -1
- package/dist/api/split.d.ts +31 -0
- package/dist/api/split.d.ts.map +1 -0
- package/dist/api/split.js +96 -0
- package/dist/api/split.js.map +1 -0
- package/dist/api/surface/arg-spec.d.ts +17 -0
- package/dist/api/surface/arg-spec.d.ts.map +1 -1
- package/dist/api/surface/arg-spec.js +86 -66
- package/dist/api/surface/arg-spec.js.map +1 -1
- package/dist/api/surface/projection-overrides.d.ts.map +1 -1
- package/dist/api/surface/projection-overrides.js +6 -0
- package/dist/api/surface/projection-overrides.js.map +1 -1
- package/dist/api/topo-resolve.d.ts.map +1 -1
- package/dist/api/topo-resolve.js +65 -3
- package/dist/api/topo-resolve.js.map +1 -1
- package/dist/api/transform.d.ts +4 -0
- package/dist/api/transform.d.ts.map +1 -1
- package/dist/api/transform.js +44 -12
- package/dist/api/transform.js.map +1 -1
- package/dist/boolean/deriveNormals.d.ts +5 -4
- package/dist/boolean/deriveNormals.d.ts.map +1 -1
- package/dist/boolean/deriveNormals.js +24 -7
- package/dist/boolean/deriveNormals.js.map +1 -1
- package/dist/brep/brep-ops.d.ts +34 -1
- package/dist/brep/brep-ops.d.ts.map +1 -1
- package/dist/brep/brep-ops.js +62 -22
- package/dist/brep/brep-ops.js.map +1 -1
- package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brep-mock.js +66 -0
- package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
- package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brepkit.js +44 -1
- package/dist/brep/engine/adapters/brepkit.js.map +1 -1
- package/dist/brep/engine/adapters/occt.d.ts +1 -5
- package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
- package/dist/brep/engine/adapters/occt.js +246 -9
- package/dist/brep/engine/adapters/occt.js.map +1 -1
- package/dist/brep/engine/primitives.d.ts +96 -0
- package/dist/brep/engine/primitives.d.ts.map +1 -1
- package/dist/brep/engine/primitives.js.map +1 -1
- package/dist/brep/engine/types.d.ts +66 -6
- package/dist/brep/engine/types.d.ts.map +1 -1
- package/dist/brep/engine/types.js.map +1 -1
- package/dist/brep/export/step.d.ts.map +1 -1
- package/dist/brep/export/step.js +6 -1
- package/dist/brep/export/step.js.map +1 -1
- package/dist/brep/face-evolution.d.ts +78 -8
- package/dist/brep/face-evolution.d.ts.map +1 -1
- package/dist/brep/face-evolution.js +130 -17
- package/dist/brep/face-evolution.js.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.d.ts +1 -1
- package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.js +108 -12
- package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
- package/dist/browser.d.ts +6 -28
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +6 -17
- package/dist/browser.js.map +1 -1
- package/dist/cad-runtime/admit-compat-lib.d.ts +13 -0
- package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
- package/dist/cad-runtime/admit-compat-lib.js +27 -0
- package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
- package/dist/cad-runtime/backend-dispatch.d.ts +46 -3
- package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
- package/dist/cad-runtime/backend-dispatch.js +48 -3
- package/dist/cad-runtime/backend-dispatch.js.map +1 -1
- package/dist/cad-runtime/browser-lib-loader.d.ts +4 -4
- package/dist/cad-runtime/browser-lib-loader.d.ts.map +1 -1
- package/dist/cad-runtime/browser-lib-loader.js +7 -4
- package/dist/cad-runtime/browser-lib-loader.js.map +1 -1
- package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
- package/dist/cad-runtime/direct-executor.js +14 -4
- package/dist/cad-runtime/direct-executor.js.map +1 -1
- package/dist/cad-runtime/module-registry.d.ts +3 -1
- package/dist/cad-runtime/module-registry.d.ts.map +1 -1
- package/dist/cad-runtime/module-registry.js +13 -1
- package/dist/cad-runtime/module-registry.js.map +1 -1
- package/dist/cad-runtime/runtime-concurrent-error.d.ts +38 -0
- package/dist/cad-runtime/runtime-concurrent-error.d.ts.map +1 -0
- package/dist/cad-runtime/runtime-concurrent-error.js +43 -0
- package/dist/cad-runtime/runtime-concurrent-error.js.map +1 -0
- package/dist/cad-runtime/runtime.d.ts +52 -2
- package/dist/cad-runtime/runtime.d.ts.map +1 -1
- package/dist/cad-runtime/runtime.js +180 -9
- 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 +82 -12
- package/dist/define-op.js.map +1 -1
- package/dist/env-agnostic.d.ts +38 -0
- package/dist/env-agnostic.d.ts.map +1 -0
- package/dist/env-agnostic.js +29 -0
- package/dist/env-agnostic.js.map +1 -0
- package/dist/fcstd/attachment.d.ts +8 -1
- package/dist/fcstd/attachment.d.ts.map +1 -1
- package/dist/fcstd/attachment.js +7 -1
- package/dist/fcstd/attachment.js.map +1 -1
- package/dist/fcstd/build-fai-zip.d.ts.map +1 -1
- package/dist/fcstd/build-fai-zip.js +12 -7
- package/dist/fcstd/build-fai-zip.js.map +1 -1
- package/dist/fcstd/codegen.d.ts +10 -1
- package/dist/fcstd/codegen.d.ts.map +1 -1
- package/dist/fcstd/codegen.js +158 -49
- package/dist/fcstd/codegen.js.map +1 -1
- package/dist/fcstd/contour.d.ts.map +1 -1
- package/dist/fcstd/contour.js +23 -24
- package/dist/fcstd/contour.js.map +1 -1
- package/dist/fcstd/convert.d.ts +2 -18
- package/dist/fcstd/convert.d.ts.map +1 -1
- package/dist/fcstd/convert.js +35 -53
- package/dist/fcstd/convert.js.map +1 -1
- package/dist/fcstd/expressions.d.ts +24 -0
- package/dist/fcstd/expressions.d.ts.map +1 -1
- package/dist/fcstd/expressions.js +91 -0
- package/dist/fcstd/expressions.js.map +1 -1
- package/dist/fcstd/external-geo.d.ts +12 -1
- package/dist/fcstd/external-geo.d.ts.map +1 -1
- package/dist/fcstd/external-geo.js +15 -1
- package/dist/fcstd/external-geo.js.map +1 -1
- package/dist/fcstd/feature-translate.d.ts +21 -1
- package/dist/fcstd/feature-translate.d.ts.map +1 -1
- package/dist/fcstd/feature-translate.js +124 -8
- package/dist/fcstd/feature-translate.js.map +1 -1
- package/dist/fcstd/structural-types.d.ts +83 -0
- package/dist/fcstd/structural-types.d.ts.map +1 -0
- package/dist/fcstd/structural-types.js +121 -0
- package/dist/fcstd/structural-types.js.map +1 -0
- package/dist/index.d.ts +7 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -16
- package/dist/index.js.map +1 -1
- package/dist/lang/determinism-scanner.d.ts +71 -0
- package/dist/lang/determinism-scanner.d.ts.map +1 -0
- package/dist/lang/determinism-scanner.js +625 -0
- package/dist/lang/determinism-scanner.js.map +1 -0
- package/dist/lang/symbol-table.d.ts +31 -0
- package/dist/lang/symbol-table.d.ts.map +1 -1
- package/dist/lang/symbol-table.generated.d.ts +13 -19
- package/dist/lang/symbol-table.generated.d.ts.map +1 -1
- package/dist/lang/symbol-table.generated.js +13 -19
- package/dist/lang/symbol-table.generated.js.map +1 -1
- package/dist/lang/symbol-table.js +50 -1
- package/dist/lang/symbol-table.js.map +1 -1
- package/dist/mesh/creased-normals.d.ts +50 -0
- package/dist/mesh/creased-normals.d.ts.map +1 -0
- package/dist/mesh/creased-normals.js +114 -0
- package/dist/mesh/creased-normals.js.map +1 -0
- package/dist/mesh/decoration-provider.d.ts +53 -0
- package/dist/mesh/decoration-provider.d.ts.map +1 -0
- package/dist/mesh/decoration-provider.js +21 -0
- package/dist/mesh/decoration-provider.js.map +1 -0
- package/dist/mesh/engrave.d.ts +4 -0
- package/dist/mesh/engrave.d.ts.map +1 -1
- package/dist/mesh/engrave.js +22 -31
- package/dist/mesh/engrave.js.map +1 -1
- package/dist/mesh/index.d.ts +5 -14
- package/dist/mesh/index.d.ts.map +1 -1
- package/dist/mesh/index.js +7 -18
- package/dist/mesh/index.js.map +1 -1
- package/dist/mesh/io.d.ts +2 -1
- package/dist/mesh/io.d.ts.map +1 -1
- package/dist/mesh/io.js +5 -7
- package/dist/mesh/io.js.map +1 -1
- package/dist/mesh/primitives.d.ts +5 -18
- package/dist/mesh/primitives.d.ts.map +1 -1
- package/dist/mesh/primitives.js +4 -48
- package/dist/mesh/primitives.js.map +1 -1
- package/dist/mesh/stl-loader.d.ts +23 -0
- package/dist/mesh/stl-loader.d.ts.map +1 -0
- package/dist/mesh/stl-loader.js +139 -0
- package/dist/mesh/stl-loader.js.map +1 -0
- package/dist/module-resolver/parse-imports.d.ts +37 -0
- package/dist/module-resolver/parse-imports.d.ts.map +1 -0
- package/dist/module-resolver/parse-imports.js +39 -0
- package/dist/module-resolver/parse-imports.js.map +1 -0
- package/dist/module-resolver/resolver.d.ts +1 -1
- package/dist/module-resolver/resolver.js +2 -2
- package/dist/module-resolver/resolver.js.map +1 -1
- package/dist/node-host/cli.d.ts.map +1 -1
- package/dist/node-host/cli.js +37 -4
- package/dist/node-host/cli.js.map +1 -1
- package/dist/primitives/text/cjk-font.d.ts +42 -0
- package/dist/primitives/text/cjk-font.d.ts.map +1 -0
- package/dist/primitives/text/cjk-font.js +86 -0
- package/dist/primitives/text/cjk-font.js.map +1 -0
- package/dist/runtime-state.d.ts +18 -6
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +9 -1
- package/dist/runtime-state.js.map +1 -1
- package/dist/sdk.d.ts +2 -2
- package/dist/sdk.js +2 -2
- package/dist/sdk.js.map +1 -1
- package/dist/shape.d.ts +15 -0
- package/dist/shape.d.ts.map +1 -1
- package/dist/shape.js +26 -3
- package/dist/shape.js.map +1 -1
- package/dist/symbol-table.d.ts +15 -0
- package/dist/symbol-table.d.ts.map +1 -0
- package/dist/symbol-table.js +14 -0
- package/dist/symbol-table.js.map +1 -0
- package/dist/topology/naming/build-naming.d.ts +14 -30
- package/dist/topology/naming/build-naming.d.ts.map +1 -1
- package/dist/topology/naming/build-naming.js +21 -54
- package/dist/topology/naming/build-naming.js.map +1 -1
- package/dist/topology/naming/capture-topo-ref.d.ts.map +1 -1
- package/dist/topology/naming/capture-topo-ref.js +5 -0
- package/dist/topology/naming/capture-topo-ref.js.map +1 -1
- package/dist/topology/naming/index.d.ts +3 -0
- package/dist/topology/naming/index.d.ts.map +1 -1
- package/dist/topology/naming/index.js +3 -0
- package/dist/topology/naming/index.js.map +1 -1
- package/dist/topology/naming/lineage-resolve.d.ts +80 -0
- package/dist/topology/naming/lineage-resolve.d.ts.map +1 -0
- package/dist/topology/naming/lineage-resolve.js +120 -0
- package/dist/topology/naming/lineage-resolve.js.map +1 -0
- package/dist/topology/naming/lineage.d.ts +349 -0
- package/dist/topology/naming/lineage.d.ts.map +1 -0
- package/dist/topology/naming/lineage.js +398 -0
- package/dist/topology/naming/lineage.js.map +1 -0
- package/dist/topology/naming/migrate.d.ts +41 -0
- package/dist/topology/naming/migrate.d.ts.map +1 -0
- package/dist/topology/naming/migrate.js +88 -0
- package/dist/topology/naming/migrate.js.map +1 -0
- package/dist/topology/naming/role-name.d.ts +176 -0
- package/dist/topology/naming/role-name.d.ts.map +1 -0
- package/dist/topology/naming/role-name.js +344 -0
- package/dist/topology/naming/role-name.js.map +1 -0
- package/dist/topology/naming/roles.d.ts +20 -22
- package/dist/topology/naming/roles.d.ts.map +1 -1
- package/dist/topology/naming/roles.js +51 -49
- package/dist/topology/naming/roles.js.map +1 -1
- package/dist/topology/naming/types.d.ts +65 -18
- package/dist/topology/naming/types.d.ts.map +1 -1
- package/dist/topology/naming/types.js.map +1 -1
- package/dist/vendored/brepjs/kernel/index.d.ts +5 -0
- package/dist/vendored/brepjs/kernel/index.d.ts.map +1 -1
- package/dist/vendored/brepjs/kernel/index.js +11 -0
- package/dist/vendored/brepjs/kernel/index.js.map +1 -1
- package/dist/weapp.d.ts +4 -4
- package/dist/weapp.d.ts.map +1 -1
- package/dist/weapp.js +7 -4
- package/dist/weapp.js.map +1 -1
- package/package.json +16 -14
- package/dist/api/compat/index.d.ts +0 -173
- package/dist/api/compat/index.d.ts.map +0 -1
- package/dist/api/compat/index.js +0 -222
- package/dist/api/compat/index.js.map +0 -1
- package/dist/api/compound.d.ts +0 -108
- package/dist/api/compound.d.ts.map +0 -1
- package/dist/api/compound.js +0 -162
- package/dist/api/compound.js.map +0 -1
- package/dist/api/copy.d.ts +0 -39
- package/dist/api/copy.d.ts.map +0 -1
- package/dist/api/copy.js +0 -81
- package/dist/api/copy.js.map +0 -1
- package/dist/api/fai_drill.d.ts +0 -46
- package/dist/api/fai_drill.d.ts.map +0 -1
- package/dist/api/fai_drill.js +0 -230
- package/dist/api/fai_drill.js.map +0 -1
- package/dist/api/fai_extrude.d.ts +0 -36
- package/dist/api/fai_extrude.d.ts.map +0 -1
- package/dist/api/fai_extrude.js +0 -78
- package/dist/api/fai_extrude.js.map +0 -1
- package/dist/api/fai_split.d.ts +0 -46
- package/dist/api/fai_split.d.ts.map +0 -1
- package/dist/api/fai_split.js +0 -253
- package/dist/api/fai_split.js.map +0 -1
- package/dist/api/load.d.ts +0 -39
- package/dist/api/load.d.ts.map +0 -1
- package/dist/api/load.js +0 -82
- package/dist/api/load.js.map +0 -1
- package/dist/api/svgExtrude.d.ts +0 -32
- package/dist/api/svgExtrude.d.ts.map +0 -1
- package/dist/api/svgExtrude.js +0 -73
- package/dist/api/svgExtrude.js.map +0 -1
- package/dist/api/text.d.ts +0 -34
- package/dist/api/text.d.ts.map +0 -1
- package/dist/api/text.js +0 -100
- package/dist/api/text.js.map +0 -1
- package/dist/brep/text/fontTestHelper.d.ts +0 -30
- package/dist/brep/text/fontTestHelper.d.ts.map +0 -1
- package/dist/brep/text/fontTestHelper.js +0 -57
- package/dist/brep/text/fontTestHelper.js.map +0 -1
- package/dist/cad-runtime/module-executor.d.ts +0 -271
- package/dist/cad-runtime/module-executor.d.ts.map +0 -1
- package/dist/cad-runtime/module-executor.js +0 -630
- package/dist/cad-runtime/module-executor.js.map +0 -1
- package/dist/cad-runtime/terminal-dag.d.ts +0 -65
- package/dist/cad-runtime/terminal-dag.d.ts.map +0 -1
- package/dist/cad-runtime/terminal-dag.js +0 -167
- package/dist/cad-runtime/terminal-dag.js.map +0 -1
- package/dist/faqts/browser.d.ts +0 -16
- package/dist/faqts/browser.d.ts.map +0 -1
- package/dist/faqts/browser.js +0 -13
- package/dist/faqts/browser.js.map +0 -1
- package/dist/faqts/exec-blob.d.ts +0 -14
- package/dist/faqts/exec-blob.d.ts.map +0 -1
- package/dist/faqts/exec-blob.js +0 -22
- package/dist/faqts/exec-blob.js.map +0 -1
- package/dist/faqts/exec-node.d.ts +0 -15
- package/dist/faqts/exec-node.d.ts.map +0 -1
- package/dist/faqts/exec-node.js +0 -29
- package/dist/faqts/exec-node.js.map +0 -1
- package/dist/faqts/imports.d.ts +0 -74
- package/dist/faqts/imports.d.ts.map +0 -1
- package/dist/faqts/imports.js +0 -95
- package/dist/faqts/imports.js.map +0 -1
- package/dist/faqts/index.d.ts +0 -22
- package/dist/faqts/index.d.ts.map +0 -1
- package/dist/faqts/index.js +0 -21
- package/dist/faqts/index.js.map +0 -1
- package/dist/faqts/node.d.ts +0 -23
- package/dist/faqts/node.d.ts.map +0 -1
- package/dist/faqts/node.js +0 -23
- package/dist/faqts/node.js.map +0 -1
- package/dist/faqts/run.d.ts +0 -62
- package/dist/faqts/run.d.ts.map +0 -1
- package/dist/faqts/run.js +0 -62
- package/dist/faqts/run.js.map +0 -1
- package/dist/faqts/transform.d.ts +0 -43
- package/dist/faqts/transform.d.ts.map +0 -1
- package/dist/faqts/transform.js +0 -35
- package/dist/faqts/transform.js.map +0 -1
- package/dist/lang/compile.d.ts +0 -50
- package/dist/lang/compile.d.ts.map +0 -1
- package/dist/lang/compile.js +0 -368
- package/dist/lang/compile.js.map +0 -1
- package/dist/lang/keep.d.ts +0 -109
- package/dist/lang/keep.d.ts.map +0 -1
- package/dist/lang/keep.js +0 -226
- package/dist/lang/keep.js.map +0 -1
- package/dist/lang/parser.d.ts +0 -91
- package/dist/lang/parser.d.ts.map +0 -1
- package/dist/lang/parser.js +0 -1594
- package/dist/lang/parser.js.map +0 -1
- package/dist/mesh/drill-hole/DrillHoleCore.d.ts +0 -90
- package/dist/mesh/drill-hole/DrillHoleCore.d.ts.map +0 -1
- package/dist/mesh/drill-hole/DrillHoleCore.js +0 -287
- package/dist/mesh/drill-hole/DrillHoleCore.js.map +0 -1
- package/dist/mesh/drill-hole/drill-types.d.ts +0 -34
- package/dist/mesh/drill-hole/drill-types.d.ts.map +0 -1
- package/dist/mesh/drill-hole/drill-types.js +0 -7
- package/dist/mesh/drill-hole/drill-types.js.map +0 -1
- package/dist/mesh/fai_drill.d.ts +0 -21
- package/dist/mesh/fai_drill.d.ts.map +0 -1
- package/dist/mesh/fai_drill.js +0 -92
- package/dist/mesh/fai_drill.js.map +0 -1
- package/dist/mesh/fai_extrude.d.ts +0 -24
- package/dist/mesh/fai_extrude.d.ts.map +0 -1
- package/dist/mesh/fai_extrude.js +0 -42
- package/dist/mesh/fai_extrude.js.map +0 -1
- package/dist/mesh/fai_split.d.ts +0 -164
- package/dist/mesh/fai_split.d.ts.map +0 -1
- package/dist/mesh/fai_split.js +0 -269
- package/dist/mesh/fai_split.js.map +0 -1
- package/dist/primitives/svg-extrude.d.ts +0 -43
- package/dist/primitives/svg-extrude.d.ts.map +0 -1
- package/dist/primitives/svg-extrude.js +0 -78
- package/dist/primitives/svg-extrude.js.map +0 -1
- package/dist/primitives/text/cjk.d.ts +0 -61
- package/dist/primitives/text/cjk.d.ts.map +0 -1
- package/dist/primitives/text/cjk.js +0 -215
- package/dist/primitives/text/cjk.js.map +0 -1
- package/dist/primitives/text-geometry.d.ts +0 -47
- package/dist/primitives/text-geometry.d.ts.map +0 -1
- package/dist/primitives/text-geometry.js +0 -127
- package/dist/primitives/text-geometry.js.map +0 -1
- package/dist/test-helpers.d.ts +0 -31
- package/dist/test-helpers.d.ts.map +0 -1
- package/dist/test-helpers.js +0 -55
- package/dist/test-helpers.js.map +0 -1
- package/dist/vendored/brepjs/core/kernelReentrancy.d.ts +0 -41
- package/dist/vendored/brepjs/core/kernelReentrancy.d.ts.map +0 -1
- package/dist/vendored/brepjs/core/kernelReentrancy.js +0 -68
- package/dist/vendored/brepjs/core/kernelReentrancy.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"occt.js","sourceRoot":"","sources":["../../../../src/brep/engine/adapters/occt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAmB,MAAM,aAAa,CAAA;AAExG,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAA;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,MAAM,UAAU,GAAG,MAAM,YAAY,EAAE,CAAA;IACvC,IAAI,sBAAsB,CAAC,mBAAmB,CAAC;QAAE,OAAM;IACvD,kBAAkB,CAAC,mBAAmB,EAAE,KAAK,IAAyB,EAAE,CAAC,CAAC;QACxE,EAAE,EAAE,mBAAmB;QACvB,UAAU;QACV,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,IAAI;YACd,kEAAkE;YAClE,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,IAAI;YACtB,iBAAiB,EAAE,cAAc;SAClC;KACF,CAAC,CAAC,CAAA;IACH,uDAAuD;IACvD,yCAAyC;IACzC,cAAc,EAAE,CAAA;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,IAAI,aAAa,EAAE;QAAE,OAAM;IAC3B,MAAM,sBAAsB,EAAE,CAAA;AAChC,CAAC","sourcesContent":["/**\n * engine/adapters/occt — OCCT BREP 引擎适配器(槽位 1 的默认实现)\n *\n *\n * 本文件是「occt 引擎实现」的注册入口:把 occt-kernel 的 initOcctWasm 包装为\n * BrepEngine 注册进注册表。业务层(runtime/brep ops/stdlib)只经注册表取引擎,\n * 不直接 import occt 初始化函数——引擎本体可整体替换(换一个适配器即换引擎)。\n *\n * OCCT 类型耦合(import 'occt-wasm')只存在于 occt-kernel/occtKernel.ts(A1 验收\n * 允许的唯一耦合区);本文件经 initOcctWasm 函数边界获得 BrepEngineApi,不直接\n * 接触 occt-wasm 类型。\n */\n\nimport { registerBrepEngine, hasBrepEngine, isBrepEngineRegistered, type BrepEngine } from '../registry'\nimport type { AssertSatisfiesBrepEngineApi } from '../primitives'\nimport { initOcctWasm } from '../../../occt-kernel/occtKernel'\nimport { bindOcctKernel } from '../../../api/occt-kernel-bridge'\n\n/** OCCT 引擎注册 id(默认 BREP 引擎;首个注册自动成为默认)。 */\nexport const OCCT_BREP_ENGINE_ID = 'occt'\n\n/**\n * 装配 OCCT BREP 引擎(宿主启动时调用一次,幂等)。\n *\n * 预初始化 initOcctWasm():wasm 加载完成后立即注册——保证注册返回后\n * getKernel() 立即可用(occt-kernel 单例已就绪),provider 直接返回预初始化实例。\n * 幂等:已注册(含运行时默认装配或宿主先行注册)则跳过注册,仅确保 wasm 预初始化。\n */\nexport async function registerOcctBrepEngine(): Promise<void> {\n const primitives = await initOcctWasm()\n if (isBrepEngineRegistered(OCCT_BREP_ENGINE_ID)) return\n registerBrepEngine(OCCT_BREP_ENGINE_ID, async (): Promise<BrepEngine> => ({\n id: OCCT_BREP_ENGINE_ID,\n primitives,\n capabilities: {\n evolution: true,\n heal: true,\n directEdit: true,\n advSurface: true,\n assembly: true,\n // P7 并入(D4):OCCT 是精确 B-rep 内核——如实声明 brepjs KernelCapabilities 字段。\n exact: true,\n brepExport: true,\n exactMeasurement: true,\n tessellationModel: 'extract-time',\n },\n }))\n // P7-②:同一装配点把移植内核注册表绑定到同一个 occt-wasm 实例(D10 单实例 + 冻结)。\n // 使 L3 调移植 L2 的 op 在宿主装配后立即可用;幂等,重复调用安全。\n bindOcctKernel()\n}\n\n/**\n * 内置默认 BREP 引擎装配(OCCT):宿主未注册任何引擎时的缺省值。\n *\n * OCCT 是 faijs 的默认 BREP 引擎——低频率、静态的替换:换引擎 = 宿主在\n * 装配期显式注册其它引擎(首个注册者为默认),或改本处默认。宿主无需为\n * 每次使用自行提供引擎;本函数幂等,已注册任何引擎则 no-op。\n */\nexport async function ensureOcctDefaultEngine(): Promise<void> {\n if (hasBrepEngine()) return\n await registerOcctBrepEngine()\n}\n\n// §7.8 编译期守卫:initOcctWasm 的返回类型必须满足 BrepEngineApi。\n// 若未来 occt-kernel 的导出类型不再满足接口(如接口新增方法)→ tsc 报错列出缺失。\ntype _AssertOcctApi = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n"]}
|
|
1
|
+
{"version":3,"file":"occt.js","sourceRoot":"","sources":["../../../../src/brep/engine/adapters/occt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAmB,MAAM,aAAa,CAAA;AAIxG,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAA;AAEjF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAA;AAEzC,+DAA+D;AAC/D,8CAA8C;AAC9C,2EAA2E;AAC3E,IAAI,gBAAgB,GAAG,KAAK,CAAA;AAE5B;;;;;;;GAOG;AACH;;;;;;;;;;;;GAYG;AACH,MAAM,iBAAiB,GAAG;IACxB,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,eAAe;IACf,OAAO;IACP,SAAS;IACT,MAAM;IACN,cAAc;IACd,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,MAAM;IACN,KAAK;IACL,WAAW;IACX,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,UAAU;IACV,mBAAmB;IACnB,cAAc;IACd,WAAW;IACX,YAAY;IACZ,mBAAmB;IACnB,oBAAoB;IACpB,gBAAgB;IAChB,cAAc;IACd,KAAK;IACL,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,UAAU;IACV,UAAU;IACV,qBAAqB;IACrB,SAAS;IACT,uBAAuB;IACvB,UAAU;IACV,OAAO;IACP,aAAa;IACb,iBAAiB;IACjB,mBA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AAY,EAAE;YACZ,2CAA2C;YAC3C,SAAS,EAAE,oBAAoB;YAC/B,+CAA+C;YAC/C,OAAO,EAAE,iBAAiB;YAC1B,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,IAAI;YACd,kEAAkE;YAClE,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,IAAI;YACtB,iBAAiB,EAAE,cAAc;SAClC;KACF,CAAC,CAAC,CAAA;IACH,oDAAoD;IACpD,kEAAkE;IAClE,yCAAyC;IACzC,MAAM,+BAA+B,EAAE,CAAA;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,IAAI,aAAa,EAAE;QAAE,OAAM;IAC3B,MAAM,sBAAsB,EAAE,CAAA;AAChC,CAAC","sourcesContent":["/**\n * engine/adapters/occt — OCCT BREP 引擎适配器(槽位 1 的默认实现)\n *\n *\n * 本文件是「occt 引擎实现」的注册入口:把 occt-kernel 的 initOcctWasm 包装为\n * BrepEngine 注册进注册表。业务层(runtime/brep ops/stdlib)只经注册表取引擎,\n * 不直接 import occt 初始化函数——引擎本体可整体替换(换一个适配器即换引擎)。\n *\n * OCCT 类型耦合(import 'occt-wasm')只存在于 occt-kernel/occtKernel.ts(A1 验收\n * 允许的唯一耦合区);本文件经 initOcctWasm 函数边界获得 BrepEngineApi,不直接\n * 接触 occt-wasm 类型。\n */\n\nimport { registerBrepEngine, hasBrepEngine, isBrepEngineRegistered, type BrepEngine } from '../registry'\nimport type { AssertSatisfiesBrepEngineApi, BrepEngineApi } from '../primitives'\nimport type { BrepEvolutionKind, BrepMethodKind } from '../types'\nimport type { BrepEvolutionData, BrepHandle, BrepSubShapeType, BrepVec3 } from '../types'\nimport { OcctWasmAdapter } from '../../../vendored/brepjs/kernel/occtWasm/occtWasmAdapter'\nimport { initOcctWasm } from '../../../occt-kernel/occtKernel'\nimport { injectCurrentBrepEngineAsKernel } from '../../../api/occt-kernel-bridge'\n\n/** OCCT 引擎注册 id(默认 BREP 引擎;首个注册自动成为默认)。 */\nexport const OCCT_BREP_ENGINE_ID = 'occt'\n\n// Phase 2 幂等护栏:occt-wasm 是进程级单例,registerOcctBrepEngine 可能被多次调用\n// (测试重置注册表后重注册)。pattern 三方法只覆写一次——重复覆写会捕获到上一轮\n// 覆写版(返回 BrepHandle[]),把它当 compound 拆 → getSubShapes: Invalid shape ID: 0。\nlet occtPatternWired = false\n\n/**\n * OCCT 实际提供的 `*WithHistory` 核函数名(Phase 0.2:逐核函数如实声明)。\n *\n * 12 个全部由 `occt-wasm@3.8.4` 提供(`dist/index.d.ts` 的 `*WithHistory` 声明),\n * 且 faijs 侧已全部绑定(`brep/engine/primitives.ts` 的 `BrepEngineApi`)并有运行时\n * 冒烟测试(`brep/engine/evolution-bindings.test.ts`——因 `initOcctWasm` 的返回类型\n * 被 `as unknown as` 硬断言,编译期守卫是空转的,只有运行时测试能证明它们真在)。\n */\n/**\n * 非演化内核方法全集(BrepMethodKind)——occt-wasm 是参考内核,vendored\n * occtWasmAdapter 提供全部方法(occt-kernel/initOcctWasm 包装同一实例),\n * 逐核如实声明(Phase 1,P2 缺口补齐)。\n *\n * ⚠️ Phase 2 修正(能力声明=可执行语义):\n * - 保留 `gridPattern`:occt-wasm 无原生 gridPattern,但 vendored gridPattern\n * 有回退路径(嵌套 linearPattern,patternFns.ts)且本适配器新增组合实现\n * ——occt 下 gridPattern op 可执行,声明成立;\n * - 移除 `rectangularPattern`:occt-wasm 无此内核方法,vendored rectangularPattern\n * 是纯 JS 组合(compoundOpsFns.ts translate+fuseAll,不调内核)——无 op 依赖\n * 该能力名,声明即虚假(capability-map 实证 36 op 无一依赖)。\n */\nconst OCCT_METHOD_KINDS = [\n 'linearPattern',\n 'circularPattern',\n 'gridPattern',\n 'mirror',\n 'rotate',\n 'translate',\n 'scale',\n 'makeRectangle',\n 'shell',\n 'extrude',\n 'loft',\n 'loftAdvanced',\n 'section',\n 'sweepPipeShell',\n 'simplePipe',\n 'revolveVec',\n 'buildExtrusionLaw',\n 'fuse',\n 'cut',\n 'intersect',\n 'fuseAll',\n 'makeArcEdge',\n 'makeBezierEdge',\n 'makeCylinder',\n 'makeEllipsoid',\n 'makeFace',\n 'makeFaceOnSurface',\n 'makeLineEdge',\n 'makeTorus',\n 'makeVertex',\n 'makeWireFromMixed',\n 'buildEdgeOnSurface',\n 'addHolesInFace',\n 'buildTriFace',\n 'sew',\n 'sewAndSolidify',\n 'healFace',\n 'healSolid',\n 'healWire',\n 'fixShape',\n 'fixSelfIntersection',\n 'isValid',\n 'removeDegenerateEdges',\n 'simplify',\n 'split',\n 'boundingBox',\n 'curveParameters',\n 'curvePointAtParam',\n 'curveTangent',\n 'hullFromPoints',\n 'isNull',\n 'iterShapes',\n 'locate',\n 'shapeType',\n 'surfaceCenterOfMass',\n 'surfaceNormal',\n 'surfaceType',\n 'uvBounds',\n 'composeTransform',\n 'applyComposedTransformWithHistory',\n 'generalTransformNonOrthogonal',\n 'generalTransformWithHistory',\n 'importStl',\n 'createXCAFDocument',\n 'importXCAFFromSTEP',\n 'copyShape',\n 'dispose',\n 'downcast',\n 'hashCode',\n // Phase 2:chamfer/fillet 基础方法(directEdit 族逐核真名;occt-wasm 原生提供,\n // brepkit 无——chamfer op 静态判定执行前报错)\n 'chamfer',\n 'chamferDistAngle',\n 'fillet',\n 'filletVariable',\n] as const satisfies readonly BrepMethodKind[]\n\nconst OCCT_EVOLUTION_KINDS = [\n 'fuseWithHistory',\n 'cutWithHistory',\n 'intersectWithHistory',\n 'filletWithHistory',\n 'chamferWithHistory',\n 'translateWithHistory',\n 'rotateWithHistory',\n 'mirrorWithHistory',\n 'scaleWithHistory',\n 'shellWithHistory',\n 'offsetWithHistory',\n 'thickenWithHistory',\n] as const satisfies readonly BrepEvolutionKind[]\n\n/**\n * 装配 OCCT BREP 引擎(宿主启动时调用一次,幂等)。\n *\n * 预初始化 initOcctWasm():wasm 加载完成后立即注册——保证注册返回后\n * getKernel() 立即可用(occt-kernel 单例已就绪),provider 直接返回预初始化实例。\n * 幂等:已注册(含运行时默认装配或宿主先行注册)则跳过注册,仅确保 wasm 预初始化。\n */\n/** occt-wasm 运行时原始 pattern 形态(initOcctWasm 返回类型被硬断言,此处如实还原)。 */\ninterface OcctPatternRaw {\n // occt-wasm 原生签名(dist/index.d.ts:230-231 实证):方向/中心/轴是 **Vec3 对象**\n // ({x,y,z}),4/5 参数形态。⚠️ vendored transformOps.ts 的分量式调用(6/9 参数)\n // 是 brepjs 内部 OcctKernelWasm 的假定面,对真实 occt-wasm 不成立(运行实证崩),\n // Phase 3 全量收敛时单独处置。\n linearPattern(shape: number, direction: { x: number; y: number; z: number }, spacing: number, count: number): number\n circularPattern(shape: number, center: { x: number; y: number; z: number }, axis: { x: number; y: number; z: number }, angleStep: number, count: number): number\n getSubShapes(shape: number, type: 'solid'): number[]\n release(shape: number): void\n fuseAll(shapes: number[]): number\n}\n\n/**\n * 装配 OCCT BREP 引擎(幂等;pattern 三方法仅首次覆写,见上方长注释)。\n */\nexport async function registerOcctBrepEngine(): Promise<void> {\n const primitives = await initOcctWasm()\n if (isBrepEngineRegistered(OCCT_BREP_ENGINE_ID)) return\n // Phase 2:occt-wasm 原生 linearPattern/circularPattern 返回 compound(含全部副本),\n // BrepEngineApi 契约要求 BrepHandle[](各份副本)→ 在此拆 compound(getSubShapes)。\n // gridPattern 无原生内核函数 → 组合实现(嵌套 linearPattern + fuseAll,与 vendored\n // 回退路径同构);拆出的子句柄由调用方 release,compound 容器拆完即释放。\n // ⚠️ initOcctWasm 的返回类型在 occtKernel.ts 被硬断言为 BrepEngineApi(linearPattern\n // 签名 BrepHandle[]),但运行时 occt-wasm 的 linearPattern/circularPattern 返回**单个\n // compound 句柄**(含全部副本)——类型撒谎。此处以运行时原始形态(OcctPatternRaw)\n // 调用,再经 getSubShapes 拆成数组(与 vendored transformOps.linearPattern 同构)。\n // 不能使用对象展开({ ...primitives }):OcctKernel 的方法在原型上(class 实例),\n // 展开只拷自有属性 → makeBoxFromCorners 等全部原型方法丢失(consume-input.test 实证)。\n // 直接覆盖单例实例的 pattern 三方法(occt-wasm 单例,无共享状态风险)。\n // ⚠️ 覆盖前必须先捕获原生 linearPattern/circularPattern:覆盖后 raw.linearPattern\n // 会指向 occtApi.linearPattern 自身 → 无限递归(Maximum call stack size exceeded 实证)。\n const raw = primitives as unknown as OcctPatternRaw\n // ⚠️ 幂等护栏:occt-wasm 是进程级单例,宿主可能多次调用本注册(测试重置注册表后\n // 重注册)。重复覆写会捕获到上一轮覆写版(返回 BrepHandle[]),把它当 compound 拆\n // → `getSubShapes: Invalid shape ID: 0`(engine-switch-p2 parity 实证)。只覆写一次,\n // raw 与 occtApi 指向同一单例,后续注册直接复用覆写结果。\n if (!occtPatternWired) {\n // ⚠️ 覆盖前必须先捕获原生 linearPattern/circularPattern:覆盖后 raw.linearPattern\n // 会指向 occtApi.linearPattern 自身 → 无限递归(Maximum call stack size exceeded 实证)。\n const nativeLinearPattern = raw.linearPattern.bind(raw)\n const nativeCircularPattern = raw.circularPattern.bind(raw)\n const occtApi = primitives as BrepEngineApi\n occtApi.linearPattern = (shape, direction, spacing, count) => {\n const compound = nativeLinearPattern(shape, direction, spacing, count)\n const parts = raw.getSubShapes(compound, 'solid')\n raw.release(compound)\n return parts.map((h) => h as BrepHandle)\n }\n occtApi.circularPattern = (shape, center, axis, angleStep, count) => {\n const compound = nativeCircularPattern(shape, center, axis, angleStep, count)\n const parts = raw.getSubShapes(compound, 'solid')\n raw.release(compound)\n return parts.map((h) => h as BrepHandle)\n }\n occtApi.gridPattern = (shape, directionX, directionY, spacingX, spacingY, countX, countY) => {\n // ⚠️ 内部必须用捕获的 nativeLinearPattern:此时 raw.linearPattern 已被覆写为\n // BrepHandle[] 语义,误用会把数组当 compound 拆(同上红线实证)。\n const colCompound = nativeLinearPattern(shape, directionX, spacingX, countX)\n const cols = raw.getSubShapes(colCompound, 'solid')\n raw.release(colCompound)\n const all: number[] = []\n try {\n for (const c of cols) {\n const rowCompound = nativeLinearPattern(c, directionY, spacingY, countY)\n try {\n all.push(...raw.getSubShapes(rowCompound, 'solid'))\n } finally {\n raw.release(rowCompound)\n }\n }\n } finally {\n for (const c of cols) raw.release(c)\n }\n return raw.fuseAll(all) as BrepHandle\n }\n\n // ═══ Phase 3:能力表 33 个登记方法接线(capability-map 64 方法收口) ═══\n // 原则:能力表声明了(OCCT_METHOD_KINDS 含全部 33)→ 实例必须可实现,否则静态\n // 判定放行后运行时崩(红线)。18 个 occt-wasm 原生导出直接绑定(签名与\n // BrepEngineApi 一致:Vec3=BrepVec3、ShapeHandle=BrepHandle);15 个组合方法\n // (occt-wasm 无原生导出)经 vendored OcctWasmAdapter 组合面代理 + 形态转换。\n // 只接线一次(occtPatternWired 护栏内);重复注册复用覆写结果,不重复捕获。\n const k = primitives as unknown as {\n buildExtrusionLaw(profile: string, length: number, endFactor: number): BrepHandle\n composeTransform(m1: number[], m2: number[]): number[]\n downcast(shape: BrepHandle, targetType: BrepSubShapeType): BrepHandle\n healFace(shape: BrepHandle, tolerance?: number): BrepHandle\n healWire(shape: BrepHandle, tolerance?: number): BrepHandle\n isNull(shape: BrepHandle): boolean\n iterShapes(shape: BrepHandle): BrepHandle[]\n makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle\n makeFaceOnSurface(face: BrepHandle, wire: BrepHandle): BrepHandle\n makeTorus(majorRadius: number, minorRadius: number): BrepHandle\n makeVertex(x: number, y: number, z: number): BrepHandle\n mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle\n sew(shapes: BrepHandle[], tolerance?: number): BrepHandle\n shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle\n simplePipe(profile: BrepHandle, spine: BrepHandle): BrepHandle\n simplify(shape: BrepHandle): BrepHandle\n split(shape: BrepHandle, tools: BrepHandle[]): BrepHandle\n sweepPipeShell(profile: BrepHandle, spine: BrepHandle, freenet?: boolean, smooth?: boolean): BrepHandle\n }\n occtApi.buildExtrusionLaw = k.buildExtrusionLaw.bind(primitives)\n occtApi.composeTransform = k.composeTransform.bind(primitives)\n occtApi.downcast = k.downcast.bind(primitives)\n occtApi.healFace = k.healFace.bind(primitives)\n occtApi.healWire = k.healWire.bind(primitives)\n occtApi.isNull = k.isNull.bind(primitives)\n occtApi.iterShapes = k.iterShapes.bind(primitives)\n occtApi.makeEllipsoid = k.makeEllipsoid.bind(primitives)\n occtApi.makeFaceOnSurface = k.makeFaceOnSurface.bind(primitives)\n occtApi.makeTorus = k.makeTorus.bind(primitives)\n occtApi.makeVertex = k.makeVertex.bind(primitives)\n occtApi.mirror = k.mirror.bind(primitives)\n occtApi.sew = k.sew.bind(primitives)\n occtApi.shell = k.shell.bind(primitives)\n occtApi.simplePipe = k.simplePipe.bind(primitives)\n occtApi.simplify = k.simplify.bind(primitives)\n occtApi.split = k.split.bind(primitives)\n occtApi.sweepPipeShell = k.sweepPipeShell.bind(primitives)\n const vendor = OcctWasmAdapter.fromKernel(primitives as never)\n occtApi.boundingBox = (shape) => {\n const b = vendor.boundingBox(shape as never)\n return { xmin: b.min[0], ymin: b.min[1], zmin: b.min[2], xmax: b.max[0], ymax: b.max[1], zmax: b.max[2] }\n }\n occtApi.shapeType = (shape) => vendor.shapeType(shape as never) as BrepSubShapeType\n occtApi.surfaceCenterOfMass = (face) => {\n const v = vendor.surfaceCenterOfMass(face as never)\n return { x: v[0], y: v[1], z: v[2] }\n }\n occtApi.locate = (shape, matrix) => vendor.locate(shape as never, matrix as never) as BrepHandle\n occtApi.copyShape = (shape) => vendor.copyShape(shape as never) as BrepHandle\n occtApi.fixSelfIntersection = (wire) => vendor.fixSelfIntersection(wire as never) as BrepHandle\n occtApi.hullFromPoints = (points, tolerance) => vendor.hullFromPoints(points as never, tolerance) as BrepHandle\n occtApi.loftAdvanced = (wires, options) => vendor.loftAdvanced(wires as never, options as never) as BrepHandle\n occtApi.makeWireFromMixed = (items) => vendor.makeWireFromMixed(items as never) as BrepHandle\n occtApi.revolveVec = (shape, center, direction, angleDeg) =>\n vendor.revolveVec(shape as never, [center.x, center.y, center.z] as never, [direction.x, direction.y, direction.z] as never, angleDeg) as BrepHandle\n occtApi.buildEdgeOnSurface = (curve, surface) => vendor.buildEdgeOnSurface(curve as never, surface as never) as BrepHandle\n occtApi.dispose = (shape) => { if (shape !== undefined) raw.release(shape as number) }\n occtApi.generalTransformNonOrthogonal = (shape, matrix) =>\n vendor.generalTransformNonOrthogonal(shape as never, matrix.slice(0, 9) as never, matrix.slice(9, 12) as never) as BrepHandle\n const toEvolution = (op: {\n shape: number\n evolution: {\n modified: ReadonlyMap<number, readonly number[]>\n generated: ReadonlyMap<number, readonly number[]>\n deleted: ReadonlySet<number>\n }\n }): BrepEvolutionData => {\n const segments = (m: ReadonlyMap<number, readonly number[]>): number[] => {\n const out: number[] = []\n for (const [inHash, outHashes] of m) out.push(inHash, outHashes.length, ...outHashes)\n return out\n }\n return { result: op.shape as BrepHandle, modified: segments(op.evolution.modified), generated: segments(op.evolution.generated), deleted: [...op.evolution.deleted] }\n }\n occtApi.generalTransformWithHistory = (shape, matrix, inputFaceHashes, hashUpperBound) =>\n toEvolution(vendor.generalTransformWithHistory(\n shape as never,\n matrix.slice(0, 9) as never,\n matrix.slice(9, 12) as never,\n false,\n inputFaceHashes as never,\n hashUpperBound,\n ) as never)\n occtApi.applyComposedTransformWithHistory = (shape, matrix, inputFaceHashes, hashUpperBound) =>\n toEvolution(vendor.applyComposedTransformWithHistory(\n shape as never,\n matrix as never,\n inputFaceHashes as never,\n hashUpperBound,\n ) as never)\n occtPatternWired = true\n }\n const occtApi = primitives as BrepEngineApi\n registerBrepEngine(OCCT_BREP_ENGINE_ID, async (): Promise<BrepEngine> => ({\n id: OCCT_BREP_ENGINE_ID,\n primitives: occtApi,\n capabilities: {\n // 面演化:逐核函数名单(不是族级布尔——见 BrepEvolutionKind)。\n evolution: OCCT_EVOLUTION_KINDS,\n // 非演化内核方法:逐核如实声明(Phase 1,P2 缺口补齐;op 声明按此静态判定)。\n methods: OCCT_METHOD_KINDS,\n heal: true,\n directEdit: true,\n advSurface: true,\n assembly: true,\n // P7 并入(D4):OCCT 是精确 B-rep 内核——如实声明 brepjs KernelCapabilities 字段。\n exact: true,\n brepExport: true,\n exactMeasurement: true,\n tessellationModel: 'extract-time',\n },\n }))\n // P7-②:同一装配点把移植内核注册表注入到当前 BREP 引擎(Phase 2 P2-5:取代旧的\n // bindOcctKernel() 固定绑定,改为引擎中立的 injectCurrentBrepEngineAsKernel)。\n // 使 L3 调移植 L2 的 op 在宿主装配后立即可用;幂等,重复调用安全。\n await injectCurrentBrepEngineAsKernel()\n}\n\n/**\n * 内置默认 BREP 引擎装配(OCCT):宿主未注册任何引擎时的缺省值。\n *\n * OCCT 是 faijs 的默认 BREP 引擎——低频率、静态的替换:换引擎 = 宿主在\n * 装配期显式注册其它引擎(首个注册者为默认),或改本处默认。宿主无需为\n * 每次使用自行提供引擎;本函数幂等,已注册任何引擎则 no-op。\n */\nexport async function ensureOcctDefaultEngine(): Promise<void> {\n if (hasBrepEngine()) return\n await registerOcctBrepEngine()\n}\n\n// §7.8 编译期守卫:initOcctWasm 的返回类型必须满足 BrepEngineApi。\n// 若未来 occt-kernel 的导出类型不再满足接口(如接口新增方法)→ tsc 报错列出缺失。\ntype _AssertOcctApi = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n"]}
|
|
@@ -54,10 +54,89 @@ export interface BrepEngineApi {
|
|
|
54
54
|
chamferWithHistory(solid: BrepHandle, edges: BrepHandle[], distance: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
55
55
|
translate(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle;
|
|
56
56
|
scale(shape: BrepHandle, center: BrepVec3, factor: number): BrepHandle;
|
|
57
|
+
/** 3×4 行主序 12 元素矩阵(口径见上方"变换"节注释)。 */
|
|
57
58
|
transform(shape: BrepHandle, matrix: number[]): BrepHandle;
|
|
59
|
+
/** 3×4 行主序 12 元素矩阵(口径见上方"变换"节注释)。 */
|
|
58
60
|
located(shape: BrepHandle, matrix: number[]): BrepHandle;
|
|
61
|
+
/** 3×4 行主序 12 元素矩阵(口径见上方"变换"节注释)。 */
|
|
59
62
|
generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle;
|
|
60
63
|
copy(shape: BrepHandle): BrepHandle;
|
|
64
|
+
/** 线性阵列:沿 direction 复制 count 份(含原位置),返回各份副本句柄数组。 */
|
|
65
|
+
linearPattern(shape: BrepHandle, direction: BrepVec3, spacing: number, count: number): BrepHandle[];
|
|
66
|
+
/** 环形阵列:绕 axis 均分 angleStep 每份,返回各份副本句柄数组。 */
|
|
67
|
+
circularPattern(shape: BrepHandle, center: BrepVec3, axis: BrepVec3, angleStep: number, count: number): BrepHandle[];
|
|
68
|
+
/** 二维栅格阵列:沿两方向复制 countX×countY 份,返回 compound 单句柄。 */
|
|
69
|
+
gridPattern(shape: BrepHandle, directionX: BrepVec3, directionY: BrepVec3, spacingX: number, spacingY: number, countX: number, countY: number): BrepHandle;
|
|
70
|
+
/** 轴对齐包围盒。 */
|
|
71
|
+
boundingBox(shape: BrepHandle): BrepBoundingBox;
|
|
72
|
+
/** 形状类型(vertex/edge/wire/face/shell/solid)。 */
|
|
73
|
+
shapeType(shape: BrepHandle): BrepSubShapeType;
|
|
74
|
+
/** 句柄是否为空(无效引用)。 */
|
|
75
|
+
isNull(shape: BrepHandle): boolean;
|
|
76
|
+
/** 遍历子形状句柄(与 getSubShapes 同族,返回句柄数组)。 */
|
|
77
|
+
iterShapes(shape: BrepHandle): BrepHandle[];
|
|
78
|
+
/** 曲面质心。 */
|
|
79
|
+
surfaceCenterOfMass(face: BrepHandle): BrepVec3;
|
|
80
|
+
/** 带位置矩阵放置(3×4 行主序 12 元素,口径见变换族注释)。 */
|
|
81
|
+
locate(shape: BrepHandle, matrix: number[]): BrepHandle;
|
|
82
|
+
/** 复制句柄(独立引用计数)。 */
|
|
83
|
+
copyShape(shape: BrepHandle): BrepHandle;
|
|
84
|
+
/** 类型降级(目标子形状类型;不匹配返回空句柄)。 */
|
|
85
|
+
downcast(shape: BrepHandle, targetType: BrepSubShapeType): BrepHandle;
|
|
86
|
+
/** 释放内核/句柄(引擎级释放语义;brepkit GC 型 no-op)。 */
|
|
87
|
+
dispose(shape?: BrepHandle): void;
|
|
88
|
+
/** 组合两个 3×4 行主序变换矩阵(12 元素)。 */
|
|
89
|
+
composeTransform(m1: number[], m2: number[]): number[];
|
|
90
|
+
/** 拉伸律面构造(profile 为曲线描述串)。 */
|
|
91
|
+
buildExtrusionLaw(profile: string, length: number, endFactor: number): BrepHandle;
|
|
92
|
+
/** 曲面上的边构造(curve 为 2D 曲线句柄,宽化 BrepHandle 口径)。 */
|
|
93
|
+
buildEdgeOnSurface(curve: BrepHandle, surface: BrepHandle): BrepHandle;
|
|
94
|
+
/** 面修复(ShapeFix,容忍度可选)。 */
|
|
95
|
+
healFace(shape: BrepHandle, tolerance?: number): BrepHandle;
|
|
96
|
+
/** 线修复(ShapeFix,容忍度可选)。 */
|
|
97
|
+
healWire(shape: BrepHandle, tolerance?: number): BrepHandle;
|
|
98
|
+
/** 线自相交修复。 */
|
|
99
|
+
fixSelfIntersection(wire: BrepHandle): BrepHandle;
|
|
100
|
+
/** 点集凸包(tolerance 为容差)。 */
|
|
101
|
+
hullFromPoints(points: BrepVec3[], tolerance: number): BrepHandle;
|
|
102
|
+
/** 高级放样(options 形态同 vendored loftAdvanced)。 */
|
|
103
|
+
loftAdvanced(wires: BrepHandle[], options?: {
|
|
104
|
+
solid?: boolean;
|
|
105
|
+
ruled?: boolean;
|
|
106
|
+
tolerance?: number;
|
|
107
|
+
}): BrepHandle;
|
|
108
|
+
/** 椭球(三半轴)。 */
|
|
109
|
+
makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle;
|
|
110
|
+
/** 曲面上的面构造(face 为承载面、wire 为边界)。 */
|
|
111
|
+
makeFaceOnSurface(face: BrepHandle, wire: BrepHandle): BrepHandle;
|
|
112
|
+
/** 圆环(主/次半径)。 */
|
|
113
|
+
makeTorus(majorRadius: number, minorRadius: number): BrepHandle;
|
|
114
|
+
/** 顶点构造。 */
|
|
115
|
+
makeVertex(x: number, y: number, z: number): BrepHandle;
|
|
116
|
+
/** 混合线构造(items 为边/顶点混合)。 */
|
|
117
|
+
makeWireFromMixed(items: BrepHandle[]): BrepHandle;
|
|
118
|
+
/** 镜像(过 point、法向 normal 的平面)。 */
|
|
119
|
+
mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle;
|
|
120
|
+
/** 旋转(绕过 center、方向 direction 的轴,angle 为度)。 */
|
|
121
|
+
revolveVec(shape: BrepHandle, center: BrepVec3, direction: BrepVec3, angleDeg: number): BrepHandle;
|
|
122
|
+
/** 缝合(tolerance 可选)。 */
|
|
123
|
+
sew(shapes: BrepHandle[], tolerance?: number): BrepHandle;
|
|
124
|
+
/** 抽壳(facesToRemove 移除面、thickness 壁厚、tolerance 容差)。 */
|
|
125
|
+
shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle;
|
|
126
|
+
/** 简单扫掠(profile 沿 spine 扫出实体)。 */
|
|
127
|
+
simplePipe(profile: BrepHandle, spine: BrepHandle): BrepHandle;
|
|
128
|
+
/** 简化几何。 */
|
|
129
|
+
simplify(shape: BrepHandle): BrepHandle;
|
|
130
|
+
/** 分割(tools 切割体;返回单个结果句柄,语义同 vendored boolOps.split)。 */
|
|
131
|
+
split(shape: BrepHandle, tools: BrepHandle[]): BrepHandle;
|
|
132
|
+
/** 管壳扫掠(freenet/smooth 可选)。 */
|
|
133
|
+
sweepPipeShell(profile: BrepHandle, spine: BrepHandle, freenet?: boolean, smooth?: boolean): BrepHandle;
|
|
134
|
+
/** 非正交一般变换(3×4 行主序 12 元素)。 */
|
|
135
|
+
generalTransformNonOrthogonal(shape: BrepHandle, matrix: number[]): BrepHandle;
|
|
136
|
+
/** 一般变换(带面演化;3×4 行主序 12 元素,适配器拆分 linear/translation)。 */
|
|
137
|
+
generalTransformWithHistory(shape: BrepHandle, matrix: number[], inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
138
|
+
/** 组合变换(带面演化;3×4 行主序 12 元素)。 */
|
|
139
|
+
applyComposedTransformWithHistory(shape: BrepHandle, matrix: number[], inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
61
140
|
makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle;
|
|
62
141
|
makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle;
|
|
63
142
|
makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle;
|
|
@@ -119,6 +198,23 @@ export interface BrepEngineApi {
|
|
|
119
198
|
cutWithHistory(a: BrepHandle, b: BrepHandle, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
120
199
|
fuseWithHistory(a: BrepHandle, b: BrepHandle, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
121
200
|
intersectWithHistory(a: BrepHandle, b: BrepHandle, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
201
|
+
/** 平移 + 面演化(权威 hash→hash 映射,替代序号对齐近似)。 */
|
|
202
|
+
translateWithHistory(shape: BrepHandle, dx: number, dy: number, dz: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
203
|
+
/** 绕任意轴旋转 + 面演化。`axis = {point, direction}`,`angleRad` 为**弧度**。 */
|
|
204
|
+
rotateWithHistory(shape: BrepHandle, axis: {
|
|
205
|
+
point: BrepVec3;
|
|
206
|
+
direction: BrepVec3;
|
|
207
|
+
}, angleRad: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
208
|
+
/** 镜像 + 面演化。`point` 为镜像面上一点,`normal` 为镜像面法向。 */
|
|
209
|
+
mirrorWithHistory(shape: BrepHandle, point: BrepVec3, normal: BrepVec3, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
210
|
+
/** 缩放 + 面演化。⚠️ 仅**均匀**缩放(`factor: number`);非均匀走 `generalTransform`(无历史)。 */
|
|
211
|
+
scaleWithHistory(shape: BrepHandle, center: BrepVec3, factor: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
212
|
+
/** 抽壳 + 面演化。`faces` 为被移除的面(开口),`thickness` 为壁厚。 */
|
|
213
|
+
shellWithHistory(solid: BrepHandle, faces: BrepHandle[], thickness: number, tolerance: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
214
|
+
/** 偏移 + 面演化。 */
|
|
215
|
+
offsetWithHistory(solid: BrepHandle, distance: number, tolerance: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
216
|
+
/** 加厚(面/壳 → 实体)+ 面演化。 */
|
|
217
|
+
thickenWithHistory(shape: BrepHandle, thickness: number, tolerance: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
|
|
122
218
|
createXCAFDocument(): BrepXcafDocument;
|
|
123
219
|
importXCAFFromSTEP(stepData: string): BrepXcafDocument;
|
|
124
220
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,QAAQ,EACR,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB;;;GAGG;AACH,MAAM,WAAW,aAAa;IAE5B,+BAA+B;IAC/B,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IAGhC,OAAO,CAAC,EAAE,EAAE,MAAM,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MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,yBAAyB;IACzB,kBAAkB,CAChB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IAGpB,kBAAkB,IAAI,gBAAgB,CAAA;IACtC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACvD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,4BAA4B,CAAC,IAAI,SAAS,aAAa,IAAI,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * engine/primitives — BREP 引擎契约面(port 面)\n *\n *\n * ⚠️ Phase 0 落地形态:覆盖 §2.3 实测的 66 个被调方法(BrepHandle 中立签名),\n * 供类型解耦使用。Phase 1 按 §7.4 扩到 83 项分 14 族,并落地编译期完整性守卫\n * (_AssertSatisfiesBrepEngineApi,抄 brepjs §3.2)。\n * 复杂返回类型(XCAF 文档 / NURBS 曲线数据等)在 Phase 0 用 unknown 占位,Phase 1 钉死。\n *\n * 命名沿用 occt-wasm 现状——最小迁移成本 + 可演进(§7.4 的取舍)。\n */\n\nimport type {\n BrepBoundingBox,\n BrepCurveParameters,\n BrepEdgeData,\n BrepEvolutionData,\n BrepHandle,\n BrepMeshResult,\n BrepSubShapeType,\n BrepTessellateOptions,\n BrepUvBounds,\n BrepVec3,\n BrepXcafDocument,\n} from './types'\n\n/**\n * BREP 引擎原语契约。所有句柄参数/返回值均为 BrepHandle(不透明值,§6.3)。\n * 引擎实现(occt/remus 适配器)负责内部句柄形态与 BrepHandle 的转换。\n */\nexport interface BrepEngineApi {\n // ── 生命周期 ──\n /** 手工释放句柄(GC 型引擎实现为 no-op)。 */\n release(shape: BrepHandle): void\n\n // ── 实体图元 ──\n makeBox(dx: number, dy: number, dz: number): BrepHandle\n makeBoxFromCorners(corner1: BrepVec3, corner2: BrepVec3): BrepHandle\n makeCylinder(radius: number, height: number): BrepHandle\n makeSphere(radius: number): BrepHandle\n makeCone(r1: number, r2: number, height: number): BrepHandle\n makeRectangle(width: number, height: number): BrepHandle\n\n // ── 造型运算 ──\n extrude(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n loft(wires: BrepHandle[], isSolid: boolean, ruled: boolean): BrepHandle\n\n // ── 布尔与分割 ──\n fuse(a: BrepHandle, b: BrepHandle): BrepHandle\n cut(a: BrepHandle, b: BrepHandle): BrepHandle\n common(a: BrepHandle, b: BrepHandle): BrepHandle\n intersect(a: BrepHandle, b: BrepHandle): BrepHandle\n section(a: BrepHandle, b: BrepHandle): BrepHandle\n fuseAll(shapes: BrepHandle[]): BrepHandle\n\n // ── 倒角与圆角(directEdit 能力)──\n /** 等距倒角:逐边 `BRepFilletAPI_MakeChamfer::Add(distance, E)`。 */\n chamfer(solid: BrepHandle, edges: BrepHandle[], distance: number): BrepHandle\n /**\n * 距角倒角:`AddDA(distance, angleRad, E, F)`。\n * ⚠️ F 由内核自选(外层 TopExp_Explorer 第一个含该边的面),调用方不可指定。\n */\n chamferDistAngle(\n solid: BrepHandle, edges: BrepHandle[], distance: number, angleDeg: number,\n ): BrepHandle\n /** 等半径圆角:`BRepFilletAPI_MakeFillet::Add(radius, E)`。 */\n fillet(solid: BrepHandle, edges: BrepHandle[], radius: number): BrepHandle\n /** 变半径圆角:单边 `BRepFilletAPI_MakeFillet::Add(startRadius, endRadius, E)`。 */\n filletVariable(solid: BrepHandle, edge: BrepHandle, startRadius: number, endRadius: number): BrepHandle\n /**\n * 等半径圆角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n filletWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n radius: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /**\n * 等距倒角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n chamferWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n distance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── 变换 ──\n translate(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n scale(shape: BrepHandle, center: BrepVec3, factor: number): BrepHandle\n transform(shape: BrepHandle, matrix: number[]): BrepHandle\n located(shape: BrepHandle, matrix: number[]): BrepHandle\n generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle\n copy(shape: BrepHandle): BrepHandle\n\n // ── 曲线构造 ──\n makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle\n makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle\n makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle\n\n // ── 拓扑构造 ──\n makeWire(edges: BrepHandle[]): BrepHandle\n makeFace(wire: BrepHandle): BrepHandle\n makeCompound(shapes: BrepHandle[]): BrepHandle\n sewAndSolidify(faces: BrepHandle[], tolerance?: number): BrepHandle\n buildTriFace(a: BrepVec3, b: BrepVec3, c: BrepVec3): BrepHandle\n addHolesInFace(face: BrepHandle, holeWires: BrepHandle[]): BrepHandle\n\n // ── 三角化(BREP→mesh 唯一出口,断链物化依赖,硬必需) ──\n meshShape(shape: BrepHandle, options?: BrepTessellateOptions): BrepMeshResult\n wireframe(shape: BrepHandle, deflection?: number): BrepEdgeData\n\n // ── 拓扑查询 ──\n getSubShapes(shape: BrepHandle, type: BrepSubShapeType): BrepHandle[]\n /** 批量查询(§2.3:生产路径零调用,仅测试使用;Phase 1 钉死返回形态)。 */\n queryBatch(shapes: BrepHandle[]): Array<{ area: number }>\n subShapeHashes(shape: BrepHandle, type: BrepSubShapeType, hashUpperBound: number): number[]\n hashCode(shape: BrepHandle, upperBound: number): number\n isSame(a: BrepHandle, b: BrepHandle): boolean\n isSolid(shape: BrepHandle): boolean\n /** 方向标识(与内核 ShapeOrientation 同构:'forward'|'reversed'|'internal'|'external')。 */\n shapeOrientation(shape: BrepHandle): string\n\n // ── 几何求值 ──\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n curveType(edge: BrepHandle): string\n curvePointAtParam(edge: BrepHandle, param: number): BrepVec3\n curveTangent(edge: BrepHandle, param: number): BrepVec3\n curveParameters(edge: BrepHandle): BrepCurveParameters\n curveIsClosed(edge: BrepHandle): boolean\n curveLength(edge: BrepHandle): number\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n surfaceType(face: BrepHandle): string\n surfaceNormal(face: BrepHandle, u: number, v: number): BrepVec3\n pointOnSurface(face: BrepHandle, u: number, v: number): BrepVec3\n uvBounds(face: BrepHandle): BrepUvBounds\n getSurfaceCenterOfMass(face: BrepHandle): BrepVec3\n /** Phase 1 钉死返回形态(topologyExt 仅读 radius)。 */\n getFaceCylinderData(face: BrepHandle): { radius: number } | null\n /** Phase 1 钉死返回形态(topologyExt 读 degree/periodic/rational)。 */\n getNurbsCurveData(edge: BrepHandle): { degree: number; periodic: boolean; rational: boolean } | null\n\n // ── 测量 ──\n getBoundingBox(shape: BrepHandle, useTriangulation?: boolean): BrepBoundingBox\n getVolume(shape: BrepHandle): number\n getCenterOfMass(shape: BrepHandle): BrepVec3\n\n // ── 校验与修复 ──\n isValid(shape: BrepHandle): boolean\n unifySameDomain(shape: BrepHandle): BrepHandle\n healSolid(shape: BrepHandle, tolerance?: number): BrepHandle\n fixShape(shape: BrepHandle): BrepHandle\n fixFaceOrientations(shape: BrepHandle): BrepHandle\n removeDegenerateEdges(shape: BrepHandle): BrepHandle\n\n // ── IO ──\n importStep(data: string | ArrayBuffer): BrepHandle\n exportStep(shape: BrepHandle): string\n importStl(data: string | ArrayBuffer): BrepHandle\n fromBREP(data: string): BrepHandle\n\n // ── 面演化(可选能力槽 §7.5 EvolutionCapability) ──\n cutWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n fuseWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n intersectWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── XCAF 装配(可选能力槽 §7.5 AssemblyCapability,Phase 1 钉死完整形态) ──\n createXCAFDocument(): BrepXcafDocument\n importXCAFFromSTEP(stepData: string): BrepXcafDocument\n}\n\n/**\n * 编译期完整性守卫(§7.8,抄 brepjs §3.2 的 _AssertSatisfiesKernelShape)。\n *\n * 用法(适配器里):\n * ```ts\n * type _AssertOcct = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n * ```\n * 若实现类型缺少接口中的任何方法(或签名不兼容)→ tsc 报错并列出缺失属性。\n * 引擎换用 / 接口演进(Phase 1 扩到 83 项)时,失配在编译期暴露,而非运行时黑盒。\n */\nexport type AssertSatisfiesBrepEngineApi<Impl extends BrepEngineApi> = Impl\n"]}
|
|
1
|
+
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * engine/primitives — BREP 引擎契约面(port 面)\n *\n *\n * ⚠️ Phase 0 落地形态:覆盖 §2.3 实测的 66 个被调方法(BrepHandle 中立签名),\n * 供类型解耦使用。Phase 1 按 §7.4 扩到 83 项分 14 族,并落地编译期完整性守卫\n * (_AssertSatisfiesBrepEngineApi,抄 brepjs §3.2)。\n * 复杂返回类型(XCAF 文档 / NURBS 曲线数据等)在 Phase 0 用 unknown 占位,Phase 1 钉死。\n *\n * 命名沿用 occt-wasm 现状——最小迁移成本 + 可演进(§7.4 的取舍)。\n */\n\nimport type {\n BrepBoundingBox,\n BrepCurveParameters,\n BrepEdgeData,\n BrepEvolutionData,\n BrepHandle,\n BrepMeshResult,\n BrepSubShapeType,\n BrepTessellateOptions,\n BrepUvBounds,\n BrepVec3,\n BrepXcafDocument,\n} from './types'\n\n/**\n * BREP 引擎原语契约。所有句柄参数/返回值均为 BrepHandle(不透明值,§6.3)。\n * 引擎实现(occt/remus 适配器)负责内部句柄形态与 BrepHandle 的转换。\n */\nexport interface BrepEngineApi {\n // ── 生命周期 ──\n /** 手工释放句柄(GC 型引擎实现为 no-op)。 */\n release(shape: BrepHandle): void\n\n // ── 实体图元 ──\n makeBox(dx: number, dy: number, dz: number): BrepHandle\n makeBoxFromCorners(corner1: BrepVec3, corner2: BrepVec3): BrepHandle\n makeCylinder(radius: number, height: number): BrepHandle\n makeSphere(radius: number): BrepHandle\n makeCone(r1: number, r2: number, height: number): BrepHandle\n makeRectangle(width: number, height: number): BrepHandle\n\n // ── 造型运算 ──\n extrude(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n loft(wires: BrepHandle[], isSolid: boolean, ruled: boolean): BrepHandle\n\n // ── 布尔与分割 ──\n fuse(a: BrepHandle, b: BrepHandle): BrepHandle\n cut(a: BrepHandle, b: BrepHandle): BrepHandle\n common(a: BrepHandle, b: BrepHandle): BrepHandle\n intersect(a: BrepHandle, b: BrepHandle): BrepHandle\n section(a: BrepHandle, b: BrepHandle): BrepHandle\n fuseAll(shapes: BrepHandle[]): BrepHandle\n\n // ── 倒角与圆角(directEdit 能力)──\n /** 等距倒角:逐边 `BRepFilletAPI_MakeChamfer::Add(distance, E)`。 */\n chamfer(solid: BrepHandle, edges: BrepHandle[], distance: number): BrepHandle\n /**\n * 距角倒角:`AddDA(distance, angleRad, E, F)`。\n * ⚠️ F 由内核自选(外层 TopExp_Explorer 第一个含该边的面),调用方不可指定。\n */\n chamferDistAngle(\n solid: BrepHandle, edges: BrepHandle[], distance: number, angleDeg: number,\n ): BrepHandle\n /** 等半径圆角:`BRepFilletAPI_MakeFillet::Add(radius, E)`。 */\n fillet(solid: BrepHandle, edges: BrepHandle[], radius: number): BrepHandle\n /** 变半径圆角:单边 `BRepFilletAPI_MakeFillet::Add(startRadius, endRadius, E)`。 */\n filletVariable(solid: BrepHandle, edge: BrepHandle, startRadius: number, endRadius: number): BrepHandle\n /**\n * 等半径圆角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n filletWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n radius: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /**\n * 等距倒角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n chamferWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n distance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── 变换 ──\n // 矩阵口径(唯一权威):matrix 参数是 **3×4 行主序、12 个 double**——\n // [r00,r01,r02,tx, r10,r11,r12,ty, r20,r21,r22,tz],与 brep/brep-ops.ts 的\n // matrixToArray()(THREE.Matrix4 column-major → 行主序 3×4)产出同构。\n // 各引擎方言不同(如 brepkit transformSolid 吃 4×4 行主序 16 元素)时,\n // 由该引擎适配层内部转换(见 brepkit-kernel/brepkitKernel.ts 的 toKernelMatrix\n // 唯一转换点),禁止要求调用方适配引擎方言。\n translate(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n scale(shape: BrepHandle, center: BrepVec3, factor: number): BrepHandle\n /** 3×4 行主序 12 元素矩阵(口径见上方\"变换\"节注释)。 */\n transform(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 3×4 行主序 12 元素矩阵(口径见上方\"变换\"节注释)。 */\n located(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 3×4 行主序 12 元素矩阵(口径见上方\"变换\"节注释)。 */\n generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle\n copy(shape: BrepHandle): BrepHandle\n\n // ── 阵列(Phase 2:pattern 族;occt-wasm 原生 + brepkit wasm 已导出) ──\n // 口径(vendored brepjs 内核调用面,docs/plans/2026-09-23-brep-engine-switchability-rework.md §Phase 2):\n // - 两内核的 pattern 内核函数都返回 compound(含全部副本),适配器负责拆成数组;\n // - 不声明 rectangularPattern:vendored rectangularPattern 是纯 JS 组合\n // (compoundOpsFns.ts,translate + fuseAll),不调内核方法(capability-map 实证);\n // - 不声明裸 mirror/rotate:vendored transformFns 全部走 `*WithHistory` 内核\n // (transformFns.ts:29-99 实证),基础方法仅 2D sketcher 面使用(走 KernelAdapter)。\n /** 线性阵列:沿 direction 复制 count 份(含原位置),返回各份副本句柄数组。 */\n linearPattern(shape: BrepHandle, direction: BrepVec3, spacing: number, count: number): BrepHandle[]\n /** 环形阵列:绕 axis 均分 angleStep 每份,返回各份副本句柄数组。 */\n circularPattern(\n shape: BrepHandle,\n center: BrepVec3,\n axis: BrepVec3,\n angleStep: number,\n count: number,\n ): BrepHandle[]\n /** 二维栅格阵列:沿两方向复制 countX×countY 份,返回 compound 单句柄。 */\n gridPattern(\n shape: BrepHandle,\n directionX: BrepVec3,\n directionY: BrepVec3,\n spacingX: number,\n spacingY: number,\n countX: number,\n countY: number,\n ): BrepHandle\n\n // ── 查询与测量(Phase 3:capability-map 64 方法登记补全——occt-wasm 原生或\n // vendored 适配器组合面;brepkit 无实现的能力保持不声明,静态判定拦截) ──\n /** 轴对齐包围盒。 */\n boundingBox(shape: BrepHandle): BrepBoundingBox\n /** 形状类型(vertex/edge/wire/face/shell/solid)。 */\n shapeType(shape: BrepHandle): BrepSubShapeType\n /** 句柄是否为空(无效引用)。 */\n isNull(shape: BrepHandle): boolean\n /** 遍历子形状句柄(与 getSubShapes 同族,返回句柄数组)。 */\n iterShapes(shape: BrepHandle): BrepHandle[]\n /** 曲面质心。 */\n surfaceCenterOfMass(face: BrepHandle): BrepVec3\n /** 带位置矩阵放置(3×4 行主序 12 元素,口径见变换族注释)。 */\n locate(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 复制句柄(独立引用计数)。 */\n copyShape(shape: BrepHandle): BrepHandle\n /** 类型降级(目标子形状类型;不匹配返回空句柄)。 */\n downcast(shape: BrepHandle, targetType: BrepSubShapeType): BrepHandle\n /** 释放内核/句柄(引擎级释放语义;brepkit GC 型 no-op)。 */\n dispose(shape?: BrepHandle): void\n /** 组合两个 3×4 行主序变换矩阵(12 元素)。 */\n composeTransform(m1: number[], m2: number[]): number[]\n\n // ── 构形与修复(Phase 3 登记;brepkit 未实现 → 能力表不声明) ──\n /** 拉伸律面构造(profile 为曲线描述串)。 */\n buildExtrusionLaw(profile: string, length: number, endFactor: number): BrepHandle\n /** 曲面上的边构造(curve 为 2D 曲线句柄,宽化 BrepHandle 口径)。 */\n buildEdgeOnSurface(curve: BrepHandle, surface: BrepHandle): BrepHandle\n /** 面修复(ShapeFix,容忍度可选)。 */\n healFace(shape: BrepHandle, tolerance?: number): BrepHandle\n /** 线修复(ShapeFix,容忍度可选)。 */\n healWire(shape: BrepHandle, tolerance?: number): BrepHandle\n /** 线自相交修复。 */\n fixSelfIntersection(wire: BrepHandle): BrepHandle\n /** 点集凸包(tolerance 为容差)。 */\n hullFromPoints(points: BrepVec3[], tolerance: number): BrepHandle\n /** 高级放样(options 形态同 vendored loftAdvanced)。 */\n loftAdvanced(wires: BrepHandle[], options?: { solid?: boolean; ruled?: boolean; tolerance?: number }): BrepHandle\n /** 椭球(三半轴)。 */\n makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle\n /** 曲面上的面构造(face 为承载面、wire 为边界)。 */\n makeFaceOnSurface(face: BrepHandle, wire: BrepHandle): BrepHandle\n /** 圆环(主/次半径)。 */\n makeTorus(majorRadius: number, minorRadius: number): BrepHandle\n /** 顶点构造。 */\n makeVertex(x: number, y: number, z: number): BrepHandle\n /** 混合线构造(items 为边/顶点混合)。 */\n makeWireFromMixed(items: BrepHandle[]): BrepHandle\n /** 镜像(过 point、法向 normal 的平面)。 */\n mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle\n /** 旋转(绕过 center、方向 direction 的轴,angle 为度)。 */\n revolveVec(shape: BrepHandle, center: BrepVec3, direction: BrepVec3, angleDeg: number): BrepHandle\n /** 缝合(tolerance 可选)。 */\n sew(shapes: BrepHandle[], tolerance?: number): BrepHandle\n /** 抽壳(facesToRemove 移除面、thickness 壁厚、tolerance 容差)。 */\n shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle\n /** 简单扫掠(profile 沿 spine 扫出实体)。 */\n simplePipe(profile: BrepHandle, spine: BrepHandle): BrepHandle\n /** 简化几何。 */\n simplify(shape: BrepHandle): BrepHandle\n /** 分割(tools 切割体;返回单个结果句柄,语义同 vendored boolOps.split)。 */\n split(shape: BrepHandle, tools: BrepHandle[]): BrepHandle\n /** 管壳扫掠(freenet/smooth 可选)。 */\n sweepPipeShell(profile: BrepHandle, spine: BrepHandle, freenet?: boolean, smooth?: boolean): BrepHandle\n /** 非正交一般变换(3×4 行主序 12 元素)。 */\n generalTransformNonOrthogonal(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 一般变换(带面演化;3×4 行主序 12 元素,适配器拆分 linear/translation)。 */\n generalTransformWithHistory(\n shape: BrepHandle,\n matrix: number[],\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 组合变换(带面演化;3×4 行主序 12 元素)。 */\n applyComposedTransformWithHistory(\n shape: BrepHandle,\n matrix: number[],\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n\n // ── 曲线构造 ──\n makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle\n makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle\n makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle\n\n // ── 拓扑构造 ──\n makeWire(edges: BrepHandle[]): BrepHandle\n makeFace(wire: BrepHandle): BrepHandle\n makeCompound(shapes: BrepHandle[]): BrepHandle\n sewAndSolidify(faces: BrepHandle[], tolerance?: number): BrepHandle\n buildTriFace(a: BrepVec3, b: BrepVec3, c: BrepVec3): BrepHandle\n addHolesInFace(face: BrepHandle, holeWires: BrepHandle[]): BrepHandle\n\n // ── 三角化(BREP→mesh 唯一出口,断链物化依赖,硬必需) ──\n meshShape(shape: BrepHandle, options?: BrepTessellateOptions): BrepMeshResult\n wireframe(shape: BrepHandle, deflection?: number): BrepEdgeData\n\n // ── 拓扑查询 ──\n getSubShapes(shape: BrepHandle, type: BrepSubShapeType): BrepHandle[]\n /** 批量查询(§2.3:生产路径零调用,仅测试使用;Phase 1 钉死返回形态)。 */\n queryBatch(shapes: BrepHandle[]): Array<{ area: number }>\n subShapeHashes(shape: BrepHandle, type: BrepSubShapeType, hashUpperBound: number): number[]\n hashCode(shape: BrepHandle, upperBound: number): number\n isSame(a: BrepHandle, b: BrepHandle): boolean\n isSolid(shape: BrepHandle): boolean\n /** 方向标识(与内核 ShapeOrientation 同构:'forward'|'reversed'|'internal'|'external')。 */\n shapeOrientation(shape: BrepHandle): string\n\n // ── 几何求值 ──\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n curveType(edge: BrepHandle): string\n curvePointAtParam(edge: BrepHandle, param: number): BrepVec3\n curveTangent(edge: BrepHandle, param: number): BrepVec3\n curveParameters(edge: BrepHandle): BrepCurveParameters\n curveIsClosed(edge: BrepHandle): boolean\n curveLength(edge: BrepHandle): number\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n surfaceType(face: BrepHandle): string\n surfaceNormal(face: BrepHandle, u: number, v: number): BrepVec3\n pointOnSurface(face: BrepHandle, u: number, v: number): BrepVec3\n uvBounds(face: BrepHandle): BrepUvBounds\n getSurfaceCenterOfMass(face: BrepHandle): BrepVec3\n /** Phase 1 钉死返回形态(topologyExt 仅读 radius)。 */\n getFaceCylinderData(face: BrepHandle): { radius: number } | null\n /** Phase 1 钉死返回形态(topologyExt 读 degree/periodic/rational)。 */\n getNurbsCurveData(edge: BrepHandle): { degree: number; periodic: boolean; rational: boolean } | null\n\n // ── 测量 ──\n getBoundingBox(shape: BrepHandle, useTriangulation?: boolean): BrepBoundingBox\n getVolume(shape: BrepHandle): number\n getCenterOfMass(shape: BrepHandle): BrepVec3\n\n // ── 校验与修复 ──\n isValid(shape: BrepHandle): boolean\n unifySameDomain(shape: BrepHandle): BrepHandle\n healSolid(shape: BrepHandle, tolerance?: number): BrepHandle\n fixShape(shape: BrepHandle): BrepHandle\n fixFaceOrientations(shape: BrepHandle): BrepHandle\n removeDegenerateEdges(shape: BrepHandle): BrepHandle\n\n // ── IO ──\n importStep(data: string | ArrayBuffer): BrepHandle\n exportStep(shape: BrepHandle): string\n importStl(data: string | ArrayBuffer): BrepHandle\n fromBREP(data: string): BrepHandle\n\n // ── 面演化(可选能力槽 §7.5 EvolutionCapability) ──\n cutWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n fuseWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n intersectWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── 面演化 · Phase 0.1 补齐的 7 个(occt-wasm 运行时本就存在) ──\n //\n // ⚠️ 为什么此前只有 5 个:faijs 只绑了 boolean 与 fillet/chamfer,那 7 个在\n // `occt-wasm@3.8.4` 的运行时**一直都在**(dist/index.d.ts:458-472 共 12 个),\n // 只是 faijs 类型层未声明、也无人调用。补齐**不动 WASM**。\n //\n // ⚠️ 注意:`initOcctWasm()` 的返回类型在本文件之外已被硬断言为 BrepEngineApi\n // (occtKernel.ts:88/95/106/112 `as unknown as`)⇒ 下方 `_AssertOcctApi`\n // 恒真、**无校验力**。声明 ≠ 运行时存在:存在性由\n // `packages/core/src/brep/engine/evolution-bindings.test.ts` 的冒烟测试钉住。\n\n /** 平移 + 面演化(权威 hash→hash 映射,替代序号对齐近似)。 */\n translateWithHistory(\n shape: BrepHandle,\n dx: number,\n dy: number,\n dz: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 绕任意轴旋转 + 面演化。`axis = {point, direction}`,`angleRad` 为**弧度**。 */\n rotateWithHistory(\n shape: BrepHandle,\n axis: { point: BrepVec3; direction: BrepVec3 },\n angleRad: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 镜像 + 面演化。`point` 为镜像面上一点,`normal` 为镜像面法向。 */\n mirrorWithHistory(\n shape: BrepHandle,\n point: BrepVec3,\n normal: BrepVec3,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 缩放 + 面演化。⚠️ 仅**均匀**缩放(`factor: number`);非均匀走 `generalTransform`(无历史)。 */\n scaleWithHistory(\n shape: BrepHandle,\n center: BrepVec3,\n factor: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 抽壳 + 面演化。`faces` 为被移除的面(开口),`thickness` 为壁厚。 */\n shellWithHistory(\n solid: BrepHandle,\n faces: BrepHandle[],\n thickness: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 偏移 + 面演化。 */\n offsetWithHistory(\n solid: BrepHandle,\n distance: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 加厚(面/壳 → 实体)+ 面演化。 */\n thickenWithHistory(\n shape: BrepHandle,\n thickness: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── XCAF 装配(可选能力槽 §7.5 AssemblyCapability,Phase 1 钉死完整形态) ──\n createXCAFDocument(): BrepXcafDocument\n importXCAFFromSTEP(stepData: string): BrepXcafDocument\n}\n\n/**\n * 编译期完整性守卫(§7.8,抄 brepjs §3.2 的 _AssertSatisfiesKernelShape)。\n *\n * 用法(适配器里):\n * ```ts\n * type _AssertOcct = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n * ```\n * 若实现类型缺少接口中的任何方法(或签名不兼容)→ tsc 报错并列出缺失属性。\n * 引擎换用 / 接口演进(Phase 1 扩到 83 项)时,失配在编译期暴露,而非运行时黑盒。\n */\nexport type AssertSatisfiesBrepEngineApi<Impl extends BrepEngineApi> = Impl\n"]}
|
|
@@ -69,15 +69,37 @@ export interface BrepEdgeData {
|
|
|
69
69
|
/** 不同边的数量 */
|
|
70
70
|
edgeCount: number;
|
|
71
71
|
}
|
|
72
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* *WithHistory 面演化数据(modified/generated/deleted 用面 hash 编码)。
|
|
74
|
+
*
|
|
75
|
+
* ⚠️ **三个字段的编码不同,实测于 2026-09-22(`brep/engine/phase0-kernel-probes.test.ts`),
|
|
76
|
+
* 与 occt-wasm 自己的文档(`dist/types.d.ts:227-231`)不符**:
|
|
77
|
+
*
|
|
78
|
+
* | 字段 | 实际编码 | 键/值语义 |
|
|
79
|
+
* |---|---|---|
|
|
80
|
+
* | `modified` | **分段** `[inHash, count, outHash…] × N` | 键 = 输入面 hash;值 = 该输入面在结果里的**后继**(可 1→N) |
|
|
81
|
+
* | `generated` | **同构分段**,**键集与 `modified` 相同** | 值 = 该输入面派生出的**中间形**(实测结果里 0 存活) |
|
|
82
|
+
* | `deleted` | **扁平** hash 数组 | 输入面中已不存在的面 |
|
|
83
|
+
*
|
|
84
|
+
* 「扁平数组」的读法会把 `generated` 的 count 字段当成 hash——
|
|
85
|
+
* 实测 `cut` 的 `generated` 里真的含 `2`(一个 count),故该误读不会自己暴露。
|
|
86
|
+
*
|
|
87
|
+
* ⚠️ **未受影响的面有两种上报形态,两种都表示"未变"**:自映射(`i -> [i]`)。
|
|
88
|
+
* 或者**整个不上报**(`fillet` 实测两者并存)。⇒ 读法必须是
|
|
89
|
+
* `modified.get(h) ?? [h]`,不能只看"是否出现在 `modified` 里"。
|
|
90
|
+
*
|
|
91
|
+
* ⇒ 结果面的三种命运(判据见 `phase0-kernel-probes.test.ts`):
|
|
92
|
+
* **原样幸存**(hash ∈ 输入 hash 集合,hash 逐字不变)/ **改型幸存**(在 `modified` 输出里)/
|
|
93
|
+
* **新造**(两者皆非——这才是真正需要派生词汇命名的面,如 `fillet` 的过渡面)。
|
|
94
|
+
*/
|
|
73
95
|
export interface BrepEvolutionData {
|
|
74
96
|
/** 结果句柄 */
|
|
75
97
|
result: BrepHandle;
|
|
76
|
-
/**
|
|
98
|
+
/** 分段:`[inHash, count, outHash…] × N`;值 = 该输入面的结果后继 */
|
|
77
99
|
modified: number[];
|
|
78
|
-
/**
|
|
100
|
+
/** 分段(键集同 `modified`):该输入面派生的中间形 hash,实测结果里 0 存活 */
|
|
79
101
|
generated: number[];
|
|
80
|
-
/**
|
|
102
|
+
/** 扁平:输入面中已不存在的面 hash */
|
|
81
103
|
deleted: number[];
|
|
82
104
|
}
|
|
83
105
|
/** 曲线参数区间(与内核 curveParameters 返回同构:first/last)。 */
|
|
@@ -117,6 +139,36 @@ export interface BrepXcafDocument {
|
|
|
117
139
|
* - `'none'` — 无细分控制(或非网格内核)。
|
|
118
140
|
*/
|
|
119
141
|
export type BrepTessellationModel = 'build-time' | 'extract-time' | 'none';
|
|
142
|
+
/**
|
|
143
|
+
* 面演化(`*WithHistory`)核函数名——与内核方法同名,**逐核函数**声明。
|
|
144
|
+
*
|
|
145
|
+
* ⚠️ **为什么不能是一个布尔位**(2026-09-22 Phase 0.2):`evolution: true` 是**族级**声明。
|
|
146
|
+
* 而「本内核提供面演化」这句话在建面上不成立——每个 `*WithHistory` 是一个独立核函数,
|
|
147
|
+
* 内核可以只提供其中一部分。`brepkit` 就是活例:它提供 `fuse`/`cut`/`fillet`,
|
|
148
|
+
* `chamfer`/`intersect`/`translate`/… 一律 `unsupported(...)`
|
|
149
|
+
* (`brepkit-kernel/brepkitKernel.ts:220-537`)。
|
|
150
|
+
*
|
|
151
|
+
* 族级布尔的后果不是"少报"而是**多报**:`cad.intersect` 声明需要 `evolution`,
|
|
152
|
+
* 在 `evolution: true` 下通过静态判定 → 落到运行时才撞 `unsupported('intersectWithHistory')`。
|
|
153
|
+
* 这直接违反 AGENTS.md 红线「BREP 路径能否走由静态规则判定,禁止运行时回退」——
|
|
154
|
+
* 静态判定之所以能成立,前提是引擎的能力声明**说的是逐核函数的实话**。
|
|
155
|
+
*
|
|
156
|
+
* ⇒ 引擎声明"我提供哪几个"(`BrepCapabilities.evolution`),op 声明"我要哪一个"
|
|
157
|
+
* (`defineOp.capabilities`),两者**按名字求交集**(`cad-runtime/backend-dispatch.ts`)。
|
|
158
|
+
*/
|
|
159
|
+
export type BrepEvolutionKind = 'fuseWithHistory' | 'cutWithHistory' | 'intersectWithHistory' | 'filletWithHistory' | 'chamferWithHistory' | 'translateWithHistory' | 'rotateWithHistory' | 'mirrorWithHistory' | 'scaleWithHistory' | 'shellWithHistory' | 'offsetWithHistory' | 'thickenWithHistory';
|
|
160
|
+
/**
|
|
161
|
+
* 非演化内核方法真名(`*WithHistory` 之外的 `BrepEngineApi` 方法)。
|
|
162
|
+
*
|
|
163
|
+
* 与 `BrepEvolutionKind` 分名(P3 冲突消除):`'mirror'` 一个字符串不能同时表示
|
|
164
|
+
* "提供 `mirrorWithHistory`"与"提供 `mirror`",两族必须互不共用字符串。
|
|
165
|
+
* 语义与 evolution 相同——**逐核函数**声明:声明 = 实现(诚实原则),
|
|
166
|
+
* 缺省/空 = 一个都不提供。
|
|
167
|
+
*
|
|
168
|
+
* 初始全集 = Phase 0 能力映射表(`api/surface/capability-map.json`)盘点的
|
|
169
|
+
* compat op 依赖内核方法 + 方案初始项;Phase 3 全量收敛时按映射表滚动补全。
|
|
170
|
+
*/
|
|
171
|
+
export type BrepMethodKind = 'linearPattern' | 'circularPattern' | 'gridPattern' | 'rectangularPattern' | 'mirror' | 'rotate' | 'translate' | 'scale' | 'chamfer' | 'chamferDistAngle' | 'fillet' | 'filletVariable' | 'makeRectangle' | 'shell' | 'extrude' | 'loft' | 'loftAdvanced' | 'section' | 'sweepPipeShell' | 'simplePipe' | 'revolveVec' | 'buildExtrusionLaw' | 'fuse' | 'cut' | 'intersect' | 'fuseAll' | 'makeArcEdge' | 'makeBezierEdge' | 'makeCylinder' | 'makeEllipsoid' | 'makeFace' | 'makeFaceOnSurface' | 'makeLineEdge' | 'makeTorus' | 'makeVertex' | 'makeWireFromMixed' | 'buildEdgeOnSurface' | 'addHolesInFace' | 'buildTriFace' | 'sew' | 'sewAndSolidify' | 'healFace' | 'healSolid' | 'healWire' | 'fixShape' | 'fixSelfIntersection' | 'isValid' | 'removeDegenerateEdges' | 'simplify' | 'split' | 'boundingBox' | 'curveParameters' | 'curvePointAtParam' | 'curveTangent' | 'hullFromPoints' | 'isNull' | 'iterShapes' | 'locate' | 'shapeType' | 'surfaceCenterOfMass' | 'surfaceNormal' | 'surfaceType' | 'uvBounds' | 'composeTransform' | 'applyComposedTransformWithHistory' | 'generalTransformNonOrthogonal' | 'generalTransformWithHistory' | 'importStl' | 'createXCAFDocument' | 'importXCAFFromSTEP' | 'copyShape' | 'dispose' | 'downcast' | 'hashCode';
|
|
120
172
|
/**
|
|
121
173
|
* 可选能力槽声明(§7.5,Phase 1 钉死成员)。
|
|
122
174
|
*
|
|
@@ -132,8 +184,16 @@ export type BrepTessellationModel = 'build-time' | 'extract-time' | 'none';
|
|
|
132
184
|
* 语义不强制统一,故不作为能力位记录。
|
|
133
185
|
*/
|
|
134
186
|
export interface BrepCapabilities {
|
|
135
|
-
/**
|
|
136
|
-
|
|
187
|
+
/**
|
|
188
|
+
* 面演化族:本引擎**实际提供**的 `*WithHistory` 核函数名(不是族级布尔,见
|
|
189
|
+
* `BrepEvolutionKind`)。空数组 / 缺省 = 一个都不提供。
|
|
190
|
+
*/
|
|
191
|
+
evolution?: readonly BrepEvolutionKind[];
|
|
192
|
+
/**
|
|
193
|
+
* 非演化内核方法族:本引擎**实际提供**的 `BrepEngineApi` 方法真名
|
|
194
|
+
* (逐核声明,与 `evolution` 同语义;空数组 / 缺省 = 一个都不提供)。
|
|
195
|
+
*/
|
|
196
|
+
methods?: readonly BrepMethodKind[];
|
|
137
197
|
/** 修复族(healSolid/fixShape/fixFaceOrientations/...) */
|
|
138
198
|
heal?: boolean;
|
|
139
199
|
/** 直接编辑族(C1:moveFace/replaceFace/...) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,CAAC,MAAM,eAAe,EAAE,OAAO,MAAM,CAAA;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAEvE,0BAA0B;AAC1B,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,cAAc;AACd,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,+CAA+C;AAC/C,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,SAAS,EAAE,YAAY,CAAA;IACvB,sCAAsC;IACtC,OAAO,EAAE,YAAY,CAAA;IACrB,YAAY;IACZ,OAAO,EAAE,WAAW,CAAA;IACpB,gCAAgC;IAChC,WAAW,EAAE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+1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/brep/engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * engine/types — BREP 引擎中立类型(零具体实现依赖,不 import 任何内核包)\n *\n *\n * 契约(对应 brepjs 的 KernelShape 约定):\n * - L1 及以上代码永远不对句柄调用任何方法,只把它传回产生它的那个引擎;\n * - 句柄不得跨引擎传递——跨引擎必须先经 mesh 层(§8.3 的结构保证)。\n * - OCCT 适配器的句柄运行时就是 number,加 brand 是零成本的类型层转换。\n */\n\ndeclare const BrepHandleBrand: unique symbol\n\n/**\n * BREP 实体句柄——不透明值。\n *\n * 与 occt-wasm 的 ShapeHandle 同构(number & brand)。OCCT 适配器\n * (occt-kernel/)内部以 `as unknown as` 双向转换,跨适配器边界零运行时成本。\n */\nexport type BrepHandle = number & { readonly [BrepHandleBrand]: never }\n\n/** 三维点/向量(与内核无关的中立形态)。 */\nexport interface BrepVec3 {\n x: number\n y: number\n z: number\n}\n\n/** 轴对齐包围盒。 */\nexport interface BrepBoundingBox {\n xmin: number\n ymin: number\n zmin: number\n xmax: number\n ymax: number\n zmax: number\n}\n\n/** BRepMesh 三角化输出(镜像 occt-wasm Mesh 的中立形态)。 */\nexport interface BrepMeshResult {\n /** XYZ 交错顶点坐标,长度 = vertexCount * 3 */\n positions: Float32Array\n /** XYZ 交错顶点法线,长度 = vertexCount * 3 */\n normals: Float32Array\n /** 三角形索引 */\n indices: Uint32Array\n /** 顶点数(positions.length / 3) */\n vertexCount: number\n /** 三角形数(indices.length / 3) */\n triangleCount: number\n /** 面组:[triStart, triCount, faceHash] 三元组(meshShape 时存在) */\n faceGroups?: Int32Array\n /** 面组数(meshShape 时存在) */\n faceCount?: number\n}\n\n/** 三角化精度选项。 */\nexport interface BrepTessellateOptions {\n /** 最大弦偏差(mm),默认 0.1 */\n linearDeflection?: number\n /** 最大角偏差(弧度),默认 0.5 */\n angularDeflection?: number\n /** 按每条边长度相对解释 linearDeflection */\n relative?: boolean\n}\n\n/** 边折线数据(wireframe 输出)。 */\nexport interface BrepEdgeData {\n /** XYZ 交错边采样点 */\n points: Float32Array\n /** 每边分组:[pointStart, pointCount, edgeHash] 三元组 */\n edgeGroups: Int32Array\n /** points 中的浮点数总数(= XYZ 坐标数) */\n pointCount: number\n /** 不同边的数量 */\n edgeCount: number\n}\n\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/brep/engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * engine/types — BREP 引擎中立类型(零具体实现依赖,不 import 任何内核包)\n *\n *\n * 契约(对应 brepjs 的 KernelShape 约定):\n * - L1 及以上代码永远不对句柄调用任何方法,只把它传回产生它的那个引擎;\n * - 句柄不得跨引擎传递——跨引擎必须先经 mesh 层(§8.3 的结构保证)。\n * - OCCT 适配器的句柄运行时就是 number,加 brand 是零成本的类型层转换。\n */\n\ndeclare const BrepHandleBrand: unique symbol\n\n/**\n * BREP 实体句柄——不透明值。\n *\n * 与 occt-wasm 的 ShapeHandle 同构(number & brand)。OCCT 适配器\n * (occt-kernel/)内部以 `as unknown as` 双向转换,跨适配器边界零运行时成本。\n */\nexport type BrepHandle = number & { readonly [BrepHandleBrand]: never }\n\n/** 三维点/向量(与内核无关的中立形态)。 */\nexport interface BrepVec3 {\n x: number\n y: number\n z: number\n}\n\n/** 轴对齐包围盒。 */\nexport interface BrepBoundingBox {\n xmin: number\n ymin: number\n zmin: number\n xmax: number\n ymax: number\n zmax: number\n}\n\n/** BRepMesh 三角化输出(镜像 occt-wasm Mesh 的中立形态)。 */\nexport interface BrepMeshResult {\n /** XYZ 交错顶点坐标,长度 = vertexCount * 3 */\n positions: Float32Array\n /** XYZ 交错顶点法线,长度 = vertexCount * 3 */\n normals: Float32Array\n /** 三角形索引 */\n indices: Uint32Array\n /** 顶点数(positions.length / 3) */\n vertexCount: number\n /** 三角形数(indices.length / 3) */\n triangleCount: number\n /** 面组:[triStart, triCount, faceHash] 三元组(meshShape 时存在) */\n faceGroups?: Int32Array\n /** 面组数(meshShape 时存在) */\n faceCount?: number\n}\n\n/** 三角化精度选项。 */\nexport interface BrepTessellateOptions {\n /** 最大弦偏差(mm),默认 0.1 */\n linearDeflection?: number\n /** 最大角偏差(弧度),默认 0.5 */\n angularDeflection?: number\n /** 按每条边长度相对解释 linearDeflection */\n relative?: boolean\n}\n\n/** 边折线数据(wireframe 输出)。 */\nexport interface BrepEdgeData {\n /** XYZ 交错边采样点 */\n points: Float32Array\n /** 每边分组:[pointStart, pointCount, edgeHash] 三元组 */\n edgeGroups: Int32Array\n /** points 中的浮点数总数(= XYZ 坐标数) */\n pointCount: number\n /** 不同边的数量 */\n edgeCount: number\n}\n\n/**\n * *WithHistory 面演化数据(modified/generated/deleted 用面 hash 编码)。\n *\n * ⚠️ **三个字段的编码不同,实测于 2026-09-22(`brep/engine/phase0-kernel-probes.test.ts`),\n * 与 occt-wasm 自己的文档(`dist/types.d.ts:227-231`)不符**:\n *\n * | 字段 | 实际编码 | 键/值语义 |\n * |---|---|---|\n * | `modified` | **分段** `[inHash, count, outHash…] × N` | 键 = 输入面 hash;值 = 该输入面在结果里的**后继**(可 1→N) |\n * | `generated` | **同构分段**,**键集与 `modified` 相同** | 值 = 该输入面派生出的**中间形**(实测结果里 0 存活) |\n * | `deleted` | **扁平** hash 数组 | 输入面中已不存在的面 |\n *\n * 「扁平数组」的读法会把 `generated` 的 count 字段当成 hash——\n * 实测 `cut` 的 `generated` 里真的含 `2`(一个 count),故该误读不会自己暴露。\n *\n * ⚠️ **未受影响的面有两种上报形态,两种都表示\"未变\"**:自映射(`i -> [i]`)。\n * 或者**整个不上报**(`fillet` 实测两者并存)。⇒ 读法必须是\n * `modified.get(h) ?? [h]`,不能只看\"是否出现在 `modified` 里\"。\n *\n * ⇒ 结果面的三种命运(判据见 `phase0-kernel-probes.test.ts`):\n * **原样幸存**(hash ∈ 输入 hash 集合,hash 逐字不变)/ **改型幸存**(在 `modified` 输出里)/\n * **新造**(两者皆非——这才是真正需要派生词汇命名的面,如 `fillet` 的过渡面)。\n */\nexport interface BrepEvolutionData {\n /** 结果句柄 */\n result: BrepHandle\n /** 分段:`[inHash, count, outHash…] × N`;值 = 该输入面的结果后继 */\n modified: number[]\n /** 分段(键集同 `modified`):该输入面派生的中间形 hash,实测结果里 0 存活 */\n generated: number[]\n /** 扁平:输入面中已不存在的面 hash */\n deleted: number[]\n}\n\n/** 曲线参数区间(与内核 curveParameters 返回同构:first/last)。 */\nexport interface BrepCurveParameters {\n first: number\n last: number\n}\n\n/** 曲面 UV 边界。 */\nexport interface BrepUvBounds {\n uMin: number\n uMax: number\n vMin: number\n vMax: number\n}\n\n/** 子形状类型(getSubShapes / subShapeHashes 等)。 */\nexport type BrepSubShapeType = 'vertex' | 'edge' | 'wire' | 'face' | 'shell' | 'solid'\n\n/**\n * XCAF 装配文档句柄(可选能力槽 AssemblyCapability 的文档形态)。\n *\n * 形态来自 occt-wasm XCAFDocumentImpl 的被调用子集(step.ts / occt-kernel 装配链)。\n */\nexport interface BrepXcafDocument {\n addShape(shape: BrepHandle, opts?: { name?: string; color?: [number, number, number] }): void\n exportSTEP(): string\n close(): void\n}\n\n/**\n * 曲面细分精度控制模型(与 brepjs KernelCapabilities.tessellationModel 同构的中立镜像,\n * P7 并入;faijs 侧零内核依赖,不 import vendored 树——D8 反向只允许发生在 api/)。\n *\n * - `'build-time'` — 网格在实体构造时固定(如 manifold 全局分段设置);质量参数须在构造前应用。\n * - `'extract-time'`— 形状是精确的,按需以每调用 deflection 细分(如 OCCT);质量是\n * `mesh()`/导出时的默认 deflection。\n * - `'none'` — 无细分控制(或非网格内核)。\n */\nexport type BrepTessellationModel = 'build-time' | 'extract-time' | 'none'\n\n/**\n * 面演化(`*WithHistory`)核函数名——与内核方法同名,**逐核函数**声明。\n *\n * ⚠️ **为什么不能是一个布尔位**(2026-09-22 Phase 0.2):`evolution: true` 是**族级**声明。\n * 而「本内核提供面演化」这句话在建面上不成立——每个 `*WithHistory` 是一个独立核函数,\n * 内核可以只提供其中一部分。`brepkit` 就是活例:它提供 `fuse`/`cut`/`fillet`,\n * `chamfer`/`intersect`/`translate`/… 一律 `unsupported(...)`\n * (`brepkit-kernel/brepkitKernel.ts:220-537`)。\n *\n * 族级布尔的后果不是\"少报\"而是**多报**:`cad.intersect` 声明需要 `evolution`,\n * 在 `evolution: true` 下通过静态判定 → 落到运行时才撞 `unsupported('intersectWithHistory')`。\n * 这直接违反 AGENTS.md 红线「BREP 路径能否走由静态规则判定,禁止运行时回退」——\n * 静态判定之所以能成立,前提是引擎的能力声明**说的是逐核函数的实话**。\n *\n * ⇒ 引擎声明\"我提供哪几个\"(`BrepCapabilities.evolution`),op 声明\"我要哪一个\"\n * (`defineOp.capabilities`),两者**按名字求交集**(`cad-runtime/backend-dispatch.ts`)。\n */\nexport type BrepEvolutionKind =\n // 布尔族\n | 'fuseWithHistory'\n | 'cutWithHistory'\n | 'intersectWithHistory'\n // 倒圆/倒角族\n | 'filletWithHistory'\n | 'chamferWithHistory'\n // 刚体变换族\n | 'translateWithHistory'\n | 'rotateWithHistory'\n | 'mirrorWithHistory'\n | 'scaleWithHistory'\n // 抽壳/偏置/加厚族\n | 'shellWithHistory'\n | 'offsetWithHistory'\n | 'thickenWithHistory'\n\n/**\n * 非演化内核方法真名(`*WithHistory` 之外的 `BrepEngineApi` 方法)。\n *\n * 与 `BrepEvolutionKind` 分名(P3 冲突消除):`'mirror'` 一个字符串不能同时表示\n * \"提供 `mirrorWithHistory`\"与\"提供 `mirror`\",两族必须互不共用字符串。\n * 语义与 evolution 相同——**逐核函数**声明:声明 = 实现(诚实原则),\n * 缺省/空 = 一个都不提供。\n *\n * 初始全集 = Phase 0 能力映射表(`api/surface/capability-map.json`)盘点的\n * compat op 依赖内核方法 + 方案初始项;Phase 3 全量收敛时按映射表滚动补全。\n */\nexport type BrepMethodKind =\n // pattern 族\n | 'linearPattern'\n | 'circularPattern'\n | 'gridPattern'\n | 'rectangularPattern'\n // 基础方法族(裸方法,无历史)\n | 'mirror'\n | 'rotate'\n | 'translate'\n | 'scale'\n // 倒角/圆角基础方法(directEdit 族下的逐核真名,Phase 2:chamfer op 能力声明\n // 精确到内核方法——brepkit 无 chamfer/chamferDistAngle,静态判定执行前报错)\n | 'chamfer'\n | 'chamferDistAngle'\n | 'fillet'\n | 'filletVariable'\n // 构形/拉伸/放样族\n | 'makeRectangle'\n | 'shell'\n | 'extrude'\n | 'loft'\n | 'loftAdvanced'\n | 'section'\n | 'sweepPipeShell'\n | 'simplePipe'\n | 'revolveVec'\n | 'buildExtrusionLaw'\n // 布尔/装配辅助(裸方法)\n | 'fuse'\n | 'cut'\n | 'intersect'\n | 'fuseAll'\n // 构造方法族\n | 'makeArcEdge'\n | 'makeBezierEdge'\n | 'makeCylinder'\n | 'makeEllipsoid'\n | 'makeFace'\n | 'makeFaceOnSurface'\n | 'makeLineEdge'\n | 'makeTorus'\n | 'makeVertex'\n | 'makeWireFromMixed'\n | 'buildEdgeOnSurface'\n | 'addHolesInFace'\n | 'buildTriFace'\n | 'sew'\n | 'sewAndSolidify'\n // 修复/校验族\n | 'healFace'\n | 'healSolid'\n | 'healWire'\n | 'fixShape'\n | 'fixSelfIntersection'\n | 'isValid'\n | 'removeDegenerateEdges'\n | 'simplify'\n | 'split'\n // 查询/测量族\n | 'boundingBox'\n | 'curveParameters'\n | 'curvePointAtParam'\n | 'curveTangent'\n | 'hullFromPoints'\n | 'isNull'\n | 'iterShapes'\n | 'locate'\n | 'shapeType'\n | 'surfaceCenterOfMass'\n | 'surfaceNormal'\n | 'surfaceType'\n | 'uvBounds'\n // 变换族(非演化真名)\n | 'composeTransform'\n | 'applyComposedTransformWithHistory'\n | 'generalTransformNonOrthogonal'\n | 'generalTransformWithHistory'\n // 交换/导入族\n | 'importStl'\n | 'createXCAFDocument'\n | 'importXCAFFromSTEP'\n // 生命周期辅助\n | 'copyShape'\n | 'dispose'\n | 'downcast'\n | 'hashCode'\n\n/**\n * 可选能力槽声明(§7.5,Phase 1 钉死成员)。\n *\n * 缺失的能力 → 依赖它的功能静态降级走 mesh(§8.4),绝不伪造。\n *\n * P7 并入(D4):移植 brepjs `KernelCapabilities` 的数据字段(exact/brepExport/\n * exactMeasurement/tessellationModel)进本模型,由适配器在注册时如实声明;分派逻辑\n * (backend-dispatch 的 BrepCapabilityName 路由)不改——新字段是引擎本质描述,不是\n * 逐 op 路由键。\n *\n * 未并入 `disposalModel`(D5 决策,与 vendored port 一致):faijs 的句柄释放由\n * `cad-runtime` 顶替释放统一编排(增量失败回滚前提),brepjs 的 DisposalScope/arena\n * 语义不强制统一,故不作为能力位记录。\n */\nexport interface BrepCapabilities {\n /**\n * 面演化族:本引擎**实际提供**的 `*WithHistory` 核函数名(不是族级布尔,见\n * `BrepEvolutionKind`)。空数组 / 缺省 = 一个都不提供。\n */\n evolution?: readonly BrepEvolutionKind[]\n /**\n * 非演化内核方法族:本引擎**实际提供**的 `BrepEngineApi` 方法真名\n * (逐核声明,与 `evolution` 同语义;空数组 / 缺省 = 一个都不提供)。\n */\n methods?: readonly BrepMethodKind[]\n /** 修复族(healSolid/fixShape/fixFaceOrientations/...) */\n heal?: boolean\n /** 直接编辑族(C1:moveFace/replaceFace/...) */\n directEdit?: boolean\n /** 高级曲面族(C1:boundarySurface/fillSurface/...) */\n advSurface?: boolean\n /** XCAF 装配族 */\n assembly?: boolean\n /** mesh→BREP 提升(buildTriFace/sewAndSolidify) */\n meshLift?: boolean\n /** 精确 B-rep 几何(vs mesh 近似)——brepjs KernelCapabilities.exact 并入 */\n exact?: boolean\n /** 可序列化为 B-rep 交换格式(BREP/STEP)——brepjs brepExport 并入 */\n brepExport?: boolean\n /** 体积/面积/长度匹配解析值(vs mesh 近似)——brepjs exactMeasurement 并入 */\n exactMeasurement?: boolean\n /** 细分精度控制模型——brepjs tessellationModel 并入 */\n tessellationModel?: BrepTessellationModel\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/brep/export/step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,8CAA8C;AAC9C,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,0DAA0D;IAC1D,IAAI,CAAC,EAAE;QAAE,SAAS,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAA;IACxD,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAgBD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,eAAe,EAAE,GACzB,WAAW,
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/brep/export/step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,8CAA8C;AAC9C,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,0DAA0D;IAC1D,IAAI,CAAC,EAAE;QAAE,SAAS,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAA;IACxD,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAgBD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,eAAe,EAAE,GACzB,WAAW,CA4Eb;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,aAAa,GACpB,WAAW,CAEb"}
|
package/dist/brep/export/step.js
CHANGED
|
@@ -68,7 +68,12 @@ export function exportStepFromSolids(kernel, entries) {
|
|
|
68
68
|
subs = kernel.getSubShapes(solid, 'edge');
|
|
69
69
|
}
|
|
70
70
|
if (subs.length === 0) {
|
|
71
|
-
|
|
71
|
+
// wasm getSubShapes 不展开 compound 层(TopExp_Explorer 默认跳过),
|
|
72
|
+
// 纯面/壳/边 compound(如 Shape.siblings / faces('>Z') 结果)在这里
|
|
73
|
+
// 拿不到子形状。把 compound 整体作为单个 XCAF label 写入(STEP
|
|
74
|
+
// writer 支持 compound 形状,与 ref 侧 cadquery Shape.exportStep
|
|
75
|
+
// 对 faces/edges compound 的行为一致)。
|
|
76
|
+
subs = [solid];
|
|
72
77
|
}
|
|
73
78
|
for (let si = 0; si < subs.length; si++) {
|
|
74
79
|
const sub = subs[si];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../../src/brep/export/step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAc5E;;;;;;;;;GASG;AACH,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAA;AACtE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAqB,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AC,GAAG;oBACvC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAA;gBACd,yDAAyD;gBACzD,6CAA6C;gBAC7C,MAAM,KAAK,GAAyC,KAAK,CAAC,KAAK;oBAC7D,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5F,CAAC,CAAC,SAAS,CAAA;gBACb,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;YACpC,CAAC;QACH,CAAC;QAED,uCAAuC;QACvC,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,EAAE,CAAA;QACjC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAA;IAClD,CAAC;YAAS,CAAC;QACT,2BAA2B;QAC3B,GAAG,CAAC,KAAK,EAAE,CAAA;QACX,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,mBAAmB;YACrB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAiB,EACjB,MAAqB;IAErB,OAAO,oBAAoB,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;AAClD,CAAC","sourcesContent":["/**\n * exportStepFromSolids — L1 STEP 导出(从 OCCT solid 句柄,多实体、零 fuse)\n *\n * 每个 entry 作为 STEP 中一个独立实体(独立 XCAF label / PRODUCT)导出,\n * 保留名称与颜色。多实体之间绝不 fuse —— 这是硬性约定:\n * fuse 只允许作为用户脚本里的几何布尔运算,禁止作为导出时的实体合并手段。\n *\n * 导出 → 再导入身份闭环:导入侧 importAssemblyFromStep(XCAF)会把\n * 多实体 STEP 还原为多个 part;多 solid compound 拆分出的子节点命名为\n * `name [n]`,与本节点的展平命名规则一致。\n */\n\nimport type { BrepHandle } from '../engine/types'\nimport type { BrepEngineApi } from '../engine/primitives'\nimport { reconstructSolidFromMesh } from '../../occt-kernel/meshReconstruct'\n\n/** STEP 导出条目:一个 part(精确 BREP 形状或三角网格,二选一)。 */\nexport interface StepExportEntry {\n /** 精确 BREP 形状(solid/shell/face/compound,来自宿主导出缓存)。与 mesh 二选一,solid 优先。 */\n solid?: BrepHandle\n /** 三角网格(世界坐标、已按单位缩放),经 reconstructSolidFromMesh 重建为实体。 */\n mesh?: { positions: Float32Array; indices: Uint32Array }\n /** 实体名称(写入 label name,导出为 PRODUCT 名称)。 */\n name?: string\n /** RGB 0..1 颜色(sRGB 编码,如宿主材质 base color)。写入前转 linear。 */\n color?: [number, number, number]\n}\n\n/**\n * sRGB → linear 转换。\n *\n * OCCT XCAF 内部按 linear RGB 存储颜色,STEP writer(xcafExportSTEP)\n * 导出时做 linear→sRGB 编码写 COLOUR_RGB。为了让\"宿主传入的 sRGB 颜色 ==\n * STEP 文件中的 COLOUR_RGB == 回读颜色\",写入前必须先转 linear。\n *\n * @param c sRGB 编码值(0..1)\n * @returns linear 值(0..1)\n */\nfunction srgbToLinear(c: number): number {\n return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4)\n}\n\n/**\n * Export multiple BREP solids (and/or triangle meshes) to STEP, one\n * independent entity per entry — no fuse, no string splicing.\n *\n * @param kernel OCCT kernel (must match the one that created the solids)\n * @param entries parts to export; each becomes its own XCAF label\n * @returns STEP file content as ArrayBuffer\n * @throws if entries is empty, or a mesh entry fails to reconstruct\n */\nexport function exportStepFromSolids(\n kernel: BrepEngineApi,\n entries: StepExportEntry[],\n): ArrayBuffer {\n if (entries.length === 0) {\n throw new Error('No exportable geometry')\n }\n\n const doc = kernel.createXCAFDocument()\n // 本函数创建的句柄(展平出的子 solid + mesh 重建的 solid),导出后释放。\n // 缓存里的原 solid(entry.solid)绝不释放,归调用方/缓存所有。\n const ownedHandles: BrepHandle[] = []\n\n try {\n for (const entry of entries) {\n // 1. 解析 solid:优先用精确 solid;无则从三角网格重建\n let solid = entry.solid\n if (!solid) {\n if (!entry.mesh) {\n throw new Error('StepExportEntry must provide either solid or mesh')\n }\n solid = reconstructSolidFromMesh(kernel, entry.mesh.positions, entry.mesh.indices)\n ownedHandles.push(solid)\n }\n\n // 2. 展平 Compound(多 solid 导入的 part 其 solid 是 Compound);\n // 纯 solid 时 getSubShapes('solid') 返回 [自身]。\n // 形状类型分派:solid → shell → face → edge。ref 侧(cadquery\n // Shape.exportStep)可导出任意类型的形状,面/壳/边 compound(如\n // Shape.faces('>Z') / shape.edges('>Z') 的结果)同样要能写进\n // STEP(U22,2026-09-09)。\n let subs = kernel.getSubShapes(solid, 'solid')\n if (subs.length === 0) {\n subs = kernel.getSubShapes(solid, 'shell')\n }\n if (subs.length === 0) {\n subs = kernel.getSubShapes(solid, 'face')\n }\n if (subs.length === 0) {\n subs = kernel.getSubShapes(solid, 'edge')\n }\n if (subs.length === 0) {\n // wasm getSubShapes 不展开 compound 层(TopExp_Explorer 默认跳过),\n // 纯面/壳/边 compound(如 Shape.siblings / faces('>Z') 结果)在这里\n // 拿不到子形状。把 compound 整体作为单个 XCAF label 写入(STEP\n // writer 支持 compound 形状,与 ref 侧 cadquery Shape.exportStep\n // 对 faces/edges compound 的行为一致)。\n subs = [solid]\n }\n for (let si = 0; si < subs.length; si++) {\n const sub = subs[si]\n // 展平出的子句柄若不属于调用方缓存,记入 ownedHandles\n if (solid !== sub) ownedHandles.push(sub)\n const name = subs.length > 1\n ? `${entry.name ?? 'part'} [${si + 1}]`\n : entry.name\n // sRGB → linear:XCAF 按 linear 存储,STEP writer 输出时线性→sRGB,\n // 转换后 STEP 文件里的 COLOUR_RGB 才是宿主传入的原始 sRGB 值。\n const color: [number, number, number] | undefined = entry.color\n ? [srgbToLinear(entry.color[0]), srgbToLinear(entry.color[1]), srgbToLinear(entry.color[2])]\n : undefined\n doc.addShape(sub, { name, color })\n }\n }\n\n // 3. 导出(每个 label 一个独立 PRODUCT,保留名称/颜色)\n const stepText = doc.exportSTEP()\n return new TextEncoder().encode(stepText).buffer\n } finally {\n // 4. 释放顺序:先关文档,再释放本函数创建的句柄\n doc.close()\n for (const h of ownedHandles) {\n try {\n kernel.release(h)\n } catch {\n // already released\n }\n }\n }\n}\n\n/**\n * Export a BREP solid (OCCT native) to STEP format.\n *\n * 单实体导出 = exportStepFromSolids 的单条目特例(同一实现,无第二真源)。\n *\n * @param solid OCCT solid handle\n * @param kernel OCCT kernel (must match the one that created the solid)\n * @returns STEP file content as ArrayBuffer\n */\nexport function exportStepFromSolid(\n solid: BrepHandle,\n kernel: BrepEngineApi,\n): ArrayBuffer {\n return exportStepFromSolids(kernel, [{ solid }])\n}"]}
|