@faicad/faijs 0.19.0 → 0.29.3
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/LICENSE +202 -28
- package/dist/api/api-namespace.d.ts +5 -5
- package/dist/api/api-namespace.d.ts.map +1 -1
- package/dist/api/api-namespace.js +4 -4
- package/dist/api/api-namespace.js.map +1 -1
- package/dist/api/assert.d.ts +2 -2
- package/dist/api/assert.js +8 -8
- package/dist/api/assert.js.map +1 -1
- package/dist/api/asset.d.ts +1 -1
- package/dist/api/asset.js +2 -2
- package/dist/api/asset.js.map +1 -1
- package/dist/api/boolean.d.ts +1 -1
- package/dist/api/boolean.d.ts.map +1 -1
- package/dist/api/boolean.js +128 -16
- package/dist/api/boolean.js.map +1 -1
- package/dist/api/brep-mirror/joinery-brep.d.ts.map +1 -1
- package/dist/api/brep-mirror/joinery-brep.js +3 -1
- package/dist/api/brep-mirror/joinery-brep.js.map +1 -1
- package/dist/api/cadquery-selectors/borrow-bridge.d.ts +14 -0
- package/dist/api/cadquery-selectors/borrow-bridge.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/borrow-bridge.js +52 -0
- package/dist/api/cadquery-selectors/borrow-bridge.js.map +1 -0
- package/dist/api/cadquery-selectors/edge.d.ts +40 -0
- package/dist/api/cadquery-selectors/edge.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/edge.js +70 -0
- package/dist/api/cadquery-selectors/edge.js.map +1 -0
- package/dist/api/cadquery-selectors/entity.d.ts +121 -0
- package/dist/api/cadquery-selectors/entity.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/entity.js +167 -0
- package/dist/api/cadquery-selectors/entity.js.map +1 -0
- package/dist/api/cadquery-selectors/face.d.ts +33 -0
- package/dist/api/cadquery-selectors/face.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/face.js +353 -0
- package/dist/api/cadquery-selectors/face.js.map +1 -0
- package/dist/api/cadquery-selectors/grammar.d.ts +50 -0
- package/dist/api/cadquery-selectors/grammar.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/grammar.js +345 -0
- package/dist/api/cadquery-selectors/grammar.js.map +1 -0
- package/dist/api/cadquery-selectors/index.d.ts +18 -0
- package/dist/api/cadquery-selectors/index.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/index.js +17 -0
- package/dist/api/cadquery-selectors/index.js.map +1 -0
- package/dist/api/cadquery-selectors/predicates.d.ts +76 -0
- package/dist/api/cadquery-selectors/predicates.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/predicates.js +85 -0
- package/dist/api/cadquery-selectors/predicates.js.map +1 -0
- package/dist/api/cadquery-selectors/resolve.d.ts +41 -0
- package/dist/api/cadquery-selectors/resolve.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/resolve.js +243 -0
- package/dist/api/cadquery-selectors/resolve.js.map +1 -0
- package/dist/api/cadquery-selectors/types.d.ts +96 -0
- package/dist/api/cadquery-selectors/types.d.ts.map +1 -0
- package/dist/api/cadquery-selectors/types.js +11 -0
- package/dist/api/cadquery-selectors/types.js.map +1 -0
- package/dist/api/chamfer.d.ts +13 -5
- package/dist/api/chamfer.d.ts.map +1 -1
- package/dist/api/chamfer.js +63 -7
- package/dist/api/chamfer.js.map +1 -1
- package/dist/api/compound-geom.d.ts +1 -1
- package/dist/api/compound-geom.js +1 -1
- package/dist/api/compound-geom.js.map +1 -1
- package/dist/api/draft.d.ts +1 -1
- package/dist/api/draft.js +1 -1
- package/dist/api/draft.js.map +1 -1
- package/dist/api/edge-ref.d.ts +1 -1
- package/dist/api/edge-ref.d.ts.map +1 -1
- package/dist/api/edge-ref.js +11 -3
- package/dist/api/edge-ref.js.map +1 -1
- package/dist/api/engrave.d.ts +1 -1
- package/dist/api/engrave.js +7 -7
- package/dist/api/engrave.js.map +1 -1
- package/dist/api/extrude.d.ts +6 -1
- package/dist/api/extrude.d.ts.map +1 -1
- package/dist/api/extrude.js +59 -5
- package/dist/api/extrude.js.map +1 -1
- package/dist/api/face-ref.d.ts +1 -1
- package/dist/api/face-ref.js +1 -1
- package/dist/api/face-ref.js.map +1 -1
- package/dist/api/feature-repair.d.ts +1 -1
- package/dist/api/feature-repair.js +1 -1
- package/dist/api/feature-repair.js.map +1 -1
- package/dist/api/fillet-variable.d.ts +1 -1
- package/dist/api/fillet-variable.js +1 -1
- package/dist/api/fillet-variable.js.map +1 -1
- package/dist/api/fillet.d.ts +28 -8
- package/dist/api/fillet.d.ts.map +1 -1
- package/dist/api/fillet.js +64 -9
- package/dist/api/fillet.js.map +1 -1
- package/dist/api/generated/script-face-manifest.d.ts +4 -0
- package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
- package/dist/api/generated/script-face-manifest.js.map +1 -1
- package/dist/api/geom.d.ts +1 -1
- package/dist/api/geom.js +1 -1
- package/dist/api/geom.js.map +1 -1
- package/dist/api/helix.d.ts +1 -1
- package/dist/api/helix.js +1 -1
- package/dist/api/helix.js.map +1 -1
- package/dist/api/import-brep.d.ts +20 -2
- package/dist/api/import-brep.d.ts.map +1 -1
- package/dist/api/import-brep.js +28 -3
- package/dist/api/import-brep.js.map +1 -1
- package/dist/api/import-step.d.ts +17 -2
- package/dist/api/import-step.d.ts.map +1 -1
- package/dist/api/import-step.js +23 -3
- package/dist/api/import-step.js.map +1 -1
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +5 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/internal/compat-op.js +1 -1
- package/dist/api/internal/compat-op.js.map +1 -1
- package/dist/api/internal/mesh-solid-op.d.ts +236 -0
- package/dist/api/internal/mesh-solid-op.d.ts.map +1 -0
- package/dist/api/internal/mesh-solid-op.js +352 -0
- package/dist/api/internal/mesh-solid-op.js.map +1 -0
- package/dist/api/internal/svg-asset-resolver.d.ts +1 -1
- package/dist/api/internal/svg-asset-resolver.js +1 -1
- package/dist/api/internal/svg-asset-resolver.js.map +1 -1
- package/dist/api/knurl.d.ts +1 -1
- package/dist/api/knurl.d.ts.map +1 -1
- package/dist/api/knurl.js +3 -2
- package/dist/api/knurl.js.map +1 -1
- package/dist/api/loft.d.ts +1 -1
- package/dist/api/loft.js +1 -1
- package/dist/api/loft.js.map +1 -1
- package/dist/api/measurement/index.d.ts +9 -5
- package/dist/api/measurement/index.d.ts.map +1 -1
- package/dist/api/measurement/index.js +47 -20
- package/dist/api/measurement/index.js.map +1 -1
- package/dist/api/pattern.d.ts +5 -3
- package/dist/api/pattern.d.ts.map +1 -1
- package/dist/api/pattern.js +32 -4
- package/dist/api/pattern.js.map +1 -1
- package/dist/api/place.d.ts +1 -1
- package/dist/api/place.js +1 -1
- package/dist/api/place.js.map +1 -1
- package/dist/api/primitives.d.ts +5 -4
- package/dist/api/primitives.d.ts.map +1 -1
- package/dist/api/primitives.js +11 -5
- package/dist/api/primitives.js.map +1 -1
- package/dist/api/profile.d.ts +64 -8
- package/dist/api/profile.d.ts.map +1 -1
- package/dist/api/profile.js +61 -10
- package/dist/api/profile.js.map +1 -1
- package/dist/api/punch-hole.d.ts +3 -0
- package/dist/api/punch-hole.d.ts.map +1 -1
- package/dist/api/punch-hole.js.map +1 -1
- package/dist/api/reconcile.d.ts +1 -1
- package/dist/api/reconcile.js +1 -1
- package/dist/api/reconcile.js.map +1 -1
- package/dist/api/replicate.d.ts.map +1 -1
- package/dist/api/replicate.js +122 -1
- package/dist/api/replicate.js.map +1 -1
- package/dist/api/screw.d.ts +1 -1
- package/dist/api/screw.js +3 -3
- package/dist/api/screw.js.map +1 -1
- package/dist/api/sdf.d.ts +1 -1
- package/dist/api/sdf.js +2 -2
- package/dist/api/sdf.js.map +1 -1
- package/dist/api/section-by-plane.d.ts +1 -1
- package/dist/api/section-by-plane.d.ts.map +1 -1
- package/dist/api/section-by-plane.js +2 -1
- package/dist/api/section-by-plane.js.map +1 -1
- package/dist/api/shell.d.ts +11 -4
- package/dist/api/shell.d.ts.map +1 -1
- package/dist/api/shell.js +53 -7
- package/dist/api/shell.js.map +1 -1
- package/dist/api/sketch-on-face.d.ts +41 -0
- package/dist/api/sketch-on-face.d.ts.map +1 -1
- package/dist/api/sketch-on-face.js +100 -1
- package/dist/api/sketch-on-face.js.map +1 -1
- package/dist/api/sketch-on-plane.d.ts +17 -9
- package/dist/api/sketch-on-plane.d.ts.map +1 -1
- package/dist/api/sketch-on-plane.js +12 -10
- package/dist/api/sketch-on-plane.js.map +1 -1
- package/dist/api/split-by-plane.d.ts +1 -1
- package/dist/api/split-by-plane.d.ts.map +1 -1
- package/dist/api/split-by-plane.js +2 -1
- package/dist/api/split-by-plane.js.map +1 -1
- package/dist/api/split.d.ts +1 -1
- package/dist/api/split.js +2 -2
- package/dist/api/split.js.map +1 -1
- package/dist/api/surface/arg-spec.d.ts +8 -0
- package/dist/api/surface/arg-spec.d.ts.map +1 -1
- package/dist/api/surface/arg-spec.js.map +1 -1
- package/dist/api/sweep.d.ts +1 -1
- package/dist/api/sweep.js +1 -1
- package/dist/api/sweep.js.map +1 -1
- package/dist/api/thicken.d.ts +1 -1
- package/dist/api/thicken.js +1 -1
- package/dist/api/thicken.js.map +1 -1
- package/dist/api/topo-resolve.d.ts +74 -1
- package/dist/api/topo-resolve.d.ts.map +1 -1
- package/dist/api/topo-resolve.js +180 -2
- package/dist/api/topo-resolve.js.map +1 -1
- package/dist/api/transform.d.ts +10 -6
- package/dist/api/transform.d.ts.map +1 -1
- package/dist/api/transform.js +74 -21
- package/dist/api/transform.js.map +1 -1
- package/dist/api/wire.d.ts +1 -1
- package/dist/api/wire.js +1 -1
- package/dist/api/wire.js.map +1 -1
- package/dist/api/xml-dom.d.ts +27 -0
- package/dist/api/xml-dom.d.ts.map +1 -0
- package/dist/api/xml-dom.js +45 -0
- package/dist/api/xml-dom.js.map +1 -0
- package/dist/brep/brep-ops.d.ts +13 -11
- package/dist/brep/brep-ops.d.ts.map +1 -1
- package/dist/brep/brep-ops.js +31 -30
- package/dist/brep/brep-ops.js.map +1 -1
- package/dist/brep/brep-topology.d.ts +5 -4
- package/dist/brep/brep-topology.d.ts.map +1 -1
- package/dist/brep/brep-topology.js +9 -6
- package/dist/brep/brep-topology.js.map +1 -1
- package/dist/brep/effective-deflection.d.ts +35 -0
- package/dist/brep/effective-deflection.d.ts.map +1 -0
- package/dist/brep/effective-deflection.js +49 -0
- package/dist/brep/effective-deflection.js.map +1 -0
- package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brep-mock.js +27 -0
- package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
- package/dist/brep/engine/adapters/brepkit.d.ts +18 -0
- package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brepkit.js +46 -1
- package/dist/brep/engine/adapters/brepkit.js.map +1 -1
- package/dist/brep/engine/adapters/occt.d.ts +1 -1
- package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
- package/dist/brep/engine/adapters/occt.js +3 -1
- package/dist/brep/engine/adapters/occt.js.map +1 -1
- package/dist/brep/engine/primitives.d.ts +29 -7
- package/dist/brep/engine/primitives.d.ts.map +1 -1
- package/dist/brep/engine/primitives.js.map +1 -1
- package/dist/brep/engine/registry.d.ts +24 -1
- package/dist/brep/engine/registry.d.ts.map +1 -1
- package/dist/brep/engine/registry.js +24 -0
- package/dist/brep/engine/registry.js.map +1 -1
- package/dist/brep/engine/types.d.ts +54 -3
- package/dist/brep/engine/types.d.ts.map +1 -1
- package/dist/brep/engine/types.js +10 -0
- package/dist/brep/engine/types.js.map +1 -1
- package/dist/brep/export/export-model.d.ts +79 -0
- package/dist/brep/export/export-model.d.ts.map +1 -0
- package/dist/brep/export/export-model.js +336 -0
- package/dist/brep/export/export-model.js.map +1 -0
- package/dist/brep/face-evolution.d.ts +1 -1
- package/dist/brep/face-evolution.d.ts.map +1 -1
- package/dist/brep/face-evolution.js +20 -1
- package/dist/brep/face-evolution.js.map +1 -1
- package/dist/brep/handle-bridge.d.ts +1 -1
- package/dist/brep/handle-bridge.js +1 -1
- package/dist/brep/handle-bridge.js.map +1 -1
- package/dist/brep/mesh-solid.d.ts +218 -0
- package/dist/brep/mesh-solid.d.ts.map +1 -0
- package/dist/brep/mesh-solid.js +229 -0
- package/dist/brep/mesh-solid.js.map +1 -0
- package/dist/brep/primitives-brep.d.ts.map +1 -1
- package/dist/brep/primitives-brep.js +3 -1
- package/dist/brep/primitives-brep.js.map +1 -1
- package/dist/brep/text/fontRegistry.d.ts +32 -1
- package/dist/brep/text/fontRegistry.d.ts.map +1 -1
- package/dist/brep/text/fontRegistry.js +51 -1
- package/dist/brep/text/fontRegistry.js.map +1 -1
- package/dist/brep/text/text-to-solid.d.ts.map +1 -1
- package/dist/brep/text/text-to-solid.js +8 -3
- package/dist/brep/text/text-to-solid.js.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.d.ts +18 -2
- package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.js +453 -125
- package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
- package/dist/brepkit-kernel/brepkitWasm.d.ts +8 -0
- package/dist/brepkit-kernel/brepkitWasm.d.ts.map +1 -1
- package/dist/brepkit-kernel/brepkitWasm.js +10 -0
- package/dist/brepkit-kernel/brepkitWasm.js.map +1 -1
- package/dist/browser-host/browser-font-provider.d.ts +12 -0
- package/dist/browser-host/browser-font-provider.d.ts.map +1 -1
- package/dist/browser-host/browser-font-provider.js +25 -0
- package/dist/browser-host/browser-font-provider.js.map +1 -1
- package/dist/browser.d.ts +6 -3
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +10 -3
- package/dist/browser.js.map +1 -1
- package/dist/cad-runtime/backend-dispatch.d.ts +28 -3
- package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
- package/dist/cad-runtime/backend-dispatch.js +119 -4
- package/dist/cad-runtime/backend-dispatch.js.map +1 -1
- package/dist/cad-runtime/browser-lib-loader.js.map +1 -1
- package/dist/cad-runtime/direct-executor.d.ts +19 -3
- package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
- package/dist/cad-runtime/direct-executor.js +49 -1
- package/dist/cad-runtime/direct-executor.js.map +1 -1
- package/dist/cad-runtime/ports.d.ts +3 -3
- package/dist/cad-runtime/ports.d.ts.map +1 -1
- package/dist/cad-runtime/ports.js.map +1 -1
- package/dist/cad-runtime/preview-exec.d.ts +4 -4
- package/dist/cad-runtime/preview-exec.js +2 -2
- package/dist/cad-runtime/preview-exec.js.map +1 -1
- package/dist/cad-runtime/runtime.d.ts +66 -8
- package/dist/cad-runtime/runtime.d.ts.map +1 -1
- package/dist/cad-runtime/runtime.js +121 -8
- package/dist/cad-runtime/runtime.js.map +1 -1
- package/dist/define-op.d.ts +37 -1
- package/dist/define-op.d.ts.map +1 -1
- package/dist/define-op.js +25 -1
- package/dist/define-op.js.map +1 -1
- package/dist/env-agnostic.d.ts +7 -7
- package/dist/env-agnostic.d.ts.map +1 -1
- package/dist/env-agnostic.js +3 -3
- package/dist/env-agnostic.js.map +1 -1
- package/dist/geometry2d/adapt.d.ts +39 -4
- package/dist/geometry2d/adapt.d.ts.map +1 -1
- package/dist/geometry2d/adapt.js +14 -3
- package/dist/geometry2d/adapt.js.map +1 -1
- package/dist/geometry2d/blueprint.d.ts +2 -2
- package/dist/geometry2d/blueprint.js +2 -2
- package/dist/geometry2d/blueprint.js.map +1 -1
- package/dist/geometry2d/bridge/lift-on-plane.d.ts +18 -8
- package/dist/geometry2d/bridge/lift-on-plane.d.ts.map +1 -1
- package/dist/geometry2d/bridge/lift-on-plane.js +71 -12
- package/dist/geometry2d/bridge/lift-on-plane.js.map +1 -1
- package/dist/geometry2d/bridge/plane.d.ts +17 -0
- package/dist/geometry2d/bridge/plane.d.ts.map +1 -1
- package/dist/geometry2d/bridge/plane.js +22 -0
- package/dist/geometry2d/bridge/plane.js.map +1 -1
- package/dist/geometry2d/curve2d.d.ts +25 -0
- package/dist/geometry2d/curve2d.d.ts.map +1 -1
- package/dist/geometry2d/curve2d.js +41 -5
- package/dist/geometry2d/curve2d.js.map +1 -1
- package/dist/geometry2d/pen-sketcher.d.ts +25 -0
- package/dist/geometry2d/pen-sketcher.d.ts.map +1 -1
- package/dist/geometry2d/pen-sketcher.js +43 -0
- package/dist/geometry2d/pen-sketcher.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/io/bytes-node.d.ts +11 -0
- package/dist/io/bytes-node.d.ts.map +1 -0
- package/dist/io/bytes-node.js +28 -0
- package/dist/io/bytes-node.js.map +1 -0
- package/dist/io/bytes.d.ts +33 -0
- package/dist/io/bytes.d.ts.map +1 -0
- package/dist/io/bytes.js +41 -0
- package/dist/io/bytes.js.map +1 -0
- package/dist/io/fai-zip/container-read.d.ts +102 -0
- package/dist/io/fai-zip/container-read.d.ts.map +1 -0
- package/dist/io/fai-zip/container-read.js +305 -0
- package/dist/io/fai-zip/container-read.js.map +1 -0
- package/dist/io/fai-zip/container-write.d.ts +70 -0
- package/dist/io/fai-zip/container-write.d.ts.map +1 -0
- package/dist/io/fai-zip/container-write.js +186 -0
- package/dist/io/fai-zip/container-write.js.map +1 -0
- package/dist/io/fai-zip/container.d.ts +107 -0
- package/dist/io/fai-zip/container.d.ts.map +1 -0
- package/dist/io/fai-zip/container.js +89 -0
- package/dist/io/fai-zip/container.js.map +1 -0
- package/dist/io/fai-zip/index.d.ts +18 -0
- package/dist/io/fai-zip/index.d.ts.map +1 -0
- package/dist/io/fai-zip/index.js +4 -0
- package/dist/io/fai-zip/index.js.map +1 -0
- package/dist/io/index.d.ts +10 -0
- package/dist/io/index.d.ts.map +1 -0
- package/dist/io/index.js +13 -0
- package/dist/io/index.js.map +1 -0
- package/dist/io/zip.d.ts +68 -0
- package/dist/io/zip.d.ts.map +1 -0
- package/dist/io/zip.js +147 -0
- package/dist/io/zip.js.map +1 -0
- package/dist/lang/code-to-args.d.ts +30 -4
- package/dist/lang/code-to-args.d.ts.map +1 -1
- package/dist/lang/code-to-args.js +42 -3
- package/dist/lang/code-to-args.js.map +1 -1
- package/dist/lang/codegen.d.ts +45 -1
- package/dist/lang/codegen.d.ts.map +1 -1
- package/dist/lang/codegen.js +135 -6
- package/dist/lang/codegen.js.map +1 -1
- package/dist/lang/host-arg.d.ts +6 -0
- package/dist/lang/host-arg.d.ts.map +1 -1
- package/dist/lang/host-arg.js.map +1 -1
- package/dist/lang/metadata-extractor.d.ts +25 -0
- package/dist/lang/metadata-extractor.d.ts.map +1 -1
- package/dist/lang/metadata-extractor.js +289 -25
- package/dist/lang/metadata-extractor.js.map +1 -1
- package/dist/lang/parse-error.d.ts +7 -1
- package/dist/lang/parse-error.d.ts.map +1 -1
- package/dist/lang/parse-error.js.map +1 -1
- package/dist/lang/security-scanner.d.ts +9 -1
- package/dist/lang/security-scanner.d.ts.map +1 -1
- package/dist/lang/security-scanner.js +38 -1
- package/dist/lang/security-scanner.js.map +1 -1
- package/dist/lang/statement-summary.d.ts +1 -1
- package/dist/lang/statement-summary.js +1 -1
- package/dist/lang/statement-summary.js.map +1 -1
- package/dist/lang/types.d.ts +1 -1
- package/dist/lang/types.js +1 -1
- package/dist/lang/types.js.map +1 -1
- package/dist/mesh/index.d.ts +2 -1
- package/dist/mesh/index.d.ts.map +1 -1
- package/dist/mesh/index.js +2 -1
- package/dist/mesh/index.js.map +1 -1
- package/dist/mesh/io.d.ts +69 -9
- package/dist/mesh/io.d.ts.map +1 -1
- package/dist/mesh/io.js +121 -17
- package/dist/mesh/io.js.map +1 -1
- package/dist/mesh/reconcile.d.ts +1 -1
- package/dist/mesh/reconcile.js +1 -1
- package/dist/mesh/reconcile.js.map +1 -1
- package/dist/mesh/rigid-transform.d.ts +3 -3
- package/dist/mesh/rigid-transform.js +3 -3
- package/dist/mesh/rigid-transform.js.map +1 -1
- package/dist/mesh/stl-unit.d.ts +24 -0
- package/dist/mesh/stl-unit.d.ts.map +1 -0
- package/dist/mesh/stl-unit.js +17 -0
- package/dist/mesh/stl-unit.js.map +1 -0
- package/dist/mesh/threemf-bambu.d.ts +142 -0
- package/dist/mesh/threemf-bambu.d.ts.map +1 -0
- package/dist/mesh/threemf-bambu.js +334 -0
- package/dist/mesh/threemf-bambu.js.map +1 -0
- package/dist/mesh/threemf-loader.d.ts +50 -0
- package/dist/mesh/threemf-loader.d.ts.map +1 -0
- package/dist/mesh/threemf-loader.js +628 -0
- package/dist/mesh/threemf-loader.js.map +1 -0
- package/dist/mesh/threemf-view.d.ts +71 -0
- package/dist/mesh/threemf-view.d.ts.map +1 -0
- package/dist/mesh/threemf-view.js +100 -0
- package/dist/mesh/threemf-view.js.map +1 -0
- package/dist/mesh/transform.d.ts +2 -2
- package/dist/mesh/transform.d.ts.map +1 -1
- package/dist/mesh/transform.js +3 -3
- package/dist/mesh/transform.js.map +1 -1
- package/dist/mesh/types.d.ts +1 -1
- package/dist/mesh/types.d.ts.map +1 -1
- package/dist/mesh/types.js.map +1 -1
- package/dist/node-host/cli.d.ts +44 -6
- package/dist/node-host/cli.d.ts.map +1 -1
- package/dist/node-host/cli.js +127 -50
- package/dist/node-host/cli.js.map +1 -1
- package/dist/node-host/font-family-index.d.ts +93 -0
- package/dist/node-host/font-family-index.d.ts.map +1 -0
- package/dist/node-host/font-family-index.js +273 -0
- package/dist/node-host/font-family-index.js.map +1 -0
- package/dist/node-host/fs-asset-resolver.d.ts +8 -3
- package/dist/node-host/fs-asset-resolver.d.ts.map +1 -1
- package/dist/node-host/fs-asset-resolver.js +13 -5
- package/dist/node-host/fs-asset-resolver.js.map +1 -1
- package/dist/node-host/index.d.ts +8 -0
- package/dist/node-host/index.d.ts.map +1 -1
- package/dist/node-host/index.js +1 -0
- package/dist/node-host/index.js.map +1 -1
- package/dist/node-host/node-font-provider.d.ts +28 -0
- package/dist/node-host/node-font-provider.d.ts.map +1 -1
- package/dist/node-host/node-font-provider.js +49 -0
- package/dist/node-host/node-font-provider.js.map +1 -1
- package/dist/node.d.ts +1 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +1 -0
- package/dist/node.js.map +1 -1
- package/dist/occt-kernel/occt-primitives.d.ts.map +1 -1
- package/dist/occt-kernel/occt-primitives.js +35 -2
- package/dist/occt-kernel/occt-primitives.js.map +1 -1
- package/dist/occt-kernel/occtKernel.d.ts +18 -13
- package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
- package/dist/occt-kernel/occtKernel.js +20 -31
- package/dist/occt-kernel/occtKernel.js.map +1 -1
- package/dist/occt-kernel/stepColorParser.d.ts +18 -0
- package/dist/occt-kernel/stepColorParser.d.ts.map +1 -1
- package/dist/occt-kernel/stepColorParser.js +38 -0
- package/dist/occt-kernel/stepColorParser.js.map +1 -1
- package/dist/occt-kernel/topologyExt.d.ts +1 -1
- package/dist/occt-kernel/topologyExt.d.ts.map +1 -1
- package/dist/occt-kernel/topologyExt.js +8 -6
- package/dist/occt-kernel/topologyExt.js.map +1 -1
- package/dist/primitives/text/cjk-font.d.ts +2 -15
- package/dist/primitives/text/cjk-font.d.ts.map +1 -1
- package/dist/primitives/text/cjk-font.js +13 -1
- package/dist/primitives/text/cjk-font.js.map +1 -1
- package/dist/runtime-state.d.ts +103 -9
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +95 -2
- package/dist/runtime-state.js.map +1 -1
- package/dist/sdk.d.ts +4 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +6 -6
- package/dist/sdk.js.map +1 -1
- package/dist/shape.d.ts +97 -2
- package/dist/shape.d.ts.map +1 -1
- package/dist/shape.js +126 -1
- package/dist/shape.js.map +1 -1
- package/dist/tolerance.d.ts +38 -0
- package/dist/tolerance.d.ts.map +1 -0
- package/dist/tolerance.js +40 -0
- package/dist/tolerance.js.map +1 -0
- package/dist/topology/naming/lineage.d.ts +6 -0
- package/dist/topology/naming/lineage.d.ts.map +1 -1
- package/dist/topology/naming/lineage.js +8 -0
- package/dist/topology/naming/lineage.js.map +1 -1
- package/dist/topology/naming/resolve-edge.d.ts +20 -1
- package/dist/topology/naming/resolve-edge.d.ts.map +1 -1
- package/dist/topology/naming/resolve-edge.js +54 -20
- package/dist/topology/naming/resolve-edge.js.map +1 -1
- package/dist/topology/naming/score.js +3 -3
- package/dist/topology/naming/score.js.map +1 -1
- package/dist/units.d.ts +248 -0
- package/dist/units.d.ts.map +1 -0
- package/dist/units.js +397 -0
- package/dist/units.js.map +1 -0
- package/dist/weapp.d.ts +6 -2
- package/dist/weapp.d.ts.map +1 -1
- package/dist/weapp.js +7 -1
- package/dist/weapp.js.map +1 -1
- package/package.json +28 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,QAAQ,EACT,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAE5B,+BAA+B;IAC/B,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IAChC,2CAA2C;IAC3C,OAAO,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IAGjC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,CAAA;IACvD,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,UAAU,CAAA;IACpE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAA;IACxD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAA;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,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AAE,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC5D,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAA;IACvC,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAA;IAClD,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAGxE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAA;IAClD,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAA;IACrC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAA;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;IAGlC,cAAc,CACZ,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,UAAU,EACb,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,eAAe,CACb,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,UAAU,EACb,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,oBAAoB,CAClB,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,UAAU,EACb,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;CACrB;AAED;;;GAGG;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;;;;;;;;;;;;GAYG","sourcesContent":["/**\n * engine/primitives — BREP 引擎契约面(port 面,L1 核心面)\n *\n * ⚠️ 2026-09-24 契约面收窄(docs/plans/2026-09-24-brep-engine-api-narrowing-native-access.md\n * §Phase 2 / D1 / D9 / D10):`BrepEngineApi` 的语义 = **所有已注册 BREP 引擎都真实现的\n * 方法**(occt 与 brepkit 双方语义可对齐的交集面,最大化口径)。判据唯一真源:\n * `api/surface/engine-method-map.json`(status ∈ {aligned, dialect} 的条目)。\n *\n * - 移出 L1 的方法(occt-only 语义)不再有中立名,平台代码直接走原生面:\n * `getOcctKernel()` / `getBrepkitKernel()`(D3),op 侧用 `engines: ['occt']` 声明(D11)。\n * - 禁止任何 `as BrepEngineApi` 跨层断言(守卫见 §5 守卫清单)。\n * - 三个适配器的编译期断言 `_Assert*Api` 由此全部获得真校验力。\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} from './types'\n\n/**\n * BREP 引擎原语契约(L1 核心面)。所有句柄参数/返回值均为 BrepHandle(不透明值,§6.3)。\n * 引擎实现(occt/brepkit 适配器)负责内部句柄形态与 BrepHandle 的转换,以及方言消化\n * (如 brepkit surfaceArea → getSurfaceArea,与 matrix 方言的 toKernelMatrix 同构)。\n */\nexport interface BrepEngineApi {\n // ── 生命周期 ──\n /** 手工释放句柄(GC 型引擎实现为 no-op)。 */\n release(shape: BrepHandle): void\n /** 释放内核/句柄(引擎级释放语义;brepkit GC 型 no-op)。 */\n dispose(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 makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle\n makeTorus(majorRadius: number, minorRadius: number): BrepHandle\n makeVertex(x: number, y: number, z: number): BrepHandle\n\n // ── 造型运算 ──\n /**\n * 挤出:`{dx,dy,dz}` 为挤出向量(occt 方言)。\n * brepkit 方言(方向+距离、只吃 face)由适配器归一:`len = |v|`、`dir = v/len`;\n * `len === 0` 抛错;输入不是 face → 报错(显式失败,不静默降级,§3.6-1)。\n */\n extrude(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n /** 旋转挤出(绕过 center、方向 direction 的轴,angle 为度;输入需 face,brepkit 方言断言同 extrude)。 */\n revolveVec(shape: BrepHandle, center: BrepVec3, direction: BrepVec3, angleDeg: number): BrepHandle\n /** 缝合(tolerance 可选)。 */\n sew(shapes: BrepHandle[], tolerance?: number): BrepHandle\n /** 缝合并固化成实体。 */\n sewAndSolidify(faces: BrepHandle[], tolerance?: number): BrepHandle\n /** 抽壳(facesToRemove 移除面、thickness 壁厚、tolerance 容差)。 */\n shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle\n /** 点集凸包(tolerance 为容差)。 */\n hullFromPoints(points: BrepVec3[], tolerance: number): 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 fuseAll(shapes: BrepHandle[]): BrepHandle\n /**\n * 平面求交线:solid 与「过 point、法向 normal 的无限平面」的交线(§3.6-2 新中立名)。\n * occt 适配器:大平面 face 作 tool 经原生 section 达成(Phase 1 探针 A 实测可达)。\n * 返回交线/顶点句柄数组(brepkit 返回 Uint32Array 句柄组,occt compound downcast 展开)。\n */\n sectionByPlane(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle[]\n /**\n * 平面二分:把 solid 沿「过 point、法向 normal 的无限平面」切成两半(§3.6-2 新中立名)。\n * occt 适配器:大平面 face 作 tool 经原生 splitter 达成(Phase 1 探针 A 实测,solidCount=2)。\n * 法向正侧 = `positive`(§3.7 返回口径)。\n */\n splitByPlane(\n shape: BrepHandle,\n point: BrepVec3,\n normal: BrepVec3,\n ): { positive: BrepHandle; negative: BrepHandle }\n\n // ── 倒角与圆角(Q7:只对齐等距 + 距角两种粒度)──\n /** 等距倒角:逐边 `BRepFilletAPI_MakeChamfer::Add(distance, E)`。 */\n chamfer(solid: BrepHandle, edges: BrepHandle[], distance: number): BrepHandle\n /**\n * 距角倒角:`AddDA(distance, angleDeg, E, F)`(brepkit 原生 chamferDistanceAngle,方言映射)。\n * ⚠️ F 由内核自选(外层第一个含该边的面),调用方不可指定。\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 /** 变半径圆角:单边 `Add(startRadius, endRadius, E)`(brepkit 吃 json 描述,适配器消化)。 */\n filletVariable(solid: BrepHandle, edge: BrepHandle, startRadius: number, endRadius: number): BrepHandle\n /**\n * 等半径圆角(带面演化):modified/generated/deleted 用面 hash 编码(§7.5)。\n * brepkit 原生 filletWithEvolution,适配器映射。\n */\n filletWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n radius: 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 locate(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 一般变换(3×4 行主序 12 元素)。 */\n generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle\n copy(shape: BrepHandle): BrepHandle\n /** 复制句柄(独立引用计数)。 */\n copyShape(shape: BrepHandle): BrepHandle\n /** 组合两个 3×4 行主序变换矩阵(12 元素)。 */\n composeTransform(m1: number[], m2: number[]): number[]\n /** 镜像(过 point、法向 normal 的平面)。 */\n mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle\n\n // ── 阵列 ──\n // 口径:两内核的 pattern 内核函数都返回 compound(含全部副本),适配器负责拆成数组。\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 // ── 曲线构造 ──\n makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle\n makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle\n makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle\n makeCircleEdge(center: BrepVec3, normal: BrepVec3, radius: number): BrepHandle\n\n // ── 拓扑构造 ──\n makeWire(edges: BrepHandle[]): BrepHandle\n makeFace(wire: BrepHandle): BrepHandle\n makeCompound(shapes: BrepHandle[]): BrepHandle\n addHolesInFace(face: BrepHandle, holeWires: BrepHandle[]): BrepHandle\n /** 三角面(三顶点)。 */\n buildTriFace(a: BrepVec3, b: BrepVec3, c: BrepVec3): 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 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 /** 形状类型名('SOLID' / 'FACE' / 'EDGE' / 'WIRE' / 'COMPOUND' 等;引擎方言归一)。\n * 库桥(l3-bridge)构造借入视图时读;brepkit/mock 按能力防御返回。 */\n shapeType(shape: BrepHandle): string\n /** 方向标识(与内核 ShapeOrientation 同构:'forward'|'reversed'|'internal'|'external')。 */\n shapeOrientation(shape: BrepHandle): string\n /** 边→面关联(brepkit 原生同名)。 */\n edgeToFaceMap(shape: BrepHandle): unknown\n /** 面的相邻面(同一 solid 内与 face 共享边的面;两内核原生都吃 (shape, face))。 */\n adjacentFaces(shape: BrepHandle, face: BrepHandle): BrepHandle[]\n /** 两面共享的边。 */\n sharedEdges(a: BrepHandle, b: BrepHandle): BrepHandle[]\n\n // ── 几何求值 ──\n /** 曲线类型标识(与内核 CurveKind 同构的中立字符串形态)。 */\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 /** 曲面质心。 */\n surfaceCenterOfMass(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 interpolatePoints(points: BrepVec3[], degree: number): BrepHandle\n\n /** 去特征(移除面集合)。 */\n defeature(shape: BrepHandle, faces: BrepHandle[]): BrepHandle\n /** 拔模。 */\n draft(shape: BrepHandle, faces: BrepHandle[], pull: BrepVec3, neutral: BrepVec3, angleDeg: number): BrepHandle\n removeHolesFromFace(face: BrepHandle): BrepHandle\n reverseShape(shape: BrepHandle): BrepHandle\n /** 边投影(方言参数由适配器消化)。 */\n projectEdges(shape: BrepHandle, origin: BrepVec3, direction: BrepVec3, xAxis: BrepVec3, hiddenLines: boolean, deflection: number): unknown\n\n // ── 测量(D5/D6:核心面只进双方都有的;linearCenterOfMass/inertia/distance 是 L2 平台面)──\n getBoundingBox(shape: BrepHandle, useTriangulation?: boolean): BrepBoundingBox\n getVolume(shape: BrepHandle): number\n getCenterOfMass(shape: BrepHandle): BrepVec3\n /** 表面积(D6:面积进 L1;brepkit 原生 surfaceArea/faceArea,适配器映射)。 */\n getSurfaceArea(shape: BrepHandle): number\n /** 长度(D6:进 L1;brepkit 原生 length/wireLength,wire 与 edge 入参差异由适配器判别)。 */\n getLength(shape: BrepHandle): number\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, tolerance?: number): 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 // ── 面演化(仅双方都有原生/可对齐实现的三员,D1)──\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\n/**\n * 编译期完整性断言(D1):实现类型必须逐成员满足 L1 核心面。\n * 三处守卫 `_AssertOcctApi` / `_AssertBrepkitApi` / `_AssertBrepMockApi` 同时生效。\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;;;;;;;;;;;;GAYG","sourcesContent":["/**\n * engine/primitives — BREP 引擎契约面(port 面,L1 核心面)\n *\n * ⚠️ 2026-09-24 契约面收窄(docs/plans/2026-09-24-brep-engine-api-narrowing-native-access.md\n * §Phase 2 / D1 / D9 / D10):`BrepEngineApi` 的语义 = **所有已注册 BREP 引擎都真实现的\n * 方法**(occt 与 brepkit 双方语义可对齐的交集面,最大化口径)。判据唯一真源:\n * `api/surface/engine-method-map.json`(status ∈ {aligned, dialect} 的条目)。\n *\n * - 移出 L1 的方法(occt-only 语义)不再有中立名,平台代码直接走原生面:\n * `getOcctKernel()` / `getBrepkitKernel()`(D3),op 侧用 `engines: ['occt']` 声明(D11)。\n * - 禁止任何 `as BrepEngineApi` 跨层断言(守卫见 §5 守卫清单)。\n * - 三个适配器的编译期断言 `_Assert*Api` 由此全部获得真校验力。\n */\n\nimport type {\n BrepBoundingBox,\n BrepCurveParameters,\n BrepEdgeData,\n BrepEvolutionData,\n BrepHandle,\n BrepMeshResult,\n BrepNurbsCurveData,\n BrepSubShapeType,\n BrepTessellateOptions,\n BrepUvBounds,\n BrepVec3,\n} from './types'\n\n/**\n * BREP 引擎原语契约(L1 核心面)。所有句柄参数/返回值均为 BrepHandle(不透明值,§6.3)。\n * 引擎实现(occt/brepkit 适配器)负责内部句柄形态与 BrepHandle 的转换,以及方言消化\n * (如 brepkit surfaceArea → getSurfaceArea,与 matrix 方言的 toKernelMatrix 同构)。\n */\nexport interface BrepEngineApi {\n // ── 生命周期 ──\n /** 手工释放句柄(GC 型引擎实现为 no-op)。 */\n release(shape: BrepHandle): void\n /** 释放内核/句柄(引擎级释放语义;brepkit GC 型 no-op)。 */\n dispose(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 makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle\n makeTorus(majorRadius: number, minorRadius: number): BrepHandle\n makeVertex(x: number, y: number, z: number): BrepHandle\n\n // ── 造型运算 ──\n /**\n * 挤出:`{dx,dy,dz}` 为挤出向量(occt 方言)。\n * brepkit 方言(方向+距离、只吃 face)由适配器归一:`len = |v|`、`dir = v/len`;\n * `len === 0` 抛错;输入不是 face → 报错(显式失败,不静默降级,§3.6-1)。\n */\n extrude(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n /** 旋转挤出(绕过 center、方向 direction 的轴,angle 为度;输入需 face,brepkit 方言断言同 extrude)。 */\n revolveVec(shape: BrepHandle, center: BrepVec3, direction: BrepVec3, angleDeg: number): BrepHandle\n /** 缝合(tolerance 可选)。 */\n sew(shapes: BrepHandle[], tolerance?: number): BrepHandle\n /** 缝合并固化成实体。 */\n sewAndSolidify(faces: BrepHandle[], tolerance?: number): BrepHandle\n /** 抽壳(facesToRemove 移除面、thickness 壁厚、tolerance 容差)。 */\n shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle\n /** 点集凸包(tolerance 为容差)。 */\n hullFromPoints(points: BrepVec3[], tolerance: number): 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 fuseAll(shapes: BrepHandle[]): BrepHandle\n /**\n * 平面求交线:solid 与「过 point、法向 normal 的无限平面」的交线(§3.6-2 新中立名)。\n * occt 适配器:大平面 face 作 tool 经原生 section 达成(Phase 1 探针 A 实测可达)。\n * 返回交线/顶点句柄数组(brepkit 返回 Uint32Array 句柄组,occt compound downcast 展开)。\n */\n sectionByPlane(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle[]\n /**\n * 平面二分:把 solid 沿「过 point、法向 normal 的无限平面」切成两半(§3.6-2 新中立名)。\n * occt 适配器:大平面 face 作 tool 经原生 splitter 达成(Phase 1 探针 A 实测,solidCount=2)。\n * 法向正侧 = `positive`(§3.7 返回口径)。\n */\n splitByPlane(\n shape: BrepHandle,\n point: BrepVec3,\n normal: BrepVec3,\n ): { positive: BrepHandle; negative: BrepHandle }\n\n // ── 倒角与圆角(Q7:只对齐等距 + 距角两种粒度)──\n /** 等距倒角:逐边 `BRepFilletAPI_MakeChamfer::Add(distance, E)`。 */\n chamfer(solid: BrepHandle, edges: BrepHandle[], distance: number): BrepHandle\n /**\n * 距角倒角:`AddDA(distance, angleDeg, E, F)`(brepkit 原生 chamferDistanceAngle,方言映射)。\n * ⚠️ F 由内核自选(外层第一个含该边的面),调用方不可指定。\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 /** 变半径圆角:单边 `Add(startRadius, endRadius, E)`(brepkit 吃 json 描述,适配器消化)。 */\n filletVariable(solid: BrepHandle, edge: BrepHandle, startRadius: number, endRadius: number): BrepHandle\n /**\n * 等半径圆角(带面演化):modified/generated/deleted 用面 hash 编码(§7.5)。\n * brepkit 原生 filletWithEvolution,适配器映射。\n */\n filletWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n radius: 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 locate(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 一般变换(3×4 行主序 12 元素)。 */\n generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle\n copy(shape: BrepHandle): BrepHandle\n /** 复制句柄(独立引用计数)。 */\n copyShape(shape: BrepHandle): BrepHandle\n /** 组合两个 3×4 行主序变换矩阵(12 元素)。 */\n composeTransform(m1: number[], m2: number[]): number[]\n /** 镜像(过 point、法向 normal 的平面)。 */\n mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle\n\n // ── 阵列 ──\n // 口径:两内核的 pattern 内核函数都返回 compound(含全部副本),适配器负责拆成数组。\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 // ── 曲线构造 ──\n makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle\n makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle\n makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle\n /**\n * Exact NURBS edge from raw control data — the write-side counterpart of\n * `getNurbsCurveData`, so a rational / multi-span curve survives a round trip\n * instead of being tessellated.\n *\n * `poles` is flat `[x,y,z, …]`; `knots`/`multiplicities` are parallel (the\n * expanded knot vector is `knots[i]` repeated `multiplicities[i]` times). The\n * built edge spans the WHOLE curve — to reproduce an edge that is a sub-range\n * of its basis curve, trim it with `curveSplit`.\n */\n makeBSplineEdge(\n poles: number[],\n weights: number[],\n knots: number[],\n multiplicities: number[],\n degree: number,\n periodic?: boolean,\n ): BrepHandle\n makeCircleEdge(center: BrepVec3, normal: BrepVec3, radius: number): BrepHandle\n /**\n * Split an edge at an interior parameter into its two sub-edges, in order.\n * The parameter must be STRICTLY inside the edge's domain — splitting at an\n * end is rejected by the kernel rather than returning a degenerate pair.\n */\n curveSplit(edge: BrepHandle, param: number): [BrepHandle, BrepHandle]\n\n // ── 拓扑构造 ──\n makeWire(edges: BrepHandle[]): BrepHandle\n makeFace(wire: BrepHandle): BrepHandle\n makeCompound(shapes: BrepHandle[]): BrepHandle\n addHolesInFace(face: BrepHandle, holeWires: BrepHandle[]): BrepHandle\n /** 三角面(三顶点)。 */\n buildTriFace(a: BrepVec3, b: BrepVec3, c: BrepVec3): 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 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 /** 形状类型名('SOLID' / 'FACE' / 'EDGE' / 'WIRE' / 'COMPOUND' 等;引擎方言归一)。\n * 库桥(l3-bridge)构造借入视图时读;brepkit/mock 按能力防御返回。 */\n shapeType(shape: BrepHandle): string\n /** 方向标识(与内核 ShapeOrientation 同构:'forward'|'reversed'|'internal'|'external')。 */\n shapeOrientation(shape: BrepHandle): string\n /** 边→面关联(brepkit 原生同名)。 */\n edgeToFaceMap(shape: BrepHandle): unknown\n /** 面的相邻面(同一 solid 内与 face 共享边的面;两内核原生都吃 (shape, face))。 */\n adjacentFaces(shape: BrepHandle, face: BrepHandle): BrepHandle[]\n /** 两面共享的边。 */\n sharedEdges(a: BrepHandle, b: BrepHandle): BrepHandle[]\n\n // ── 几何求值 ──\n /** 曲线类型标识(与内核 CurveKind 同构的中立字符串形态)。 */\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 /** 曲面质心。 */\n surfaceCenterOfMass(face: BrepHandle): BrepVec3\n /** Phase 1 钉死返回形态(topologyExt 仅读 radius)。 */\n getFaceCylinderData(face: BrepHandle): { radius: number } | null\n /**\n * NURBS control data of the edge's basis curve, or `null` for the analytic\n * kinds (line / circle / ellipse / hyperbola / parabola).\n *\n * ⚠️ Two measured behaviours (2026-09-29) that the name does not imply:\n * · it THROWS — it is not a nullable getter — when the edge is not a B-spline\n * or Bézier, so callers must guard, not just null-check;\n * · it returns the WHOLE basis curve, while `curveParameters` returns the\n * EDGE's trim range on it; rebuilding without the trim is not faithful.\n */\n getNurbsCurveData(edge: BrepHandle): BrepNurbsCurveData | null\n interpolatePoints(points: BrepVec3[], degree: number): BrepHandle\n\n /** 去特征(移除面集合)。 */\n defeature(shape: BrepHandle, faces: BrepHandle[]): BrepHandle\n /** 拔模。 */\n draft(shape: BrepHandle, faces: BrepHandle[], pull: BrepVec3, neutral: BrepVec3, angleDeg: number): BrepHandle\n removeHolesFromFace(face: BrepHandle): BrepHandle\n reverseShape(shape: BrepHandle): BrepHandle\n /** 边投影(方言参数由适配器消化)。 */\n projectEdges(shape: BrepHandle, origin: BrepVec3, direction: BrepVec3, xAxis: BrepVec3, hiddenLines: boolean, deflection: number): unknown\n\n // ── 测量(D5/D6:核心面只进双方都有的;linearCenterOfMass/inertia/distance 是 L2 平台面)──\n getBoundingBox(shape: BrepHandle, useTriangulation?: boolean): BrepBoundingBox\n getVolume(shape: BrepHandle): number\n getCenterOfMass(shape: BrepHandle): BrepVec3\n /** 表面积(D6:面积进 L1;brepkit 原生 surfaceArea/faceArea,适配器映射)。 */\n getSurfaceArea(shape: BrepHandle): number\n /** 长度(D6:进 L1;brepkit 原生 length/wireLength,wire 与 edge 入参差异由适配器判别)。 */\n getLength(shape: BrepHandle): number\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, tolerance?: number): 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 // ── 面演化(仅双方都有原生/可对齐实现的三员,D1)──\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\n/**\n * 编译期完整性断言(D1):实现类型必须逐成员满足 L1 核心面。\n * 三处守卫 `_AssertOcctApi` / `_AssertBrepkitApi` / `_AssertBrepMockApi` 同时生效。\n */\nexport type AssertSatisfiesBrepEngineApi<Impl extends BrepEngineApi> = Impl\n"]}
|
|
@@ -22,9 +22,16 @@ export interface BrepEngine {
|
|
|
22
22
|
}
|
|
23
23
|
/** BREP 引擎异步提供者(宿主装配时注册;引擎初始化完成后 resolve)。 */
|
|
24
24
|
export type BrepEngineProvider = () => Promise<BrepEngine>;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* mesh 引擎实例(槽位 2)——与 BREP 槽完全独立(R2)。
|
|
27
|
+
*
|
|
28
|
+
* `meshSolid`:可选的**网格实体后端**(方案 2026-10-01 §3.3)。提供它的 mesh
|
|
29
|
+
* 引擎才能把网格文件导入成"网格实体 + 近似拓扑"。缺省(未提供)= 该 mesh 后端
|
|
30
|
+
* 只做裸网格布尔,`load` 的 mesh 路径保持"裸网格、无拓扑"的历史行为。
|
|
31
|
+
*/
|
|
26
32
|
export interface MeshEngine {
|
|
27
33
|
readonly id: string;
|
|
34
|
+
readonly meshSolid?: import('../mesh-solid.js').MeshSolidBackend;
|
|
28
35
|
}
|
|
29
36
|
/**
|
|
30
37
|
* 冻结注册表:宿主启动装配完成后调用(R8)。
|
|
@@ -44,6 +51,12 @@ export declare function registerBrepEngine(id: string, provider: BrepEngineProvi
|
|
|
44
51
|
* @param engine - the engine instance to register.
|
|
45
52
|
*/
|
|
46
53
|
export declare function registerMeshEngine(id: string, engine: MeshEngine): void;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the given mesh engine is registered (used for idempotent adapter registration).
|
|
56
|
+
* @param id - the mesh engine registration id to look up.
|
|
57
|
+
* @returns true when the engine is registered.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isMeshEngineRegistered(id: string): boolean;
|
|
47
60
|
/**
|
|
48
61
|
* Whether a default BREP engine is registered (none → mesh mode, equivalent to "no BREP capability").
|
|
49
62
|
* @returns true when a default BREP engine is registered.
|
|
@@ -78,6 +91,16 @@ export declare function getActiveBrepEngineId(): string | null;
|
|
|
78
91
|
* @returns the active mesh engine id or null.
|
|
79
92
|
*/
|
|
80
93
|
export declare function getActiveMeshEngineId(): string | null;
|
|
94
|
+
/**
|
|
95
|
+
* 已装配的网格实体后端(方案 2026-10-01 §3.3)。
|
|
96
|
+
*
|
|
97
|
+
* 按**注册顺序**返回第一个声明了 `meshSolid` 的 mesh 引擎——不要求它就是
|
|
98
|
+
* "默认" mesh 引擎(默认槽位今天无人注册,直接看默认槽会永远拿不到后端)。
|
|
99
|
+
* 一个都没有 → `null`:这是宿主装配事实,不是错误。
|
|
100
|
+
*
|
|
101
|
+
* @returns the assembled mesh-solid backend, or null when none is available.
|
|
102
|
+
*/
|
|
103
|
+
export declare function getMeshSolidBackend(): import('../mesh-solid.js').MeshSolidBackend | null;
|
|
81
104
|
/**
|
|
82
105
|
* 仅测试用:重置注册表状态。
|
|
83
106
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAA;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAA;CACzC;AAED,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAA;AAE1D
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAA;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAA;CACzC;AAED,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAA;AAE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|
|
62
|
+
* Whether the given mesh engine is registered (used for idempotent adapter registration).
|
|
63
|
+
* @param id - the mesh engine registration id to look up.
|
|
64
|
+
* @returns true when the engine is registered.
|
|
65
|
+
*/
|
|
66
|
+
export function isMeshEngineRegistered(id) {
|
|
67
|
+
return meshEngines.has(id);
|
|
68
|
+
}
|
|
61
69
|
/**
|
|
62
70
|
* Whether a default BREP engine is registered (none → mesh mode, equivalent to "no BREP capability").
|
|
63
71
|
* @returns true when a default BREP engine is registered.
|
|
@@ -122,6 +130,22 @@ export function getActiveBrepEngineId() {
|
|
|
122
130
|
export function getActiveMeshEngineId() {
|
|
123
131
|
return defaultMeshId;
|
|
124
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* 已装配的网格实体后端(方案 2026-10-01 §3.3)。
|
|
135
|
+
*
|
|
136
|
+
* 按**注册顺序**返回第一个声明了 `meshSolid` 的 mesh 引擎——不要求它就是
|
|
137
|
+
* "默认" mesh 引擎(默认槽位今天无人注册,直接看默认槽会永远拿不到后端)。
|
|
138
|
+
* 一个都没有 → `null`:这是宿主装配事实,不是错误。
|
|
139
|
+
*
|
|
140
|
+
* @returns the assembled mesh-solid backend, or null when none is available.
|
|
141
|
+
*/
|
|
142
|
+
export function getMeshSolidBackend() {
|
|
143
|
+
for (const engine of meshEngines.values()) {
|
|
144
|
+
if (engine.meshSolid)
|
|
145
|
+
return engine.meshSolid;
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
125
149
|
/**
|
|
126
150
|
* 仅测试用:重置注册表状态。
|
|
127
151
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/brep/engine/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/brep/engine/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA2BH,MAAM,mBAAmB,GA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M,IAAI,KAAK,CAAC,kCAAkC,GAAG,IAAI,QAAQ,kBAAkB,CAAC,CAAA;IACtF,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,aAAa,CAAA;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,aAAa,CAAA;AACtB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB;IACjC,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,IAAI,MAAM,CAAC,SAAS;YAAE,OAAO,MAAM,CAAC,SAAS,CAAA;IAC/C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B;IAC7C,mBAAmB,CAAC,KAAK,EAAE,CAAA;IAC3B,eAAe,CAAC,KAAK,EAAE,CAAA;IACvB,WAAW,CAAC,KAAK,EAAE,CAAA;IACnB,aAAa,GAAG,IAAI,CAAA;IACpB,aAAa,GAAG,IAAI,CAAA;IACpB,MAAM,GAAG,KAAK,CAAA;AAChB,CAAC","sourcesContent":["/**\n * engine/registry — BREP / mesh 双槽位注册表(§6.2,R8 构建时切换)\n *\n *\n * 与 brepjs 的 registerKernel 同构(首个注册者为默认),但两张表、两套 getter——\n * 这是 R2(双槽位正交:mesh 引擎与 BREP 引擎独立注册、单独切换)的直接落地。\n *\n * BREP 槽以「异步 provider」注册:引擎可能需异步初始化(occt-wasm 加载、\n * 外部内核 wasm 下载等),provider 只解析一次,结果缓存。\n *\n * 注册只发生在宿主启动装配期(R8):构建时选定的适配器包在初始化时完成注册,\n * 之后注册表运行期只读。不提供运行时的 unregister / setDefault / 切换 API;\n * 装配完成后调用 freezeEngineRegistries() 冻结,冻结后任何注册尝试抛错(E2 验收)。\n */\n\nimport type { BrepEngineApi } from './primitives'\nimport type { BrepCapabilities } from './types'\n\n/** BREP 引擎实例(槽位 1):原语契约 + 可选能力声明。 */\nexport interface BrepEngine {\n readonly id: string\n readonly primitives: BrepEngineApi\n readonly capabilities?: BrepCapabilities\n}\n\n/** BREP 引擎异步提供者(宿主装配时注册;引擎初始化完成后 resolve)。 */\nexport type BrepEngineProvider = () => Promise<BrepEngine>\n\n/**\n * mesh 引擎实例(槽位 2)——与 BREP 槽完全独立(R2)。\n *\n * `meshSolid`:可选的**网格实体后端**(方案 2026-10-01 §3.3)。提供它的 mesh\n * 引擎才能把网格文件导入成\"网格实体 + 近似拓扑\"。缺省(未提供)= 该 mesh 后端\n * 只做裸网格布尔,`load` 的 mesh 路径保持\"裸网格、无拓扑\"的历史行为。\n */\nexport interface MeshEngine {\n readonly id: string\n readonly meshSolid?: import('../mesh-solid').MeshSolidBackend\n}\n\nconst brepEngineProviders = new Map<string, BrepEngineProvider>()\nconst brepEngineCache = new Map<string, BrepEngine>()\nlet defaultBrepId: string | null = null\n\nconst meshEngines = new Map<string, MeshEngine>()\nlet defaultMeshId: string | null = null\n\nlet frozen = false\n\n/**\n * 冻结注册表:宿主启动装配完成后调用(R8)。\n * 冻结后任何 registerBrepEngine / registerMeshEngine 尝试抛错。\n * 已解析的引擎实例仍可读取(运行期只读,不冻结读取)。\n */\nexport function freezeEngineRegistries(): void {\n frozen = true\n}\n\n/**\n * Register a BREP engine (slot 1). The first registrant automatically becomes the default.\n * @param id - the engine registration id.\n * @param provider - the async provider that resolves the engine instance.\n */\nexport function registerBrepEngine(id: string, provider: BrepEngineProvider): void {\n if (frozen) {\n throw new Error(`[engine/registry] registry frozen — cannot register BREP engine '${id}' after assembly (R8)`)\n }\n if (brepEngineProviders.has(id)) {\n throw new Error(`[engine/registry] BREP engine '${id}' already registered`)\n }\n brepEngineProviders.set(id, provider)\n if (defaultBrepId === null) defaultBrepId = id\n}\n\n/**\n * Register a mesh engine (slot 2). The first registrant automatically becomes the default.\n * @param id - the engine registration id.\n * @param engine - the engine instance to register.\n */\nexport function registerMeshEngine(id: string, engine: MeshEngine): void {\n if (frozen) {\n throw new Error(`[engine/registry] registry frozen — cannot register mesh engine '${id}' after assembly (R8)`)\n }\n if (meshEngines.has(id)) {\n throw new Error(`[engine/registry] mesh engine '${id}' already registered`)\n }\n meshEngines.set(id, engine)\n if (defaultMeshId === null) defaultMeshId = id\n}\n\n/**\n * Whether the given mesh engine is registered (used for idempotent adapter registration).\n * @param id - the mesh engine registration id to look up.\n * @returns true when the engine is registered.\n */\nexport function isMeshEngineRegistered(id: string): boolean {\n return meshEngines.has(id)\n}\n\n/**\n * Whether a default BREP engine is registered (none → mesh mode, equivalent to \"no BREP capability\").\n * @returns true when a default BREP engine is registered.\n */\nexport function hasBrepEngine(): boolean {\n return defaultBrepId !== null\n}\n\n/**\n * Whether the given BREP engine is registered (used for idempotent adapter registration).\n * @param id - the engine registration id to look up.\n * @returns true when the engine is registered.\n */\nexport function isBrepEngineRegistered(id: string): boolean {\n return brepEngineProviders.has(id)\n}\n\n/**\n * Resolve a BREP engine (asynchronously, resolving its provider; throws when not registered).\n * Omitting id uses the default (the first registrant).\n * @param id - optional engine registration id; defaults to the active engine.\n * @returns a Promise resolving to the BREP engine instance.\n */\nexport async function getBrepEngine(id?: string): Promise<BrepEngine> {\n const key = id ?? defaultBrepId\n if (key === null) {\n throw new Error('[engine/registry] no BREP engine registered — call registerBrepEngine() during host assembly (R8)')\n }\n const cached = brepEngineCache.get(key)\n if (cached) return cached\n const provider = brepEngineProviders.get(key)\n if (!provider) {\n throw new Error(`[engine/registry] BREP engine '${key}' not registered`)\n }\n const engine = await provider()\n brepEngineCache.set(key, engine)\n return engine\n}\n\n/**\n * Get a mesh engine (throws when not registered). Omitting id uses the default (the first registrant).\n * @param id - optional engine registration id; defaults to the active engine.\n * @returns the mesh engine instance.\n */\nexport function getMeshEngine(id?: string): MeshEngine {\n const key = id ?? defaultMeshId\n const engine = key === null ? undefined : meshEngines.get(key)\n if (!engine) {\n throw new Error(`[engine/registry] mesh engine '${key ?? '<none>'}' not registered`)\n }\n return engine\n}\n\n/**\n * The current default BREP engine id (null when none is registered).\n * @returns the active BREP engine id or null.\n */\nexport function getActiveBrepEngineId(): string | null {\n return defaultBrepId\n}\n\n/**\n * The current default mesh engine id (null when none is registered).\n * @returns the active mesh engine id or null.\n */\nexport function getActiveMeshEngineId(): string | null {\n return defaultMeshId\n}\n\n/**\n * 已装配的网格实体后端(方案 2026-10-01 §3.3)。\n *\n * 按**注册顺序**返回第一个声明了 `meshSolid` 的 mesh 引擎——不要求它就是\n * \"默认\" mesh 引擎(默认槽位今天无人注册,直接看默认槽会永远拿不到后端)。\n * 一个都没有 → `null`:这是宿主装配事实,不是错误。\n *\n * @returns the assembled mesh-solid backend, or null when none is available.\n */\nexport function getMeshSolidBackend(): import('../mesh-solid').MeshSolidBackend | null {\n for (const engine of meshEngines.values()) {\n if (engine.meshSolid) return engine.meshSolid\n }\n return null\n}\n\n/**\n * 仅测试用:重置注册表状态。\n *\n * R8 不提供运行期的 unregister / setDefault;此函数仅供 registry.test.ts\n * 重置模块级单例,不进入任何公共导出面(index/browser/node/sdk 均不 re-export)。\n */\nexport function __resetEngineRegistriesForTests(): void {\n brepEngineProviders.clear()\n brepEngineCache.clear()\n meshEngines.clear()\n defaultBrepId = null\n defaultMeshId = null\n frozen = false\n}\n"]}
|
|
@@ -45,7 +45,27 @@ export interface BrepBoundingBox {
|
|
|
45
45
|
ymax: number;
|
|
46
46
|
zmax: number;
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* 面/边 hash 的上界(唯一真源)。
|
|
50
|
+
*
|
|
51
|
+
* 拓扑提取侧用 `kernel.hashCode(subShape, BREP_HASH_BOUND)` 查面/边,
|
|
52
|
+
* 三角化/线框侧把 hash 写进 `faceGroups[·+2]` / `edgeGroups[·+2]`——
|
|
53
|
+
* **两侧必须对同一上界取模**,否则查表恒 miss(实测 2026-10-01:
|
|
54
|
+
* brepkit 适配器曾用 1e9、topologyExt 用 INT32_MAX → 面行 triangleCount 全 0)。
|
|
55
|
+
* 值取自 OCCT `HASH_CODE_MAX` 惯例,也是 occt-wasm 的实际口径(实测一致)。
|
|
56
|
+
*/
|
|
57
|
+
export declare const BREP_HASH_BOUND = 2147483647;
|
|
58
|
+
/**
|
|
59
|
+
* BRepMesh 三角化输出(镜像 occt-wasm Mesh 的中立形态)。
|
|
60
|
+
*
|
|
61
|
+
* ⚠️ 单位口径(L1 契约的一部分,实测钉死):
|
|
62
|
+
* - `faceGroups` 三元组 = `[triStart, triCount, faceHash]`,前两元是**索引单位**
|
|
63
|
+
* (3/三角形),不是三角形单位;
|
|
64
|
+
* - `wireframe().edgeGroups` = `[pointStart, pointCount, edgeHash]`,前两元是
|
|
65
|
+
* **浮点单位**(3/点)。
|
|
66
|
+
* 修订任何一侧都要同步改另一侧与 brepkit 适配器(跨引擎一致性测试
|
|
67
|
+
* `topology/face-group-units.test.ts` 钉住)。
|
|
68
|
+
*/
|
|
49
69
|
export interface BrepMeshResult {
|
|
50
70
|
/** XYZ 交错顶点坐标,长度 = vertexCount * 3 */
|
|
51
71
|
positions: Float32Array;
|
|
@@ -75,7 +95,7 @@ export interface BrepTessellateOptions {
|
|
|
75
95
|
export interface BrepEdgeData {
|
|
76
96
|
/** XYZ 交错边采样点 */
|
|
77
97
|
points: Float32Array;
|
|
78
|
-
/** 每边分组:[pointStart, pointCount, edgeHash]
|
|
98
|
+
/** 每边分组:[pointStart, pointCount, edgeHash] 三元组;前两元为**浮点单位**(3/点)。 */
|
|
79
99
|
edgeGroups: Int32Array;
|
|
80
100
|
/** points 中的浮点数总数(= XYZ 坐标数) */
|
|
81
101
|
pointCount: number;
|
|
@@ -120,6 +140,37 @@ export interface BrepCurveParameters {
|
|
|
120
140
|
first: number;
|
|
121
141
|
last: number;
|
|
122
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* NURBS control data of one edge's BASIS curve.
|
|
145
|
+
*
|
|
146
|
+
* ⚠️ This is the WHOLE basis curve, not the edge: an OCCT edge is often only a
|
|
147
|
+
* sub-range of its curve, so `curveParameters(edge)` is the trim to apply on top
|
|
148
|
+
* of this (`BRep_Tool::Curve` hands back both halves). Rebuilding an edge from
|
|
149
|
+
* this data without honouring that trim produces a curve running past its
|
|
150
|
+
* neighbour's start (measured 2026-09-29).
|
|
151
|
+
*
|
|
152
|
+
* `poles` is flat `[x,y,z, x,y,z, …]`; `weights` has one entry per pole (all 1
|
|
153
|
+
* for a non-rational curve, and `rational` then says whether they mean anything);
|
|
154
|
+
* `knots`/`multiplicities` are parallel arrays (expanded, the knot vector is
|
|
155
|
+
* `knots[i]` repeated `multiplicities[i]` times and has `poles + degree + 1`
|
|
156
|
+
* entries).
|
|
157
|
+
*/
|
|
158
|
+
export interface BrepNurbsCurveData {
|
|
159
|
+
/** Polynomial degree. */
|
|
160
|
+
degree: number;
|
|
161
|
+
/** True when `weights` are meaningful (a rational curve). */
|
|
162
|
+
rational: boolean;
|
|
163
|
+
/** True for a periodic (closed, wrap-around) curve. */
|
|
164
|
+
periodic: boolean;
|
|
165
|
+
/** Distinct knot values, parallel to `multiplicities`. */
|
|
166
|
+
knots: number[];
|
|
167
|
+
/** Multiplicity of each entry in `knots`. */
|
|
168
|
+
multiplicities: number[];
|
|
169
|
+
/** Flat control points: `[x, y, z, x, y, z, …]`. */
|
|
170
|
+
poles: number[];
|
|
171
|
+
/** One weight per control point. */
|
|
172
|
+
weights: number[];
|
|
173
|
+
}
|
|
123
174
|
/** 曲面 UV 边界。 */
|
|
124
175
|
export interface BrepUvBounds {
|
|
125
176
|
uMin: number;
|
|
@@ -181,7 +232,7 @@ export type BrepEvolutionKind = 'fuseWithHistory' | 'cutWithHistory' | 'intersec
|
|
|
181
232
|
* 初始全集 = Phase 0 能力映射表(`api/surface/capability-map.json`)盘点的
|
|
182
233
|
* compat op 依赖内核方法 + 方案初始项;Phase 3 全量收敛时按映射表滚动补全。
|
|
183
234
|
*/
|
|
184
|
-
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' | 'getBoundingBox' | 'getVolume' | 'getSurfaceArea' | 'getLength' | 'getCenterOfMass' | 'curveParameters' | 'curvePointAtParam' | 'curveTangent' | 'hullFromPoints' | 'isNull' | 'iterShapes' | 'locate' | 'shapeType' | 'surfaceCenterOfMass' | 'surfaceNormal' | 'surfaceType' | 'uvBounds' | 'composeTransform' | 'applyComposedTransformWithHistory' | 'generalTransformNonOrthogonal' | 'generalTransformWithHistory' | 'sectionByPlane' | 'makeCompound' | 'located' | 'getSubShapes' | 'transform' | 'generalTransform' | 'importStl' | 'createXCAFDocument' | 'importXCAFFromSTEP' | 'copyShape' | 'dispose' | 'downcast' | 'hashCode';
|
|
235
|
+
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' | 'makeCircleEdge' | 'makeBezierEdge' | 'makeCylinder' | 'makeEllipsoid' | 'makeFace' | 'makeFaceOnSurface' | 'makeLineEdge' | 'makeTorus' | 'makeVertex' | 'makeWire' | 'makeWireFromMixed' | 'buildEdgeOnSurface' | 'addHolesInFace' | 'buildTriFace' | 'sew' | 'sewAndSolidify' | 'healFace' | 'healSolid' | 'healWire' | 'fixShape' | 'fixSelfIntersection' | 'isValid' | 'removeDegenerateEdges' | 'simplify' | 'split' | 'getBoundingBox' | 'getVolume' | 'getSurfaceArea' | 'getLength' | 'getCenterOfMass' | 'curveParameters' | 'curvePointAtParam' | 'curveTangent' | 'hullFromPoints' | 'isNull' | 'iterShapes' | 'locate' | 'shapeType' | 'surfaceCenterOfMass' | 'surfaceNormal' | 'surfaceType' | 'uvBounds' | 'composeTransform' | 'applyComposedTransformWithHistory' | 'generalTransformNonOrthogonal' | 'generalTransformWithHistory' | 'sectionByPlane' | 'makeCompound' | 'located' | 'getSubShapes' | 'transform' | 'generalTransform' | 'importStl' | 'createXCAFDocument' | 'importXCAFFromSTEP' | 'copyShape' | 'dispose' | 'downcast' | 'hashCode';
|
|
185
236
|
/**
|
|
186
237
|
* 可选能力槽声明(§7.5,Phase 1 钉死成员)。
|
|
187
238
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,2CAA4C,CAAA;AAExE,sDAAsD;AACtD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3D,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,CAA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xC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IACnC,sDAAsD;IACtD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,qBAAqB,CAAA;CAC1C"}
|
|
@@ -18,4 +18,14 @@
|
|
|
18
18
|
* 身份分支(D11-2)、`script-face-manifest` 的平台 op 标注(§3.8)。
|
|
19
19
|
*/
|
|
20
20
|
export const BREP_ENGINE_IDS = ['occt', 'brepkit', 'brep_mock'];
|
|
21
|
+
/**
|
|
22
|
+
* 面/边 hash 的上界(唯一真源)。
|
|
23
|
+
*
|
|
24
|
+
* 拓扑提取侧用 `kernel.hashCode(subShape, BREP_HASH_BOUND)` 查面/边,
|
|
25
|
+
* 三角化/线框侧把 hash 写进 `faceGroups[·+2]` / `edgeGroups[·+2]`——
|
|
26
|
+
* **两侧必须对同一上界取模**,否则查表恒 miss(实测 2026-10-01:
|
|
27
|
+
* brepkit 适配器曾用 1e9、topologyExt 用 INT32_MAX → 面行 triangleCount 全 0)。
|
|
28
|
+
* 值取自 OCCT `HASH_CODE_MAX` 惯例,也是 occt-wasm 的实际口径(实测一致)。
|
|
29
|
+
*/
|
|
30
|
+
export const BREP_HASH_BOUND = 2147483647;
|
|
21
31
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/brep/engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,CAAU,CAAA","sourcesContent":["/**\n * engine/types — BREP 引擎中立类型(零具体实现依赖,不 import 任何内核包)\n *\n *\n * 契约(对应 brepjs 的 KernelShape 约定):\n * - L1 及以上代码永远不对句柄调用任何方法,只把它传回产生它的那个引擎;\n * - 句柄不得跨引擎传递——跨引擎必须先经 mesh 层(§8.3 的结构保证)。\n * - OCCT 适配器的句柄运行时就是 number,加 brand 是零成本的类型层转换。\n */\n\n/**\n * BREP 引擎身份(D11-1,2026-09-24 narrowing plan)。\n *\n * 三个值来自三个已存在的引擎 id 常量(`OCCT_BREP_ENGINE_ID` / `BREPKIT_BREP_ENGINE_ID`\n * / `BREP_MOCK_ENGINE_ID`,各自适配器导出);本类型由常量数组推导,禁止裸 `string`。\n * 适配器常量用 `satisfies BrepEngineId` 收窄(typecheck 钉住集合一致)。\n *\n * 消费点:`defineOp` 的 `engines` 声明(平台 op 自证身份)、`dispatchPath` 的平台\n * 身份分支(D11-2)、`script-face-manifest` 的平台 op 标注(§3.8)。\n */\nexport const BREP_ENGINE_IDS = ['occt', 'brepkit', 'brep_mock'] as const\n\n/** BREP 引擎身份(固定三值联合;由 {@link BREP_ENGINE_IDS} 推导)。 */\nexport type BrepEngineId = (typeof BREP_ENGINE_IDS)[number]\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 // ⚠️ 测量族能力名用 L1 中立名(D5,narrowing plan):`getBoundingBox` / `getVolume`\n // / `getSurfaceArea` / `getLength` / `getCenterOfMass` ——能力名 == BrepEngineApi 接口名,\n // 守卫「能力声明诚实」据此逐名断言适配器是 function。vendored 面自己的原生名\n // (boundingBox/volume/area/length)按其自身命名,\n // 不是能力名空间成员。\n | 'getBoundingBox'\n | 'getVolume'\n | 'getSurfaceArea'\n | 'getLength'\n | 'getCenterOfMass'\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 // 2026-09-26 C batch: section/drill/pocket/boss/mirrorJoin downgrade wiring.\n | 'sectionByPlane'\n | 'makeCompound'\n | 'located'\n | 'getSubShapes'\n | 'transform'\n | 'generalTransform'\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
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/brep/engine/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,CAAU,CAAA;AAgCxE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAA","sourcesContent":["/**\n * engine/types — BREP 引擎中立类型(零具体实现依赖,不 import 任何内核包)\n *\n *\n * 契约(对应 brepjs 的 KernelShape 约定):\n * - L1 及以上代码永远不对句柄调用任何方法,只把它传回产生它的那个引擎;\n * - 句柄不得跨引擎传递——跨引擎必须先经 mesh 层(§8.3 的结构保证)。\n * - OCCT 适配器的句柄运行时就是 number,加 brand 是零成本的类型层转换。\n */\n\n/**\n * BREP 引擎身份(D11-1,2026-09-24 narrowing plan)。\n *\n * 三个值来自三个已存在的引擎 id 常量(`OCCT_BREP_ENGINE_ID` / `BREPKIT_BREP_ENGINE_ID`\n * / `BREP_MOCK_ENGINE_ID`,各自适配器导出);本类型由常量数组推导,禁止裸 `string`。\n * 适配器常量用 `satisfies BrepEngineId` 收窄(typecheck 钉住集合一致)。\n *\n * 消费点:`defineOp` 的 `engines` 声明(平台 op 自证身份)、`dispatchPath` 的平台\n * 身份分支(D11-2)、`script-face-manifest` 的平台 op 标注(§3.8)。\n */\nexport const BREP_ENGINE_IDS = ['occt', 'brepkit', 'brep_mock'] as const\n\n/** BREP 引擎身份(固定三值联合;由 {@link BREP_ENGINE_IDS} 推导)。 */\nexport type BrepEngineId = (typeof BREP_ENGINE_IDS)[number]\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/**\n * 面/边 hash 的上界(唯一真源)。\n *\n * 拓扑提取侧用 `kernel.hashCode(subShape, BREP_HASH_BOUND)` 查面/边,\n * 三角化/线框侧把 hash 写进 `faceGroups[·+2]` / `edgeGroups[·+2]`——\n * **两侧必须对同一上界取模**,否则查表恒 miss(实测 2026-10-01:\n * brepkit 适配器曾用 1e9、topologyExt 用 INT32_MAX → 面行 triangleCount 全 0)。\n * 值取自 OCCT `HASH_CODE_MAX` 惯例,也是 occt-wasm 的实际口径(实测一致)。\n */\nexport const BREP_HASH_BOUND = 2147483647\n\n/**\n * BRepMesh 三角化输出(镜像 occt-wasm Mesh 的中立形态)。\n *\n * ⚠️ 单位口径(L1 契约的一部分,实测钉死):\n * - `faceGroups` 三元组 = `[triStart, triCount, faceHash]`,前两元是**索引单位**\n * (3/三角形),不是三角形单位;\n * - `wireframe().edgeGroups` = `[pointStart, pointCount, edgeHash]`,前两元是\n * **浮点单位**(3/点)。\n * 修订任何一侧都要同步改另一侧与 brepkit 适配器(跨引擎一致性测试\n * `topology/face-group-units.test.ts` 钉住)。\n */\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] 三元组;前两元为**浮点单位**(3/点)。 */\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/**\n * NURBS control data of one edge's BASIS curve.\n *\n * ⚠️ This is the WHOLE basis curve, not the edge: an OCCT edge is often only a\n * sub-range of its curve, so `curveParameters(edge)` is the trim to apply on top\n * of this (`BRep_Tool::Curve` hands back both halves). Rebuilding an edge from\n * this data without honouring that trim produces a curve running past its\n * neighbour's start (measured 2026-09-29).\n *\n * `poles` is flat `[x,y,z, x,y,z, …]`; `weights` has one entry per pole (all 1\n * for a non-rational curve, and `rational` then says whether they mean anything);\n * `knots`/`multiplicities` are parallel arrays (expanded, the knot vector is\n * `knots[i]` repeated `multiplicities[i]` times and has `poles + degree + 1`\n * entries).\n */\nexport interface BrepNurbsCurveData {\n /** Polynomial degree. */\n degree: number\n /** True when `weights` are meaningful (a rational curve). */\n rational: boolean\n /** True for a periodic (closed, wrap-around) curve. */\n periodic: boolean\n /** Distinct knot values, parallel to `multiplicities`. */\n knots: number[]\n /** Multiplicity of each entry in `knots`. */\n multiplicities: number[]\n /** Flat control points: `[x, y, z, x, y, z, …]`. */\n poles: number[]\n /** One weight per control point. */\n weights: 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 | 'makeCircleEdge'\n | 'makeBezierEdge'\n | 'makeCylinder'\n | 'makeEllipsoid'\n | 'makeFace'\n | 'makeFaceOnSurface'\n | 'makeLineEdge'\n | 'makeTorus'\n | 'makeVertex'\n | 'makeWire'\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 // ⚠️ 测量族能力名用 L1 中立名(D5,narrowing plan):`getBoundingBox` / `getVolume`\n // / `getSurfaceArea` / `getLength` / `getCenterOfMass` ——能力名 == BrepEngineApi 接口名,\n // 守卫「能力声明诚实」据此逐名断言适配器是 function。vendored 面自己的原生名\n // (boundingBox/volume/area/length)按其自身命名,\n // 不是能力名空间成员。\n | 'getBoundingBox'\n | 'getVolume'\n | 'getSurfaceArea'\n | 'getLength'\n | 'getCenterOfMass'\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 // 2026-09-26 C batch: section/drill/pocket/boss/mirrorJoin downgrade wiring.\n | 'sectionByPlane'\n | 'makeCompound'\n | 'located'\n | 'getSubShapes'\n | 'transform'\n | 'generalTransform'\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"]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* exportModel — 统一导出入口(unit-system §10.6 二 / R11 / 裁决 J)
|
|
3
|
+
*
|
|
4
|
+
* 单一真源:坐标单位换算与文件单位声明由**同一次换算**产出(§10.3 规则 3),
|
|
5
|
+
* 声明与坐标必须同源。CLI(writeOutput)与宿主(3d_editor)共用本入口。
|
|
6
|
+
*
|
|
7
|
+
* 格式分派(§10.6 表):
|
|
8
|
+
* - stl:坐标缩放到 unit 刻度,无声明(格式不支持)。
|
|
9
|
+
* - step:预缩放 + 文本层只改写单位实体(§10.3 规则 3a;OCCT 恒写
|
|
10
|
+
* SI_UNIT(.MILLI.,.METRE.),坐标预先缩放到目标刻度后声明必须跟上)。
|
|
11
|
+
* - 3mf:坐标缩放到 unit 刻度 + <model unit> 与坐标同源;yard 不在 3MF
|
|
12
|
+
* 枚举 → 成对回落到 mm(§10.3 规则 2)。
|
|
13
|
+
*
|
|
14
|
+
* 红线(§10.3 3a):绝不文本级改坐标 — 坐标只在几何层缩放,文本层只碰单位实体。
|
|
15
|
+
*/
|
|
16
|
+
import { type UnitName } from '../../units.js';
|
|
17
|
+
import type { BrepHandle } from '../engine/types.js';
|
|
18
|
+
/** 导出条目:一个 part 的几何来源。精确 BREP 与三角网格二选一,solid 优先。 */
|
|
19
|
+
export interface ExportEntry {
|
|
20
|
+
/** 精确 BREP 句柄(来自 brep 链,导出 ADVANCED_FACE)。 */
|
|
21
|
+
solid?: BrepHandle;
|
|
22
|
+
/** 三角网格(基准单位刻度;调用方只做世界变换烘焙,不做单位缩放)。 */
|
|
23
|
+
mesh?: {
|
|
24
|
+
positions: Float32Array;
|
|
25
|
+
indices: Uint32Array;
|
|
26
|
+
};
|
|
27
|
+
/** 实体名(写 STEP PRODUCT 名 / 3MF <object name>)。 */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** sRGB 0..1 颜色(STEP 走 XCAF COLOUR_RGB,3MF 走 basematerials)。 */
|
|
30
|
+
color?: readonly [number, number, number];
|
|
31
|
+
}
|
|
32
|
+
/** Output formats supported by the unified {@link exportModel} entry. */
|
|
33
|
+
export type ExportFormat = 'stl' | 'step' | '3mf';
|
|
34
|
+
/**
|
|
35
|
+
* Options controlling {@link exportModel}/{@link exportModelSync} output
|
|
36
|
+
* (unit-system §10.3): the declared target unit and optional 3MF print config.
|
|
37
|
+
*/
|
|
38
|
+
export interface ExportOptions {
|
|
39
|
+
/**
|
|
40
|
+
* 目标长度单位。缺省 'mm'。语义是「文件里声明的单位」——
|
|
41
|
+
* 实现负责把坐标换算到该单位刻度并与声明成对写出(§10.3)。
|
|
42
|
+
*/
|
|
43
|
+
unit?: UnitName;
|
|
44
|
+
/** 3MF 打印配置(可选,原样进 model 层)。 */
|
|
45
|
+
printConfig?: unknown;
|
|
46
|
+
}
|
|
47
|
+
/** UnitName → 3MF <model unit> 枚举全名(唯一真源;yard 无对应值)。 */
|
|
48
|
+
export declare const UNIT_NAME_TO_3MF: Partial<Record<UnitName, 'micron' | 'millimeter' | 'centimeter' | 'inch' | 'foot' | 'meter'>>;
|
|
49
|
+
/**
|
|
50
|
+
* Synchronous twin of {@link exportModel} for hosts already holding a live
|
|
51
|
+
* kernel (CLI, in-process consumers). Same invariants: declared unit ==
|
|
52
|
+
* written coordinate scale. Only 'stl' / 'step' (3mf is also sync but is
|
|
53
|
+
* routed through the same code path below).
|
|
54
|
+
*
|
|
55
|
+
* @param entries - the shapes to export (BREP solids preferred, mesh fallback).
|
|
56
|
+
* @param format - output format: 'stl' | 'step' | '3mf'.
|
|
57
|
+
* @param opts - optional target unit and 3MF print config.
|
|
58
|
+
* @returns the serialized file bytes (ArrayBuffer).
|
|
59
|
+
*/
|
|
60
|
+
export declare function exportModelSync(entries: ExportEntry[], format: ExportFormat, opts?: ExportOptions): ArrayBuffer;
|
|
61
|
+
/**
|
|
62
|
+
* 统一导出入口:按 format 分派到各写出器。
|
|
63
|
+
* **内部不变式:写出的坐标刻度 == 文件声明的单位。** 这是本 API 存在的唯一理由。
|
|
64
|
+
* @param entries - 待导出的几何条目(BREP solid 优先,缺则走 mesh)。
|
|
65
|
+
* @param format - 输出格式:'stl' | 'step' | '3mf'。
|
|
66
|
+
* @param opts - 可选的目标单位与 3MF 打印配置。
|
|
67
|
+
* @returns 文件字节
|
|
68
|
+
* @throws 目标单位该格式不支持且无法回落时(不静默降级)
|
|
69
|
+
*/
|
|
70
|
+
export declare function exportModel(entries: ExportEntry[], format: ExportFormat, opts?: ExportOptions): Promise<ArrayBuffer>;
|
|
71
|
+
/**
|
|
72
|
+
* 导出后回读声明单位(自检与验收用;与 detectStepUnit 互为对偶)。
|
|
73
|
+
* @param data - the exported file bytes (ArrayBuffer or decoded Uint8Array).
|
|
74
|
+
* @param format - the format the bytes were produced in.
|
|
75
|
+
* @returns the declared unit, or null when the format cannot declare one (STL)
|
|
76
|
+
* or the declaration cannot be parsed.
|
|
77
|
+
*/
|
|
78
|
+
export declare function readDeclaredUnit(data: ArrayBuffer | Uint8Array, format: ExportFormat): UnitName | null;
|
|
79
|
+
//# sourceMappingURL=export-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-model.d.ts","sourceRoot":"","sources":["../../../src/brep/export/export-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,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