@faicad/faijs 0.13.2 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/api-namespace.d.ts +7 -0
- package/dist/api/api-namespace.d.ts.map +1 -1
- package/dist/api/api-namespace.js +44 -17
- package/dist/api/api-namespace.js.map +1 -1
- package/dist/api/boolean.d.ts +19 -0
- package/dist/api/boolean.d.ts.map +1 -1
- package/dist/api/boolean.js +71 -12
- package/dist/api/boolean.js.map +1 -1
- package/dist/api/chamfer.d.ts.map +1 -1
- package/dist/api/chamfer.js +12 -8
- package/dist/api/chamfer.js.map +1 -1
- package/dist/api/compound-geom.d.ts +45 -0
- package/dist/api/compound-geom.d.ts.map +1 -0
- package/dist/api/compound-geom.js +85 -0
- package/dist/api/compound-geom.js.map +1 -0
- package/dist/api/edge-ref.d.ts.map +1 -1
- package/dist/api/edge-ref.js +7 -4
- package/dist/api/edge-ref.js.map +1 -1
- package/dist/api/engrave.d.ts.map +1 -1
- package/dist/api/engrave.js +1 -0
- package/dist/api/engrave.js.map +1 -1
- package/dist/api/extrude.d.ts.map +1 -1
- package/dist/api/extrude.js +131 -3
- package/dist/api/extrude.js.map +1 -1
- package/dist/api/face-ref.d.ts.map +1 -1
- package/dist/api/face-ref.js +7 -4
- package/dist/api/face-ref.js.map +1 -1
- package/dist/api/fillet.d.ts.map +1 -1
- package/dist/api/fillet.js +6 -5
- package/dist/api/fillet.js.map +1 -1
- package/dist/api/generated/cad/script-face.d.ts +1 -1
- package/dist/api/generated/cad/script-face.d.ts.map +1 -1
- package/dist/api/generated/cad/script-face.js +1 -2
- package/dist/api/generated/cad/script-face.js.map +1 -1
- package/dist/api/generated/operations.js +16 -16
- package/dist/api/generated/operations.js.map +1 -1
- package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
- package/dist/api/generated/script-face-manifest.js +0 -2
- package/dist/api/generated/script-face-manifest.js.map +1 -1
- package/dist/api/generated/script-face.d.ts +1 -7
- package/dist/api/generated/script-face.d.ts.map +1 -1
- package/dist/api/generated/script-face.js +2 -4
- package/dist/api/generated/script-face.js.map +1 -1
- package/dist/api/generated/sketching.js +1 -1
- package/dist/api/generated/sketching.js.map +1 -1
- package/dist/api/generated/topology.d.ts +0 -56
- package/dist/api/generated/topology.d.ts.map +1 -1
- package/dist/api/generated/topology.js +19 -68
- package/dist/api/generated/topology.js.map +1 -1
- package/dist/api/import-brep.d.ts +36 -0
- package/dist/api/import-brep.d.ts.map +1 -0
- package/dist/api/import-brep.js +72 -0
- package/dist/api/import-brep.js.map +1 -0
- package/dist/api/import-step.d.ts +28 -0
- package/dist/api/import-step.d.ts.map +1 -0
- package/dist/api/import-step.js +57 -0
- package/dist/api/import-step.js.map +1 -0
- package/dist/api/index.d.ts +8 -12
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +22 -16
- package/dist/api/index.js.map +1 -1
- package/dist/api/internal/compat-op.d.ts.map +1 -1
- package/dist/api/internal/compat-op.js +2 -1
- package/dist/api/internal/compat-op.js.map +1 -1
- package/dist/api/internal/compat-projection.d.ts +3 -1
- package/dist/api/internal/compat-projection.d.ts.map +1 -1
- package/dist/api/internal/compat-projection.js +8 -5
- package/dist/api/internal/compat-projection.js.map +1 -1
- package/dist/api/internal/replica-role-table.d.ts +36 -0
- package/dist/api/internal/replica-role-table.d.ts.map +1 -0
- package/dist/api/internal/replica-role-table.js +73 -0
- package/dist/api/internal/replica-role-table.js.map +1 -0
- package/dist/api/internal/result-unwrap.d.ts +3 -1
- package/dist/api/internal/result-unwrap.d.ts.map +1 -1
- package/dist/api/internal/result-unwrap.js +2 -2
- package/dist/api/internal/result-unwrap.js.map +1 -1
- package/dist/api/knurl.d.ts.map +1 -1
- package/dist/api/knurl.js +1 -0
- package/dist/api/knurl.js.map +1 -1
- package/dist/api/occt-kernel-bridge.d.ts +105 -27
- package/dist/api/occt-kernel-bridge.d.ts.map +1 -1
- package/dist/api/occt-kernel-bridge.js +255 -41
- package/dist/api/occt-kernel-bridge.js.map +1 -1
- package/dist/api/pattern.d.ts +32 -0
- package/dist/api/pattern.d.ts.map +1 -0
- package/dist/api/pattern.js +85 -0
- package/dist/api/pattern.js.map +1 -0
- package/dist/api/place.d.ts +35 -0
- package/dist/api/place.d.ts.map +1 -0
- package/dist/api/place.js +113 -0
- package/dist/api/place.js.map +1 -0
- package/dist/api/primitives.d.ts.map +1 -1
- package/dist/api/primitives.js +10 -3
- package/dist/api/primitives.js.map +1 -1
- package/dist/api/replicate.d.ts +145 -0
- package/dist/api/replicate.d.ts.map +1 -0
- package/dist/api/replicate.js +351 -0
- package/dist/api/replicate.js.map +1 -0
- package/dist/api/revolve.d.ts +36 -0
- package/dist/api/revolve.d.ts.map +1 -0
- package/dist/api/revolve.js +165 -0
- package/dist/api/revolve.js.map +1 -0
- package/dist/api/screw.d.ts.map +1 -1
- package/dist/api/screw.js +1 -0
- package/dist/api/screw.js.map +1 -1
- package/dist/api/sdf.d.ts.map +1 -1
- package/dist/api/sdf.js +1 -0
- package/dist/api/sdf.js.map +1 -1
- package/dist/api/sketch.d.ts.map +1 -1
- package/dist/api/sketch.js +1 -0
- package/dist/api/sketch.js.map +1 -1
- package/dist/api/split.d.ts +31 -0
- package/dist/api/split.d.ts.map +1 -0
- package/dist/api/split.js +96 -0
- package/dist/api/split.js.map +1 -0
- package/dist/api/surface/arg-spec.d.ts +17 -0
- package/dist/api/surface/arg-spec.d.ts.map +1 -1
- package/dist/api/surface/arg-spec.js +86 -66
- package/dist/api/surface/arg-spec.js.map +1 -1
- package/dist/api/surface/projection-overrides.d.ts.map +1 -1
- package/dist/api/surface/projection-overrides.js +6 -0
- package/dist/api/surface/projection-overrides.js.map +1 -1
- package/dist/api/topo-resolve.d.ts.map +1 -1
- package/dist/api/topo-resolve.js +65 -3
- package/dist/api/topo-resolve.js.map +1 -1
- package/dist/api/transform.d.ts +4 -0
- package/dist/api/transform.d.ts.map +1 -1
- package/dist/api/transform.js +44 -12
- package/dist/api/transform.js.map +1 -1
- package/dist/boolean/deriveNormals.d.ts +5 -4
- package/dist/boolean/deriveNormals.d.ts.map +1 -1
- package/dist/boolean/deriveNormals.js +24 -7
- package/dist/boolean/deriveNormals.js.map +1 -1
- package/dist/brep/brep-ops.d.ts +34 -1
- package/dist/brep/brep-ops.d.ts.map +1 -1
- package/dist/brep/brep-ops.js +62 -22
- package/dist/brep/brep-ops.js.map +1 -1
- package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brep-mock.js +66 -0
- package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
- package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brepkit.js +44 -1
- package/dist/brep/engine/adapters/brepkit.js.map +1 -1
- package/dist/brep/engine/adapters/occt.d.ts +1 -5
- package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
- package/dist/brep/engine/adapters/occt.js +246 -9
- package/dist/brep/engine/adapters/occt.js.map +1 -1
- package/dist/brep/engine/primitives.d.ts +96 -0
- package/dist/brep/engine/primitives.d.ts.map +1 -1
- package/dist/brep/engine/primitives.js.map +1 -1
- package/dist/brep/engine/types.d.ts +66 -6
- package/dist/brep/engine/types.d.ts.map +1 -1
- package/dist/brep/engine/types.js.map +1 -1
- package/dist/brep/export/step.d.ts.map +1 -1
- package/dist/brep/export/step.js +6 -1
- package/dist/brep/export/step.js.map +1 -1
- package/dist/brep/face-evolution.d.ts +78 -8
- package/dist/brep/face-evolution.d.ts.map +1 -1
- package/dist/brep/face-evolution.js +130 -17
- package/dist/brep/face-evolution.js.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.d.ts +1 -1
- package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.js +108 -12
- package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
- package/dist/browser.d.ts +6 -28
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +6 -17
- package/dist/browser.js.map +1 -1
- package/dist/cad-runtime/admit-compat-lib.d.ts +13 -0
- package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
- package/dist/cad-runtime/admit-compat-lib.js +27 -0
- package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
- package/dist/cad-runtime/backend-dispatch.d.ts +46 -3
- package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
- package/dist/cad-runtime/backend-dispatch.js +48 -3
- package/dist/cad-runtime/backend-dispatch.js.map +1 -1
- package/dist/cad-runtime/browser-lib-loader.d.ts +4 -4
- package/dist/cad-runtime/browser-lib-loader.d.ts.map +1 -1
- package/dist/cad-runtime/browser-lib-loader.js +7 -4
- package/dist/cad-runtime/browser-lib-loader.js.map +1 -1
- package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
- package/dist/cad-runtime/direct-executor.js +14 -4
- package/dist/cad-runtime/direct-executor.js.map +1 -1
- package/dist/cad-runtime/module-registry.d.ts +3 -1
- package/dist/cad-runtime/module-registry.d.ts.map +1 -1
- package/dist/cad-runtime/module-registry.js +13 -1
- package/dist/cad-runtime/module-registry.js.map +1 -1
- package/dist/cad-runtime/runtime-concurrent-error.d.ts +38 -0
- package/dist/cad-runtime/runtime-concurrent-error.d.ts.map +1 -0
- package/dist/cad-runtime/runtime-concurrent-error.js +43 -0
- package/dist/cad-runtime/runtime-concurrent-error.js.map +1 -0
- package/dist/cad-runtime/runtime.d.ts +52 -2
- package/dist/cad-runtime/runtime.d.ts.map +1 -1
- package/dist/cad-runtime/runtime.js +180 -9
- package/dist/cad-runtime/runtime.js.map +1 -1
- package/dist/define-op.d.ts +22 -0
- package/dist/define-op.d.ts.map +1 -1
- package/dist/define-op.js +82 -12
- package/dist/define-op.js.map +1 -1
- package/dist/env-agnostic.d.ts +38 -0
- package/dist/env-agnostic.d.ts.map +1 -0
- package/dist/env-agnostic.js +29 -0
- package/dist/env-agnostic.js.map +1 -0
- package/dist/fcstd/attachment.d.ts +8 -1
- package/dist/fcstd/attachment.d.ts.map +1 -1
- package/dist/fcstd/attachment.js +7 -1
- package/dist/fcstd/attachment.js.map +1 -1
- package/dist/fcstd/build-fai-zip.d.ts.map +1 -1
- package/dist/fcstd/build-fai-zip.js +12 -7
- package/dist/fcstd/build-fai-zip.js.map +1 -1
- package/dist/fcstd/codegen.d.ts +10 -1
- package/dist/fcstd/codegen.d.ts.map +1 -1
- package/dist/fcstd/codegen.js +158 -49
- package/dist/fcstd/codegen.js.map +1 -1
- package/dist/fcstd/contour.d.ts.map +1 -1
- package/dist/fcstd/contour.js +23 -24
- package/dist/fcstd/contour.js.map +1 -1
- package/dist/fcstd/convert.d.ts +2 -18
- package/dist/fcstd/convert.d.ts.map +1 -1
- package/dist/fcstd/convert.js +35 -53
- package/dist/fcstd/convert.js.map +1 -1
- package/dist/fcstd/expressions.d.ts +24 -0
- package/dist/fcstd/expressions.d.ts.map +1 -1
- package/dist/fcstd/expressions.js +91 -0
- package/dist/fcstd/expressions.js.map +1 -1
- package/dist/fcstd/external-geo.d.ts +12 -1
- package/dist/fcstd/external-geo.d.ts.map +1 -1
- package/dist/fcstd/external-geo.js +15 -1
- package/dist/fcstd/external-geo.js.map +1 -1
- package/dist/fcstd/feature-translate.d.ts +21 -1
- package/dist/fcstd/feature-translate.d.ts.map +1 -1
- package/dist/fcstd/feature-translate.js +124 -8
- package/dist/fcstd/feature-translate.js.map +1 -1
- package/dist/fcstd/structural-types.d.ts +83 -0
- package/dist/fcstd/structural-types.d.ts.map +1 -0
- package/dist/fcstd/structural-types.js +121 -0
- package/dist/fcstd/structural-types.js.map +1 -0
- package/dist/index.d.ts +7 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -16
- package/dist/index.js.map +1 -1
- package/dist/lang/determinism-scanner.d.ts +71 -0
- package/dist/lang/determinism-scanner.d.ts.map +1 -0
- package/dist/lang/determinism-scanner.js +625 -0
- package/dist/lang/determinism-scanner.js.map +1 -0
- package/dist/lang/symbol-table.d.ts +31 -0
- package/dist/lang/symbol-table.d.ts.map +1 -1
- package/dist/lang/symbol-table.generated.d.ts +13 -19
- package/dist/lang/symbol-table.generated.d.ts.map +1 -1
- package/dist/lang/symbol-table.generated.js +13 -19
- package/dist/lang/symbol-table.generated.js.map +1 -1
- package/dist/lang/symbol-table.js +50 -1
- package/dist/lang/symbol-table.js.map +1 -1
- package/dist/mesh/creased-normals.d.ts +50 -0
- package/dist/mesh/creased-normals.d.ts.map +1 -0
- package/dist/mesh/creased-normals.js +114 -0
- package/dist/mesh/creased-normals.js.map +1 -0
- package/dist/mesh/decoration-provider.d.ts +53 -0
- package/dist/mesh/decoration-provider.d.ts.map +1 -0
- package/dist/mesh/decoration-provider.js +21 -0
- package/dist/mesh/decoration-provider.js.map +1 -0
- package/dist/mesh/engrave.d.ts +4 -0
- package/dist/mesh/engrave.d.ts.map +1 -1
- package/dist/mesh/engrave.js +22 -31
- package/dist/mesh/engrave.js.map +1 -1
- package/dist/mesh/index.d.ts +5 -14
- package/dist/mesh/index.d.ts.map +1 -1
- package/dist/mesh/index.js +7 -18
- package/dist/mesh/index.js.map +1 -1
- package/dist/mesh/io.d.ts +2 -1
- package/dist/mesh/io.d.ts.map +1 -1
- package/dist/mesh/io.js +5 -7
- package/dist/mesh/io.js.map +1 -1
- package/dist/mesh/primitives.d.ts +5 -18
- package/dist/mesh/primitives.d.ts.map +1 -1
- package/dist/mesh/primitives.js +4 -48
- package/dist/mesh/primitives.js.map +1 -1
- package/dist/mesh/stl-loader.d.ts +23 -0
- package/dist/mesh/stl-loader.d.ts.map +1 -0
- package/dist/mesh/stl-loader.js +139 -0
- package/dist/mesh/stl-loader.js.map +1 -0
- package/dist/module-resolver/parse-imports.d.ts +37 -0
- package/dist/module-resolver/parse-imports.d.ts.map +1 -0
- package/dist/module-resolver/parse-imports.js +39 -0
- package/dist/module-resolver/parse-imports.js.map +1 -0
- package/dist/module-resolver/resolver.d.ts +1 -1
- package/dist/module-resolver/resolver.js +2 -2
- package/dist/module-resolver/resolver.js.map +1 -1
- package/dist/node-host/cli.d.ts.map +1 -1
- package/dist/node-host/cli.js +37 -4
- package/dist/node-host/cli.js.map +1 -1
- package/dist/primitives/text/cjk-font.d.ts +42 -0
- package/dist/primitives/text/cjk-font.d.ts.map +1 -0
- package/dist/primitives/text/cjk-font.js +86 -0
- package/dist/primitives/text/cjk-font.js.map +1 -0
- package/dist/runtime-state.d.ts +18 -6
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +9 -1
- package/dist/runtime-state.js.map +1 -1
- package/dist/sdk.d.ts +2 -2
- package/dist/sdk.js +2 -2
- package/dist/sdk.js.map +1 -1
- package/dist/shape.d.ts +15 -0
- package/dist/shape.d.ts.map +1 -1
- package/dist/shape.js +26 -3
- package/dist/shape.js.map +1 -1
- package/dist/symbol-table.d.ts +15 -0
- package/dist/symbol-table.d.ts.map +1 -0
- package/dist/symbol-table.js +14 -0
- package/dist/symbol-table.js.map +1 -0
- package/dist/topology/naming/build-naming.d.ts +14 -30
- package/dist/topology/naming/build-naming.d.ts.map +1 -1
- package/dist/topology/naming/build-naming.js +21 -54
- package/dist/topology/naming/build-naming.js.map +1 -1
- package/dist/topology/naming/capture-topo-ref.d.ts.map +1 -1
- package/dist/topology/naming/capture-topo-ref.js +5 -0
- package/dist/topology/naming/capture-topo-ref.js.map +1 -1
- package/dist/topology/naming/index.d.ts +3 -0
- package/dist/topology/naming/index.d.ts.map +1 -1
- package/dist/topology/naming/index.js +3 -0
- package/dist/topology/naming/index.js.map +1 -1
- package/dist/topology/naming/lineage-resolve.d.ts +80 -0
- package/dist/topology/naming/lineage-resolve.d.ts.map +1 -0
- package/dist/topology/naming/lineage-resolve.js +120 -0
- package/dist/topology/naming/lineage-resolve.js.map +1 -0
- package/dist/topology/naming/lineage.d.ts +349 -0
- package/dist/topology/naming/lineage.d.ts.map +1 -0
- package/dist/topology/naming/lineage.js +398 -0
- package/dist/topology/naming/lineage.js.map +1 -0
- package/dist/topology/naming/migrate.d.ts +41 -0
- package/dist/topology/naming/migrate.d.ts.map +1 -0
- package/dist/topology/naming/migrate.js +88 -0
- package/dist/topology/naming/migrate.js.map +1 -0
- package/dist/topology/naming/role-name.d.ts +176 -0
- package/dist/topology/naming/role-name.d.ts.map +1 -0
- package/dist/topology/naming/role-name.js +344 -0
- package/dist/topology/naming/role-name.js.map +1 -0
- package/dist/topology/naming/roles.d.ts +20 -22
- package/dist/topology/naming/roles.d.ts.map +1 -1
- package/dist/topology/naming/roles.js +51 -49
- package/dist/topology/naming/roles.js.map +1 -1
- package/dist/topology/naming/types.d.ts +65 -18
- package/dist/topology/naming/types.d.ts.map +1 -1
- package/dist/topology/naming/types.js.map +1 -1
- package/dist/vendored/brepjs/kernel/index.d.ts +5 -0
- package/dist/vendored/brepjs/kernel/index.d.ts.map +1 -1
- package/dist/vendored/brepjs/kernel/index.js +11 -0
- package/dist/vendored/brepjs/kernel/index.js.map +1 -1
- package/dist/weapp.d.ts +4 -4
- package/dist/weapp.d.ts.map +1 -1
- package/dist/weapp.js +7 -4
- package/dist/weapp.js.map +1 -1
- package/package.json +16 -14
- package/dist/api/compat/index.d.ts +0 -173
- package/dist/api/compat/index.d.ts.map +0 -1
- package/dist/api/compat/index.js +0 -222
- package/dist/api/compat/index.js.map +0 -1
- package/dist/api/compound.d.ts +0 -108
- package/dist/api/compound.d.ts.map +0 -1
- package/dist/api/compound.js +0 -162
- package/dist/api/compound.js.map +0 -1
- package/dist/api/copy.d.ts +0 -39
- package/dist/api/copy.d.ts.map +0 -1
- package/dist/api/copy.js +0 -81
- package/dist/api/copy.js.map +0 -1
- package/dist/api/fai_drill.d.ts +0 -46
- package/dist/api/fai_drill.d.ts.map +0 -1
- package/dist/api/fai_drill.js +0 -230
- package/dist/api/fai_drill.js.map +0 -1
- package/dist/api/fai_extrude.d.ts +0 -36
- package/dist/api/fai_extrude.d.ts.map +0 -1
- package/dist/api/fai_extrude.js +0 -78
- package/dist/api/fai_extrude.js.map +0 -1
- package/dist/api/fai_split.d.ts +0 -46
- package/dist/api/fai_split.d.ts.map +0 -1
- package/dist/api/fai_split.js +0 -253
- package/dist/api/fai_split.js.map +0 -1
- package/dist/api/load.d.ts +0 -39
- package/dist/api/load.d.ts.map +0 -1
- package/dist/api/load.js +0 -82
- package/dist/api/load.js.map +0 -1
- package/dist/api/svgExtrude.d.ts +0 -32
- package/dist/api/svgExtrude.d.ts.map +0 -1
- package/dist/api/svgExtrude.js +0 -73
- package/dist/api/svgExtrude.js.map +0 -1
- package/dist/api/text.d.ts +0 -34
- package/dist/api/text.d.ts.map +0 -1
- package/dist/api/text.js +0 -100
- package/dist/api/text.js.map +0 -1
- package/dist/brep/text/fontTestHelper.d.ts +0 -30
- package/dist/brep/text/fontTestHelper.d.ts.map +0 -1
- package/dist/brep/text/fontTestHelper.js +0 -57
- package/dist/brep/text/fontTestHelper.js.map +0 -1
- package/dist/cad-runtime/module-executor.d.ts +0 -271
- package/dist/cad-runtime/module-executor.d.ts.map +0 -1
- package/dist/cad-runtime/module-executor.js +0 -630
- package/dist/cad-runtime/module-executor.js.map +0 -1
- package/dist/cad-runtime/terminal-dag.d.ts +0 -65
- package/dist/cad-runtime/terminal-dag.d.ts.map +0 -1
- package/dist/cad-runtime/terminal-dag.js +0 -167
- package/dist/cad-runtime/terminal-dag.js.map +0 -1
- package/dist/faqts/browser.d.ts +0 -16
- package/dist/faqts/browser.d.ts.map +0 -1
- package/dist/faqts/browser.js +0 -13
- package/dist/faqts/browser.js.map +0 -1
- package/dist/faqts/exec-blob.d.ts +0 -14
- package/dist/faqts/exec-blob.d.ts.map +0 -1
- package/dist/faqts/exec-blob.js +0 -22
- package/dist/faqts/exec-blob.js.map +0 -1
- package/dist/faqts/exec-node.d.ts +0 -15
- package/dist/faqts/exec-node.d.ts.map +0 -1
- package/dist/faqts/exec-node.js +0 -29
- package/dist/faqts/exec-node.js.map +0 -1
- package/dist/faqts/imports.d.ts +0 -74
- package/dist/faqts/imports.d.ts.map +0 -1
- package/dist/faqts/imports.js +0 -95
- package/dist/faqts/imports.js.map +0 -1
- package/dist/faqts/index.d.ts +0 -22
- package/dist/faqts/index.d.ts.map +0 -1
- package/dist/faqts/index.js +0 -21
- package/dist/faqts/index.js.map +0 -1
- package/dist/faqts/node.d.ts +0 -23
- package/dist/faqts/node.d.ts.map +0 -1
- package/dist/faqts/node.js +0 -23
- package/dist/faqts/node.js.map +0 -1
- package/dist/faqts/run.d.ts +0 -62
- package/dist/faqts/run.d.ts.map +0 -1
- package/dist/faqts/run.js +0 -62
- package/dist/faqts/run.js.map +0 -1
- package/dist/faqts/transform.d.ts +0 -43
- package/dist/faqts/transform.d.ts.map +0 -1
- package/dist/faqts/transform.js +0 -35
- package/dist/faqts/transform.js.map +0 -1
- package/dist/lang/compile.d.ts +0 -50
- package/dist/lang/compile.d.ts.map +0 -1
- package/dist/lang/compile.js +0 -368
- package/dist/lang/compile.js.map +0 -1
- package/dist/lang/keep.d.ts +0 -109
- package/dist/lang/keep.d.ts.map +0 -1
- package/dist/lang/keep.js +0 -226
- package/dist/lang/keep.js.map +0 -1
- package/dist/lang/parser.d.ts +0 -91
- package/dist/lang/parser.d.ts.map +0 -1
- package/dist/lang/parser.js +0 -1594
- package/dist/lang/parser.js.map +0 -1
- package/dist/mesh/drill-hole/DrillHoleCore.d.ts +0 -90
- package/dist/mesh/drill-hole/DrillHoleCore.d.ts.map +0 -1
- package/dist/mesh/drill-hole/DrillHoleCore.js +0 -287
- package/dist/mesh/drill-hole/DrillHoleCore.js.map +0 -1
- package/dist/mesh/drill-hole/drill-types.d.ts +0 -34
- package/dist/mesh/drill-hole/drill-types.d.ts.map +0 -1
- package/dist/mesh/drill-hole/drill-types.js +0 -7
- package/dist/mesh/drill-hole/drill-types.js.map +0 -1
- package/dist/mesh/fai_drill.d.ts +0 -21
- package/dist/mesh/fai_drill.d.ts.map +0 -1
- package/dist/mesh/fai_drill.js +0 -92
- package/dist/mesh/fai_drill.js.map +0 -1
- package/dist/mesh/fai_extrude.d.ts +0 -24
- package/dist/mesh/fai_extrude.d.ts.map +0 -1
- package/dist/mesh/fai_extrude.js +0 -42
- package/dist/mesh/fai_extrude.js.map +0 -1
- package/dist/mesh/fai_split.d.ts +0 -164
- package/dist/mesh/fai_split.d.ts.map +0 -1
- package/dist/mesh/fai_split.js +0 -269
- package/dist/mesh/fai_split.js.map +0 -1
- package/dist/primitives/svg-extrude.d.ts +0 -43
- package/dist/primitives/svg-extrude.d.ts.map +0 -1
- package/dist/primitives/svg-extrude.js +0 -78
- package/dist/primitives/svg-extrude.js.map +0 -1
- package/dist/primitives/text/cjk.d.ts +0 -61
- package/dist/primitives/text/cjk.d.ts.map +0 -1
- package/dist/primitives/text/cjk.js +0 -215
- package/dist/primitives/text/cjk.js.map +0 -1
- package/dist/primitives/text-geometry.d.ts +0 -47
- package/dist/primitives/text-geometry.d.ts.map +0 -1
- package/dist/primitives/text-geometry.js +0 -127
- package/dist/primitives/text-geometry.js.map +0 -1
- package/dist/test-helpers.d.ts +0 -31
- package/dist/test-helpers.d.ts.map +0 -1
- package/dist/test-helpers.js +0 -55
- package/dist/test-helpers.js.map +0 -1
- package/dist/vendored/brepjs/core/kernelReentrancy.d.ts +0 -41
- package/dist/vendored/brepjs/core/kernelReentrancy.d.ts.map +0 -1
- package/dist/vendored/brepjs/core/kernelReentrancy.js +0 -68
- package/dist/vendored/brepjs/core/kernelReentrancy.js.map +0 -1
package/dist/weapp.d.ts
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
* 导出面受 entry-boundary.test.ts 白名单守卫约束——新增导出必须同步更新白名单。
|
|
12
12
|
* web/desktop 宿主禁止 import 本入口(brepkit 是 weapp 专属 BREP 引擎)。
|
|
13
13
|
*/
|
|
14
|
+
export * from './env-agnostic.js';
|
|
14
15
|
export { setBrepkitWasmInitFn, initBrepkitWasm, isBrepkitInitialized } from './brepkit-kernel/brepkitWasm.js';
|
|
15
16
|
export { registerBrepkitBrepEngine, BREPKIT_BREP_ENGINE_ID, ensureBrepkitDefaultEngine } from './brep/engine/adapters/brepkit.js';
|
|
16
|
-
export { registerBrepEngine, hasBrepEngine, getActiveBrepEngineId, freezeEngineRegistries } from './brep/engine/registry.js';
|
|
17
|
+
export { registerBrepEngine, hasBrepEngine, getBrepEngine, getActiveBrepEngineId, freezeEngineRegistries } from './brep/engine/registry.js';
|
|
17
18
|
export type { BrepEngine, BrepEngineProvider } from './brep/engine/registry.js';
|
|
18
19
|
export type { BrepEngineApi } from './brep/engine/primitives.js';
|
|
19
|
-
export { createRuntime } from './cad-runtime/
|
|
20
|
-
export type { CadRuntime } from './cad-runtime/
|
|
21
|
-
export { createApiNamespace } from './api/api-namespace.js';
|
|
20
|
+
export { createRuntime } from './cad-runtime/createRuntimeWithCad.js';
|
|
21
|
+
export type { CadRuntime } from './cad-runtime/createRuntimeWithCad.js';
|
|
22
22
|
//# sourceMappingURL=weapp.d.ts.map
|
package/dist/weapp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weapp.d.ts","sourceRoot":"","sources":["../src/weapp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"weapp.d.ts","sourceRoot":"","sources":["../src/weapp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,cAAc,gBAAgB,CAAA;AAG9B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAG1G,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAG9H,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACxI,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC5E,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI7D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAClE,YAAY,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA"}
|
package/dist/weapp.js
CHANGED
|
@@ -11,13 +11,16 @@
|
|
|
11
11
|
* 导出面受 entry-boundary.test.ts 白名单守卫约束——新增导出必须同步更新白名单。
|
|
12
12
|
* web/desktop 宿主禁止 import 本入口(brepkit 是 weapp 专属 BREP 引擎)。
|
|
13
13
|
*/
|
|
14
|
+
// 共享面(env-agnostic:identity + runtime-state + lang/*)——三处 umbrella 统一
|
|
15
|
+
// re-export(§9.1),weapp worker 由此获得 analyzeCode 等语言层符号。
|
|
16
|
+
export * from './env-agnostic.js';
|
|
14
17
|
// brepkit wasm 装载(weapp 专属注入点;宿主装配期调用一次 setBrepkitWasmInitFn)
|
|
15
18
|
export { setBrepkitWasmInitFn, initBrepkitWasm, isBrepkitInitialized } from './brepkit-kernel/brepkitWasm.js';
|
|
16
19
|
// brepkit BREP 引擎注册(weapp 只注册 brepkit,不注册 occt)
|
|
17
20
|
export { registerBrepkitBrepEngine, BREPKIT_BREP_ENGINE_ID, ensureBrepkitDefaultEngine } from './brep/engine/adapters/brepkit.js';
|
|
18
21
|
// BREP 引擎注册表(环境无关;ensureBrepChain 见已注册引擎即跳过 OCCT)
|
|
19
|
-
export { registerBrepEngine, hasBrepEngine, getActiveBrepEngineId, freezeEngineRegistries } from './brep/engine/registry.js';
|
|
20
|
-
// cad-runtime
|
|
21
|
-
|
|
22
|
-
export {
|
|
22
|
+
export { registerBrepEngine, hasBrepEngine, getBrepEngine, getActiveBrepEngineId, freezeEngineRegistries } from './brep/engine/registry.js';
|
|
23
|
+
// cad-runtime(环境无关执行栈):createRuntime 为 with-cad 变体(§9.2),与
|
|
24
|
+
// browser/node 入口同口径——自带 cad 命名空间注册,宿主无需手工补注册。
|
|
25
|
+
export { createRuntime } from './cad-runtime/createRuntimeWithCad.js';
|
|
23
26
|
//# sourceMappingURL=weapp.js.map
|
package/dist/weapp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weapp.js","sourceRoot":"","sources":["../src/weapp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,8DAA8D;AAC9D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAE1G,gDAAgD;AAChD,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAE9H,kDAAkD;AAClD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"weapp.js","sourceRoot":"","sources":["../src/weapp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,sEAAsE;AACtE,wDAAwD;AACxD,cAAc,gBAAgB,CAAA;AAE9B,8DAA8D;AAC9D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAE1G,gDAAgD;AAChD,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAE9H,kDAAkD;AAClD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAIxI,2DAA2D;AAC3D,+CAA+C;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA","sourcesContent":["/**\n * @faicad/faijs-core/weapp — weapp 专用宿主入口(docs/plans/2026-09-20-weapp-host-entry-design.md)\n *\n * 小程序(无 OCCT 环境)宿主的最小导出面:brepkit wasm 装载注入点 + brepkit BREP\n * 引擎注册 + 环境无关执行栈。全部为 re-export,零新实现。\n *\n * 为什么独立成入口:browser umbrella 曾 re-export brepkit 符号,导致 web 端模块图\n * 包含 brepkitWasm.js(其 node 分支 import('brepkit-wasm') 被 vite 静态解析而报错)。\n * 宿主边界必须由静态入口声明,而不是靠构建脚本事后 stub 剔除。\n *\n * 导出面受 entry-boundary.test.ts 白名单守卫约束——新增导出必须同步更新白名单。\n * web/desktop 宿主禁止 import 本入口(brepkit 是 weapp 专属 BREP 引擎)。\n */\n\n// 共享面(env-agnostic:identity + runtime-state + lang/*)——三处 umbrella 统一\n// re-export(§9.1),weapp worker 由此获得 analyzeCode 等语言层符号。\nexport * from './env-agnostic'\n\n// brepkit wasm 装载(weapp 专属注入点;宿主装配期调用一次 setBrepkitWasmInitFn)\nexport { setBrepkitWasmInitFn, initBrepkitWasm, isBrepkitInitialized } from './brepkit-kernel/brepkitWasm'\n\n// brepkit BREP 引擎注册(weapp 只注册 brepkit,不注册 occt)\nexport { registerBrepkitBrepEngine, BREPKIT_BREP_ENGINE_ID, ensureBrepkitDefaultEngine } from './brep/engine/adapters/brepkit'\n\n// BREP 引擎注册表(环境无关;ensureBrepChain 见已注册引擎即跳过 OCCT)\nexport { registerBrepEngine, hasBrepEngine, getBrepEngine, getActiveBrepEngineId, freezeEngineRegistries } from './brep/engine/registry'\nexport type { BrepEngine, BrepEngineProvider } from './brep/engine/registry'\nexport type { BrepEngineApi } from './brep/engine/primitives'\n\n// cad-runtime(环境无关执行栈):createRuntime 为 with-cad 变体(§9.2),与\n// browser/node 入口同口径——自带 cad 命名空间注册,宿主无需手工补注册。\nexport { createRuntime } from './cad-runtime/createRuntimeWithCad'\nexport type { CadRuntime } from './cad-runtime/createRuntimeWithCad'\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faicad/faijs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"types": "./dist/sdk.d.ts",
|
|
38
38
|
"default": "./dist/sdk.js"
|
|
39
39
|
},
|
|
40
|
+
"./symbol-table": {
|
|
41
|
+
"types": "./dist/symbol-table.d.ts",
|
|
42
|
+
"default": "./dist/symbol-table.js"
|
|
43
|
+
},
|
|
40
44
|
"./csg": {
|
|
41
45
|
"types": "./dist/csg.d.ts",
|
|
42
46
|
"default": "./dist/csg.js"
|
|
@@ -77,14 +81,6 @@
|
|
|
77
81
|
"types": "./dist/shape.d.ts",
|
|
78
82
|
"default": "./dist/shape.js"
|
|
79
83
|
},
|
|
80
|
-
"./faqts": {
|
|
81
|
-
"types": "./dist/faqts/index.d.ts",
|
|
82
|
-
"default": "./dist/faqts/index.js"
|
|
83
|
-
},
|
|
84
|
-
"./faqts/*": {
|
|
85
|
-
"types": "./dist/faqts/*.d.ts",
|
|
86
|
-
"default": "./dist/faqts/*.js"
|
|
87
|
-
},
|
|
88
84
|
"./module-resolver": {
|
|
89
85
|
"types": "./dist/module-resolver/index.d.ts",
|
|
90
86
|
"default": "./dist/module-resolver/index.js"
|
|
@@ -146,14 +142,18 @@
|
|
|
146
142
|
"fflate": "^0.8.2",
|
|
147
143
|
"flatbush": "^4.6.2",
|
|
148
144
|
"manifold-3d": "^3.5.1",
|
|
149
|
-
"opentype.js": "^1.3.4"
|
|
150
|
-
"sucrase": "^3.35.1",
|
|
151
|
-
"three": "^0.184.0"
|
|
145
|
+
"opentype.js": "^1.3.4"
|
|
152
146
|
},
|
|
153
147
|
"peerDependencies": {
|
|
154
|
-
"occt-wasm": "^3.8.4"
|
|
148
|
+
"occt-wasm": "^3.8.4",
|
|
149
|
+
"three": "^0.162.0 || ^0.184.0"
|
|
155
150
|
},
|
|
156
151
|
"devDependencies": {
|
|
152
|
+
"@types/three": "^0.184.1",
|
|
153
|
+
"brepkit-wasm": "^3.4.18",
|
|
154
|
+
"sucrase": "^3.35.1",
|
|
155
|
+
"three": "^0.184.0",
|
|
156
|
+
"three-162": "npm:three@^0.162.0",
|
|
157
157
|
"typescript": "*",
|
|
158
158
|
"vitest": "*"
|
|
159
159
|
},
|
|
@@ -162,6 +162,8 @@
|
|
|
162
162
|
"typecheck": "tsc --noEmit",
|
|
163
163
|
"test": "vitest run",
|
|
164
164
|
"lint": "eslint src",
|
|
165
|
-
"fcstd:convert": "tsx src/fcstd/cli.ts"
|
|
165
|
+
"fcstd:convert": "tsx src/fcstd/cli.ts",
|
|
166
|
+
"gen:capability-map": "tsx scripts/gen-capability-map.ts",
|
|
167
|
+
"gen:brepkit-surface": "tsx scripts/gen-brepkit-surface.ts"
|
|
166
168
|
}
|
|
167
169
|
}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BREP-TS compatibility surface (P21).
|
|
3
|
-
*
|
|
4
|
-
* Projects the vendored BREP TS tree onto four stable groups so library authors
|
|
5
|
-
* can write `import { box, fuse, Sketcher, ok } from this module` and call it
|
|
6
|
-
* upstream-style:
|
|
7
|
-
*
|
|
8
|
-
* ① op — solid primitives + boolean / evolution operations
|
|
9
|
-
* ② topology — sub-shape queries + measurements (plus the Bounds3D type)
|
|
10
|
-
* ③ sketching — stateful Sketcher / FaceSketcher DSL + drawing factories
|
|
11
|
-
* ④ combinators / types — result, vector, plane, errors, constants, types
|
|
12
|
-
*
|
|
13
|
-
* Every symbol is a projection (re-export or a thin dual-form wrapper) from the
|
|
14
|
-
* ported tree: no reimplementation. The `.js` specifiers are the repo
|
|
15
|
-
* convention (TypeScript maps `.js` → `.ts`).
|
|
16
|
-
*
|
|
17
|
-
* Semantic wraps (P23: both live in `api/internal/compat-projection.ts` so the
|
|
18
|
-
* generated face and this hand-curated face share one mechanism):
|
|
19
|
-
* - single-kernel assert: every modeling op asserts a bound BREP kernel first
|
|
20
|
-
* (see `assertKernelBound`); `getBackends()` may throw before configuration,
|
|
21
|
-
* so it is guarded and falls back to the occt-kernel binding flag.
|
|
22
|
-
* - dual argument forms: object form normalizes to positional form via the
|
|
23
|
-
* shared `resolveArgs` discriminant; object keys outside the declared
|
|
24
|
-
* parameter table throw the shared `E_ARGS_FORM` token.
|
|
25
|
-
* - `box` is the hand-written dual-form sample: positional
|
|
26
|
-
* `box(width, depth, height)` and `box({ size })` / `box({ width, depth,
|
|
27
|
-
* height })` both forward to the vendored primitive in its native dimension
|
|
28
|
-
* order (width = X, depth = Y, height = Z — confirm against
|
|
29
|
-
* `primitiveFns#box`), so every accepted form yields identical geometry.
|
|
30
|
-
*/
|
|
31
|
-
import type { ValidSolid } from '../../vendored/brepjs/core/shapeTypes.js';
|
|
32
|
-
/** Signature of a compat op projection (inputs normalized before the call). */
|
|
33
|
-
type CompatOp = (...args: unknown[]) => unknown;
|
|
34
|
-
import { sphere as primitiveSphere, cylinder as primitiveCylinder } from '../../vendored/brepjs/topology/primitiveFns.js';
|
|
35
|
-
/**
|
|
36
|
-
* Create a solid box.
|
|
37
|
-
*
|
|
38
|
-
* Positional form `box(width, depth, height)` uses the vendor's native
|
|
39
|
-
* dimension order — X = width, Y = depth,
|
|
40
|
-
* Z = height (the vendored `primitiveFns#box` dimension order; width/height are
|
|
41
|
-
* NOT swapped). See the overload below for the object form.
|
|
42
|
-
*
|
|
43
|
-
* @param width - side length along X.
|
|
44
|
-
* @param depth - side length along Y.
|
|
45
|
-
* @param height - side length along Z.
|
|
46
|
-
* @returns a new valid solid box.
|
|
47
|
-
*/
|
|
48
|
-
export declare function box(width: number, depth: number, height: number): ValidSolid;
|
|
49
|
-
/**
|
|
50
|
-
* Create a solid box from an object form.
|
|
51
|
-
*
|
|
52
|
-
* Accepts `box({ size })` where `size` is a number (cube) or a
|
|
53
|
-
* `[width, depth, height]` triple, or `box({ width, depth, height })`. Every
|
|
54
|
-
* accepted form forwards to `primitiveBox(width, depth, height)`, so equal
|
|
55
|
-
* dimension values always produce identical geometry.
|
|
56
|
-
*
|
|
57
|
-
* @param options - the dimension set: `size` (a cube edge or a triple) or
|
|
58
|
-
* `width`/`depth`/`height` sides.
|
|
59
|
-
* @returns a new valid solid box.
|
|
60
|
-
* @throws An `Error` whose message contains the shared `E_ARGS_FORM` token when
|
|
61
|
-
* no form matches (e.g. `box('x')`, `box()`, or unknown object keys).
|
|
62
|
-
*/
|
|
63
|
-
export declare function box(options: BoxDimensions): ValidSolid;
|
|
64
|
-
/** Object-form input accepted by {@link box}. */
|
|
65
|
-
export interface BoxDimensions {
|
|
66
|
-
/** All three sides as one number (cube) or a `[width, depth, height]` triple. */
|
|
67
|
-
size?: number | [number, number, number];
|
|
68
|
-
/** Side length along X. */
|
|
69
|
-
width?: number;
|
|
70
|
-
/** Side length along Y. */
|
|
71
|
-
depth?: number;
|
|
72
|
-
/** Side length along Z. */
|
|
73
|
-
height?: number;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Project the vendored `sphere(radius, options?)` verbatim (P25: the raw
|
|
77
|
-
* morph form is what portable libraries call — upstream brepjs signatures,
|
|
78
|
-
* no op projection).
|
|
79
|
-
*/
|
|
80
|
-
export { primitiveSphere as sphere };
|
|
81
|
-
/** Project the vendored `cylinder(radius, height, options?)` verbatim. */
|
|
82
|
-
export { primitiveCylinder as cylinder };
|
|
83
|
-
/** Project the vendored `cone(bottomRadius, topRadius, height, options?)`. */
|
|
84
|
-
export declare const cone: CompatOp;
|
|
85
|
-
/** Project the vendored `torus(majorRadius, minorRadius, options?)`. */
|
|
86
|
-
export declare const torus: CompatOp;
|
|
87
|
-
/** Project the vendored `ellipsoid(rx, ry, rz, options?)`. */
|
|
88
|
-
export declare const ellipsoid: CompatOp;
|
|
89
|
-
import { fuse as vendoredFuse, cut as vendoredCut, intersect as vendoredIntersect } from '../../vendored/brepjs/topology/api.js';
|
|
90
|
-
import { extrude as vendoredExtrude, revolve as vendoredRevolve, loft as vendoredLoft } from '../../vendored/brepjs/operations/api.js';
|
|
91
|
-
/** Fuse two shapeables into one 3D result. */
|
|
92
|
-
export declare const fuse: typeof vendoredFuse;
|
|
93
|
-
/** Cut the second shapeable out of the first. */
|
|
94
|
-
export declare const cut: typeof vendoredCut;
|
|
95
|
-
/** Extrude a planar profile along a height or direction vector. */
|
|
96
|
-
export declare const extrude: typeof vendoredExtrude;
|
|
97
|
-
/** Revolve a planar profile around an axis with optional angle. */
|
|
98
|
-
export declare const revolve: typeof vendoredRevolve;
|
|
99
|
-
/** Loft through a set of wire profiles. */
|
|
100
|
-
export declare const loft: typeof vendoredLoft;
|
|
101
|
-
/** Intersect two shapeables (common 3D volume). */
|
|
102
|
-
export declare const intersect: typeof vendoredIntersect;
|
|
103
|
-
import { makeExternalGear as vendoredMakeExternalGear, makeInternalGear as vendoredMakeInternalGear, makePlanetaryGear as vendoredMakePlanetaryGear } from '../../vendored/brepjs/gear/gearFns.js';
|
|
104
|
-
import { thread as vendoredThread } from '../../vendored/brepjs/operations/threadFns.js';
|
|
105
|
-
/**
|
|
106
|
-
* Build an external spur gear.
|
|
107
|
-
* @param params - the external-gear parameters (`teeth`, `moduleSize`, `thickness`, …).
|
|
108
|
-
* @returns `Ok` with the gear solid + geometry, or `Err` for invalid parameters.
|
|
109
|
-
*/
|
|
110
|
-
export declare const makeExternalGear: typeof vendoredMakeExternalGear;
|
|
111
|
-
/**
|
|
112
|
-
* Build an internal (ring) spur gear.
|
|
113
|
-
* @param params - the internal-gear parameters, including the optional ring wall thickness.
|
|
114
|
-
* @returns `Ok` with the gear solid + geometry, or `Err` for invalid parameters.
|
|
115
|
-
*/
|
|
116
|
-
export declare const makeInternalGear: typeof vendoredMakeInternalGear;
|
|
117
|
-
/**
|
|
118
|
-
* Build a planetary gear train (sun + planets + ring).
|
|
119
|
-
* @param params - the planetary-gear parameters.
|
|
120
|
-
* @returns `Ok` with the sun/planet/ring solids and mesh diagnostics, or `Err`.
|
|
121
|
-
*/
|
|
122
|
-
export declare const makePlanetaryGear: typeof vendoredMakePlanetaryGear;
|
|
123
|
-
/**
|
|
124
|
-
* Build a helical screw-thread ridge.
|
|
125
|
-
* @param options - the thread profile (`radius`, `pitch`, `height`, …).
|
|
126
|
-
* @returns `Ok` with the thread-ridge solid, or `Err` for invalid parameters.
|
|
127
|
-
*/
|
|
128
|
-
export declare const thread: typeof vendoredThread;
|
|
129
|
-
export type { ExternalGearParams, InternalGearParams, PlanetaryGearParams, GearResult, PlanetaryGearAssembly, } from '../../vendored/brepjs/gear/gearFns.js';
|
|
130
|
-
export type { ThreadOptions } from '../../vendored/brepjs/operations/threadFns.js';
|
|
131
|
-
export { getEdges, getFaces, getWires, getVertices, getShells, getSolids, getCompSolids, getBounds, vertexPosition, } from '../../vendored/brepjs/topology/topologyQueryFns.js';
|
|
132
|
-
export type { Bounds3D } from '../../vendored/brepjs/topology/topologyQueryFns.js';
|
|
133
|
-
export { measureVolume, measureArea, measureLength, } from '../../vendored/brepjs/measurement/measureFns.js';
|
|
134
|
-
export { default as Sketcher } from '../../vendored/brepjs/sketching/sketcher.js';
|
|
135
|
-
export { default as FaceSketcher } from '../../vendored/brepjs/sketching/faceSketcher.js';
|
|
136
|
-
export { drawCircle, drawEllipse, drawRoundedRectangle, drawRectangle, drawSingleCircle, drawSingleEllipse, drawPolysides, drawText, } from '../../vendored/brepjs/sketching/drawingFactories.js';
|
|
137
|
-
export { draw } from '../../vendored/brepjs/sketching/drawingPen.js';
|
|
138
|
-
export { makeBaseBox } from '../../vendored/brepjs/sketching/shortcuts.js';
|
|
139
|
-
export { ok, err, isOk, isErr, unwrap, unwrapOr, map, andThen, } from '../../vendored/brepjs/core/result.js';
|
|
140
|
-
export type { Result, Ok, Err } from '../../vendored/brepjs/core/result.js';
|
|
141
|
-
export { vecAdd, vecSub, vecScale, vecDot, vecCross, vecLength, vecNormalize, } from '../../vendored/brepjs/core/vecOps.js';
|
|
142
|
-
export { createPlane, createNamedPlane, resolvePlane, } from '../../vendored/brepjs/core/planeOps.js';
|
|
143
|
-
export { kernelError, validationError } from '../../vendored/brepjs/core/errors.js';
|
|
144
|
-
export type { BrepError } from '../../vendored/brepjs/core/errors.js';
|
|
145
|
-
export { DEG2RAD, RAD2DEG } from '../../vendored/brepjs/core/constants.js';
|
|
146
|
-
export type { Vertex, Edge, Wire, Face, Shell, Solid, CompSolid, Shape3D, ValidSolid, ClosedWire, AnyShape, } from '../../vendored/brepjs/core/shapeTypes.js';
|
|
147
|
-
export type { GearGeometry } from '../../vendored/brepjs/gear/gearMath.js';
|
|
148
|
-
export type { Plane, PlaneName, PlaneInput } from '../../vendored/brepjs/core/planeTypes.js';
|
|
149
|
-
export type { Vec3, PointInput } from '../../vendored/brepjs/core/types.js';
|
|
150
|
-
import { line as rawLine, wire as rawWire, wireLoop as rawWireLoop, face as rawFace, polygon as rawPolygon } from '../../vendored/brepjs/topology/primitiveFns.js';
|
|
151
|
-
import { outerWire as rawOuterWire, getSurfaceType as rawSurfaceType, pointOnSurface as rawPointOnSurface, normalAt as rawNormalAt, faceCenter as rawFaceCenter } from '../../vendored/brepjs/topology/faceFns.js';
|
|
152
|
-
import { sharedEdges as rawSharedEdges } from '../../vendored/brepjs/topology/adjacencyFns.js';
|
|
153
|
-
import { curveStartPoint as rawCurveStartPoint, curveEndPoint as rawCurveEndPoint } from '../../vendored/brepjs/topology/curveFns.js';
|
|
154
|
-
import { translate as rawTranslate } from '../../vendored/brepjs/topology/transformFns.js';
|
|
155
|
-
import { isSolid as rawIsSolid } from '../../vendored/brepjs/core/shapeTypes.js';
|
|
156
|
-
import { isPlanarWire as rawIsPlanarWire } from '../../vendored/brepjs/core/validityTypes.js';
|
|
157
|
-
import { isValid as rawIsValid } from '../../vendored/brepjs/topology/healingFns.js';
|
|
158
|
-
import type { AnyShape } from '../../vendored/brepjs/core/shapeTypes.js';
|
|
159
|
-
import type { Vec3 } from '../../vendored/brepjs/core/types.js';
|
|
160
|
-
export { rawLine as line, rawWire as wire, rawWireLoop as wireLoop, rawFace as face, rawPolygon as polygon, rawOuterWire as outerWire, rawSurfaceType as getSurfaceType, rawPointOnSurface as pointOnSurface, rawNormalAt as normalAt, rawFaceCenter as faceCenter, rawSharedEdges as sharedEdges, rawCurveStartPoint as curveStartPoint, rawCurveEndPoint as curveEndPoint, rawTranslate as translate, rawIsSolid as isSolid, rawIsPlanarWire as isPlanarWire, rawIsValid as isValid, };
|
|
161
|
-
/**
|
|
162
|
-
* Rotate a shape by an angle in degrees around an axis.
|
|
163
|
-
* @param shape - The shape to rotate.
|
|
164
|
-
* @param angle - Rotation angle in degrees.
|
|
165
|
-
* @param options - Axis and pivot (`at`) for the rotation; defaults to the Z
|
|
166
|
-
* axis through the origin, matching upstream brepjs.
|
|
167
|
-
* @returns A new rotated shape.
|
|
168
|
-
*/
|
|
169
|
-
export declare function rotate<T extends AnyShape>(shape: T, angle: number, options?: {
|
|
170
|
-
at?: Vec3;
|
|
171
|
-
axis?: Vec3;
|
|
172
|
-
}): T;
|
|
173
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/compat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAE1E,+EAA+E;AAC/E,KAAK,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAA;AAoC/C,OAAO,EAEL,MAAM,IAAI,eAAe,EACzB,QAAQ,IAAI,iBAAiB,EAI9B,MAAM,gDAAgD,CAAA;AAEvD;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAA;AAC7E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,aAAa,GAAG,UAAU,CAAA;AAgCvD,iDAAiD;AACjD,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAA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,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAChF,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAC7F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAA;AACxE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAA;AAE/D,OAAO,EACL,OAAO,IAAI,IAAI,EACf,OAAO,IAAI,IAAI,EACf,WAAW,IAAI,QAAQ,EACvB,OAAO,IAAI,IAAI,EACf,UAAU,IAAI,OAAO,EACrB,YAAY,IAAI,SAAS,EACzB,cAAc,IAAI,cAAc,EAChC,iBAAiB,IAAI,cAAc,EACnC,WAAW,IAAI,QAAQ,EACvB,aAAa,IAAI,UAAU,EAC3B,cAAc,IAAI,WAAW,EAC7B,kBAAkB,IAAI,eAAe,EACrC,gBAAgB,IAAI,aAAa,EACjC,YAAY,IAAI,SAAS,EACzB,UAAU,IAAI,OAAO,EACrB,eAAe,IAAI,YAAY,EAC/B,UAAU,IAAI,OAAO,GACtB,CAAA;AAMD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,QAAQ,EACvC,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO,GACvC,CAAC,CAEH"}
|
package/dist/api/compat/index.js
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BREP-TS compatibility surface (P21).
|
|
3
|
-
*
|
|
4
|
-
* Projects the vendored BREP TS tree onto four stable groups so library authors
|
|
5
|
-
* can write `import { box, fuse, Sketcher, ok } from this module` and call it
|
|
6
|
-
* upstream-style:
|
|
7
|
-
*
|
|
8
|
-
* ① op — solid primitives + boolean / evolution operations
|
|
9
|
-
* ② topology — sub-shape queries + measurements (plus the Bounds3D type)
|
|
10
|
-
* ③ sketching — stateful Sketcher / FaceSketcher DSL + drawing factories
|
|
11
|
-
* ④ combinators / types — result, vector, plane, errors, constants, types
|
|
12
|
-
*
|
|
13
|
-
* Every symbol is a projection (re-export or a thin dual-form wrapper) from the
|
|
14
|
-
* ported tree: no reimplementation. The `.js` specifiers are the repo
|
|
15
|
-
* convention (TypeScript maps `.js` → `.ts`).
|
|
16
|
-
*
|
|
17
|
-
* Semantic wraps (P23: both live in `api/internal/compat-projection.ts` so the
|
|
18
|
-
* generated face and this hand-curated face share one mechanism):
|
|
19
|
-
* - single-kernel assert: every modeling op asserts a bound BREP kernel first
|
|
20
|
-
* (see `assertKernelBound`); `getBackends()` may throw before configuration,
|
|
21
|
-
* so it is guarded and falls back to the occt-kernel binding flag.
|
|
22
|
-
* - dual argument forms: object form normalizes to positional form via the
|
|
23
|
-
* shared `resolveArgs` discriminant; object keys outside the declared
|
|
24
|
-
* parameter table throw the shared `E_ARGS_FORM` token.
|
|
25
|
-
* - `box` is the hand-written dual-form sample: positional
|
|
26
|
-
* `box(width, depth, height)` and `box({ size })` / `box({ width, depth,
|
|
27
|
-
* height })` both forward to the vendored primitive in its native dimension
|
|
28
|
-
* order (width = X, depth = Y, height = Z — confirm against
|
|
29
|
-
* `primitiveFns#box`), so every accepted form yields identical geometry.
|
|
30
|
-
*/
|
|
31
|
-
import { assertKernelBound, projectBrepOp } from '../internal/compat-projection.js';
|
|
32
|
-
import { isObjectForm } from '../internal/dual-form-args.js';
|
|
33
|
-
/**
|
|
34
|
-
* Dual-form op wrapper (A-class): asserts the kernel, normalizes object form to
|
|
35
|
-
* positional form via `resolveArgs`, then delegates to the vendored
|
|
36
|
-
* implementation.
|
|
37
|
-
*
|
|
38
|
-
* P23: delegates to the shared {@link projectBrepOp} so the hand-curated face
|
|
39
|
-
* and the generated face share one projection mechanism (§4.3.2).
|
|
40
|
-
*/
|
|
41
|
-
function wrapDual(name, params, impl) {
|
|
42
|
-
return projectBrepOp(name, params, 'A', impl);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Guard-only wrapper: forwards the arguments unchanged after the kernel assert.
|
|
46
|
-
* Used for positional-first ops (booleans, evolutions) whose first argument is
|
|
47
|
-
* a shape, so the object-form discriminant never applies. The exact function
|
|
48
|
-
* type `F` (including its parameter and Result types) is preserved.
|
|
49
|
-
*/
|
|
50
|
-
function wrapGuarded(name, impl) {
|
|
51
|
-
const fn = (...args) => {
|
|
52
|
-
assertKernelBound(name);
|
|
53
|
-
return impl(...args);
|
|
54
|
-
};
|
|
55
|
-
return fn;
|
|
56
|
-
}
|
|
57
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
58
|
-
// ① primitives + booleans + evolutions
|
|
59
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
60
|
-
import { box as primitiveBox, sphere as primitiveSphere, cylinder as primitiveCylinder, cone as primitiveCone, torus as primitiveTorus, ellipsoid as primitiveEllipsoid, } from '../../vendored/brepjs/topology/primitiveFns.js';
|
|
61
|
-
export function box(...args) {
|
|
62
|
-
assertKernelBound('box');
|
|
63
|
-
if (isObjectForm(args)) {
|
|
64
|
-
const obj = args[0];
|
|
65
|
-
const keys = Object.keys(obj);
|
|
66
|
-
const unknownKeys = keys.filter((k) => !['size', 'width', 'depth', 'height'].includes(k));
|
|
67
|
-
if (unknownKeys.length > 0)
|
|
68
|
-
throw boxArgError(args);
|
|
69
|
-
const size = obj.size;
|
|
70
|
-
if (size !== undefined) {
|
|
71
|
-
if (typeof size === 'number')
|
|
72
|
-
return primitiveBox(size, size, size);
|
|
73
|
-
if (Array.isArray(size) && size.length === 3) {
|
|
74
|
-
const [w, d, h] = size;
|
|
75
|
-
return primitiveBox(w, d, h);
|
|
76
|
-
}
|
|
77
|
-
throw boxArgError(args);
|
|
78
|
-
}
|
|
79
|
-
const width = obj.width;
|
|
80
|
-
const depth = obj.depth;
|
|
81
|
-
const height = obj.height;
|
|
82
|
-
if (typeof width === 'number' && typeof depth === 'number' && typeof height === 'number') {
|
|
83
|
-
return primitiveBox(width, depth, height);
|
|
84
|
-
}
|
|
85
|
-
throw boxArgError(args);
|
|
86
|
-
}
|
|
87
|
-
if (args.length === 3 && args.every((a) => typeof a === 'number')) {
|
|
88
|
-
const [w, d, h] = args;
|
|
89
|
-
return primitiveBox(w, d, h);
|
|
90
|
-
}
|
|
91
|
-
throw boxArgError(args);
|
|
92
|
-
}
|
|
93
|
-
/** Shared E_ARGS_FORM error for {@link box} argument mismatches. */
|
|
94
|
-
function boxArgError(args) {
|
|
95
|
-
return new Error('[compat:box] E_ARGS_FORM: expected box(width, depth, height), ' +
|
|
96
|
-
"box({ size: number | [w, d, h] }) or box({ width, depth, height }); got " +
|
|
97
|
-
args.map((a) => safeJson(a)).join(', '));
|
|
98
|
-
}
|
|
99
|
-
/** JSON stringification that never throws on cyclic or exotic values. */
|
|
100
|
-
function safeJson(v) {
|
|
101
|
-
try {
|
|
102
|
-
return JSON.stringify(v) ?? String(v);
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
return '[unserializable]';
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Project the vendored `sphere(radius, options?)` verbatim (P25: the raw
|
|
110
|
-
* morph form is what portable libraries call — upstream brepjs signatures,
|
|
111
|
-
* no op projection).
|
|
112
|
-
*/
|
|
113
|
-
export { primitiveSphere as sphere };
|
|
114
|
-
/** Project the vendored `cylinder(radius, height, options?)` verbatim. */
|
|
115
|
-
export { primitiveCylinder as cylinder };
|
|
116
|
-
/** Project the vendored `cone(bottomRadius, topRadius, height, options?)`. */
|
|
117
|
-
export const cone = wrapDual('cone', ['bottomRadius', 'topRadius', 'height'], primitiveCone);
|
|
118
|
-
/** Project the vendored `torus(majorRadius, minorRadius, options?)`. */
|
|
119
|
-
export const torus = wrapDual('torus', ['majorRadius', 'minorRadius'], primitiveTorus);
|
|
120
|
-
/** Project the vendored `ellipsoid(rx, ry, rz, options?)`. */
|
|
121
|
-
export const ellipsoid = wrapDual('ellipsoid', ['rx', 'ry', 'rz'], primitiveEllipsoid);
|
|
122
|
-
import { fuse as vendoredFuse, cut as vendoredCut, intersect as vendoredIntersect, } from '../../vendored/brepjs/topology/api.js';
|
|
123
|
-
import { extrude as vendoredExtrude, revolve as vendoredRevolve, loft as vendoredLoft, } from '../../vendored/brepjs/operations/api.js';
|
|
124
|
-
/** Fuse two shapeables into one 3D result. */
|
|
125
|
-
export const fuse = wrapGuarded('fuse', vendoredFuse);
|
|
126
|
-
/** Cut the second shapeable out of the first. */
|
|
127
|
-
export const cut = wrapGuarded('cut', vendoredCut);
|
|
128
|
-
/** Extrude a planar profile along a height or direction vector. */
|
|
129
|
-
export const extrude = wrapGuarded('extrude', vendoredExtrude);
|
|
130
|
-
/** Revolve a planar profile around an axis with optional angle. */
|
|
131
|
-
export const revolve = wrapGuarded('revolve', vendoredRevolve);
|
|
132
|
-
/** Loft through a set of wire profiles. */
|
|
133
|
-
export const loft = wrapGuarded('loft', vendoredLoft);
|
|
134
|
-
/** Intersect two shapeables (common 3D volume). */
|
|
135
|
-
export const intersect = wrapGuarded('intersect', vendoredIntersect);
|
|
136
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
137
|
-
// ①b library-building factories (P24, §8.1): spur gears, planetary trains, threads.
|
|
138
|
-
// Both morphs of these factories are brep-only builders gated by the single-kernel
|
|
139
|
-
// assert (wrapGuarded); the kernel is bound at the host boundary (D10).
|
|
140
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
141
|
-
import { makeExternalGear as vendoredMakeExternalGear, makeInternalGear as vendoredMakeInternalGear, makePlanetaryGear as vendoredMakePlanetaryGear, } from '../../vendored/brepjs/gear/gearFns.js';
|
|
142
|
-
import { thread as vendoredThread } from '../../vendored/brepjs/operations/threadFns.js';
|
|
143
|
-
/**
|
|
144
|
-
* Build an external spur gear.
|
|
145
|
-
* @param params - the external-gear parameters (`teeth`, `moduleSize`, `thickness`, …).
|
|
146
|
-
* @returns `Ok` with the gear solid + geometry, or `Err` for invalid parameters.
|
|
147
|
-
*/
|
|
148
|
-
export const makeExternalGear = wrapGuarded('makeExternalGear', vendoredMakeExternalGear);
|
|
149
|
-
/**
|
|
150
|
-
* Build an internal (ring) spur gear.
|
|
151
|
-
* @param params - the internal-gear parameters, including the optional ring wall thickness.
|
|
152
|
-
* @returns `Ok` with the gear solid + geometry, or `Err` for invalid parameters.
|
|
153
|
-
*/
|
|
154
|
-
export const makeInternalGear = wrapGuarded('makeInternalGear', vendoredMakeInternalGear);
|
|
155
|
-
/**
|
|
156
|
-
* Build a planetary gear train (sun + planets + ring).
|
|
157
|
-
* @param params - the planetary-gear parameters.
|
|
158
|
-
* @returns `Ok` with the sun/planet/ring solids and mesh diagnostics, or `Err`.
|
|
159
|
-
*/
|
|
160
|
-
export const makePlanetaryGear = wrapGuarded('makePlanetaryGear', vendoredMakePlanetaryGear);
|
|
161
|
-
/**
|
|
162
|
-
* Build a helical screw-thread ridge.
|
|
163
|
-
* @param options - the thread profile (`radius`, `pitch`, `height`, …).
|
|
164
|
-
* @returns `Ok` with the thread-ridge solid, or `Err` for invalid parameters.
|
|
165
|
-
*/
|
|
166
|
-
export const thread = wrapGuarded('thread', vendoredThread);
|
|
167
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
168
|
-
// ② sub-shape queries + measurements
|
|
169
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
170
|
-
export { getEdges, getFaces, getWires, getVertices, getShells, getSolids, getCompSolids, getBounds, vertexPosition, } from '../../vendored/brepjs/topology/topologyQueryFns.js';
|
|
171
|
-
export { measureVolume, measureArea, measureLength, } from '../../vendored/brepjs/measurement/measureFns.js';
|
|
172
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
173
|
-
// ③ sketching DSL + drawing factories
|
|
174
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
175
|
-
export { default as Sketcher } from '../../vendored/brepjs/sketching/sketcher.js';
|
|
176
|
-
export { default as FaceSketcher } from '../../vendored/brepjs/sketching/faceSketcher.js';
|
|
177
|
-
export { drawCircle, drawEllipse, drawRoundedRectangle, drawRectangle, drawSingleCircle, drawSingleEllipse, drawPolysides, drawText, } from '../../vendored/brepjs/sketching/drawingFactories.js';
|
|
178
|
-
export { draw } from '../../vendored/brepjs/sketching/drawingPen.js';
|
|
179
|
-
export { makeBaseBox } from '../../vendored/brepjs/sketching/shortcuts.js';
|
|
180
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
181
|
-
// ④ combinators / pure helpers / types
|
|
182
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
183
|
-
export { ok, err, isOk, isErr, unwrap, unwrapOr, map, andThen, } from '../../vendored/brepjs/core/result.js';
|
|
184
|
-
export { vecAdd, vecSub, vecScale, vecDot, vecCross, vecLength, vecNormalize, } from '../../vendored/brepjs/core/vecOps.js';
|
|
185
|
-
export { createPlane, createNamedPlane, resolvePlane, } from '../../vendored/brepjs/core/planeOps.js';
|
|
186
|
-
export { kernelError, validationError } from '../../vendored/brepjs/core/errors.js';
|
|
187
|
-
export { DEG2RAD, RAD2DEG } from '../../vendored/brepjs/core/constants.js';
|
|
188
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
189
|
-
// ⑤ raw 2D-morph + transform + face ports (P25: sheetmetal 单一说明符面)
|
|
190
|
-
//
|
|
191
|
-
// The sheetmetal authoring path consumes the vendored morph semantics exactly
|
|
192
|
-
// (handles in, handles out, `Result` only where the vendored chain returns
|
|
193
|
-
// one). These are projected verbatim from the ported tree — same names, same
|
|
194
|
-
// signatures as upstream brepjs — so portable library sources only change the
|
|
195
|
-
// import specifier line (§8.2).
|
|
196
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
197
|
-
import { line as rawLine, wire as rawWire, wireLoop as rawWireLoop, face as rawFace, polygon as rawPolygon, } from '../../vendored/brepjs/topology/primitiveFns.js';
|
|
198
|
-
import { outerWire as rawOuterWire, getSurfaceType as rawSurfaceType, pointOnSurface as rawPointOnSurface, normalAt as rawNormalAt, faceCenter as rawFaceCenter, } from '../../vendored/brepjs/topology/faceFns.js';
|
|
199
|
-
import { sharedEdges as rawSharedEdges } from '../../vendored/brepjs/topology/adjacencyFns.js';
|
|
200
|
-
import { curveStartPoint as rawCurveStartPoint, curveEndPoint as rawCurveEndPoint, } from '../../vendored/brepjs/topology/curveFns.js';
|
|
201
|
-
import { translate as rawTranslate } from '../../vendored/brepjs/topology/transformFns.js';
|
|
202
|
-
import { rotate as rawRotate } from '../../vendored/brepjs/topology/transformFns.js';
|
|
203
|
-
import { isSolid as rawIsSolid } from '../../vendored/brepjs/core/shapeTypes.js';
|
|
204
|
-
import { isPlanarWire as rawIsPlanarWire } from '../../vendored/brepjs/core/validityTypes.js';
|
|
205
|
-
import { isValid as rawIsValid } from '../../vendored/brepjs/topology/healingFns.js';
|
|
206
|
-
export { rawLine as line, rawWire as wire, rawWireLoop as wireLoop, rawFace as face, rawPolygon as polygon, rawOuterWire as outerWire, rawSurfaceType as getSurfaceType, rawPointOnSurface as pointOnSurface, rawNormalAt as normalAt, rawFaceCenter as faceCenter, rawSharedEdges as sharedEdges, rawCurveStartPoint as curveStartPoint, rawCurveEndPoint as curveEndPoint, rawTranslate as translate, rawIsSolid as isSolid, rawIsPlanarWire as isPlanarWire, rawIsValid as isValid, };
|
|
207
|
-
// Upstream brepjs 18's `rotate` takes an axis through an `{ at, axis }` options
|
|
208
|
-
// object; the vendored tree (P5-locked commit) is the four-argument positional
|
|
209
|
-
// form. Export the upstream-aligned wrap so library code written for brepjs
|
|
210
|
-
// rotates with `rotate(shape, angle, { at?, axis? })`.
|
|
211
|
-
/**
|
|
212
|
-
* Rotate a shape by an angle in degrees around an axis.
|
|
213
|
-
* @param shape - The shape to rotate.
|
|
214
|
-
* @param angle - Rotation angle in degrees.
|
|
215
|
-
* @param options - Axis and pivot (`at`) for the rotation; defaults to the Z
|
|
216
|
-
* axis through the origin, matching upstream brepjs.
|
|
217
|
-
* @returns A new rotated shape.
|
|
218
|
-
*/
|
|
219
|
-
export function rotate(shape, angle, options = {}) {
|
|
220
|
-
return rawRotate(shape, angle, options.at ?? [0, 0, 0], options.axis ?? [0, 0, 1]);
|
|
221
|
-
}
|
|
222
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/compat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAOzD;;;;;;;GAOG;AACH,SAAS,QAAQ,CACf,IAAY,EACZ,MAAgB,EAChB,IAA+B;IAE/B,OAAO,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAqC,CAAC,CAAA;AAChF,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAI,IAAY,EAAE,IAAO;IAC3C,MAAM,EAAE,GAAoC,CAAC,GAAG,IAAe,EAAE,EAAE;QACjE,iBAAiB,CAAC,IAAI,CAAC,CAAA;QACvB,OAAQ,IAAwC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC3D,CAAC,CAAA;IACD,OAAO,EAAkB,CAAA;AAC3B,CAAC;AAED,gFAAgF;AAChF,uCAAuC;AACvC,gFAAgF;AAEhF,OAAO,EACL,GAAG,IAAI,YAAY,EACnB,MAAM,IAAI,eAAe,EACzB,QAAQ,IAAI,iBAAiB,EAC7B,IAAI,IAAI,aAAa,EACrB,KAAK,IAAI,cAAc,EACvB,SAAS,IAAI,kBAAkB,GAChC,MAAM,gDAAgD,CAAA;AA+BvD,MAAM,UAAU,GAAG,CAAC,GAAG,IAAe;IACpC,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACxB,IAAI,YAAY,CAAC,IAAI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IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAA;AAIpF,OAAO,EACL,OAAO,IAAI,IAAI,EACf,OAAO,IAAI,IAAI,EACf,WAAW,IAAI,QAAQ,EACvB,OAAO,IAAI,IAAI,EACf,UAAU,IAAI,OAAO,EACrB,YAAY,IAAI,SAAS,EACzB,cAAc,IAAI,cAAc,EAChC,iBAAiB,IAAI,cAAc,EACnC,WAAW,IAAI,QAAQ,EACvB,aAAa,IAAI,UAAU,EAC3B,cAAc,IAAI,WAAW,EAC7B,kBAAkB,IAAI,eAAe,EACrC,gBAAgB,IAAI,aAAa,EACjC,YAAY,IAAI,SAAS,EACzB,UAAU,IAAI,OAAO,EACrB,eAAe,IAAI,YAAY,EAC/B,UAAU,IAAI,OAAO,GACtB,CAAA;AAED,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,uDAAuD;AACvD;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CACpB,KAAQ,EACR,KAAa,EACb,UAAsC,EAAE;IAExC,OAAO,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC","sourcesContent":["/**\n * BREP-TS compatibility surface (P21).\n *\n * Projects the vendored BREP TS tree onto four stable groups so library authors\n * can write `import { box, fuse, Sketcher, ok } from this module` and call it\n * upstream-style:\n *\n * ① op — solid primitives + boolean / evolution operations\n * ② topology — sub-shape queries + measurements (plus the Bounds3D type)\n * ③ sketching — stateful Sketcher / FaceSketcher DSL + drawing factories\n * ④ combinators / types — result, vector, plane, errors, constants, types\n *\n * Every symbol is a projection (re-export or a thin dual-form wrapper) from the\n * ported tree: no reimplementation. The `.js` specifiers are the repo\n * convention (TypeScript maps `.js` → `.ts`).\n *\n * Semantic wraps (P23: both live in `api/internal/compat-projection.ts` so the\n * generated face and this hand-curated face share one mechanism):\n * - single-kernel assert: every modeling op asserts a bound BREP kernel first\n * (see `assertKernelBound`); `getBackends()` may throw before configuration,\n * so it is guarded and falls back to the occt-kernel binding flag.\n * - dual argument forms: object form normalizes to positional form via the\n * shared `resolveArgs` discriminant; object keys outside the declared\n * parameter table throw the shared `E_ARGS_FORM` token.\n * - `box` is the hand-written dual-form sample: positional\n * `box(width, depth, height)` and `box({ size })` / `box({ width, depth,\n * height })` both forward to the vendored primitive in its native dimension\n * order (width = X, depth = Y, height = Z — confirm against\n * `primitiveFns#box`), so every accepted form yields identical geometry.\n */\n\nimport { assertKernelBound, projectBrepOp } from '../internal/compat-projection'\nimport { isObjectForm } from '../internal/dual-form-args'\n\nimport type { ValidSolid } from '../../vendored/brepjs/core/shapeTypes.js'\n\n/** Signature of a compat op projection (inputs normalized before the call). */\ntype CompatOp = (...args: unknown[]) => unknown\n\n/**\n * Dual-form op wrapper (A-class): asserts the kernel, normalizes object form to\n * positional form via `resolveArgs`, then delegates to the vendored\n * implementation.\n *\n * P23: delegates to the shared {@link projectBrepOp} so the hand-curated face\n * and the generated face share one projection mechanism (§4.3.2).\n */\nfunction wrapDual<R>(\n name: string,\n params: string[],\n impl: (...args: unknown[]) => R\n): CompatOp {\n return projectBrepOp(name, params, 'A', impl as (...args: never[]) => unknown)\n}\n\n/**\n * Guard-only wrapper: forwards the arguments unchanged after the kernel assert.\n * Used for positional-first ops (booleans, evolutions) whose first argument is\n * a shape, so the object-form discriminant never applies. The exact function\n * type `F` (including its parameter and Result types) is preserved.\n */\nfunction wrapGuarded<F>(name: string, impl: F): F {\n const fn: (...args: unknown[]) => unknown = (...args: unknown[]) => {\n assertKernelBound(name)\n return (impl as (...args: unknown[]) => unknown)(...args)\n }\n return fn as unknown as F\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ① primitives + booleans + evolutions\n// ─────────────────────────────────────────────────────────────────────────────\n\nimport {\n box as primitiveBox,\n sphere as primitiveSphere,\n cylinder as primitiveCylinder,\n cone as primitiveCone,\n torus as primitiveTorus,\n ellipsoid as primitiveEllipsoid,\n} from '../../vendored/brepjs/topology/primitiveFns.js'\n\n/**\n * Create a solid box.\n *\n * Positional form `box(width, depth, height)` uses the vendor's native\n * dimension order — X = width, Y = depth,\n * Z = height (the vendored `primitiveFns#box` dimension order; width/height are\n * NOT swapped). See the overload below for the object form.\n *\n * @param width - side length along X.\n * @param depth - side length along Y.\n * @param height - side length along Z.\n * @returns a new valid solid box.\n */\nexport function box(width: number, depth: number, height: number): ValidSolid\n/**\n * Create a solid box from an object form.\n *\n * Accepts `box({ size })` where `size` is a number (cube) or a\n * `[width, depth, height]` triple, or `box({ width, depth, height })`. Every\n * accepted form forwards to `primitiveBox(width, depth, height)`, so equal\n * dimension values always produce identical geometry.\n *\n * @param options - the dimension set: `size` (a cube edge or a triple) or\n * `width`/`depth`/`height` sides.\n * @returns a new valid solid box.\n * @throws An `Error` whose message contains the shared `E_ARGS_FORM` token when\n * no form matches (e.g. `box('x')`, `box()`, or unknown object keys).\n */\nexport function box(options: BoxDimensions): ValidSolid\nexport function box(...args: unknown[]): ValidSolid {\n assertKernelBound('box')\n if (isObjectForm(args)) {\n const obj = args[0] as Record<string, unknown>\n const keys = Object.keys(obj)\n const unknownKeys = keys.filter((k) => !['size', 'width', 'depth', 'height'].includes(k))\n if (unknownKeys.length > 0) throw boxArgError(args)\n const size = obj.size\n if (size !== undefined) {\n if (typeof size === 'number') return primitiveBox(size, size, size)\n if (Array.isArray(size) && size.length === 3) {\n const [w, d, h] = size as [number, number, number]\n return primitiveBox(w, d, h)\n }\n throw boxArgError(args)\n }\n const width = obj.width\n const depth = obj.depth\n const height = obj.height\n if (typeof width === 'number' && typeof depth === 'number' && typeof height === 'number') {\n return primitiveBox(width, depth, height)\n }\n throw boxArgError(args)\n }\n if (args.length === 3 && args.every((a) => typeof a === 'number')) {\n const [w, d, h] = args as [number, number, number]\n return primitiveBox(w, d, h)\n }\n throw boxArgError(args)\n}\n\n/** Object-form input accepted by {@link box}. */\nexport interface BoxDimensions {\n /** All three sides as one number (cube) or a `[width, depth, height]` triple. */\n size?: number | [number, number, number]\n /** Side length along X. */\n width?: number\n /** Side length along Y. */\n depth?: number\n /** Side length along Z. */\n height?: number\n}\n\n/** Shared E_ARGS_FORM error for {@link box} argument mismatches. */\nfunction boxArgError(args: unknown[]): Error {\n return new Error(\n '[compat:box] E_ARGS_FORM: expected box(width, depth, height), ' +\n \"box({ size: number | [w, d, h] }) or box({ width, depth, height }); got \" +\n args.map((a) => safeJson(a)).join(', ')\n )\n}\n\n/** JSON stringification that never throws on cyclic or exotic values. */\nfunction safeJson(v: unknown): string {\n try {\n return JSON.stringify(v) ?? String(v)\n } catch {\n return '[unserializable]'\n }\n}\n\n/**\n * Project the vendored `sphere(radius, options?)` verbatim (P25: the raw\n * morph form is what portable libraries call — upstream brepjs signatures,\n * no op projection).\n */\nexport { primitiveSphere as sphere }\n/** Project the vendored `cylinder(radius, height, options?)` verbatim. */\nexport { primitiveCylinder as cylinder }\n/** Project the vendored `cone(bottomRadius, topRadius, height, options?)`. */\nexport const cone = wrapDual(\n 'cone',\n ['bottomRadius', 'topRadius', 'height'],\n primitiveCone as CompatOp\n)\n/** Project the vendored `torus(majorRadius, minorRadius, options?)`. */\nexport const torus = wrapDual('torus', ['majorRadius', 'minorRadius'], primitiveTorus as CompatOp)\n/** Project the vendored `ellipsoid(rx, ry, rz, options?)`. */\nexport const ellipsoid = wrapDual('ellipsoid', ['rx', 'ry', 'rz'], primitiveEllipsoid as CompatOp)\n\nimport {\n fuse as vendoredFuse,\n cut as vendoredCut,\n intersect as vendoredIntersect,\n} from '../../vendored/brepjs/topology/api.js'\nimport {\n extrude as vendoredExtrude,\n revolve as vendoredRevolve,\n loft as vendoredLoft,\n} from '../../vendored/brepjs/operations/api.js'\n\n/** Fuse two shapeables into one 3D result. */\nexport const fuse = wrapGuarded('fuse', vendoredFuse)\n/** Cut the second shapeable out of the first. */\nexport const cut = wrapGuarded('cut', vendoredCut)\n/** Extrude a planar profile along a height or direction vector. */\nexport const extrude = wrapGuarded('extrude', vendoredExtrude)\n/** Revolve a planar profile around an axis with optional angle. */\nexport const revolve = wrapGuarded('revolve', vendoredRevolve)\n/** Loft through a set of wire profiles. */\nexport const loft = wrapGuarded('loft', vendoredLoft)\n\n/** Intersect two shapeables (common 3D volume). */\nexport const intersect = wrapGuarded('intersect', vendoredIntersect)\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ①b library-building factories (P24, §8.1): spur gears, planetary trains, threads.\n// Both morphs of these factories are brep-only builders gated by the single-kernel\n// assert (wrapGuarded); the kernel is bound at the host boundary (D10).\n// ─────────────────────────────────────────────────────────────────────────────\n\nimport {\n makeExternalGear as vendoredMakeExternalGear,\n makeInternalGear as vendoredMakeInternalGear,\n makePlanetaryGear as vendoredMakePlanetaryGear,\n} from '../../vendored/brepjs/gear/gearFns.js'\nimport { thread as vendoredThread } from '../../vendored/brepjs/operations/threadFns.js'\n\n/**\n * Build an external spur gear.\n * @param params - the external-gear parameters (`teeth`, `moduleSize`, `thickness`, …).\n * @returns `Ok` with the gear solid + geometry, or `Err` for invalid parameters.\n */\nexport const makeExternalGear = wrapGuarded('makeExternalGear', vendoredMakeExternalGear)\n/**\n * Build an internal (ring) spur gear.\n * @param params - the internal-gear parameters, including the optional ring wall thickness.\n * @returns `Ok` with the gear solid + geometry, or `Err` for invalid parameters.\n */\nexport const makeInternalGear = wrapGuarded('makeInternalGear', vendoredMakeInternalGear)\n/**\n * Build a planetary gear train (sun + planets + ring).\n * @param params - the planetary-gear parameters.\n * @returns `Ok` with the sun/planet/ring solids and mesh diagnostics, or `Err`.\n */\nexport const makePlanetaryGear = wrapGuarded('makePlanetaryGear', vendoredMakePlanetaryGear)\n/**\n * Build a helical screw-thread ridge.\n * @param options - the thread profile (`radius`, `pitch`, `height`, …).\n * @returns `Ok` with the thread-ridge solid, or `Err` for invalid parameters.\n */\nexport const thread = wrapGuarded('thread', vendoredThread)\n\nexport type {\n ExternalGearParams,\n InternalGearParams,\n PlanetaryGearParams,\n GearResult,\n PlanetaryGearAssembly,\n} from '../../vendored/brepjs/gear/gearFns.js'\nexport type { ThreadOptions } from '../../vendored/brepjs/operations/threadFns.js'\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ② sub-shape queries + measurements\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport {\n getEdges,\n getFaces,\n getWires,\n getVertices,\n getShells,\n getSolids,\n getCompSolids,\n getBounds,\n vertexPosition,\n} from '../../vendored/brepjs/topology/topologyQueryFns.js'\n\nexport type { Bounds3D } from '../../vendored/brepjs/topology/topologyQueryFns.js'\n\nexport {\n measureVolume,\n measureArea,\n measureLength,\n} from '../../vendored/brepjs/measurement/measureFns.js'\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ③ sketching DSL + drawing factories\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport { default as Sketcher } from '../../vendored/brepjs/sketching/sketcher.js'\nexport { default as FaceSketcher } from '../../vendored/brepjs/sketching/faceSketcher.js'\n\nexport {\n drawCircle,\n drawEllipse,\n drawRoundedRectangle,\n drawRectangle,\n drawSingleCircle,\n drawSingleEllipse,\n drawPolysides,\n drawText,\n} from '../../vendored/brepjs/sketching/drawingFactories.js'\n\nexport { draw } from '../../vendored/brepjs/sketching/drawingPen.js'\nexport { makeBaseBox } from '../../vendored/brepjs/sketching/shortcuts.js'\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ④ combinators / pure helpers / types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport {\n ok,\n err,\n isOk,\n isErr,\n unwrap,\n unwrapOr,\n map,\n andThen,\n} from '../../vendored/brepjs/core/result.js'\nexport type { Result, Ok, Err } from '../../vendored/brepjs/core/result.js'\n\nexport {\n vecAdd,\n vecSub,\n vecScale,\n vecDot,\n vecCross,\n vecLength,\n vecNormalize,\n} from '../../vendored/brepjs/core/vecOps.js'\n\nexport {\n createPlane,\n createNamedPlane,\n resolvePlane,\n} from '../../vendored/brepjs/core/planeOps.js'\n\nexport { kernelError, validationError } from '../../vendored/brepjs/core/errors.js'\nexport type { BrepError } from '../../vendored/brepjs/core/errors.js'\n\nexport { DEG2RAD, RAD2DEG } from '../../vendored/brepjs/core/constants.js'\n\nexport type {\n Vertex,\n Edge,\n Wire,\n Face,\n Shell,\n Solid,\n CompSolid,\n Shape3D,\n ValidSolid,\n ClosedWire,\n AnyShape,\n} from '../../vendored/brepjs/core/shapeTypes.js'\n\nexport type { GearGeometry } from '../../vendored/brepjs/gear/gearMath.js'\n\nexport type { Plane, PlaneName, PlaneInput } from '../../vendored/brepjs/core/planeTypes.js'\n\nexport type { Vec3, PointInput } from '../../vendored/brepjs/core/types.js'\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ⑤ raw 2D-morph + transform + face ports (P25: sheetmetal 单一说明符面)\n//\n// The sheetmetal authoring path consumes the vendored morph semantics exactly\n// (handles in, handles out, `Result` only where the vendored chain returns\n// one). These are projected verbatim from the ported tree — same names, same\n// signatures as upstream brepjs — so portable library sources only change the\n// import specifier line (§8.2).\n// ─────────────────────────────────────────────────────────────────────────────\n\nimport {\n line as rawLine,\n wire as rawWire,\n wireLoop as rawWireLoop,\n face as rawFace,\n polygon as rawPolygon,\n} from '../../vendored/brepjs/topology/primitiveFns.js'\nimport {\n outerWire as rawOuterWire,\n getSurfaceType as rawSurfaceType,\n pointOnSurface as rawPointOnSurface,\n normalAt as rawNormalAt,\n faceCenter as rawFaceCenter,\n} from '../../vendored/brepjs/topology/faceFns.js'\nimport { sharedEdges as rawSharedEdges } from '../../vendored/brepjs/topology/adjacencyFns.js'\nimport {\n curveStartPoint as rawCurveStartPoint,\n curveEndPoint as rawCurveEndPoint,\n} from '../../vendored/brepjs/topology/curveFns.js'\nimport { translate as rawTranslate } from '../../vendored/brepjs/topology/transformFns.js'\nimport { rotate as rawRotate } from '../../vendored/brepjs/topology/transformFns.js'\nimport { isSolid as rawIsSolid } from '../../vendored/brepjs/core/shapeTypes.js'\nimport { isPlanarWire as rawIsPlanarWire } from '../../vendored/brepjs/core/validityTypes.js'\nimport { isValid as rawIsValid } from '../../vendored/brepjs/topology/healingFns.js'\nimport type { AnyShape } from '../../vendored/brepjs/core/shapeTypes.js'\nimport type { Vec3 } from '../../vendored/brepjs/core/types.js'\n\nexport {\n rawLine as line,\n rawWire as wire,\n rawWireLoop as wireLoop,\n rawFace as face,\n rawPolygon as polygon,\n rawOuterWire as outerWire,\n rawSurfaceType as getSurfaceType,\n rawPointOnSurface as pointOnSurface,\n rawNormalAt as normalAt,\n rawFaceCenter as faceCenter,\n rawSharedEdges as sharedEdges,\n rawCurveStartPoint as curveStartPoint,\n rawCurveEndPoint as curveEndPoint,\n rawTranslate as translate,\n rawIsSolid as isSolid,\n rawIsPlanarWire as isPlanarWire,\n rawIsValid as isValid,\n}\n\n// Upstream brepjs 18's `rotate` takes an axis through an `{ at, axis }` options\n// object; the vendored tree (P5-locked commit) is the four-argument positional\n// form. Export the upstream-aligned wrap so library code written for brepjs\n// rotates with `rotate(shape, angle, { at?, axis? })`.\n/**\n * Rotate a shape by an angle in degrees around an axis.\n * @param shape - The shape to rotate.\n * @param angle - Rotation angle in degrees.\n * @param options - Axis and pivot (`at`) for the rotation; defaults to the Z\n * axis through the origin, matching upstream brepjs.\n * @returns A new rotated shape.\n */\nexport function rotate<T extends AnyShape>(\n shape: T,\n angle: number,\n options: { at?: Vec3; axis?: Vec3 } = {}\n): T {\n return rawRotate(shape, angle, options.at ?? [0, 0, 0], options.axis ?? [0, 0, 1]);\n}"]}
|