@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
package/LICENSE
CHANGED
|
@@ -1,28 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* 库函数签名 = .fai.js 源码形态(无隐式参数);本文件无任何 per-函数逻辑。
|
|
6
6
|
*
|
|
7
|
-
* 归属(monorepo P5/E-a-1):本文件随
|
|
7
|
+
* 归属(monorepo P5/E-a-1):本文件随 core 出包,是 faijs 默认库函数
|
|
8
8
|
* (cad 命名空间)的装配点。K5(引擎零函数知识)的准确含义是:parser / compile /
|
|
9
9
|
* runtime 不按函数名分支、不区分函数类别,函数信息统一以 defineOp 元数据(均匀数据)
|
|
10
10
|
* 承载。把 cad 这套库数据内置进引擎,与第三方库走完全相同的 registerLib 路径,
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
* 四个 transform op(translate/rotate_euler/scale/scale3d)按 D1 选项 C 留在此处:
|
|
19
19
|
* `translate` 是通用几何变换,且是小程序端唯一在用的 transform op。
|
|
20
20
|
*/
|
|
21
|
-
import type {
|
|
21
|
+
import type { LibNamespace } from '../runtime-state.js';
|
|
22
22
|
/**
|
|
23
|
-
* Assemble
|
|
23
|
+
* Assemble api functions into the cad namespace.
|
|
24
24
|
*
|
|
25
25
|
* P23(§4.2 ②,B1 三源一致):cad 面 = faijs 特有 dual op(下方字面量)+
|
|
26
26
|
* 生成脚本面 op(`scriptFaceOps`——`api/generated/script-face.ts` 按 arg-spec
|
|
@@ -28,7 +28,7 @@ import type { StdlibNamespace } from '../runtime-state.js';
|
|
|
28
28
|
* brep-only 语句级 op)。`check()` 符号表(`gen-symbol-table.ts`)与
|
|
29
29
|
* `api/index.ts` 导出面同源于同一份清单。
|
|
30
30
|
*
|
|
31
|
-
* @returns the assembled
|
|
31
|
+
* @returns the assembled LibNamespace ready for runtime injection.
|
|
32
32
|
*/
|
|
33
|
-
export declare function createApiNamespace():
|
|
33
|
+
export declare function createApiNamespace(): LibNamespace;
|
|
34
34
|
//# sourceMappingURL=api-namespace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-namespace.d.ts","sourceRoot":"","sources":["../../src/api/api-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA4CH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"api-namespace.d.ts","sourceRoot":"","sources":["../../src/api/api-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA4CH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAmDjD"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* 库函数签名 = .fai.js 源码形态(无隐式参数);本文件无任何 per-函数逻辑。
|
|
6
6
|
*
|
|
7
|
-
* 归属(monorepo P5/E-a-1):本文件随
|
|
7
|
+
* 归属(monorepo P5/E-a-1):本文件随 core 出包,是 faijs 默认库函数
|
|
8
8
|
* (cad 命名空间)的装配点。K5(引擎零函数知识)的准确含义是:parser / compile /
|
|
9
9
|
* runtime 不按函数名分支、不区分函数类别,函数信息统一以 defineOp 元数据(均匀数据)
|
|
10
10
|
* 承载。把 cad 这套库数据内置进引擎,与第三方库走完全相同的 registerLib 路径,
|
|
@@ -61,7 +61,7 @@ import { scriptFaceOps } from './generated/script-face.js';
|
|
|
61
61
|
import { revolve } from './revolve.js';
|
|
62
62
|
import { CONTRACT_VERSION } from '../runtime-state.js';
|
|
63
63
|
/**
|
|
64
|
-
* Assemble
|
|
64
|
+
* Assemble api functions into the cad namespace.
|
|
65
65
|
*
|
|
66
66
|
* P23(§4.2 ②,B1 三源一致):cad 面 = faijs 特有 dual op(下方字面量)+
|
|
67
67
|
* 生成脚本面 op(`scriptFaceOps`——`api/generated/script-face.ts` 按 arg-spec
|
|
@@ -69,12 +69,12 @@ import { CONTRACT_VERSION } from '../runtime-state.js';
|
|
|
69
69
|
* brep-only 语句级 op)。`check()` 符号表(`gen-symbol-table.ts`)与
|
|
70
70
|
* `api/index.ts` 导出面同源于同一份清单。
|
|
71
71
|
*
|
|
72
|
-
* @returns the assembled
|
|
72
|
+
* @returns the assembled LibNamespace ready for runtime injection.
|
|
73
73
|
*/
|
|
74
74
|
export function createApiNamespace() {
|
|
75
75
|
// D-4 strict assembly check: the cad namespace now exports dual-op functions
|
|
76
76
|
// (defineOp), so registerLib requires a matching contractVersion. Cast is
|
|
77
|
-
// needed because
|
|
77
|
+
// needed because LibNamespace is an index-signature type.
|
|
78
78
|
return {
|
|
79
79
|
contractVersion: CONTRACT_VERSION,
|
|
80
80
|
box, sphere, cylinder, cone, wedge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-namespace.js","sourceRoot":"","sources":["../../src/api/api-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrE,iEAAiE;AACjE,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO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AAG;QACH,4EAA4E;QAC5E,8EAA8E;QAC9E,uEAAuE;QACvE,KAAK;QACL,aAAa;QACb,oDAAoD;QACpD,6DAA6D;QAC7D,iEAAiE;QACjE,0CAA0C;QAC1C,eAAe;QACf,WAAW;QACX,kBAAkB;QAClB,UAAU;QACV,MAAM;QACN,KAAK;KACqB,CAAA;AAC9B,CAAC","sourcesContent":["/**\n * api-namespace — 把 L3 API 面(api/ 层的 fp操作)装配为 cad 命名空间(统一 ABI,B2 消灭)\n *\n *\n * 库函数签名 = .fai.js 源码形态(无隐式参数);本文件无任何 per-函数逻辑。\n *\n * 归属(monorepo P5/E-a-1):本文件随 core 出包,是 faijs 默认库函数\n * (cad 命名空间)的装配点。K5(引擎零函数知识)的准确含义是:parser / compile /\n * runtime 不按函数名分支、不区分函数类别,函数信息统一以 defineOp 元数据(均匀数据)\n * 承载。把 cad 这套库数据内置进引擎,与第三方库走完全相同的 registerLib 路径,\n * 引擎并未对 cad 特判,因此不构成 K5 违反。cad 在 core 的 createRuntime 包装中\n * 被注册为 default 命名空间(见 cad-runtime/createRuntimeWithCad.ts)。\n *\n * D1(2026-09-23 扩展库拆分):本命名空间只装配**平台面**。编辑器专属 op\n * (`fai_*` / `group` / `assembly` / `copy` / `load`)与两个非基础 three 链的创建 op\n * (`text` / `svgExtrude`)已迁到 `@faicad/faijs-extra`,由宿主经\n * `mergeEditorNamespace()` 合并后注册——键名与拆分前完全一致,存量 `.fai.js` 零迁移。\n * 四个 transform op(translate/rotate_euler/scale/scale3d)按 D1 选项 C 留在此处:\n * `translate` 是通用几何变换,且是小程序端唯一在用的 transform op。\n */\n\nimport { box, sphere, cylinder, cone, wedge } from './primitives'\nimport { translate, rotate_euler, scale, scale3d } from './transform'\n// cad.extrude 是平台手写 op(承载 upTo;长度形态委托 generated/operations 的投影),\n// 见 api/extrude.ts 的分层说明——up-to 不落在 fai_extrude(后者已随扩展库迁出)。\nimport { extrude } from './extrude'\nimport { knurl } from './knurl'\nimport { sdf } from './sdf'\nimport { screw } from './screw'\nimport { profile } from './profile'\nimport { sketchOnPlane } from './sketch-on-plane'\nimport { sketchOnFace } from './sketch-on-face'\nimport { punchHole } from './punch-hole'\nimport { wire } from './wire'\nimport { helix } from './helix'\nimport { union, subtract, intersect, cut } from './boolean'\nimport { split } from './split'\nimport { sweep } from './sweep'\nimport { loft } from './loft'\nimport { linearPattern } from './pattern'\nimport { circularPattern, gridPattern, rectangularPattern, mirrorJoin, mirror, clone } from './replicate'\nimport { engrave } from './engrave'\nimport { chamfer } from './chamfer'\nimport { fillet } from './fillet'\nimport { shell } from './shell'\nimport { draft } from './draft'\nimport { thicken } from './thicken'\nimport { defeature, reverseShape, unifySameDomain, sew, sewAndSolidify, removeHolesFromFace } from './feature-repair'\nimport { filletVariable } from './fillet-variable'\nimport { splitByPlane } from './split-by-plane'\nimport { sectionByPlane } from './section-by-plane'\nimport { faceNormal, bboxCenter, bboxMin, bboxMax } from './geom'\nimport { edgeRef } from './edge-ref'\nimport { faceRef } from './face-ref'\nimport { jointTrajectory, inverseKinematics, mechanismDOF } from './assembly'\nimport { asset } from './asset'\nimport { import_brep } from './import-brep'\nimport { import_step } from './import-step'\nimport { compound as geometricCompound } from './compound-geom'\nimport { place } from './place'\nimport { scriptFaceOps } from './generated/script-face'\nimport { revolve } from './revolve'\nimport { CONTRACT_VERSION } from '../runtime-state'\nimport type { LibNamespace } from '../runtime-state'\n\n/**\n * Assemble api functions into the cad namespace.\n *\n * P23(§4.2 ②,B1 三源一致):cad 面 = faijs 特有 dual op(下方字面量)+\n * 生成脚本面 op(`scriptFaceOps`——`api/generated/script-face.ts` 按 arg-spec\n * 的 `scriptFace: true` 条目生成,经 `compatOp(projectBrepOp(…))` 包装的\n * brep-only 语句级 op)。`check()` 符号表(`gen-symbol-table.ts`)与\n * `api/index.ts` 导出面同源于同一份清单。\n *\n * @returns the assembled LibNamespace ready for runtime injection.\n */\nexport function createApiNamespace(): LibNamespace {\n // D-4 strict assembly check: the cad namespace now exports dual-op functions\n // (defineOp), so registerLib requires a matching contractVersion. Cast is\n // needed because LibNamespace is an index-signature type.\n return {\n contractVersion: CONTRACT_VERSION,\n box, sphere, cylinder, cone, wedge,\n screw, profile, sketchOnPlane, sketchOnFace, punchHole, wire, helix, sdf,\n // D1 选项 C:四个 transform op 全留核心(translate 小程序端在用,同族不拆散)。\n translate, rotate_euler, scale, scale3d,\n engrave, chamfer, fillet, knurl,\n // Phase 5:按面/边选的特征族 + 修复薄包装(shell/draft 中立;thicken 平台 occt)。\n shell, draft, thicken, filletVariable, splitByPlane, sectionByPlane,\n defeature, reverseShape, unifySameDomain, sew, sewAndSolidify, removeHolesFromFace,\n union, subtract, intersect,\n extrude, revolve,\n // Phase 4:手写扫掠 / 放样(平台 op engines:['occt'];截面接受 face → 取外环)。\n // arg-spec 里 sweep 保留 brep-op(引擎记录)/ loft 为 skip,两者均不投脚本面,\n // 所以这里不是 override 而是唯一实现(同 extrude / revolve 口径)。\n sweep, loft,\n faceNormal, bboxCenter, bboxMin, bboxMax,\n edgeRef,\n faceRef,\n jointTrajectory, inverseKinematics, mechanismDOF,\n asset,\n // 平台几何 op(H11,方案 §4):FCStd 迁移自此不再借用编辑器 op\n // (group/translate/rotate_euler);这几个与 ../3d_editor 无关系。\n import_brep,\n import_step,\n compound: geometricCompound,\n place,\n ...scriptFaceOps,\n // Phase 3: override generated cut (compatOp, no roleTable propagation) with\n // handwritten cut from boolean.ts (does roleTable propagation via booleanBrep).\n cut,\n // Phase 3: override generated split / linearPattern (compatOp, no roleTable\n // propagation) with handwritten versions that build replica[k] / splinter(#j)\n // role tables (L3 / L4 抗重放词汇). Spread after scriptFaceOps so they win.\n split,\n linearPattern,\n // 覆盖生成版:4 个多副本 pattern 提拔手写(keep + replica[*] 角色表);\n // 2 个单副本(mirror/clone)加 keep 薄 override。transformCopy 不再是脚本面\n // op(arg-spec skip:ComposedTransform 在 .fai.js 不可构造),仅保留 TS 库导出。\n // Spread after scriptFaceOps so they win.\n circularPattern,\n gridPattern,\n rectangularPattern,\n mirrorJoin,\n mirror,\n clone,\n } as unknown as LibNamespace\n}\n"]}
|
package/dist/api/assert.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* api assert — per-op 参数自校验助手(Phase 2.2)
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
* 阶段 4 起(args-schema/SCHEMAS 已删除),参数校验全部由本模块的 assert 助手
|
|
6
|
-
* 承担(各
|
|
6
|
+
* 承担(各 api 函数在 dispatchPath 之前调用);非法即抛 Error(不静默)。
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Assert that a parameter is a finite number, narrowing the type to `number`.
|
package/dist/api/assert.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* api assert — per-op 参数自校验助手(Phase 2.2)
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
* 阶段 4 起(args-schema/SCHEMAS 已删除),参数校验全部由本模块的 assert 助手
|
|
6
|
-
* 承担(各
|
|
6
|
+
* 承担(各 api 函数在 dispatchPath 之前调用);非法即抛 Error(不静默)。
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Assert that a parameter is a finite number, narrowing the type to `number`.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export function assertNumber(value, name) {
|
|
15
15
|
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
16
|
-
throw new Error(`[
|
|
16
|
+
throw new Error(`[api] ${name} must be a finite number, got ${JSON.stringify(value)}`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
@@ -24,7 +24,7 @@ export function assertNumber(value, name) {
|
|
|
24
24
|
export function assertPositiveNumber(value, name) {
|
|
25
25
|
assertNumber(value, name);
|
|
26
26
|
if (value <= 0) {
|
|
27
|
-
throw new Error(`[
|
|
27
|
+
throw new Error(`[api] ${name} must be > 0, got ${value}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -35,7 +35,7 @@ export function assertPositiveNumber(value, name) {
|
|
|
35
35
|
export function assertNonNegativeNumber(value, name) {
|
|
36
36
|
assertNumber(value, name);
|
|
37
37
|
if (value < 0) {
|
|
38
|
-
throw new Error(`[
|
|
38
|
+
throw new Error(`[api] ${name} must be >= 0, got ${value}`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -47,7 +47,7 @@ export function assertVec3(value, name) {
|
|
|
47
47
|
if (!Array.isArray(value) ||
|
|
48
48
|
value.length !== 3 ||
|
|
49
49
|
value.some((n) => typeof n !== 'number' || !Number.isFinite(n))) {
|
|
50
|
-
throw new Error(`[
|
|
50
|
+
throw new Error(`[api] ${name} must be a vec3 [x, y, z], got ${JSON.stringify(value)}`);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -60,7 +60,7 @@ export function assertNonZeroVec3(value, name) {
|
|
|
60
60
|
assertVec3(value, name);
|
|
61
61
|
const v = value;
|
|
62
62
|
if (v[0] === 0 && v[1] === 0 && v[2] === 0) {
|
|
63
|
-
throw new Error(`[
|
|
63
|
+
throw new Error(`[api] ${name} must be a non-zero vec3, got ${JSON.stringify(value)}`);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
@@ -84,7 +84,7 @@ export function assertNumberOrVec3(value, name) {
|
|
|
84
84
|
*/
|
|
85
85
|
export function assertOneOf(value, name, allowed) {
|
|
86
86
|
if (value !== undefined && value !== null && !allowed.includes(value)) {
|
|
87
|
-
throw new Error(`[
|
|
87
|
+
throw new Error(`[api] ${name} must be one of ${allowed.join(' | ')}, got ${JSON.stringify(value)}`);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
//# sourceMappingURL=assert.js.map
|
package/dist/api/assert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../src/api/assert.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,IAAY;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../src/api/assert.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,IAAY;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,iCAAiC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACxF,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc,EAAE,IAAY;IAC/D,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACzB,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,qBAAqB,KAAK,EAAE,CAAC,CAAA;IAC5D,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc,EAAE,IAAY;IAClE,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACzB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,sBAAsB,KAAK,EAAE,CAAC,CAAA;IAC7D,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc,EAAE,IAAY;IACrD,IACE,C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AM,IAAI,KAAK,CAAC,SAAS,IAAI,mBAAmB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACtG,CAAC;AACH,CAAC","sourcesContent":["/**\n * api assert — per-op 参数自校验助手(Phase 2.2)\n *\n *\n * 阶段 4 起(args-schema/SCHEMAS 已删除),参数校验全部由本模块的 assert 助手\n * 承担(各 api 函数在 dispatchPath 之前调用);非法即抛 Error(不静默)。\n */\n\n/**\n * Assert that a parameter is a finite number, narrowing the type to `number`.\n * @param value - the value to check.\n * @param name - the parameter name used in the thrown error message.\n * @returns asserts that `value` is a number.\n */\nexport function assertNumber(value: unknown, name: string): asserts value is number {\n if (typeof value !== 'number' || !Number.isFinite(value)) {\n throw new Error(`[api] ${name} must be a finite number, got ${JSON.stringify(value)}`)\n }\n}\n\n/**\n * Assert that a parameter is a number greater than zero.\n * @param value - the value to check.\n * @param name - the parameter name used in the thrown error message.\n */\nexport function assertPositiveNumber(value: unknown, name: string): void {\n assertNumber(value, name)\n if (value <= 0) {\n throw new Error(`[api] ${name} must be > 0, got ${value}`)\n }\n}\n\n/**\n * Assert that a parameter is a number greater than or equal to zero.\n * @param value - the value to check.\n * @param name - the parameter name used in the thrown error message.\n */\nexport function assertNonNegativeNumber(value: unknown, name: string): void {\n assertNumber(value, name)\n if (value < 0) {\n throw new Error(`[api] ${name} must be >= 0, got ${value}`)\n }\n}\n\n/**\n * Assert that a parameter is a vec3 `[x, y, z]` of finite numbers.\n * @param value - the value to check.\n * @param name - the parameter name used in the thrown error message.\n */\nexport function assertVec3(value: unknown, name: string): void {\n if (\n !Array.isArray(value) ||\n value.length !== 3 ||\n value.some((n) => typeof n !== 'number' || !Number.isFinite(n))\n ) {\n throw new Error(`[api] ${name} must be a vec3 [x, y, z], got ${JSON.stringify(value)}`)\n }\n}\n\n/**\n * Assert that a parameter is a non-zero vec3 (a zero vector would degenerate\n * operations such as split/faceNormal, so it is rejected).\n * @param value - the value to check.\n * @param name - the parameter name used in the thrown error message.\n */\nexport function assertNonZeroVec3(value: unknown, name: string): void {\n assertVec3(value, name)\n const v = value as [number, number, number]\n if (v[0] === 0 && v[1] === 0 && v[2] === 0) {\n throw new Error(`[api] ${name} must be a non-zero vec3, got ${JSON.stringify(value)}`)\n }\n}\n\n/**\n * Assert that a parameter is either a positive number or a vec3.\n * @param value - the value to check.\n * @param name - the parameter name used in the thrown error message.\n */\nexport function assertNumberOrVec3(value: unknown, name: string): void {\n if (typeof value === 'number') {\n assertPositiveNumber(value, name)\n return\n }\n assertVec3(value, name)\n}\n\n/**\n * Assert that a parameter is one of the given allowed values (skipped when\n * `value` is absent).\n * @param value - the value to check.\n * @param name - the parameter name used in the thrown error message.\n * @param allowed - the list of permitted string values.\n */\nexport function assertOneOf(value: unknown, name: string, allowed: readonly string[]): void {\n if (value !== undefined && value !== null && !allowed.includes(value as string)) {\n throw new Error(`[api] ${name} must be one of ${allowed.join(' | ')}, got ${JSON.stringify(value)}`)\n }\n}\n"]}
|
package/dist/api/asset.d.ts
CHANGED
package/dist/api/asset.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* api asset — `cad.asset(key)` 库函数(A7 消灭后 asset 走 CallRefIR)
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
* 嵌套调用 `cad.asset('cfg')` 返回 UTF-8 字符串(SVG 等文本资产)。
|
|
@@ -20,7 +20,7 @@ import { getBackends } from '../runtime-state.js';
|
|
|
20
20
|
export async function asset(key) {
|
|
21
21
|
const assets = getBackends().assets;
|
|
22
22
|
if (!assets) {
|
|
23
|
-
throw new Error(`[
|
|
23
|
+
throw new Error(`[api/asset] asset "${key}" cannot be resolved: assets not available`);
|
|
24
24
|
}
|
|
25
25
|
const result = await assets.resolveByKey(key);
|
|
26
26
|
return new TextDecoder('utf-8').decode(new Uint8Array(result.bytes));
|
package/dist/api/asset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,GAAW;IACrC,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC,MAAoF,CAAA;IACjH,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/api/asset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,GAAW;IACrC,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC,MAAoF,CAAA;IACjH,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,4CAA4C,CAAC,CAAA;IACxF,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC7C,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACtE,CAAC","sourcesContent":["/**\n * api asset — `cad.asset(key)` 库函数(A7 消灭后 asset 走 CallRefIR)\n *\n *\n * 嵌套调用 `cad.asset('cfg')` 返回 UTF-8 字符串(SVG 等文本资产)。\n */\n\nimport { getBackends } from '../runtime-state'\n\n/**\n * 查询资产 key 内容为 UTF-8 字符串(SVG 等文本资产)。嵌套调用,供 text/svg 类 op 作资产引用。\n * @group 查询\n * @inputs 0\n * @async true\n * @qual ok\n * @name asset\n * @returns Promise<string> 资产内容字符串(UTF-8 解码)。`cad.asset('cfg')` 返回 SVG 等文本资产,可作 svgExtrude/engrave 的 svg 参数。\n * @param key - 资产 key。type:string required:true\n * @example\n * const svg = await cad.asset('logo_cfg')\n */\nexport async function asset(key: string): Promise<string> {\n const assets = getBackends().assets as { resolveByKey(key: string): Promise<{ bytes: ArrayBuffer }> } | undefined\n if (!assets) {\n throw new Error(`[api/asset] asset \"${key}\" cannot be resolved: assets not available`)\n }\n const result = await assets.resolveByKey(key)\n return new TextDecoder('utf-8').decode(new Uint8Array(result.bytes))\n}\n"]}
|
package/dist/api/boolean.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../src/api/boolean.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../src/api/boolean.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AA6Q1C;;;;;;;;;;;IAWI;AACJ,eAAO,MAAM,KAAK;;CAgBhB,CAAA;AAEF;;;;;;;;;;;;;;;IAeI;AACJ,eAAO,MAAM,GAAG;;CAYd,CAAA;AAEF;;;;;;;;;;;IAWI;AACJ,eAAO,MAAM,QAAQ;;CAanB,CAAA;AAEF;;;;;;;;;;;IAWI;AACJ,eAAO,MAAM,SAAS;;CAiBpB,CAAA"}
|