@pibbl/core 0.0.1
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.txt +19 -0
- package/README.md +76 -0
- package/THIRD_PARTY_NOTICES.txt +205 -0
- package/dist/features/particles/index.d.ts +7 -0
- package/dist/features/particles/index.js +26 -0
- package/dist/features/particles/index.js.map +7 -0
- package/dist/features/particles/index.mjs +1 -0
- package/dist/features/particles/lib/canvas/birth-ledger.d.ts +69 -0
- package/dist/features/particles/lib/canvas/birth-ledger.js +752 -0
- package/dist/features/particles/lib/canvas/birth-ledger.js.map +7 -0
- package/dist/features/particles/lib/canvas/component.d.ts +14 -0
- package/dist/features/particles/lib/canvas/component.js +249 -0
- package/dist/features/particles/lib/canvas/component.js.map +7 -0
- package/dist/features/particles/lib/canvas/executor.d.ts +31 -0
- package/dist/features/particles/lib/canvas/executor.js +537 -0
- package/dist/features/particles/lib/canvas/executor.js.map +7 -0
- package/dist/features/particles/lib/canvas/primitive.d.ts +14 -0
- package/dist/features/particles/lib/canvas/primitive.js +50 -0
- package/dist/features/particles/lib/canvas/primitive.js.map +7 -0
- package/dist/features/particles/lib/canvas/raster-cache.d.ts +13 -0
- package/dist/features/particles/lib/canvas/raster-cache.js +106 -0
- package/dist/features/particles/lib/canvas/raster-cache.js.map +7 -0
- package/dist/features/particles/lib/color.d.ts +7 -0
- package/dist/features/particles/lib/color.js +159 -0
- package/dist/features/particles/lib/color.js.map +7 -0
- package/dist/features/particles/lib/compiler.d.ts +134 -0
- package/dist/features/particles/lib/compiler.js +443 -0
- package/dist/features/particles/lib/compiler.js.map +7 -0
- package/dist/features/particles/lib/curve.d.ts +19 -0
- package/dist/features/particles/lib/curve.js +129 -0
- package/dist/features/particles/lib/curve.js.map +7 -0
- package/dist/features/particles/lib/definition-records.d.ts +58 -0
- package/dist/features/particles/lib/definition-records.js +500 -0
- package/dist/features/particles/lib/definition-records.js.map +7 -0
- package/dist/features/particles/lib/definition.d.ts +18 -0
- package/dist/features/particles/lib/definition.js +602 -0
- package/dist/features/particles/lib/definition.js.map +7 -0
- package/dist/features/particles/lib/emission.d.ts +54 -0
- package/dist/features/particles/lib/emission.js +184 -0
- package/dist/features/particles/lib/emission.js.map +7 -0
- package/dist/features/particles/lib/flow/field.d.ts +81 -0
- package/dist/features/particles/lib/flow/field.js +585 -0
- package/dist/features/particles/lib/flow/field.js.map +7 -0
- package/dist/features/particles/lib/flow/hook.d.ts +158 -0
- package/dist/features/particles/lib/flow/hook.js +215 -0
- package/dist/features/particles/lib/flow/hook.js.map +7 -0
- package/dist/features/particles/lib/flow/population.d.ts +25 -0
- package/dist/features/particles/lib/flow/population.js +104 -0
- package/dist/features/particles/lib/flow/population.js.map +7 -0
- package/dist/features/particles/lib/particle.d.ts +113 -0
- package/dist/features/particles/lib/particle.js +192 -0
- package/dist/features/particles/lib/particle.js.map +7 -0
- package/dist/features/particles/lib/random.d.ts +16 -0
- package/dist/features/particles/lib/random.js +61 -0
- package/dist/features/particles/lib/random.js.map +7 -0
- package/dist/features/particles/lib/sample.d.ts +32 -0
- package/dist/features/particles/lib/sample.js +397 -0
- package/dist/features/particles/lib/sample.js.map +7 -0
- package/dist/features/particles/lib/signal-inputs.d.ts +6 -0
- package/dist/features/particles/lib/signal-inputs.js +41 -0
- package/dist/features/particles/lib/signal-inputs.js.map +7 -0
- package/dist/features/particles/lib/system/binding.d.ts +59 -0
- package/dist/features/particles/lib/system/binding.js +122 -0
- package/dist/features/particles/lib/system/binding.js.map +7 -0
- package/dist/features/particles/lib/system/controller.d.ts +58 -0
- package/dist/features/particles/lib/system/controller.js +1446 -0
- package/dist/features/particles/lib/system/controller.js.map +7 -0
- package/dist/features/particles/lib/system/hook.d.ts +13 -0
- package/dist/features/particles/lib/system/hook.js +52 -0
- package/dist/features/particles/lib/system/hook.js.map +7 -0
- package/dist/features/particles/lib/system/ownership.d.ts +26 -0
- package/dist/features/particles/lib/system/ownership.js +128 -0
- package/dist/features/particles/lib/system/ownership.js.map +7 -0
- package/dist/features/particles/lib/types.d.ts +983 -0
- package/dist/features/physics/2d-geometry.d.ts +216 -0
- package/dist/features/physics/2d-geometry.js +59 -0
- package/dist/features/physics/2d-geometry.js.map +7 -0
- package/dist/features/physics/2d-geometry.mjs +1 -0
- package/dist/features/physics/2d-testing.d.ts +80 -0
- package/dist/features/physics/2d-testing.js +141 -0
- package/dist/features/physics/2d-testing.js.map +7 -0
- package/dist/features/physics/2d-testing.mjs +1 -0
- package/dist/features/physics/2d.d.ts +165 -0
- package/dist/features/physics/2d.js +119 -0
- package/dist/features/physics/2d.js.map +7 -0
- package/dist/features/physics/2d.mjs +1 -0
- package/dist/features/physics/lib/2d/canvas/components.d.ts +46 -0
- package/dist/features/physics/lib/2d/canvas/components.js +212 -0
- package/dist/features/physics/lib/2d/canvas/components.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/custom.d.ts +24 -0
- package/dist/features/physics/lib/2d/canvas/custom.js +45 -0
- package/dist/features/physics/lib/2d/canvas/custom.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/debug.d.ts +23 -0
- package/dist/features/physics/lib/2d/canvas/debug.js +53 -0
- package/dist/features/physics/lib/2d/canvas/debug.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/inference.d.ts +9 -0
- package/dist/features/physics/lib/2d/canvas/inference.js +704 -0
- package/dist/features/physics/lib/2d/canvas/inference.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/presentation.d.ts +11 -0
- package/dist/features/physics/lib/2d/canvas/presentation.js +169 -0
- package/dist/features/physics/lib/2d/canvas/presentation.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/analytic.d.ts +15 -0
- package/dist/features/physics/lib/2d/collision/analytic.js +151 -0
- package/dist/features/physics/lib/2d/collision/analytic.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/casts.d.ts +37 -0
- package/dist/features/physics/lib/2d/collision/casts.js +631 -0
- package/dist/features/physics/lib/2d/collision/casts.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/epa.d.ts +21 -0
- package/dist/features/physics/lib/2d/collision/epa.js +102 -0
- package/dist/features/physics/lib/2d/collision/epa.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/gjk.d.ts +28 -0
- package/dist/features/physics/lib/2d/collision/gjk.js +233 -0
- package/dist/features/physics/lib/2d/collision/gjk.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/manifold.d.ts +35 -0
- package/dist/features/physics/lib/2d/collision/manifold.js +238 -0
- package/dist/features/physics/lib/2d/collision/manifold.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/pairs.d.ts +10 -0
- package/dist/features/physics/lib/2d/collision/pairs.js +285 -0
- package/dist/features/physics/lib/2d/collision/pairs.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/support.d.ts +20 -0
- package/dist/features/physics/lib/2d/collision/support.js +155 -0
- package/dist/features/physics/lib/2d/collision/support.js.map +7 -0
- package/dist/features/physics/lib/2d/inspection-types.d.ts +159 -0
- package/dist/features/physics/lib/2d/math.d.ts +27 -0
- package/dist/features/physics/lib/2d/math.js +314 -0
- package/dist/features/physics/lib/2d/math.js.map +7 -0
- package/dist/features/physics/lib/2d/numeric-policy.d.ts +24 -0
- package/dist/features/physics/lib/2d/numeric-policy.js +51 -0
- package/dist/features/physics/lib/2d/numeric-policy.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.d.ts +148 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.js +305 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/context.d.ts +9 -0
- package/dist/features/physics/lib/2d/runtime/context.js +57 -0
- package/dist/features/physics/lib/2d/runtime/context.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/controller.d.ts +106 -0
- package/dist/features/physics/lib/2d/runtime/controller.js +1317 -0
- package/dist/features/physics/lib/2d/runtime/controller.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.d.ts +153 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.js +526 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/events.d.ts +56 -0
- package/dist/features/physics/lib/2d/runtime/events.js +153 -0
- package/dist/features/physics/lib/2d/runtime/events.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.d.ts +22 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.js +192 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/ownership.d.ts +41 -0
- package/dist/features/physics/lib/2d/runtime/ownership.js +46 -0
- package/dist/features/physics/lib/2d/runtime/ownership.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/trace.d.ts +32 -0
- package/dist/features/physics/lib/2d/runtime/trace.js +22 -0
- package/dist/features/physics/lib/2d/runtime/trace.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/world-component.d.ts +18 -0
- package/dist/features/physics/lib/2d/runtime/world-component.js +41 -0
- package/dist/features/physics/lib/2d/runtime/world-component.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/world-props.d.ts +16 -0
- package/dist/features/physics/lib/2d/shape-records.d.ts +60 -0
- package/dist/features/physics/lib/2d/shape-records.js +26 -0
- package/dist/features/physics/lib/2d/shape-records.js.map +7 -0
- package/dist/features/physics/lib/2d/shapes.d.ts +191 -0
- package/dist/features/physics/lib/2d/shapes.js +543 -0
- package/dist/features/physics/lib/2d/shapes.js.map +7 -0
- package/dist/features/physics/lib/2d/types.d.ts +713 -0
- package/dist/features/physics/lib/2d/types.js +1 -0
- package/dist/features/physics/lib/2d/types.js.map +7 -0
- package/dist/features/physics/lib/2d/world/broad-phase.d.ts +77 -0
- package/dist/features/physics/lib/2d/world/broad-phase.js +762 -0
- package/dist/features/physics/lib/2d/world/broad-phase.js.map +7 -0
- package/dist/features/physics/lib/2d/world/ccd.d.ts +19 -0
- package/dist/features/physics/lib/2d/world/ccd.js +265 -0
- package/dist/features/physics/lib/2d/world/ccd.js.map +7 -0
- package/dist/features/physics/lib/2d/world/contact-cache.d.ts +81 -0
- package/dist/features/physics/lib/2d/world/contact-cache.js +497 -0
- package/dist/features/physics/lib/2d/world/contact-cache.js.map +7 -0
- package/dist/features/physics/lib/2d/world/integrator.d.ts +11 -0
- package/dist/features/physics/lib/2d/world/integrator.js +99 -0
- package/dist/features/physics/lib/2d/world/integrator.js.map +7 -0
- package/dist/features/physics/lib/2d/world/queries.d.ts +62 -0
- package/dist/features/physics/lib/2d/world/queries.js +424 -0
- package/dist/features/physics/lib/2d/world/queries.js.map +7 -0
- package/dist/features/physics/lib/2d/world/rapier-engine.js +7054 -0
- package/dist/features/physics/lib/2d/world/rapier-engine.js.map +7 -0
- package/dist/features/physics/lib/2d/world/rapier.d.ts +50 -0
- package/dist/features/physics/lib/2d/world/rapier.js +655 -0
- package/dist/features/physics/lib/2d/world/rapier.js.map +7 -0
- package/dist/features/physics/lib/2d/world/solver.d.ts +58 -0
- package/dist/features/physics/lib/2d/world/solver.js +660 -0
- package/dist/features/physics/lib/2d/world/solver.js.map +7 -0
- package/dist/features/physics/lib/2d/world/storage.d.ts +96 -0
- package/dist/features/physics/lib/2d/world/storage.js +371 -0
- package/dist/features/physics/lib/2d/world/storage.js.map +7 -0
- package/dist/features/physics/lib/2d/world/world.d.ts +265 -0
- package/dist/features/physics/lib/2d/world/world.js +1713 -0
- package/dist/features/physics/lib/2d/world/world.js.map +7 -0
- package/dist/features/physics/lib/shared/signal-inputs.d.ts +5 -0
- package/dist/features/physics/lib/shared/signal-inputs.js +20 -0
- package/dist/features/physics/lib/shared/signal-inputs.js.map +7 -0
- package/dist/features/physics/lib/shared/validation.d.ts +5 -0
- package/dist/features/physics/lib/shared/validation.js +48 -0
- package/dist/features/physics/lib/shared/validation.js.map +7 -0
- package/dist/features/sprites/formats/aseprite.js +23 -0
- package/dist/features/sprites/formats/aseprite.js.map +7 -0
- package/dist/features/sprites/formats/aseprite.mjs +1 -0
- package/dist/features/sprites/formats/texture-packer.js +14 -0
- package/dist/features/sprites/formats/texture-packer.js.map +7 -0
- package/dist/features/sprites/formats/texture-packer.mjs +1 -0
- package/dist/features/sprites/index.js +9 -0
- package/dist/features/sprites/index.js.map +7 -0
- package/dist/features/sprites/index.mjs +1 -0
- package/dist/features/sprites/loader.js +63 -0
- package/dist/features/sprites/loader.js.map +7 -0
- package/dist/features/sprites/model.js +64 -0
- package/dist/features/sprites/model.js.map +7 -0
- package/dist/features/sprites/sprite.js +31 -0
- package/dist/features/sprites/sprite.js.map +7 -0
- package/dist/features/textures/index.d.ts +22 -0
- package/dist/features/textures/index.js +31 -0
- package/dist/features/textures/index.js.map +7 -0
- package/dist/features/textures/index.mjs +1 -0
- package/dist/features/textures/lib/definitions.d.ts +117 -0
- package/dist/features/textures/lib/definitions.js +179 -0
- package/dist/features/textures/lib/definitions.js.map +7 -0
- package/dist/features/textures/lib/electric-boundary.d.ts +3 -0
- package/dist/features/textures/lib/electric-boundary.js +11 -0
- package/dist/features/textures/lib/electric-boundary.js.map +7 -0
- package/dist/features/textures/lib/electric-shared.d.ts +69 -0
- package/dist/features/textures/lib/electric-shared.js +43 -0
- package/dist/features/textures/lib/electric-shared.js.map +7 -0
- package/dist/features/textures/lib/electric-sources.d.ts +50 -0
- package/dist/features/textures/lib/electric-sources.js +43 -0
- package/dist/features/textures/lib/electric-sources.js.map +7 -0
- package/dist/features/textures/lib/lightning.d.ts +72 -0
- package/dist/features/textures/lib/lightning.js +139 -0
- package/dist/features/textures/lib/lightning.js.map +7 -0
- package/dist/features/textures/lib/material-field.d.ts +12 -0
- package/dist/features/textures/lib/material-field.js +31 -0
- package/dist/features/textures/lib/material-field.js.map +7 -0
- package/dist/features/textures/lib/palette.d.ts +45 -0
- package/dist/features/textures/lib/palette.js +52 -0
- package/dist/features/textures/lib/palette.js.map +7 -0
- package/dist/features/textures/lib/presentation.d.ts +54 -0
- package/dist/features/textures/lib/presentation.js +83 -0
- package/dist/features/textures/lib/presentation.js.map +7 -0
- package/dist/features/textures/lib/procedural-texture.d.ts +44 -0
- package/dist/features/textures/lib/procedural-texture.js +110 -0
- package/dist/features/textures/lib/procedural-texture.js.map +7 -0
- package/dist/features/textures/lib/rain-drops.d.ts +96 -0
- package/dist/features/textures/lib/rain-drops.js +322 -0
- package/dist/features/textures/lib/rain-drops.js.map +7 -0
- package/dist/features/textures/lib/reaction-diffusion.d.ts +67 -0
- package/dist/features/textures/lib/reaction-diffusion.js +210 -0
- package/dist/features/textures/lib/reaction-diffusion.js.map +7 -0
- package/dist/features/textures/lib/simulation.d.ts +16 -0
- package/dist/features/textures/lib/simulation.js +85 -0
- package/dist/features/textures/lib/simulation.js.map +7 -0
- package/dist/features/textures/lib/tendrils.d.ts +57 -0
- package/dist/features/textures/lib/tendrils.js +216 -0
- package/dist/features/textures/lib/tendrils.js.map +7 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/electric.d.ts +88 -0
- package/dist/features/textures/lib/wasm/electric.js +299 -0
- package/dist/features/textures/lib/wasm/electric.js.map +7 -0
- package/dist/features/textures/lib/wasm/ink-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/ink-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/ink-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/marble-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/marble-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/marble-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/memory.d.ts +31 -0
- package/dist/features/textures/lib/wasm/memory.js +103 -0
- package/dist/features/textures/lib/wasm/memory.js.map +7 -0
- package/dist/features/textures/lib/wasm/paper-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/paper-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/paper-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.js.map +7 -0
- package/dist/features/textures/lib/water-surface.d.ts +92 -0
- package/dist/features/textures/lib/water-surface.js +378 -0
- package/dist/features/textures/lib/water-surface.js.map +7 -0
- package/dist/features/textures/lib/water-waves.d.ts +60 -0
- package/dist/features/textures/lib/water-waves.js +154 -0
- package/dist/features/textures/lib/water-waves.js.map +7 -0
- package/dist/features/viz/index.d.ts +28 -0
- package/dist/features/viz/index.js +45 -0
- package/dist/features/viz/index.js.map +7 -0
- package/dist/features/viz/index.mjs +1 -0
- package/dist/features/viz/lib/anchored-layout.d.ts +104 -0
- package/dist/features/viz/lib/anchored-layout.js +166 -0
- package/dist/features/viz/lib/anchored-layout.js.map +7 -0
- package/dist/features/viz/lib/axis.d.ts +10 -0
- package/dist/features/viz/lib/axis.js +116 -0
- package/dist/features/viz/lib/axis.js.map +7 -0
- package/dist/features/viz/lib/band-scale.d.ts +3 -0
- package/dist/features/viz/lib/band-scale.js +57 -0
- package/dist/features/viz/lib/band-scale.js.map +7 -0
- package/dist/features/viz/lib/bar-fill.d.ts +16 -0
- package/dist/features/viz/lib/bar-fill.js +53 -0
- package/dist/features/viz/lib/bar-fill.js.map +7 -0
- package/dist/features/viz/lib/bar-series.d.ts +150 -0
- package/dist/features/viz/lib/bar-series.js +152 -0
- package/dist/features/viz/lib/bar-series.js.map +7 -0
- package/dist/features/viz/lib/hover-card.d.ts +92 -0
- package/dist/features/viz/lib/hover-card.js +146 -0
- package/dist/features/viz/lib/hover-card.js.map +7 -0
- package/dist/features/viz/lib/hover-data.d.ts +12 -0
- package/dist/features/viz/lib/hover-data.js +50 -0
- package/dist/features/viz/lib/hover-data.js.map +7 -0
- package/dist/features/viz/lib/hover-placement.d.ts +46 -0
- package/dist/features/viz/lib/hover-placement.js +51 -0
- package/dist/features/viz/lib/hover-placement.js.map +7 -0
- package/dist/features/viz/lib/hover-queries.d.ts +60 -0
- package/dist/features/viz/lib/hover-queries.js +185 -0
- package/dist/features/viz/lib/hover-queries.js.map +7 -0
- package/dist/features/viz/lib/hover-types.d.ts +277 -0
- package/dist/features/viz/lib/layout-pie.d.ts +13 -0
- package/dist/features/viz/lib/layout-pie.js +159 -0
- package/dist/features/viz/lib/layout-pie.js.map +7 -0
- package/dist/features/viz/lib/line-series.d.ts +11 -0
- package/dist/features/viz/lib/line-series.js +89 -0
- package/dist/features/viz/lib/line-series.js.map +7 -0
- package/dist/features/viz/lib/linear-scale.d.ts +3 -0
- package/dist/features/viz/lib/linear-scale.js +70 -0
- package/dist/features/viz/lib/linear-scale.js.map +7 -0
- package/dist/features/viz/lib/nearest.d.ts +82 -0
- package/dist/features/viz/lib/nearest.js +51 -0
- package/dist/features/viz/lib/nearest.js.map +7 -0
- package/dist/features/viz/lib/paint.d.ts +2 -0
- package/dist/features/viz/lib/paint.js +17 -0
- package/dist/features/viz/lib/paint.js.map +7 -0
- package/dist/features/viz/lib/pie-layout.d.ts +31 -0
- package/dist/features/viz/lib/pie-layout.js +324 -0
- package/dist/features/viz/lib/pie-layout.js.map +7 -0
- package/dist/features/viz/lib/pie-slices.d.ts +51 -0
- package/dist/features/viz/lib/pie-slices.js +50 -0
- package/dist/features/viz/lib/pie-slices.js.map +7 -0
- package/dist/features/viz/lib/pie-types.d.ts +215 -0
- package/dist/features/viz/lib/plot-series.d.ts +13 -0
- package/dist/features/viz/lib/plot-series.js +53 -0
- package/dist/features/viz/lib/plot-series.js.map +7 -0
- package/dist/features/viz/lib/plot-types.d.ts +63 -0
- package/dist/features/viz/lib/point-data.d.ts +5 -0
- package/dist/features/viz/lib/point-data.js +17 -0
- package/dist/features/viz/lib/point-data.js.map +7 -0
- package/dist/features/viz/lib/point-geometry.d.ts +2 -0
- package/dist/features/viz/lib/point-geometry.js +24 -0
- package/dist/features/viz/lib/point-geometry.js.map +7 -0
- package/dist/features/viz/lib/point-series.d.ts +11 -0
- package/dist/features/viz/lib/point-series.js +118 -0
- package/dist/features/viz/lib/point-series.js.map +7 -0
- package/dist/features/viz/lib/point-types.d.ts +94 -0
- package/dist/features/viz/lib/scale-adjust.d.ts +11 -0
- package/dist/features/viz/lib/scale-adjust.js +25 -0
- package/dist/features/viz/lib/scale-adjust.js.map +7 -0
- package/dist/features/viz/lib/scale-context.d.ts +8 -0
- package/dist/features/viz/lib/scale-context.js +61 -0
- package/dist/features/viz/lib/scale-context.js.map +7 -0
- package/dist/features/viz/lib/scale.d.ts +11 -0
- package/dist/features/viz/lib/scale.js +80 -0
- package/dist/features/viz/lib/scale.js.map +7 -0
- package/dist/features/viz/lib/types.d.ts +414 -0
- package/dist/features/viz/lib/use-scale.d.ts +20 -0
- package/dist/features/viz/lib/use-scale.js +10 -0
- package/dist/features/viz/lib/use-scale.js.map +7 -0
- package/dist/filters/displacement-gpu.d.ts +38 -0
- package/dist/filters/displacement-gpu.js +243 -0
- package/dist/filters/displacement-gpu.js.map +7 -0
- package/dist/filters/displacement-math.d.ts +5 -0
- package/dist/filters/displacement-math.js +22 -0
- package/dist/filters/displacement-math.js.map +7 -0
- package/dist/filters/displacement.d.ts +13 -0
- package/dist/filters/displacement.js +65 -0
- package/dist/filters/displacement.js.map +7 -0
- package/dist/filters/filter-executor.d.ts +21 -0
- package/dist/filters/filter-executor.js +120 -0
- package/dist/filters/filter-executor.js.map +7 -0
- package/dist/filters/native-canvas-filter.d.ts +4 -0
- package/dist/filters/native-canvas-filter.js +105 -0
- package/dist/filters/native-canvas-filter.js.map +7 -0
- package/dist/filters/native-color.d.ts +2 -0
- package/dist/filters/native-color.js +200 -0
- package/dist/filters/native-color.js.map +7 -0
- package/dist/filters/native-operations.d.ts +8 -0
- package/dist/filters/native-operations.js +7 -0
- package/dist/filters/native-operations.js.map +7 -0
- package/dist/filters/native.d.ts +113 -0
- package/dist/filters/native.js +115 -0
- package/dist/filters/native.js.map +7 -0
- package/dist/filters/reflected-light.d.ts +12 -0
- package/dist/filters/reflected-light.js +93 -0
- package/dist/filters/reflected-light.js.map +7 -0
- package/dist/filters/reflection-gpu.d.ts +58 -0
- package/dist/filters/reflection-gpu.js +266 -0
- package/dist/filters/reflection-gpu.js.map +7 -0
- package/dist/filters/render-displacement-boundary.d.ts +12 -0
- package/dist/filters/render-displacement-boundary.js +116 -0
- package/dist/filters/render-displacement-boundary.js.map +7 -0
- package/dist/filters/render-reflection-boundary.d.ts +15 -0
- package/dist/filters/render-reflection-boundary.js +127 -0
- package/dist/filters/render-reflection-boundary.js.map +7 -0
- package/dist/filters.d.ts +5 -0
- package/dist/filters.js +29 -0
- package/dist/filters.js.map +7 -0
- package/dist/filters.mjs +1 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +300 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +1 -0
- package/dist/internal.d.ts +160 -0
- package/dist/internal.js +320 -0
- package/dist/internal.js.map +7 -0
- package/dist/internal.mjs +1 -0
- package/dist/jsx-dev-runtime.d.ts +35 -0
- package/dist/jsx-dev-runtime.js +6 -0
- package/dist/jsx-dev-runtime.js.map +7 -0
- package/dist/jsx-dev-runtime.mjs +1 -0
- package/dist/jsx-runtime.d.ts +35 -0
- package/dist/jsx-runtime.js +7 -0
- package/dist/jsx-runtime.js.map +7 -0
- package/dist/jsx-runtime.mjs +1 -0
- package/dist/lib/animation/definition.d.ts +140 -0
- package/dist/lib/animation/definition.js +605 -0
- package/dist/lib/animation/definition.js.map +7 -0
- package/dist/lib/animation/easing.d.ts +55 -0
- package/dist/lib/animation/easing.js +112 -0
- package/dist/lib/animation/easing.js.map +7 -0
- package/dist/lib/animation/evaluate.d.ts +118 -0
- package/dist/lib/animation/evaluate.js +2398 -0
- package/dist/lib/animation/evaluate.js.map +7 -0
- package/dist/lib/animation/playback.d.ts +30 -0
- package/dist/lib/animation/playback.js +932 -0
- package/dist/lib/animation/playback.js.map +7 -0
- package/dist/lib/animation/program.d.ts +145 -0
- package/dist/lib/animation/program.js +741 -0
- package/dist/lib/animation/program.js.map +7 -0
- package/dist/lib/animation/spring.d.ts +30 -0
- package/dist/lib/animation/spring.js +324 -0
- package/dist/lib/animation/spring.js.map +7 -0
- package/dist/lib/animation/types.d.ts +418 -0
- package/dist/lib/animation/writer-leases.d.ts +47 -0
- package/dist/lib/animation/writer-leases.js +314 -0
- package/dist/lib/animation/writer-leases.js.map +7 -0
- package/dist/lib/backend/canvas-2d-backend.d.ts +4 -0
- package/dist/lib/backend/canvas-2d-backend.js +97 -0
- package/dist/lib/backend/canvas-2d-backend.js.map +7 -0
- package/dist/lib/backend/types.d.ts +309 -0
- package/dist/lib/backend/types.js +26 -0
- package/dist/lib/backend/types.js.map +7 -0
- package/dist/lib/components/arc-geometry.d.ts +4 -0
- package/dist/lib/components/arc-geometry.js +46 -0
- package/dist/lib/components/arc-geometry.js.map +7 -0
- package/dist/lib/components/arc.d.ts +55 -0
- package/dist/lib/components/arc.js +91 -0
- package/dist/lib/components/arc.js.map +7 -0
- package/dist/lib/components/circle.d.ts +49 -0
- package/dist/lib/components/circle.js +46 -0
- package/dist/lib/components/circle.js.map +7 -0
- package/dist/lib/components/clip.d.ts +43 -0
- package/dist/lib/components/clip.js +24 -0
- package/dist/lib/components/clip.js.map +7 -0
- package/dist/lib/components/ellipse.d.ts +53 -0
- package/dist/lib/components/ellipse.js +59 -0
- package/dist/lib/components/ellipse.js.map +7 -0
- package/dist/lib/components/g.d.ts +56 -0
- package/dist/lib/components/g.js +24 -0
- package/dist/lib/components/g.js.map +7 -0
- package/dist/lib/components/horizontal-line.d.ts +56 -0
- package/dist/lib/components/horizontal-line.js +71 -0
- package/dist/lib/components/horizontal-line.js.map +7 -0
- package/dist/lib/components/html-box.d.ts +16 -0
- package/dist/lib/components/html-box.js +57 -0
- package/dist/lib/components/html-box.js.map +7 -0
- package/dist/lib/components/img.d.ts +24 -0
- package/dist/lib/components/img.js +150 -0
- package/dist/lib/components/img.js.map +7 -0
- package/dist/lib/components/layer-node-equality.d.ts +65 -0
- package/dist/lib/components/layer-node-equality.js +91 -0
- package/dist/lib/components/layer-node-equality.js.map +7 -0
- package/dist/lib/components/layer.d.ts +34 -0
- package/dist/lib/components/layer.js +172 -0
- package/dist/lib/components/layer.js.map +7 -0
- package/dist/lib/components/line.d.ts +51 -0
- package/dist/lib/components/line.js +76 -0
- package/dist/lib/components/line.js.map +7 -0
- package/dist/lib/components/path.d.ts +28 -0
- package/dist/lib/components/path.js +47 -0
- package/dist/lib/components/path.js.map +7 -0
- package/dist/lib/components/polygon.d.ts +45 -0
- package/dist/lib/components/polygon.js +93 -0
- package/dist/lib/components/polygon.js.map +7 -0
- package/dist/lib/components/rect.d.ts +24 -0
- package/dist/lib/components/rect.js +83 -0
- package/dist/lib/components/rect.js.map +7 -0
- package/dist/lib/components/regular-polygon.d.ts +102 -0
- package/dist/lib/components/regular-polygon.js +112 -0
- package/dist/lib/components/regular-polygon.js.map +7 -0
- package/dist/lib/components/rounded-corner-style.d.ts +7 -0
- package/dist/lib/components/rounded-corner-style.js +40 -0
- package/dist/lib/components/rounded-corner-style.js.map +7 -0
- package/dist/lib/components/shape-style.d.ts +7 -0
- package/dist/lib/components/shape-style.js +52 -0
- package/dist/lib/components/shape-style.js.map +7 -0
- package/dist/lib/components/star.d.ts +56 -0
- package/dist/lib/components/star.js +98 -0
- package/dist/lib/components/star.js.map +7 -0
- package/dist/lib/components/structural-events.d.ts +10 -0
- package/dist/lib/components/structural-events.js +8 -0
- package/dist/lib/components/structural-events.js.map +7 -0
- package/dist/lib/components/svg-path.d.ts +23 -0
- package/dist/lib/components/svg-path.js +25 -0
- package/dist/lib/components/svg-path.js.map +7 -0
- package/dist/lib/components/text-layout.d.ts +31 -0
- package/dist/lib/components/text-layout.js +139 -0
- package/dist/lib/components/text-layout.js.map +7 -0
- package/dist/lib/components/text.d.ts +29 -0
- package/dist/lib/components/text.js +174 -0
- package/dist/lib/components/text.js.map +7 -0
- package/dist/lib/components/vertical-line.d.ts +57 -0
- package/dist/lib/components/vertical-line.js +71 -0
- package/dist/lib/components/vertical-line.js.map +7 -0
- package/dist/lib/components/wedge.d.ts +55 -0
- package/dist/lib/components/wedge.js +93 -0
- package/dist/lib/components/wedge.js.map +7 -0
- package/dist/lib/define-primitive.d.ts +82 -0
- package/dist/lib/define-primitive.js +85 -0
- package/dist/lib/define-primitive.js.map +7 -0
- package/dist/lib/development.d.ts +2 -0
- package/dist/lib/development.js +5 -0
- package/dist/lib/development.js.map +7 -0
- package/dist/lib/element/children.d.ts +16 -0
- package/dist/lib/element/children.js +333 -0
- package/dist/lib/element/children.js.map +7 -0
- package/dist/lib/element/create-element.d.ts +34 -0
- package/dist/lib/element/create-element.js +75 -0
- package/dist/lib/element/create-element.js.map +7 -0
- package/dist/lib/element/fragment.d.ts +15 -0
- package/dist/lib/element/fragment.js +11 -0
- package/dist/lib/element/fragment.js.map +7 -0
- package/dist/lib/element/jsx-runtime.d.ts +48 -0
- package/dist/lib/element/jsx-runtime.js +16 -0
- package/dist/lib/element/jsx-runtime.js.map +7 -0
- package/dist/lib/element/metadata.d.ts +96 -0
- package/dist/lib/element/metadata.js +160 -0
- package/dist/lib/element/metadata.js.map +7 -0
- package/dist/lib/element/resolve-primitive-inputs.d.ts +12 -0
- package/dist/lib/element/resolve-primitive-inputs.js +83 -0
- package/dist/lib/element/resolve-primitive-inputs.js.map +7 -0
- package/dist/lib/element/types.d.ts +123 -0
- package/dist/lib/element-enhancers.d.ts +134 -0
- package/dist/lib/element-enhancers.js +193 -0
- package/dist/lib/element-enhancers.js.map +7 -0
- package/dist/lib/events/adapters/clipboard.d.ts +9 -0
- package/dist/lib/events/adapters/clipboard.js +23 -0
- package/dist/lib/events/adapters/clipboard.js.map +7 -0
- package/dist/lib/events/adapters/drag.d.ts +12 -0
- package/dist/lib/events/adapters/drag.js +29 -0
- package/dist/lib/events/adapters/drag.js.map +7 -0
- package/dist/lib/events/adapters/editing.d.ts +15 -0
- package/dist/lib/events/adapters/editing.js +41 -0
- package/dist/lib/events/adapters/editing.js.map +7 -0
- package/dist/lib/events/adapters/keyboard-focus.d.ts +12 -0
- package/dist/lib/events/adapters/keyboard-focus.js +36 -0
- package/dist/lib/events/adapters/keyboard-focus.js.map +7 -0
- package/dist/lib/events/adapters/mouse.d.ts +17 -0
- package/dist/lib/events/adapters/mouse.js +32 -0
- package/dist/lib/events/adapters/mouse.js.map +7 -0
- package/dist/lib/events/adapters/pointer.d.ts +19 -0
- package/dist/lib/events/adapters/pointer.js +40 -0
- package/dist/lib/events/adapters/pointer.js.map +7 -0
- package/dist/lib/events/adapters/touch.d.ts +16 -0
- package/dist/lib/events/adapters/touch.js +36 -0
- package/dist/lib/events/adapters/touch.js.map +7 -0
- package/dist/lib/events/adapters/wheel.d.ts +10 -0
- package/dist/lib/events/adapters/wheel.js +16 -0
- package/dist/lib/events/adapters/wheel.js.map +7 -0
- package/dist/lib/events/boundary-transitions.d.ts +9 -0
- package/dist/lib/events/boundary-transitions.js +16 -0
- package/dist/lib/events/boundary-transitions.js.map +7 -0
- package/dist/lib/events/dispatch.d.ts +21 -0
- package/dist/lib/events/dispatch.js +1078 -0
- package/dist/lib/events/dispatch.js.map +7 -0
- package/dist/lib/events/event-definitions.d.ts +23 -0
- package/dist/lib/events/event-definitions.js +74 -0
- package/dist/lib/events/event-definitions.js.map +7 -0
- package/dist/lib/events/event-facade.d.ts +19 -0
- package/dist/lib/events/event-facade.js +188 -0
- package/dist/lib/events/event-facade.js.map +7 -0
- package/dist/lib/events/event-path.d.ts +3 -0
- package/dist/lib/events/event-path.js +43 -0
- package/dist/lib/events/event-path.js.map +7 -0
- package/dist/lib/events/hit-test.d.ts +13 -0
- package/dist/lib/events/hit-test.js +135 -0
- package/dist/lib/events/hit-test.js.map +7 -0
- package/dist/lib/events/native-listener-hub.d.ts +10 -0
- package/dist/lib/events/native-listener-hub.js +72 -0
- package/dist/lib/events/native-listener-hub.js.map +7 -0
- package/dist/lib/events/paint-entry.d.ts +66 -0
- package/dist/lib/events/paint-entry.js +30 -0
- package/dist/lib/events/paint-entry.js.map +7 -0
- package/dist/lib/events/pointer-capture.d.ts +23 -0
- package/dist/lib/events/pointer-capture.js +339 -0
- package/dist/lib/events/pointer-capture.js.map +7 -0
- package/dist/lib/events/propagation.d.ts +7 -0
- package/dist/lib/events/propagation.js +56 -0
- package/dist/lib/events/propagation.js.map +7 -0
- package/dist/lib/events/registrations.d.ts +120 -0
- package/dist/lib/events/registrations.js +397 -0
- package/dist/lib/events/registrations.js.map +7 -0
- package/dist/lib/events/resolver-input.d.ts +25 -0
- package/dist/lib/events/resolver-input.js +62 -0
- package/dist/lib/events/resolver-input.js.map +7 -0
- package/dist/lib/events/types.d.ts +596 -0
- package/dist/lib/execute-render.d.ts +9 -0
- package/dist/lib/execute-render.js +195 -0
- package/dist/lib/execute-render.js.map +7 -0
- package/dist/lib/filter/canvas-state.d.ts +2 -0
- package/dist/lib/filter/canvas-state.js +31 -0
- package/dist/lib/filter/canvas-state.js.map +7 -0
- package/dist/lib/filter/filter-region.d.ts +33 -0
- package/dist/lib/filter/filter-region.js +291 -0
- package/dist/lib/filter/filter-region.js.map +7 -0
- package/dist/lib/filter/filter-surface-pool.d.ts +38 -0
- package/dist/lib/filter/filter-surface-pool.js +252 -0
- package/dist/lib/filter/filter-surface-pool.js.map +7 -0
- package/dist/lib/filter/render-filter-boundary.d.ts +14 -0
- package/dist/lib/filter/render-filter-boundary.js +211 -0
- package/dist/lib/filter/render-filter-boundary.js.map +7 -0
- package/dist/lib/focus/directional-navigation.d.ts +12 -0
- package/dist/lib/focus/directional-navigation.js +86 -0
- package/dist/lib/focus/directional-navigation.js.map +7 -0
- package/dist/lib/focus/dom-focus-host.d.ts +13 -0
- package/dist/lib/focus/dom-focus-host.js +352 -0
- package/dist/lib/focus/dom-focus-host.js.map +7 -0
- package/dist/lib/focus/dom-tab-stops.d.ts +3 -0
- package/dist/lib/focus/dom-tab-stops.js +71 -0
- package/dist/lib/focus/dom-tab-stops.js.map +7 -0
- package/dist/lib/focus/focus-events.d.ts +4 -0
- package/dist/lib/focus/focus-events.js +78 -0
- package/dist/lib/focus/focus-events.js.map +7 -0
- package/dist/lib/focus/focus-manager.d.ts +121 -0
- package/dist/lib/focus/focus-manager.js +1131 -0
- package/dist/lib/focus/focus-manager.js.map +7 -0
- package/dist/lib/focus/geometry.d.ts +4 -0
- package/dist/lib/focus/geometry.js +64 -0
- package/dist/lib/focus/geometry.js.map +7 -0
- package/dist/lib/focus/html-focus-region.d.ts +27 -0
- package/dist/lib/focus/keyboard-defaults.d.ts +7 -0
- package/dist/lib/focus/keyboard-defaults.js +110 -0
- package/dist/lib/focus/keyboard-defaults.js.map +7 -0
- package/dist/lib/focus/policy-components.d.ts +45 -0
- package/dist/lib/focus/policy-components.js +94 -0
- package/dist/lib/focus/policy-components.js.map +7 -0
- package/dist/lib/focus/types.d.ts +37 -0
- package/dist/lib/focus/types.js +7 -0
- package/dist/lib/focus/types.js.map +7 -0
- package/dist/lib/geometry/circle.d.ts +22 -0
- package/dist/lib/geometry/circle.js +13 -0
- package/dist/lib/geometry/circle.js.map +7 -0
- package/dist/lib/geometry/circular-sweep.d.ts +54 -0
- package/dist/lib/geometry/circular-sweep.js +95 -0
- package/dist/lib/geometry/circular-sweep.js.map +7 -0
- package/dist/lib/geometry/ellipse.d.ts +26 -0
- package/dist/lib/geometry/ellipse.js +17 -0
- package/dist/lib/geometry/ellipse.js.map +7 -0
- package/dist/lib/geometry/line.d.ts +20 -0
- package/dist/lib/geometry/line.js +15 -0
- package/dist/lib/geometry/line.js.map +7 -0
- package/dist/lib/geometry/path-arc.d.ts +25 -0
- package/dist/lib/geometry/path-arc.js +57 -0
- package/dist/lib/geometry/path-arc.js.map +7 -0
- package/dist/lib/geometry/path-bend-guide.d.ts +31 -0
- package/dist/lib/geometry/path-bend-guide.js +282 -0
- package/dist/lib/geometry/path-bend-guide.js.map +7 -0
- package/dist/lib/geometry/path-bend-spans.d.ts +31 -0
- package/dist/lib/geometry/path-bend-spans.js +109 -0
- package/dist/lib/geometry/path-bend-spans.js.map +7 -0
- package/dist/lib/geometry/path-bending.d.ts +90 -0
- package/dist/lib/geometry/path-bending.js +202 -0
- package/dist/lib/geometry/path-bending.js.map +7 -0
- package/dist/lib/geometry/path-conversion.d.ts +19 -0
- package/dist/lib/geometry/path-conversion.js +114 -0
- package/dist/lib/geometry/path-conversion.js.map +7 -0
- package/dist/lib/geometry/path-geometry.d.ts +218 -0
- package/dist/lib/geometry/path-geometry.js +557 -0
- package/dist/lib/geometry/path-geometry.js.map +7 -0
- package/dist/lib/geometry/path-radial.d.ts +15 -0
- package/dist/lib/geometry/path-radial.js +107 -0
- package/dist/lib/geometry/path-radial.js.map +7 -0
- package/dist/lib/geometry/path-transforms.d.ts +233 -0
- package/dist/lib/geometry/path-transforms.js +478 -0
- package/dist/lib/geometry/path-transforms.js.map +7 -0
- package/dist/lib/geometry/path-utilities.d.ts +78 -0
- package/dist/lib/geometry/path-utilities.js +341 -0
- package/dist/lib/geometry/path-utilities.js.map +7 -0
- package/dist/lib/geometry/path-wang.d.ts +18 -0
- package/dist/lib/geometry/path-wang.js +136 -0
- package/dist/lib/geometry/path-wang.js.map +7 -0
- package/dist/lib/geometry/path-warp-bezier.d.ts +17 -0
- package/dist/lib/geometry/path-warp-bezier.js +109 -0
- package/dist/lib/geometry/path-warp-bezier.js.map +7 -0
- package/dist/lib/geometry/path-warp.d.ts +27 -0
- package/dist/lib/geometry/path-warp.js +165 -0
- package/dist/lib/geometry/path-warp.js.map +7 -0
- package/dist/lib/geometry/polygon.d.ts +21 -0
- package/dist/lib/geometry/polygon.js +12 -0
- package/dist/lib/geometry/polygon.js.map +7 -0
- package/dist/lib/geometry/rectangle.d.ts +38 -0
- package/dist/lib/geometry/rectangle.js +22 -0
- package/dist/lib/geometry/rectangle.js.map +7 -0
- package/dist/lib/geometry/regular-polygon.d.ts +88 -0
- package/dist/lib/geometry/regular-polygon.js +67 -0
- package/dist/lib/geometry/regular-polygon.js.map +7 -0
- package/dist/lib/geometry/resolve-path.d.ts +4 -0
- package/dist/lib/geometry/resolve-path.js +16 -0
- package/dist/lib/geometry/resolve-path.js.map +7 -0
- package/dist/lib/geometry/rounded-corners.d.ts +28 -0
- package/dist/lib/geometry/rounded-corners.js +118 -0
- package/dist/lib/geometry/rounded-corners.js.map +7 -0
- package/dist/lib/geometry/star.d.ts +39 -0
- package/dist/lib/geometry/star.js +90 -0
- package/dist/lib/geometry/star.js.map +7 -0
- package/dist/lib/geometry/svg-path.d.ts +21 -0
- package/dist/lib/geometry/svg-path.js +7 -0
- package/dist/lib/geometry/svg-path.js.map +7 -0
- package/dist/lib/geometry/transform-bend.d.ts +46 -0
- package/dist/lib/geometry/transform-bend.js +219 -0
- package/dist/lib/geometry/transform-bend.js.map +7 -0
- package/dist/lib/geometry/transform-guide.d.ts +57 -0
- package/dist/lib/geometry/transform-guide.js +157 -0
- package/dist/lib/geometry/transform-guide.js.map +7 -0
- package/dist/lib/geometry/transform-math.d.ts +21 -0
- package/dist/lib/geometry/transform-math.js +91 -0
- package/dist/lib/geometry/transform-math.js.map +7 -0
- package/dist/lib/geometry/transform-mesh.d.ts +39 -0
- package/dist/lib/geometry/transform-mesh.js +129 -0
- package/dist/lib/geometry/transform-mesh.js.map +7 -0
- package/dist/lib/geometry/validation.d.ts +6 -0
- package/dist/lib/geometry/validation.js +42 -0
- package/dist/lib/geometry/validation.js.map +7 -0
- package/dist/lib/global-state.d.ts +63 -0
- package/dist/lib/global-state.js +176 -0
- package/dist/lib/global-state.js.map +7 -0
- package/dist/lib/hooks/hook-slot.d.ts +30 -0
- package/dist/lib/hooks/hook-slot.js +66 -0
- package/dist/lib/hooks/hook-slot.js.map +7 -0
- package/dist/lib/hooks/use-animated-value.d.ts +24 -0
- package/dist/lib/hooks/use-animated-value.js +169 -0
- package/dist/lib/hooks/use-animated-value.js.map +7 -0
- package/dist/lib/hooks/use-canvas-context.d.ts +10 -0
- package/dist/lib/hooks/use-canvas-context.js +13 -0
- package/dist/lib/hooks/use-canvas-context.js.map +7 -0
- package/dist/lib/hooks/use-computed.d.ts +13 -0
- package/dist/lib/hooks/use-computed.js +91 -0
- package/dist/lib/hooks/use-computed.js.map +7 -0
- package/dist/lib/hooks/use-const.d.ts +10 -0
- package/dist/lib/hooks/use-const.js +15 -0
- package/dist/lib/hooks/use-const.js.map +7 -0
- package/dist/lib/hooks/use-cursor.d.ts +16 -0
- package/dist/lib/hooks/use-cursor.js +51 -0
- package/dist/lib/hooks/use-cursor.js.map +7 -0
- package/dist/lib/hooks/use-event-listener.d.ts +10 -0
- package/dist/lib/hooks/use-event-listener.js +24 -0
- package/dist/lib/hooks/use-event-listener.js.map +7 -0
- package/dist/lib/hooks/use-event-target.d.ts +14 -0
- package/dist/lib/hooks/use-event-target.js +30 -0
- package/dist/lib/hooks/use-event-target.js.map +7 -0
- package/dist/lib/hooks/use-layout-box.d.ts +9 -0
- package/dist/lib/hooks/use-layout-box.js +8 -0
- package/dist/lib/hooks/use-layout-box.js.map +7 -0
- package/dist/lib/hooks/use-line-path.d.ts +14 -0
- package/dist/lib/hooks/use-line-path.js +13 -0
- package/dist/lib/hooks/use-line-path.js.map +7 -0
- package/dist/lib/hooks/use-paint-target.d.ts +3 -0
- package/dist/lib/hooks/use-paint-target.js +34 -0
- package/dist/lib/hooks/use-paint-target.js.map +7 -0
- package/dist/lib/hooks/use-playback.d.ts +21 -0
- package/dist/lib/hooks/use-playback.js +87 -0
- package/dist/lib/hooks/use-playback.js.map +7 -0
- package/dist/lib/hooks/use-reaction.d.ts +19 -0
- package/dist/lib/hooks/use-reaction.js +245 -0
- package/dist/lib/hooks/use-reaction.js.map +7 -0
- package/dist/lib/hooks/use-rect-path.d.ts +20 -0
- package/dist/lib/hooks/use-rect-path.js +25 -0
- package/dist/lib/hooks/use-rect-path.js.map +7 -0
- package/dist/lib/hooks/use-ref.d.ts +17 -0
- package/dist/lib/hooks/use-ref.js +8 -0
- package/dist/lib/hooks/use-ref.js.map +7 -0
- package/dist/lib/hooks/use-region.d.ts +11 -0
- package/dist/lib/hooks/use-region.js +34 -0
- package/dist/lib/hooks/use-region.js.map +7 -0
- package/dist/lib/hooks/use-signal.d.ts +12 -0
- package/dist/lib/hooks/use-signal.js +12 -0
- package/dist/lib/hooks/use-signal.js.map +7 -0
- package/dist/lib/hooks/use-svg-path.d.ts +11 -0
- package/dist/lib/hooks/use-svg-path.js +13 -0
- package/dist/lib/hooks/use-svg-path.js.map +7 -0
- package/dist/lib/hooks/use-value-memo-slot.d.ts +12 -0
- package/dist/lib/hooks/use-value-memo-slot.js +45 -0
- package/dist/lib/hooks/use-value-memo-slot.js.map +7 -0
- package/dist/lib/hooks/use-visibility-transition.d.ts +103 -0
- package/dist/lib/hooks/use-visibility-transition.js +195 -0
- package/dist/lib/hooks/use-visibility-transition.js.map +7 -0
- package/dist/lib/html/html-service.d.ts +30 -0
- package/dist/lib/html/html-service.js +281 -0
- package/dist/lib/html/html-service.js.map +7 -0
- package/dist/lib/html/overlay-config.d.ts +3 -0
- package/dist/lib/html/overlay-config.js +37 -0
- package/dist/lib/html/overlay-config.js.map +7 -0
- package/dist/lib/html/portable-clips.d.ts +4 -0
- package/dist/lib/html/portable-clips.js +20 -0
- package/dist/lib/html/portable-clips.js.map +7 -0
- package/dist/lib/html/types.d.ts +110 -0
- package/dist/lib/layout/absolute.d.ts +57 -0
- package/dist/lib/layout/absolute.js +348 -0
- package/dist/lib/layout/absolute.js.map +7 -0
- package/dist/lib/layout/box.d.ts +19 -0
- package/dist/lib/layout/box.js +209 -0
- package/dist/lib/layout/box.js.map +7 -0
- package/dist/lib/layout/context.d.ts +13 -0
- package/dist/lib/layout/context.js +42 -0
- package/dist/lib/layout/context.js.map +7 -0
- package/dist/lib/layout/diagnostics.d.ts +15 -0
- package/dist/lib/layout/diagnostics.js +30 -0
- package/dist/lib/layout/diagnostics.js.map +7 -0
- package/dist/lib/layout/flex.d.ts +64 -0
- package/dist/lib/layout/flex.js +803 -0
- package/dist/lib/layout/flex.js.map +7 -0
- package/dist/lib/layout/flow.d.ts +53 -0
- package/dist/lib/layout/flow.js +400 -0
- package/dist/lib/layout/flow.js.map +7 -0
- package/dist/lib/layout/grid.d.ts +64 -0
- package/dist/lib/layout/grid.js +597 -0
- package/dist/lib/layout/grid.js.map +7 -0
- package/dist/lib/layout/measure.d.ts +19 -0
- package/dist/lib/layout/measure.js +144 -0
- package/dist/lib/layout/measure.js.map +7 -0
- package/dist/lib/layout/overlay.d.ts +42 -0
- package/dist/lib/layout/overlay.js +151 -0
- package/dist/lib/layout/overlay.js.map +7 -0
- package/dist/lib/layout/place-child.d.ts +12 -0
- package/dist/lib/layout/place-child.js +72 -0
- package/dist/lib/layout/place-child.js.map +7 -0
- package/dist/lib/layout/positioning-diagnostics.d.ts +3 -0
- package/dist/lib/layout/positioning-diagnostics.js +15 -0
- package/dist/lib/layout/positioning-diagnostics.js.map +7 -0
- package/dist/lib/layout/types.d.ts +78 -0
- package/dist/lib/manipulation/controller-types.d.ts +299 -0
- package/dist/lib/manipulation/controller.d.ts +57 -0
- package/dist/lib/manipulation/controller.js +464 -0
- package/dist/lib/manipulation/controller.js.map +7 -0
- package/dist/lib/manipulation/coordinates.d.ts +9 -0
- package/dist/lib/manipulation/coordinates.js +55 -0
- package/dist/lib/manipulation/coordinates.js.map +7 -0
- package/dist/lib/manipulation/degrees.d.ts +10 -0
- package/dist/lib/manipulation/degrees.js +9 -0
- package/dist/lib/manipulation/degrees.js.map +7 -0
- package/dist/lib/manipulation/frame.d.ts +24 -0
- package/dist/lib/manipulation/frame.js +101 -0
- package/dist/lib/manipulation/frame.js.map +7 -0
- package/dist/lib/manipulation/geometry.d.ts +4 -0
- package/dist/lib/manipulation/geometry.js +26 -0
- package/dist/lib/manipulation/geometry.js.map +7 -0
- package/dist/lib/manipulation/handles.d.ts +298 -0
- package/dist/lib/manipulation/handles.js +598 -0
- package/dist/lib/manipulation/handles.js.map +7 -0
- package/dist/lib/manipulation/manipulable.d.ts +65 -0
- package/dist/lib/manipulation/manipulable.js +47 -0
- package/dist/lib/manipulation/manipulable.js.map +7 -0
- package/dist/lib/manipulation/ownership.d.ts +15 -0
- package/dist/lib/manipulation/ownership.js +80 -0
- package/dist/lib/manipulation/ownership.js.map +7 -0
- package/dist/lib/manipulation/snap.d.ts +6 -0
- package/dist/lib/manipulation/snap.js +40 -0
- package/dist/lib/manipulation/snap.js.map +7 -0
- package/dist/lib/manipulation/solve.d.ts +2 -0
- package/dist/lib/manipulation/solve.js +563 -0
- package/dist/lib/manipulation/solve.js.map +7 -0
- package/dist/lib/manipulation/types.d.ts +178 -0
- package/dist/lib/mount-pibbl.d.ts +25 -0
- package/dist/lib/mount-pibbl.js +278 -0
- package/dist/lib/mount-pibbl.js.map +7 -0
- package/dist/lib/optional-services.d.ts +8 -0
- package/dist/lib/optional-services.js +11 -0
- package/dist/lib/optional-services.js.map +7 -0
- package/dist/lib/pibbl.d.ts +17 -0
- package/dist/lib/pibbl.js +21 -0
- package/dist/lib/pibbl.js.map +7 -0
- package/dist/lib/primitive-presentation.d.ts +24 -0
- package/dist/lib/primitive-presentation.js +102 -0
- package/dist/lib/primitive-presentation.js.map +7 -0
- package/dist/lib/render-layer/controller.d.ts +67 -0
- package/dist/lib/render-layer/controller.js +603 -0
- package/dist/lib/render-layer/controller.js.map +7 -0
- package/dist/lib/render-layer/define-render-layer.d.ts +17 -0
- package/dist/lib/render-layer/define-render-layer.js +90 -0
- package/dist/lib/render-layer/define-render-layer.js.map +7 -0
- package/dist/lib/render-layer/types.d.ts +315 -0
- package/dist/lib/render-target.d.ts +27 -0
- package/dist/lib/render-target.js +118 -0
- package/dist/lib/render-target.js.map +7 -0
- package/dist/lib/render-transaction.d.ts +10 -0
- package/dist/lib/render-transaction.js +46 -0
- package/dist/lib/render-transaction.js.map +7 -0
- package/dist/lib/render.d.ts +3 -0
- package/dist/lib/render.js +385 -0
- package/dist/lib/render.js.map +7 -0
- package/dist/lib/scheduler/realm-scheduler.d.ts +52 -0
- package/dist/lib/scheduler/realm-scheduler.js +964 -0
- package/dist/lib/scheduler/realm-scheduler.js.map +7 -0
- package/dist/lib/scheduler/renderer-participant.d.ts +257 -0
- package/dist/lib/scheduler/renderer-participant.js +216 -0
- package/dist/lib/scheduler/renderer-participant.js.map +7 -0
- package/dist/lib/scheduler/simulation-participant.d.ts +103 -0
- package/dist/lib/scheduler/simulation-participant.js +229 -0
- package/dist/lib/scheduler/simulation-participant.js.map +7 -0
- package/dist/lib/scheduler/testing.d.ts +56 -0
- package/dist/lib/scheduler/testing.js +71 -0
- package/dist/lib/scheduler/testing.js.map +7 -0
- package/dist/lib/scheduler/types.d.ts +103 -0
- package/dist/lib/signals/edge.d.ts +44 -0
- package/dist/lib/signals/edge.js +245 -0
- package/dist/lib/signals/edge.js.map +7 -0
- package/dist/lib/signals/graph.d.ts +220 -0
- package/dist/lib/signals/graph.js +1035 -0
- package/dist/lib/signals/graph.js.map +7 -0
- package/dist/lib/signals/input-provision.d.ts +3 -0
- package/dist/lib/signals/input-provision.js +67 -0
- package/dist/lib/signals/input-provision.js.map +7 -0
- package/dist/lib/signals/render-consumer.d.ts +21 -0
- package/dist/lib/signals/render-consumer.js +218 -0
- package/dist/lib/signals/render-consumer.js.map +7 -0
- package/dist/lib/signals/resolve-signal-value.d.ts +10 -0
- package/dist/lib/signals/resolve-signal-value.js +17 -0
- package/dist/lib/signals/resolve-signal-value.js.map +7 -0
- package/dist/lib/signals/types.d.ts +80 -0
- package/dist/lib/style/diagnostics.d.ts +83 -0
- package/dist/lib/style/diagnostics.js +63 -0
- package/dist/lib/style/diagnostics.js.map +7 -0
- package/dist/lib/style/empty-style.d.ts +3 -0
- package/dist/lib/style/empty-style.js +5 -0
- package/dist/lib/style/empty-style.js.map +7 -0
- package/dist/lib/style/filter-types.d.ts +243 -0
- package/dist/lib/style/filter-types.js +5 -0
- package/dist/lib/style/filter-types.js.map +7 -0
- package/dist/lib/style/filter.d.ts +7 -0
- package/dist/lib/style/filter.js +50 -0
- package/dist/lib/style/filter.js.map +7 -0
- package/dist/lib/style/normalize.d.ts +18 -0
- package/dist/lib/style/normalize.js +50 -0
- package/dist/lib/style/normalize.js.map +7 -0
- package/dist/lib/style/positioning.d.ts +32 -0
- package/dist/lib/style/positioning.js +81 -0
- package/dist/lib/style/positioning.js.map +7 -0
- package/dist/lib/style/resolve-built-in.d.ts +6 -0
- package/dist/lib/style/resolve-built-in.js +58 -0
- package/dist/lib/style/resolve-built-in.js.map +7 -0
- package/dist/lib/style/resolve-dispatch.d.ts +20 -0
- package/dist/lib/style/resolve-dispatch.js +167 -0
- package/dist/lib/style/resolve-dispatch.js.map +7 -0
- package/dist/lib/style/resolve-length.d.ts +16 -0
- package/dist/lib/style/resolve-length.js +54 -0
- package/dist/lib/style/resolve-length.js.map +7 -0
- package/dist/lib/style/responsive.d.ts +31 -0
- package/dist/lib/style/responsive.js +172 -0
- package/dist/lib/style/responsive.js.map +7 -0
- package/dist/lib/style/types.d.ts +338 -0
- package/dist/lib/surface/resolve-surface.d.ts +4 -0
- package/dist/lib/surface/resolve-surface.js +184 -0
- package/dist/lib/surface/resolve-surface.js.map +7 -0
- package/dist/lib/surface/root-surface.d.ts +7 -0
- package/dist/lib/surface/root-surface.js +171 -0
- package/dist/lib/surface/root-surface.js.map +7 -0
- package/dist/lib/surface/transform.d.ts +4 -0
- package/dist/lib/surface/transform.js +16 -0
- package/dist/lib/surface/transform.js.map +7 -0
- package/dist/lib/surface/types.d.ts +132 -0
- package/dist/lib/teardowns.d.ts +14 -0
- package/dist/lib/teardowns.js +50 -0
- package/dist/lib/teardowns.js.map +7 -0
- package/dist/lib/textures/texture-protocol.d.ts +124 -0
- package/dist/lib/textures/texture-protocol.js +40 -0
- package/dist/lib/textures/texture-protocol.js.map +7 -0
- package/dist/lib/textures/texture.d.ts +170 -0
- package/dist/lib/textures/texture.js +385 -0
- package/dist/lib/textures/texture.js.map +7 -0
- package/dist/lib/transitions/bifrost.d.ts +47 -0
- package/dist/lib/transitions/bifrost.js +91 -0
- package/dist/lib/transitions/bifrost.js.map +7 -0
- package/dist/lib/transitions/binding.d.ts +14 -0
- package/dist/lib/transitions/binding.js +35 -0
- package/dist/lib/transitions/binding.js.map +7 -0
- package/dist/lib/transitions/capture.d.ts +21 -0
- package/dist/lib/transitions/capture.js +91 -0
- package/dist/lib/transitions/capture.js.map +7 -0
- package/dist/lib/transitions/common.d.ts +130 -0
- package/dist/lib/transitions/common.js +57 -0
- package/dist/lib/transitions/common.js.map +7 -0
- package/dist/lib/transitions/define-transition.d.ts +64 -0
- package/dist/lib/transitions/define-transition.js +31 -0
- package/dist/lib/transitions/define-transition.js.map +7 -0
- package/dist/lib/transitions/embers-physics.d.ts +114 -0
- package/dist/lib/transitions/embers-physics.js +161 -0
- package/dist/lib/transitions/embers-physics.js.map +7 -0
- package/dist/lib/transitions/embers.d.ts +67 -0
- package/dist/lib/transitions/embers.js +196 -0
- package/dist/lib/transitions/embers.js.map +7 -0
- package/dist/lib/transitions/fade.d.ts +41 -0
- package/dist/lib/transitions/fade.js +31 -0
- package/dist/lib/transitions/fade.js.map +7 -0
- package/dist/lib/transitions/hologram.d.ts +47 -0
- package/dist/lib/transitions/hologram.js +94 -0
- package/dist/lib/transitions/hologram.js.map +7 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.js +5 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.d.ts +1 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.js +27 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.js.map +7 -0
- package/dist/lib/transitions/wasm/embers-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/embers-bytes.js +5 -0
- package/dist/lib/transitions/wasm/embers-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/hologram-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/hologram-bytes.js +5 -0
- package/dist/lib/transitions/wasm/hologram-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/kernel.d.ts +7 -0
- package/dist/lib/transitions/wasm/kernel.js +26 -0
- package/dist/lib/transitions/wasm/kernel.js.map +7 -0
- package/dist/lib/types.d.ts +570 -0
- package/dist/lib/update.d.ts +8 -0
- package/dist/lib/update.js +20 -0
- package/dist/lib/update.js.map +7 -0
- package/dist/lib/util/get-2d-context.d.ts +2 -0
- package/dist/lib/util/get-2d-context.js +11 -0
- package/dist/lib/util/get-2d-context.js.map +7 -0
- package/dist/lib/util/get-mouse-coordinates.d.ts +2 -0
- package/dist/lib/util/get-mouse-coordinates.js +32 -0
- package/dist/lib/util/get-mouse-coordinates.js.map +7 -0
- package/dist/lib/util/is-hit.d.ts +11 -0
- package/dist/lib/util/is-hit.js +52 -0
- package/dist/lib/util/is-hit.js.map +7 -0
- package/dist/lib/util/is-transparent.d.ts +1 -0
- package/dist/lib/util/is-transparent.js +8 -0
- package/dist/lib/util/is-transparent.js.map +7 -0
- package/dist/lib/util/pixel-grid-adjustments.d.ts +8 -0
- package/dist/lib/util/pixel-grid-adjustments.js +28 -0
- package/dist/lib/util/pixel-grid-adjustments.js.map +7 -0
- package/dist/lib/util/push-clipping-path.d.ts +6 -0
- package/dist/lib/util/push-clipping-path.js +28 -0
- package/dist/lib/util/push-clipping-path.js.map +7 -0
- package/dist/lib/util/wire-common-events.d.ts +2 -0
- package/dist/lib/util/wire-common-events.js +15 -0
- package/dist/lib/util/wire-common-events.js.map +7 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +7 -0
- package/dist/types.mjs +1 -0
- package/package.json +149 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { ellipseParameters, singularArcPoints } from "./path-arc.js";
|
|
2
|
+
import { bendSpanBounds, bendSpanPoint, bendSpans, splitBendSpan } from "./path-bend-spans.js";
|
|
3
|
+
const MAX_GUIDE_WORK = 2e6;
|
|
4
|
+
const MAX_GUIDE_LEAVES = 131072;
|
|
5
|
+
const MAX_GUIDE_DEPTH = 48;
|
|
6
|
+
const JOIN_ROUNDOFF = 512 * Number.EPSILON;
|
|
7
|
+
function prepareBendGuide(path) {
|
|
8
|
+
const spans = [];
|
|
9
|
+
let moves = 0, closed = false, scale = 0;
|
|
10
|
+
for (const item of bendSpans(path)) {
|
|
11
|
+
if (item.type === "move") {
|
|
12
|
+
if (++moves > 1) throw new RangeError("Along Path requires exactly one guide contour.");
|
|
13
|
+
scale = Math.max(scale, ...item.point.map(Math.abs));
|
|
14
|
+
} else if (item.type === "close") closed = true;
|
|
15
|
+
else {
|
|
16
|
+
closed = false;
|
|
17
|
+
const bounds = bendSpanBounds(item.span);
|
|
18
|
+
scale = Math.max(scale, Math.abs(bounds.xmin), Math.abs(bounds.xmax), Math.abs(bounds.ymin), Math.abs(bounds.ymax));
|
|
19
|
+
if ("arc" in item.span && !ellipseParameters(item.span.arc)) {
|
|
20
|
+
const points = [bendSpanPoint(item.span, 0), ...singularArcPoints(item.span.arc)];
|
|
21
|
+
for (let i = 1; i < points.length; i++) append({ points: [points[i - 1], points[i]] });
|
|
22
|
+
} else append(item.span);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (!spans.length) throw new RangeError("Along Path requires a guide of positive length.");
|
|
26
|
+
if (closed) sameTangent(tangent(spans.at(-1), true), tangent(spans[0], false));
|
|
27
|
+
return { spans, closed, scale };
|
|
28
|
+
function append(raw) {
|
|
29
|
+
const b = bendSpanBounds(raw);
|
|
30
|
+
if (Math.hypot(b.xmax - b.xmin, b.ymax - b.ymin) <= scale * Number.EPSILON * 32) return;
|
|
31
|
+
const span = straightSpan(raw);
|
|
32
|
+
const first = tangent(span, false), last = tangent(span, true);
|
|
33
|
+
if (spans.length) sameTangent(tangent(spans.at(-1), true), first);
|
|
34
|
+
if (![...first, ...last].every(Number.isFinite)) throw new RangeError("Guide limiting tangent is not finite.");
|
|
35
|
+
spans.push(span);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function measureBendGuide(prepared, tolerance, maxDisplacement, distanceFactor) {
|
|
39
|
+
let work = 0;
|
|
40
|
+
const charge = () => {
|
|
41
|
+
if (++work > MAX_GUIDE_WORK) throw new RangeError("Along Path exceeded its guide work budget.");
|
|
42
|
+
};
|
|
43
|
+
const roundoff = prepared.scale * Number.EPSILON * 128;
|
|
44
|
+
if (!Number.isFinite(roundoff) || roundoff >= tolerance / 16) throw new RangeError("Guide coordinates cannot support the requested tolerance.");
|
|
45
|
+
let pending = prepared.spans.map((span) => ({ span, depth: 0 }));
|
|
46
|
+
let leaves = [];
|
|
47
|
+
let target = tolerance / 32;
|
|
48
|
+
let length = 0, uncertainty = 0, error = Infinity;
|
|
49
|
+
for (let pass = 0; pass < 24; pass++) {
|
|
50
|
+
leaves = [];
|
|
51
|
+
const stack = [...pending].reverse();
|
|
52
|
+
while (stack.length) {
|
|
53
|
+
charge();
|
|
54
|
+
const { span, depth } = stack.pop();
|
|
55
|
+
const leaf = certifyLeaf(span, depth);
|
|
56
|
+
if (leaf && leaf.sag + maxDisplacement * leaf.normalError <= target) {
|
|
57
|
+
if (leaves.length >= MAX_GUIDE_LEAVES) throw new RangeError("Along Path exceeded its guide subdivision budget.");
|
|
58
|
+
leaves.push(leaf);
|
|
59
|
+
} else {
|
|
60
|
+
if (depth >= MAX_GUIDE_DEPTH) throw new RangeError("Guide has a cusp, reversal, or numerically uncertifiable tangent.");
|
|
61
|
+
const [left, right] = splitBendSpan(span);
|
|
62
|
+
stack.push({ span: right, depth: depth + 1 }, { span: left, depth: depth + 1 });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
length = 0;
|
|
66
|
+
uncertainty = 0;
|
|
67
|
+
let compensation2 = 0, sag = 0, normalError = 0, normalSlope = 0, joinError = JOIN_ROUNDOFF;
|
|
68
|
+
let previous;
|
|
69
|
+
for (const leaf of leaves) {
|
|
70
|
+
if (previous) {
|
|
71
|
+
const a = previous.last.normal, b = leaf.first.normal;
|
|
72
|
+
if (a[0] * b[0] + a[1] * b[1] <= 0) throw new RangeError("Along Path guide reverses direction at an internal cusp.");
|
|
73
|
+
joinError = Math.max(joinError, norm(subtract(a, b)));
|
|
74
|
+
}
|
|
75
|
+
previous = leaf;
|
|
76
|
+
const next = leaf.chord - compensation2, sum = length + next;
|
|
77
|
+
compensation2 = sum - length - next;
|
|
78
|
+
length = sum;
|
|
79
|
+
uncertainty += leaf.excess;
|
|
80
|
+
normalSlope = Math.max(normalSlope, norm(subtract(leaf.last.normal, leaf.first.normal)) / leaf.chord);
|
|
81
|
+
sag = Math.max(sag, leaf.sag);
|
|
82
|
+
normalError = Math.max(normalError, leaf.normalError);
|
|
83
|
+
}
|
|
84
|
+
if (!(length > 0) || !Number.isFinite(length)) throw new RangeError("Guide length must be finite and positive.");
|
|
85
|
+
uncertainty += roundoff + length * Number.EPSILON * 128;
|
|
86
|
+
const distanceError = uncertainty * distanceFactor(length);
|
|
87
|
+
error = sag + maxDisplacement * (normalError + joinError) + (1 + maxDisplacement * normalSlope) * distanceError + roundoff;
|
|
88
|
+
if (Number.isFinite(error) && error <= tolerance / 4) break;
|
|
89
|
+
if (pass === 23) throw new RangeError("Along Path cannot certify its guide-distance and normal error.");
|
|
90
|
+
target /= 2;
|
|
91
|
+
pending = leaves.flatMap((leaf) => {
|
|
92
|
+
if (leaf.depth >= MAX_GUIDE_DEPTH) throw new RangeError("Guide measurement reached numerical nonprogress.");
|
|
93
|
+
const [left, right] = splitBendSpan(leaf.span);
|
|
94
|
+
return [{ span: left, depth: leaf.depth + 1 }, { span: right, depth: leaf.depth + 1 }];
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const knots = [{ ...leaves[0].first, distance: 0 }];
|
|
98
|
+
let cumulative = 0, compensation = 0;
|
|
99
|
+
for (const leaf of leaves) {
|
|
100
|
+
const next = leaf.chord - compensation, sum = cumulative + next;
|
|
101
|
+
compensation = sum - cumulative - next;
|
|
102
|
+
cumulative = sum;
|
|
103
|
+
knots.push({ ...leaf.last, distance: cumulative });
|
|
104
|
+
}
|
|
105
|
+
if (prepared.closed) knots[knots.length - 1] = { ...knots[0], distance: length };
|
|
106
|
+
function field(distance, wrap) {
|
|
107
|
+
charge();
|
|
108
|
+
if (!Number.isFinite(distance)) throw new RangeError("Mapped guide distance overflowed.");
|
|
109
|
+
if (wrap) distance = (distance % length + length) % length;
|
|
110
|
+
if (distance < 0 || distance > length) {
|
|
111
|
+
const end = distance < 0 ? knots[0] : knots.at(-1);
|
|
112
|
+
const d = distance - end.distance;
|
|
113
|
+
return { normal: end.normal, point: [end.point[0] + d * end.normal[1], end.point[1] - d * end.normal[0]] };
|
|
114
|
+
}
|
|
115
|
+
if (distance === length) return knots.at(-1);
|
|
116
|
+
const i = index(distance), a = knots[i], b = knots[i + 1];
|
|
117
|
+
const u = (distance - a.distance) / (b.distance - a.distance);
|
|
118
|
+
return { point: lerp(a.point, b.point, u), normal: lerp(a.normal, b.normal, u) };
|
|
119
|
+
}
|
|
120
|
+
function index(distance) {
|
|
121
|
+
let low = 0, high = knots.length - 1;
|
|
122
|
+
while (low + 1 < high) {
|
|
123
|
+
const mid = Math.floor((low + high) / 2);
|
|
124
|
+
if (knots[mid].distance <= distance) low = mid;
|
|
125
|
+
else high = mid;
|
|
126
|
+
}
|
|
127
|
+
return low;
|
|
128
|
+
}
|
|
129
|
+
function envelope(low, high, wrap, visit) {
|
|
130
|
+
visit(low, field(low, wrap));
|
|
131
|
+
visit(high, field(high, wrap));
|
|
132
|
+
if (!wrap) {
|
|
133
|
+
for (let i = index(Math.max(0, low)); i < knots.length && knots[i].distance <= high; i++) {
|
|
134
|
+
if (knots[i].distance >= low) {
|
|
135
|
+
charge();
|
|
136
|
+
visit(knots[i].distance, knots[i]);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
const firstLap = Math.floor(low / length), lastLap = Math.floor(high / length);
|
|
141
|
+
if (!Number.isSafeInteger(firstLap) || !Number.isSafeInteger(lastLap) || lastLap - firstLap > MAX_GUIDE_WORK) throw new RangeError("Too many guide laps to certify.");
|
|
142
|
+
for (let lap = firstLap; lap <= lastLap; lap++) {
|
|
143
|
+
charge();
|
|
144
|
+
const offset = lap * length;
|
|
145
|
+
for (let i = index(Math.max(0, low - offset)); i < knots.length && knots[i].distance + offset <= high; i++) {
|
|
146
|
+
const s = knots[i].distance + offset;
|
|
147
|
+
if (s >= low) {
|
|
148
|
+
charge();
|
|
149
|
+
visit(s, knots[i]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
length,
|
|
157
|
+
uncertainty,
|
|
158
|
+
error,
|
|
159
|
+
field,
|
|
160
|
+
knots,
|
|
161
|
+
/** Conservative full-field residual, not a sampled flatness heuristic. */
|
|
162
|
+
chordError(low, high, s0, s1, d, ds, dds, dy, ddy, wrap) {
|
|
163
|
+
const first = field(s0, wrap), last = field(s1, wrap);
|
|
164
|
+
const delta = s1 - s0;
|
|
165
|
+
const v = delta === 0 ? [0, 0] : scaleVector(subtract(last.point, first.point), 1 / delta);
|
|
166
|
+
const q = delta === 0 ? [0, 0] : scaleVector(subtract(last.normal, first.normal), 1 / delta);
|
|
167
|
+
const baseNormal = (s) => add(first.normal, scaleVector(q, s - s0));
|
|
168
|
+
let positionResidual = 0, normalResidual = 0;
|
|
169
|
+
envelope(low, high, wrap, (s, value) => {
|
|
170
|
+
positionResidual = Math.max(positionResidual, norm(subtract(value.point, add(first.point, scaleVector(v, s - s0)))));
|
|
171
|
+
normalResidual = Math.max(normalResidual, norm(subtract(value.normal, baseNormal(s))));
|
|
172
|
+
});
|
|
173
|
+
const baseNormalSize = Math.max(norm(baseNormal(low)), norm(baseNormal(high)));
|
|
174
|
+
const polynomialError = ((norm(v) + d * norm(q)) * dds + baseNormalSize * ddy + 2 * norm(q) * ds * dy) / 8;
|
|
175
|
+
return error + polynomialError + positionResidual + d * normalResidual;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function certifyLeaf(span, depth) {
|
|
180
|
+
if ("arc" in span && Math.abs(span.arc.sweep) > Math.PI / 2) return void 0;
|
|
181
|
+
const a = bendSpanPoint(span, 0), b = bendSpanPoint(span, 1), chordVector = subtract(b, a), chord = norm(chordVector);
|
|
182
|
+
if (!(chord > 0) || !Number.isFinite(chord)) return void 0;
|
|
183
|
+
const axis = scaleVector(chordVector, 1 / chord);
|
|
184
|
+
let ratio = 0, minProjection = Infinity;
|
|
185
|
+
const hull = derivativeHull(span);
|
|
186
|
+
for (const vector of hull) {
|
|
187
|
+
const magnitude = norm(vector);
|
|
188
|
+
if (magnitude === 0) {
|
|
189
|
+
minProjection = 0;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
const v = scaleVector(vector, 1 / magnitude);
|
|
193
|
+
const projection = v[0] * axis[0] + v[1] * axis[1];
|
|
194
|
+
if (!(projection > 0)) return void 0;
|
|
195
|
+
minProjection = Math.min(minProjection, projection * magnitude);
|
|
196
|
+
ratio = Math.max(ratio, Math.abs(v[0] * axis[1] - v[1] * axis[0]) / projection);
|
|
197
|
+
}
|
|
198
|
+
const hyp = Math.hypot(1, ratio);
|
|
199
|
+
const excess = chord * ratio * (ratio / (hyp + 1));
|
|
200
|
+
const eta = ratio * Math.sqrt(2 / (hyp * (hyp + 1)));
|
|
201
|
+
const first = normal(tangent(span, false)), last = normal(tangent(span, true));
|
|
202
|
+
let normalError = 2 * ratio / hyp;
|
|
203
|
+
if (minProjection > 0) {
|
|
204
|
+
let m, acceleration, jerk;
|
|
205
|
+
if ("points" in span) {
|
|
206
|
+
const degree = span.points.length - 1;
|
|
207
|
+
m = minProjection * degree;
|
|
208
|
+
const second = hull.slice(1).map((v, i) => scaleVector(subtract(v, hull[i]), degree * (degree - 1)));
|
|
209
|
+
acceleration = Math.max(0, ...second.map(norm));
|
|
210
|
+
jerk = Math.max(0, ...second.slice(1).map((v, i) => norm(subtract(v, second[i])) * (degree - 2)));
|
|
211
|
+
} else {
|
|
212
|
+
const h = Math.abs(span.arc.sweep), basis = Math.hypot(span.arc.ux, span.arc.uy) + Math.hypot(span.arc.vx, span.arc.vy);
|
|
213
|
+
m = minProjection * h;
|
|
214
|
+
acceleration = basis * h * h;
|
|
215
|
+
jerk = acceleration * h;
|
|
216
|
+
}
|
|
217
|
+
const lengthOverSpeed = (chord + excess) / m;
|
|
218
|
+
const error = (jerk / m + 4 * (acceleration / m) ** 2) * lengthOverSpeed ** 2 / 8;
|
|
219
|
+
if (Number.isFinite(error)) normalError = Math.min(normalError, error);
|
|
220
|
+
}
|
|
221
|
+
return { span, depth, first: { point: a, normal: first }, last: { point: b, normal: last }, chord, excess, sag: (chord + excess) * eta / 2, normalError };
|
|
222
|
+
}
|
|
223
|
+
function derivativeHull(span) {
|
|
224
|
+
if ("points" in span) return span.points.slice(1).map((point, i) => subtract(point, span.points[i]));
|
|
225
|
+
const a = span.arc;
|
|
226
|
+
return [a.startAngle, a.startAngle + a.sweep].map((theta) => [
|
|
227
|
+
Math.sign(a.sweep) * (-a.ux * Math.sin(theta) + a.vx * Math.cos(theta)),
|
|
228
|
+
Math.sign(a.sweep) * (-a.uy * Math.sin(theta) + a.vy * Math.cos(theta))
|
|
229
|
+
]);
|
|
230
|
+
}
|
|
231
|
+
function tangent(span, end) {
|
|
232
|
+
const vectors = derivativeHull(span);
|
|
233
|
+
const vector = (end ? [...vectors].reverse() : vectors).find((v) => norm(v) > 0);
|
|
234
|
+
if (!vector) throw new RangeError("Guide has no limiting tangent.");
|
|
235
|
+
const length = norm(vector);
|
|
236
|
+
return scaleVector(vector, 1 / length);
|
|
237
|
+
}
|
|
238
|
+
function sameTangent(a, b) {
|
|
239
|
+
if (norm(subtract(a, b)) > JOIN_ROUNDOFF) throw new RangeError("Along Path requires smooth directed guide joins; corners and cusps are unsupported.");
|
|
240
|
+
}
|
|
241
|
+
function straightSpan(span) {
|
|
242
|
+
if (!("points" in span)) return span;
|
|
243
|
+
const a = span.points[0], b = span.points.at(-1), vector = subtract(b, a), length = norm(vector);
|
|
244
|
+
if (!(length > 0) || !Number.isFinite(length)) return span;
|
|
245
|
+
const direction = scaleVector(vector, 1 / length);
|
|
246
|
+
if (!span.points.every((p) => {
|
|
247
|
+
const v = subtract(p, a);
|
|
248
|
+
return v[0] * direction[1] - v[1] * direction[0] === 0;
|
|
249
|
+
})) return span;
|
|
250
|
+
const values = derivativeHull(span).map((v) => v[0] * direction[0] + v[1] * direction[1]);
|
|
251
|
+
let minimum = Math.min(values[0], values.at(-1));
|
|
252
|
+
if (values.length === 3) {
|
|
253
|
+
const denominator = values[0] - 2 * values[1] + values[2];
|
|
254
|
+
const t = (values[0] - values[1]) / denominator;
|
|
255
|
+
if (t > 0 && t < 1) minimum = Math.min(minimum, (1 - t) ** 2 * values[0] + 2 * t * (1 - t) * values[1] + t * t * values[2]);
|
|
256
|
+
}
|
|
257
|
+
if (minimum < -length * Number.EPSILON * 16) throw new RangeError("Guide reverses direction at a cusp.");
|
|
258
|
+
return { points: [a, b] };
|
|
259
|
+
}
|
|
260
|
+
function normal(v) {
|
|
261
|
+
return [-v[1], v[0]];
|
|
262
|
+
}
|
|
263
|
+
function norm(v) {
|
|
264
|
+
return Math.hypot(v[0], v[1]);
|
|
265
|
+
}
|
|
266
|
+
function add(a, b) {
|
|
267
|
+
return [a[0] + b[0], a[1] + b[1]];
|
|
268
|
+
}
|
|
269
|
+
function subtract(a, b) {
|
|
270
|
+
return [a[0] - b[0], a[1] - b[1]];
|
|
271
|
+
}
|
|
272
|
+
function scaleVector(a, scale) {
|
|
273
|
+
return [a[0] * scale, a[1] * scale];
|
|
274
|
+
}
|
|
275
|
+
function lerp(a, b, t) {
|
|
276
|
+
return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
|
|
277
|
+
}
|
|
278
|
+
export {
|
|
279
|
+
measureBendGuide,
|
|
280
|
+
prepareBendGuide
|
|
281
|
+
};
|
|
282
|
+
//# sourceMappingURL=path-bend-guide.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/geometry/path-bend-guide.ts"],
|
|
4
|
+
"sourcesContent": ["import { ellipseParameters, singularArcPoints } from './path-arc.js';\nimport { bendSpanBounds, bendSpanPoint, bendSpans, splitBendSpan, type BendPoint, type BendSpan } from './path-bend-spans.js';\nimport { PathGeometry } from './path-geometry.js';\n\ninterface Field { readonly point: BendPoint; readonly normal: BendPoint }\ninterface Leaf {\n readonly span: BendSpan; readonly depth: number;\n readonly first: Field; readonly last: Field;\n readonly chord: number; readonly excess: number;\n readonly sag: number; readonly normalError: number;\n}\ninterface Knot extends Field { readonly distance: number }\nexport interface PreparedBendGuide {\n readonly spans: readonly BendSpan[];\n readonly closed: boolean;\n readonly scale: number;\n}\n\n// Includes failed refinement and field-envelope visits. No resource survives a call.\nconst MAX_GUIDE_WORK = 2_000_000;\nconst MAX_GUIDE_LEAVES = 131_072;\nconst MAX_GUIDE_DEPTH = 48;\nconst JOIN_ROUNDOFF = 512 * Number.EPSILON;\n\n/** Validate all guide contours and joins, even if the source uses only part. */\nexport function prepareBendGuide(path: PathGeometry): PreparedBendGuide {\n const spans: BendSpan[] = [];\n let moves = 0, closed = false, scale = 0;\n for (const item of bendSpans(path)) {\n if (item.type === 'move') {\n if (++moves > 1) throw new RangeError('Along Path requires exactly one guide contour.');\n scale = Math.max(scale, ...item.point.map(Math.abs));\n } else if (item.type === 'close') closed = true;\n else {\n closed = false;\n const bounds = bendSpanBounds(item.span);\n scale = Math.max(scale, Math.abs(bounds.xmin), Math.abs(bounds.xmax), Math.abs(bounds.ymin), Math.abs(bounds.ymax));\n if ('arc' in item.span && !ellipseParameters(item.span.arc)) {\n const points = [bendSpanPoint(item.span, 0), ...singularArcPoints(item.span.arc)];\n for (let i = 1; i < points.length; i++) append({ points: [points[i - 1], points[i]] });\n } else append(item.span);\n }\n }\n if (!spans.length) throw new RangeError('Along Path requires a guide of positive length.');\n if (closed) sameTangent(tangent(spans.at(-1)!, true), tangent(spans[0], false));\n return { spans, closed, scale };\n\n function append(raw: BendSpan) {\n const b = bendSpanBounds(raw);\n // Numerically coincident endpoints/control hulls carry no reliable direction.\n if (Math.hypot(b.xmax - b.xmin, b.ymax - b.ymin) <= scale * Number.EPSILON * 32) return;\n const span = straightSpan(raw);\n const first = tangent(span, false), last = tangent(span, true);\n if (spans.length) sameTangent(tangent(spans.at(-1)!, true), first);\n if (![...first, ...last].every(Number.isFinite)) throw new RangeError('Guide limiting tangent is not finite.');\n spans.push(span);\n }\n}\n\n/**\n * A continuous piecewise-linear position/normal field with a certified error\n * against the true arc-length field. Interpolated normals are deliberately NOT\n * renormalized: this keeps the internal mapping bilinear within each leaf.\n */\nexport function measureBendGuide(\n prepared: PreparedBendGuide,\n tolerance: number,\n maxDisplacement: number,\n distanceFactor: (length: number) => number,\n) {\n let work = 0;\n const charge = () => { if (++work > MAX_GUIDE_WORK) throw new RangeError('Along Path exceeded its guide work budget.'); };\n const roundoff = prepared.scale * Number.EPSILON * 128;\n if (!Number.isFinite(roundoff) || roundoff >= tolerance / 16) throw new RangeError('Guide coordinates cannot support the requested tolerance.');\n let pending = prepared.spans.map(span => ({ span, depth: 0 }));\n let leaves: Leaf[] = [];\n let target = tolerance / 32;\n let length = 0, uncertainty = 0, error = Infinity;\n for (let pass = 0; pass < 24; pass++) {\n leaves = [];\n const stack = [...pending].reverse();\n while (stack.length) {\n charge();\n const { span, depth } = stack.pop()!;\n const leaf = certifyLeaf(span, depth);\n if (leaf && leaf.sag + maxDisplacement * leaf.normalError <= target) {\n if (leaves.length >= MAX_GUIDE_LEAVES) throw new RangeError('Along Path exceeded its guide subdivision budget.');\n leaves.push(leaf);\n } else {\n if (depth >= MAX_GUIDE_DEPTH) throw new RangeError('Guide has a cusp, reversal, or numerically uncertifiable tangent.');\n const [left, right] = splitBendSpan(span);\n stack.push({ span: right, depth: depth + 1 }, { span: left, depth: depth + 1 });\n }\n }\n length = 0; uncertainty = 0;\n let compensation = 0, sag = 0, normalError = 0, normalSlope = 0, joinError = JOIN_ROUNDOFF;\n let previous: Leaf | undefined;\n for (const leaf of leaves) {\n // Original segment joins were validated before subdivision. Inside a\n // polynomial/ellipse, the two limiting tangents at a split must agree or\n // reverse at a cusp. Subtracted tiny control edges amplify roundoff, so\n // do not reuse the original-join angular threshold here. Reject reversals\n // and account for the shared-knot normal replacement in the error bound.\n if (previous) {\n const a = previous.last.normal, b = leaf.first.normal;\n if (a[0] * b[0] + a[1] * b[1] <= 0) throw new RangeError('Along Path guide reverses direction at an internal cusp.');\n joinError = Math.max(joinError, norm(subtract(a, b)));\n }\n previous = leaf;\n // Compensated sums avoid accumulating an O(number-of-leaves) length bias.\n const next = leaf.chord - compensation, sum = length + next;\n compensation = (sum - length) - next; length = sum;\n uncertainty += leaf.excess;\n normalSlope = Math.max(normalSlope, norm(subtract(leaf.last.normal, leaf.first.normal)) / leaf.chord);\n sag = Math.max(sag, leaf.sag); normalError = Math.max(normalError, leaf.normalError);\n }\n if (!(length > 0) || !Number.isFinite(length)) throw new RangeError('Guide length must be finite and positive.');\n uncertainty += roundoff + length * Number.EPSILON * 128;\n // phi maps chord distance to true arc distance and has inverse Lipschitz\n // constant <=1. Its deviation from identity is bounded by total excess.\n // distanceFactor includes fit/alignment and any unwrapped guide laps.\n const distanceError = uncertainty * distanceFactor(length);\n error = sag + maxDisplacement * (normalError + joinError) + (1 + maxDisplacement * normalSlope) * distanceError + roundoff;\n if (Number.isFinite(error) && error <= tolerance / 4) break;\n if (pass === 23) throw new RangeError('Along Path cannot certify its guide-distance and normal error.');\n target /= 2;\n pending = leaves.flatMap(leaf => {\n if (leaf.depth >= MAX_GUIDE_DEPTH) throw new RangeError('Guide measurement reached numerical nonprogress.');\n const [left, right] = splitBendSpan(leaf.span);\n return [{ span: left, depth: leaf.depth + 1 }, { span: right, depth: leaf.depth + 1 }];\n });\n }\n const knots: Knot[] = [{ ...leaves[0].first, distance: 0 }];\n let cumulative = 0, compensation = 0;\n for (const leaf of leaves) {\n const next = leaf.chord - compensation, sum = cumulative + next;\n compensation = (sum - cumulative) - next; cumulative = sum;\n knots.push({ ...leaf.last, distance: cumulative });\n }\n // Joins are already checked. Sharing the endpoint field prevents tiny normal\n // jumps at the closed seam from becoming artificial output edges.\n if (prepared.closed) knots[knots.length - 1] = { ...knots[0], distance: length };\n\n function field(distance: number, wrap: boolean): Field {\n charge();\n if (!Number.isFinite(distance)) throw new RangeError('Mapped guide distance overflowed.');\n if (wrap) distance = ((distance % length) + length) % length;\n if (distance < 0 || distance > length) {\n const end = distance < 0 ? knots[0] : knots.at(-1)!;\n const d = distance - end.distance;\n return { normal: end.normal, point: [end.point[0] + d * end.normal[1], end.point[1] - d * end.normal[0]] };\n }\n if (distance === length) return knots.at(-1)!;\n const i = index(distance), a = knots[i], b = knots[i + 1];\n const u = (distance - a.distance) / (b.distance - a.distance);\n return { point: lerp(a.point, b.point, u), normal: lerp(a.normal, b.normal, u) };\n }\n function index(distance: number): number {\n let low = 0, high = knots.length - 1;\n while (low + 1 < high) {\n const mid = Math.floor((low + high) / 2);\n if (knots[mid].distance <= distance) low = mid; else high = mid;\n }\n return low;\n }\n function envelope(low: number, high: number, wrap: boolean, visit: (distance: number, value: Field) => void) {\n visit(low, field(low, wrap)); visit(high, field(high, wrap));\n if (!wrap) {\n for (let i = index(Math.max(0, low)); i < knots.length && knots[i].distance <= high; i++) {\n if (knots[i].distance >= low) { charge(); visit(knots[i].distance, knots[i]); }\n }\n } else {\n const firstLap = Math.floor(low / length), lastLap = Math.floor(high / length);\n if (!Number.isSafeInteger(firstLap) || !Number.isSafeInteger(lastLap) || lastLap - firstLap > MAX_GUIDE_WORK) throw new RangeError('Too many guide laps to certify.');\n for (let lap = firstLap; lap <= lastLap; lap++) {\n charge();\n const offset = lap * length;\n for (let i = index(Math.max(0, low - offset)); i < knots.length && knots[i].distance + offset <= high; i++) {\n const s = knots[i].distance + offset;\n if (s >= low) { charge(); visit(s, knots[i]); }\n }\n }\n }\n }\n return {\n length, uncertainty, error, field, knots,\n /** Conservative full-field residual, not a sampled flatness heuristic. */\n chordError(low: number, high: number, s0: number, s1: number, d: number, ds: number, dds: number, dy: number, ddy: number, wrap: boolean): number {\n const first = field(s0, wrap), last = field(s1, wrap);\n const delta = s1 - s0;\n const v = delta === 0 ? [0, 0] as const : scaleVector(subtract(last.point, first.point), 1 / delta);\n const q = delta === 0 ? [0, 0] as const : scaleVector(subtract(last.normal, first.normal), 1 / delta);\n const baseNormal = (s: number): BendPoint => add(first.normal, scaleVector(q, s - s0));\n let positionResidual = 0, normalResidual = 0;\n envelope(low, high, wrap, (s, value) => {\n positionResidual = Math.max(positionResidual, norm(subtract(value.point, add(first.point, scaleVector(v, s - s0)))));\n normalResidual = Math.max(normalResidual, norm(subtract(value.normal, baseNormal(s))));\n });\n const baseNormalSize = Math.max(norm(baseNormal(low)), norm(baseNormal(high)));\n const polynomialError = ((norm(v) + d * norm(q)) * dds + baseNormalSize * ddy + 2 * norm(q) * ds * dy) / 8;\n return error + polynomialError + positionResidual + d * normalResidual;\n },\n };\n}\n\nfunction certifyLeaf(span: BendSpan, depth: number): Leaf | undefined {\n if ('arc' in span && Math.abs(span.arc.sweep) > Math.PI / 2) return undefined;\n const a = bendSpanPoint(span, 0), b = bendSpanPoint(span, 1), chordVector = subtract(b, a), chord = norm(chordVector);\n if (!(chord > 0) || !Number.isFinite(chord)) return undefined;\n const axis = scaleVector(chordVector, 1 / chord);\n let ratio = 0, minProjection = Infinity;\n const hull = derivativeHull(span);\n for (const vector of hull) {\n const magnitude = norm(vector);\n if (magnitude === 0) { minProjection = 0; continue; }\n const v = scaleVector(vector, 1 / magnitude);\n const projection = v[0] * axis[0] + v[1] * axis[1];\n if (!(projection > 0)) return undefined;\n minProjection = Math.min(minProjection, projection * magnitude);\n ratio = Math.max(ratio, Math.abs(v[0] * axis[1] - v[1] * axis[0]) / projection);\n }\n const hyp = Math.hypot(1, ratio);\n // All derivatives lie in a directed cone around the chord. Its minimum\n // projection bounds length; its diameter bounds normal interpolation error.\n const excess = chord * ratio * (ratio / (hyp + 1)); // chord*(hyp-1), without cancellation\n const eta = ratio * Math.sqrt(2 / (hyp * (hyp + 1)));\n const first = normal(tangent(span, false)), last = normal(tangent(span, true));\n let normalError = 2 * ratio / hyp;\n // On regular spans use the second derivative of N with respect to arc length.\n // |N''| <= Q/m\u00B3 + 4A\u00B2/m\u2074, where m bounds speed below and A,Q bound the\n // second/third parameter derivatives. The cone remains the fallback at\n // removable stationary endpoints, where m can be zero but the normal exists.\n if (minProjection > 0) {\n let m: number, acceleration: number, jerk: number;\n if ('points' in span) {\n const degree = span.points.length - 1;\n m = minProjection * degree;\n const second = hull.slice(1).map((v, i) => scaleVector(subtract(v, hull[i]), degree * (degree - 1)));\n acceleration = Math.max(0, ...second.map(norm));\n jerk = Math.max(0, ...second.slice(1).map((v, i) => norm(subtract(v, second[i])) * (degree - 2)));\n } else {\n const h = Math.abs(span.arc.sweep), basis = Math.hypot(span.arc.ux, span.arc.uy) + Math.hypot(span.arc.vx, span.arc.vy);\n m = minProjection * h; acceleration = basis * h * h; jerk = acceleration * h;\n }\n const lengthOverSpeed = (chord + excess) / m;\n const error = (jerk / m + 4 * (acceleration / m) ** 2) * lengthOverSpeed ** 2 / 8;\n if (Number.isFinite(error)) normalError = Math.min(normalError, error);\n }\n return { span, depth, first: { point: a, normal: first }, last: { point: b, normal: last }, chord, excess, sag: (chord + excess) * eta / 2, normalError };\n}\n\nfunction derivativeHull(span: BendSpan): readonly BendPoint[] {\n if ('points' in span) return span.points.slice(1).map((point, i) => subtract(point, span.points[i]));\n const a = span.arc;\n return [a.startAngle, a.startAngle + a.sweep].map(theta => [\n Math.sign(a.sweep) * (-a.ux * Math.sin(theta) + a.vx * Math.cos(theta)),\n Math.sign(a.sweep) * (-a.uy * Math.sin(theta) + a.vy * Math.cos(theta)),\n ]);\n}\nfunction tangent(span: BendSpan, end: boolean): BendPoint {\n const vectors = derivativeHull(span);\n const vector = (end ? [...vectors].reverse() : vectors).find(v => norm(v) > 0);\n if (!vector) throw new RangeError('Guide has no limiting tangent.');\n const length = norm(vector);\n return scaleVector(vector, 1 / length);\n}\nfunction sameTangent(a: BendPoint, b: BendPoint) {\n if (norm(subtract(a, b)) > JOIN_ROUNDOFF) throw new RangeError('Along Path requires smooth directed guide joins; corners and cusps are unsupported.');\n}\n\nfunction straightSpan(span: BendSpan): BendSpan {\n if (!('points' in span)) return span;\n const a = span.points[0], b = span.points.at(-1)!, vector = subtract(b, a), length = norm(vector);\n if (!(length > 0) || !Number.isFinite(length)) return span;\n const direction = scaleVector(vector, 1 / length);\n if (!span.points.every(p => {\n const v = subtract(p, a);\n return v[0] * direction[1] - v[1] * direction[0] === 0;\n })) return span;\n const values = derivativeHull(span).map(v => v[0] * direction[0] + v[1] * direction[1]);\n let minimum = Math.min(values[0], values.at(-1)!);\n if (values.length === 3) {\n const denominator = values[0] - 2 * values[1] + values[2];\n const t = (values[0] - values[1]) / denominator;\n if (t > 0 && t < 1) minimum = Math.min(minimum, (1 - t) ** 2 * values[0] + 2 * t * (1 - t) * values[1] + t * t * values[2]);\n }\n if (minimum < -length * Number.EPSILON * 16) throw new RangeError('Guide reverses direction at a cusp.');\n return { points: [a, b] };\n}\nfunction normal(v: BendPoint): BendPoint { return [-v[1], v[0]]; }\nfunction norm(v: BendPoint): number { return Math.hypot(v[0], v[1]); }\nfunction add(a: BendPoint, b: BendPoint): BendPoint { return [a[0] + b[0], a[1] + b[1]]; }\nfunction subtract(a: BendPoint, b: BendPoint): BendPoint { return [a[0] - b[0], a[1] - b[1]]; }\nfunction scaleVector(a: BendPoint, scale: number): BendPoint { return [a[0] * scale, a[1] * scale]; }\nfunction lerp(a: BendPoint, b: BendPoint, t: number): BendPoint { return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t]; }\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,mBAAmB,yBAAyB;AACrD,SAAS,gBAAgB,eAAe,WAAW,qBAAoD;AAkBvG,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AACxB,MAAM,gBAAgB,MAAM,OAAO;AAG5B,SAAS,iBAAiB,MAAuC;AACtE,QAAM,QAAoB,CAAC;AAC3B,MAAI,QAAQ,GAAG,SAAS,OAAO,QAAQ;AACvC,aAAW,QAAQ,UAAU,IAAI,GAAG;AAClC,QAAI,KAAK,SAAS,QAAQ;AACxB,UAAI,EAAE,QAAQ,EAAG,OAAM,IAAI,WAAW,gDAAgD;AACtF,cAAQ,KAAK,IAAI,OAAO,GAAG,KAAK,MAAM,IAAI,KAAK,GAAG,CAAC;AAAA,IACrD,WAAW,KAAK,SAAS,QAAS,UAAS;AAAA,SACtC;AACH,eAAS;AACT,YAAM,SAAS,eAAe,KAAK,IAAI;AACvC,cAAQ,KAAK,IAAI,OAAO,KAAK,IAAI,OAAO,IAAI,GAAG,KAAK,IAAI,OAAO,IAAI,GAAG,KAAK,IAAI,OAAO,IAAI,GAAG,KAAK,IAAI,OAAO,IAAI,CAAC;AAClH,UAAI,SAAS,KAAK,QAAQ,CAAC,kBAAkB,KAAK,KAAK,GAAG,GAAG;AAC3D,cAAM,SAAS,CAAC,cAAc,KAAK,M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AI,IAAI,IAAI,OAAO,CAAC,CAAC;AAAA,EAC5H;AACA,MAAI,UAAU,CAAC,SAAS,OAAO,UAAU,GAAI,OAAM,IAAI,WAAW,qCAAqC;AACvG,SAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC1B;AACA,SAAS,OAAO,GAAyB;AAAE,SAAO,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;AAAG;AACjE,SAAS,KAAK,GAAsB;AAAE,SAAO,KAAK,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;AAAG;AACrE,SAAS,IAAI,GAAc,GAAyB;AAAE,SAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;AAAG;AACzF,SAAS,SAAS,GAAc,GAAyB;AAAE,SAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;AAAG;AAC9F,SAAS,YAAY,GAAc,OAA0B;AAAE,SAAO,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,IAAI,KAAK;AAAG;AACpG,SAAS,KAAK,GAAc,GAAc,GAAsB;AAAE,SAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;AAAG;",
|
|
6
|
+
"names": ["compensation"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ArcSegment } from './path-arc.js';
|
|
2
|
+
import { PathGeometry } from './path-geometry.js';
|
|
3
|
+
/** Private continuous source spans; bounds use the span's local parameter [0,1]. */
|
|
4
|
+
export type BendPoint = readonly [number, number];
|
|
5
|
+
export type BendSpan = {
|
|
6
|
+
readonly points: readonly BendPoint[];
|
|
7
|
+
} | {
|
|
8
|
+
readonly arc: ArcSegment;
|
|
9
|
+
};
|
|
10
|
+
export interface BendBounds {
|
|
11
|
+
readonly xmin: number;
|
|
12
|
+
readonly xmax: number;
|
|
13
|
+
readonly ymin: number;
|
|
14
|
+
readonly ymax: number;
|
|
15
|
+
readonly dx: number;
|
|
16
|
+
readonly dy: number;
|
|
17
|
+
readonly ddx: number;
|
|
18
|
+
readonly ddy: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function bendSpans(path: PathGeometry): Generator<{
|
|
21
|
+
type: 'move';
|
|
22
|
+
point: BendPoint;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'span';
|
|
25
|
+
span: BendSpan;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'close';
|
|
28
|
+
}>;
|
|
29
|
+
export declare function bendSpanPoint(span: BendSpan, t: number): BendPoint;
|
|
30
|
+
export declare function splitBendSpan(span: BendSpan): readonly [BendSpan, BendSpan];
|
|
31
|
+
export declare function bendSpanBounds(span: BendSpan): BendBounds;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { arcPoint } from "./path-arc.js";
|
|
2
|
+
function* bendSpans(path) {
|
|
3
|
+
let current = [0, 0], start = current;
|
|
4
|
+
for (const segment of path) {
|
|
5
|
+
switch (segment.type) {
|
|
6
|
+
case "move":
|
|
7
|
+
current = start = [segment.x, segment.y];
|
|
8
|
+
yield { type: "move", point: current };
|
|
9
|
+
break;
|
|
10
|
+
case "line": {
|
|
11
|
+
const end = [segment.x, segment.y];
|
|
12
|
+
yield { type: "span", span: { points: [current, end] } };
|
|
13
|
+
current = end;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
case "quadratic": {
|
|
17
|
+
const end = [segment.x, segment.y];
|
|
18
|
+
yield { type: "span", span: { points: [current, [segment.cpx, segment.cpy], end] } };
|
|
19
|
+
current = end;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
case "cubic": {
|
|
23
|
+
const end = [segment.x, segment.y];
|
|
24
|
+
yield { type: "span", span: { points: [current, [segment.cp1x, segment.cp1y], [segment.cp2x, segment.cp2y], end] } };
|
|
25
|
+
current = end;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
case "arc": {
|
|
29
|
+
const first = arcPoint(segment, segment.startAngle);
|
|
30
|
+
if (current[0] !== first[0] || current[1] !== first[1]) {
|
|
31
|
+
yield { type: "span", span: { points: [current, first] } };
|
|
32
|
+
}
|
|
33
|
+
yield { type: "span", span: { arc: segment } };
|
|
34
|
+
current = arcPoint(segment, segment.startAngle + segment.sweep);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
case "close":
|
|
38
|
+
yield { type: "span", span: { points: [current, start] } };
|
|
39
|
+
yield { type: "close" };
|
|
40
|
+
current = start;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function bendSpanPoint(span, t) {
|
|
46
|
+
if ("arc" in span) return arcPoint(span.arc, span.arc.startAngle + span.arc.sweep * t);
|
|
47
|
+
let points = span.points;
|
|
48
|
+
while (points.length > 1) {
|
|
49
|
+
points = points.slice(1).map((b, i) => [
|
|
50
|
+
(1 - t) * points[i][0] + t * b[0],
|
|
51
|
+
(1 - t) * points[i][1] + t * b[1]
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
return points[0];
|
|
55
|
+
}
|
|
56
|
+
function splitBendSpan(span) {
|
|
57
|
+
if ("arc" in span) {
|
|
58
|
+
const arc = span.arc, sweep = arc.sweep / 2;
|
|
59
|
+
return [{ arc: { ...arc, sweep } }, { arc: { ...arc, startAngle: arc.startAngle + sweep, sweep } }];
|
|
60
|
+
}
|
|
61
|
+
let row = span.points;
|
|
62
|
+
const left = [row[0]], right = [row.at(-1)];
|
|
63
|
+
while (row.length > 1) {
|
|
64
|
+
row = row.slice(1).map((b, i) => [row[i][0] / 2 + b[0] / 2, row[i][1] / 2 + b[1] / 2]);
|
|
65
|
+
left.push(row[0]);
|
|
66
|
+
right.push(row.at(-1));
|
|
67
|
+
}
|
|
68
|
+
return [{ points: left }, { points: right.reverse() }];
|
|
69
|
+
}
|
|
70
|
+
function bendSpanBounds(span) {
|
|
71
|
+
if ("arc" in span) {
|
|
72
|
+
const a = span.arc;
|
|
73
|
+
const [xmin, xmax] = arcRange(a.cx, a.ux, a.vx, a.startAngle, a.sweep);
|
|
74
|
+
const [ymin, ymax] = arcRange(a.cy, a.uy, a.vy, a.startAngle, a.sweep);
|
|
75
|
+
const dx = Math.hypot(a.ux, a.vx) * Math.abs(a.sweep);
|
|
76
|
+
const dy = Math.hypot(a.uy, a.vy) * Math.abs(a.sweep);
|
|
77
|
+
return { xmin, xmax, ymin, ymax, dx, dy, ddx: dx * Math.abs(a.sweep), ddy: dy * Math.abs(a.sweep) };
|
|
78
|
+
}
|
|
79
|
+
const p = span.points, n = p.length - 1;
|
|
80
|
+
const xs = p.map((point) => point[0]), ys = p.map((point) => point[1]);
|
|
81
|
+
const first = (axis) => Math.max(0, ...p.slice(1).map((b, i) => Math.abs(n * (b[axis] - p[i][axis]))));
|
|
82
|
+
const second = (axis) => Math.max(0, ...p.slice(2).map((b, i) => Math.abs(n * (n - 1) * (b[axis] - p[i + 1][axis] - (p[i + 1][axis] - p[i][axis])))));
|
|
83
|
+
return {
|
|
84
|
+
xmin: Math.min(...xs),
|
|
85
|
+
xmax: Math.max(...xs),
|
|
86
|
+
ymin: Math.min(...ys),
|
|
87
|
+
ymax: Math.max(...ys),
|
|
88
|
+
dx: first(0),
|
|
89
|
+
dy: first(1),
|
|
90
|
+
ddx: second(0),
|
|
91
|
+
ddy: second(1)
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function arcRange(center, u, v, start, sweep) {
|
|
95
|
+
const values = [center + u * Math.cos(start) + v * Math.sin(start), center + u * Math.cos(start + sweep) + v * Math.sin(start + sweep)];
|
|
96
|
+
const low = Math.min(start, start + sweep), high = Math.max(start, start + sweep);
|
|
97
|
+
const phase = Math.atan2(v, u);
|
|
98
|
+
for (let k = Math.ceil((low - phase) / Math.PI); k <= Math.floor((high - phase) / Math.PI); k++) {
|
|
99
|
+
values.push(center + (k % 2 === 0 ? 1 : -1) * Math.hypot(u, v));
|
|
100
|
+
}
|
|
101
|
+
return [Math.min(...values), Math.max(...values)];
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
bendSpanBounds,
|
|
105
|
+
bendSpanPoint,
|
|
106
|
+
bendSpans,
|
|
107
|
+
splitBendSpan
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=path-bend-spans.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/geometry/path-bend-spans.ts"],
|
|
4
|
+
"sourcesContent": ["import { arcPoint, type ArcSegment } from './path-arc.js';\nimport { PathGeometry } from './path-geometry.js';\n\n/** Private continuous source spans; bounds use the span's local parameter [0,1]. */\nexport type BendPoint = readonly [number, number];\nexport type BendSpan = { readonly points: readonly BendPoint[] } | { readonly arc: ArcSegment };\nexport interface BendBounds {\n readonly xmin: number; readonly xmax: number;\n readonly ymin: number; readonly ymax: number;\n readonly dx: number; readonly dy: number;\n readonly ddx: number; readonly ddy: number;\n}\n\nexport function* bendSpans(path: PathGeometry): Generator<\n { type: 'move'; point: BendPoint } | { type: 'span'; span: BendSpan } | { type: 'close' }\n> {\n let current: BendPoint = [0, 0], start = current;\n for (const segment of path) {\n switch (segment.type) {\n case 'move':\n current = start = [segment.x, segment.y];\n yield { type: 'move', point: current };\n break;\n case 'line': {\n const end: BendPoint = [segment.x, segment.y];\n yield { type: 'span', span: { points: [current, end] } };\n current = end;\n break;\n }\n case 'quadratic': {\n const end: BendPoint = [segment.x, segment.y];\n yield { type: 'span', span: { points: [current, [segment.cpx, segment.cpy], end] } };\n current = end;\n break;\n }\n case 'cubic': {\n const end: BendPoint = [segment.x, segment.y];\n yield { type: 'span', span: { points: [current, [segment.cp1x, segment.cp1y], [segment.cp2x, segment.cp2y], end] } };\n current = end;\n break;\n }\n case 'arc': {\n const first = arcPoint(segment, segment.startAngle);\n if (current[0] !== first[0] || current[1] !== first[1]) {\n yield { type: 'span', span: { points: [current, first] } };\n }\n yield { type: 'span', span: { arc: segment } };\n current = arcPoint(segment, segment.startAngle + segment.sweep);\n break;\n }\n case 'close':\n yield { type: 'span', span: { points: [current, start] } };\n yield { type: 'close' };\n current = start;\n break;\n }\n }\n}\n\nexport function bendSpanPoint(span: BendSpan, t: number): BendPoint {\n if ('arc' in span) return arcPoint(span.arc, span.arc.startAngle + span.arc.sweep * t);\n let points = span.points;\n while (points.length > 1) {\n points = points.slice(1).map((b, i) => [\n (1 - t) * points[i][0] + t * b[0], (1 - t) * points[i][1] + t * b[1],\n ]);\n }\n return points[0];\n}\n\nexport function splitBendSpan(span: BendSpan): readonly [BendSpan, BendSpan] {\n if ('arc' in span) {\n const arc = span.arc, sweep = arc.sweep / 2;\n return [{ arc: { ...arc, sweep } }, { arc: { ...arc, startAngle: arc.startAngle + sweep, sweep } }];\n }\n let row = span.points;\n const left = [row[0]], right = [row.at(-1)!];\n while (row.length > 1) {\n row = row.slice(1).map((b, i) => [row[i][0] / 2 + b[0] / 2, row[i][1] / 2 + b[1] / 2]);\n left.push(row[0]); right.push(row.at(-1)!);\n }\n return [{ points: left }, { points: right.reverse() }];\n}\n\nexport function bendSpanBounds(span: BendSpan): BendBounds {\n if ('arc' in span) {\n const a = span.arc;\n const [xmin, xmax] = arcRange(a.cx, a.ux, a.vx, a.startAngle, a.sweep);\n const [ymin, ymax] = arcRange(a.cy, a.uy, a.vy, a.startAngle, a.sweep);\n const dx = Math.hypot(a.ux, a.vx) * Math.abs(a.sweep);\n const dy = Math.hypot(a.uy, a.vy) * Math.abs(a.sweep);\n return { xmin, xmax, ymin, ymax, dx, dy, ddx: dx * Math.abs(a.sweep), ddy: dy * Math.abs(a.sweep) };\n }\n const p = span.points, n = p.length - 1;\n const xs = p.map(point => point[0]), ys = p.map(point => point[1]);\n const first = (axis: number) => Math.max(0, ...p.slice(1).map((b, i) => Math.abs(n * (b[axis] - p[i][axis]))));\n const second = (axis: number) => Math.max(0, ...p.slice(2).map((b, i) => Math.abs(n * (n - 1) * ((b[axis] - p[i + 1][axis]) - (p[i + 1][axis] - p[i][axis])))));\n return {\n xmin: Math.min(...xs), xmax: Math.max(...xs), ymin: Math.min(...ys), ymax: Math.max(...ys),\n dx: first(0), dy: first(1), ddx: second(0), ddy: second(1),\n };\n}\n\nfunction arcRange(center: number, u: number, v: number, start: number, sweep: number): readonly [number, number] {\n const values = [center + u * Math.cos(start) + v * Math.sin(start), center + u * Math.cos(start + sweep) + v * Math.sin(start + sweep)];\n const low = Math.min(start, start + sweep), high = Math.max(start, start + sweep);\n const phase = Math.atan2(v, u);\n for (let k = Math.ceil((low - phase) / Math.PI); k <= Math.floor((high - phase) / Math.PI); k++) {\n values.push(center + (k % 2 === 0 ? 1 : -1) * Math.hypot(u, v));\n }\n return [Math.min(...values), Math.max(...values)];\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAiC;AAanC,UAAU,UAAU,MAEzB;AACA,MAAI,UAAqB,CAAC,GAAG,CAAC,GAAG,QAAQ;AACzC,aAAW,WAAW,MAAM;AAC1B,YAAQ,QAAQ,MAAM;AAAA,MACpB,KAAK;AACH,kBAAU,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACvC,cAAM,EAAE,MAAM,QAAQ,OAAO,QAAQ;AACrC;AAAA,MACF,KAAK,QAAQ;AACX,cAAM,MAAiB,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5C,cAAM,EAAE,MAAM,QAAQ,MAAM,EAAE,QAAQ,CAAC,SAAS,GAAG,EAAE,EAAE;AACvD,kBAAU;AACV;AAAA,MACF;AAAA,MACA,KAAK,aAAa;AAChB,cAAM,MAAiB,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5C,cAAM,EAAE,MAAM,QAAQ,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,QAAQ,KAAK,Q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,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,SAAS,IAAI,KAAK,IAAI,QAAQ,KAAK,IAAI,IAAI,KAAK,IAAI,QAAQ,KAAK,CAAC;AACtI,QAAM,MAAM,KAAK,IAAI,OAAO,QAAQ,KAAK,GAAG,OAAO,KAAK,IAAI,OAAO,QAAQ,KAAK;AAChF,QAAM,QAAQ,KAAK,MAAM,GAAG,CAAC;AAC7B,WAAS,IAAI,KAAK,MAAM,MAAM,SAAS,KAAK,EAAE,GAAG,KAAK,KAAK,OAAO,OAAO,SAAS,KAAK,EAAE,GAAG,KAAK;AAC/F,WAAO,KAAK,UAAU,IAAI,MAAM,IAAI,IAAI,MAAM,KAAK,MAAM,GAAG,CAAC,CAAC;AAAA,EAChE;AACA,SAAO,CAAC,KAAK,IAAI,GAAG,MAAM,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;AAClD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ArcBendTransformOptions, BendTransformOptions } from "./transform-bend.js";
|
|
2
|
+
import { PathGeometry } from './path-geometry.js';
|
|
3
|
+
export interface PathBendFrame {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Circular guide geometry used when bending a path along an arc.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link ArcBendTransformOptions}
|
|
13
|
+
*/
|
|
14
|
+
export interface PathBendArc {
|
|
15
|
+
/** Horizontal coordinate of the center. See {@link PathBendArc}. */
|
|
16
|
+
readonly cx: number;
|
|
17
|
+
/** Vertical coordinate of the center. See {@link PathBendArc}. */
|
|
18
|
+
readonly cy: number;
|
|
19
|
+
/** Radius in the coordinate system of this geometry or effect. See {@link PathBendArc}. */
|
|
20
|
+
readonly radius: number;
|
|
21
|
+
/** Angle at which the arc or slice begins. See {@link PathBendArc}. */
|
|
22
|
+
readonly startAngle: number;
|
|
23
|
+
/** Angular extent of the arc. See {@link PathBendArc}. */
|
|
24
|
+
readonly sweep: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Placement of the source along the beginning, center, or end of a bending guide.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link BendTransformOptions}
|
|
30
|
+
*/
|
|
31
|
+
export type PathBendAlign = 'start' | 'center' | 'end';
|
|
32
|
+
/**
|
|
33
|
+
* The source baseline used for bending: an edge, center, or explicit coordinate.
|
|
34
|
+
*
|
|
35
|
+
* @see {@link BendTransformOptions}
|
|
36
|
+
*/
|
|
37
|
+
export type PathBendBaseline = 'center' | 'top' | 'bottom' | number;
|
|
38
|
+
/**
|
|
39
|
+
* Whether bending preserves source length or stretches it to the guide.
|
|
40
|
+
*
|
|
41
|
+
* @see {@link BendTransformOptions}
|
|
42
|
+
*/
|
|
43
|
+
export type PathBendFit = 'none' | 'stretch';
|
|
44
|
+
/**
|
|
45
|
+
* Policy for source geometry extending beyond a bending guide.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link BendTransformOptions}
|
|
48
|
+
*/
|
|
49
|
+
export type PathBendOverflow = 'error' | 'extend' | 'wrap';
|
|
50
|
+
/**
|
|
51
|
+
* Source bounds, guide alignment, baseline, fitting, overflow, and approximation limits for path bending.
|
|
52
|
+
*
|
|
53
|
+
* @see {@link PathBendAlign}
|
|
54
|
+
* @see {@link PathBendBaseline}
|
|
55
|
+
* @see {@link PathBendFit}
|
|
56
|
+
* @see {@link PathBendOverflow}
|
|
57
|
+
*/
|
|
58
|
+
export interface PathBendOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Source coordinate frame used to normalize the geometry before bending. See
|
|
61
|
+
* {@link PathBendFrame}.
|
|
62
|
+
*/
|
|
63
|
+
readonly source: PathBendFrame;
|
|
64
|
+
/** Placement of the source length along the guide. See {@link PathBendAlign}. */
|
|
65
|
+
readonly align?: PathBendAlign;
|
|
66
|
+
/** Source baseline mapped onto the guide. See {@link PathBendBaseline}. */
|
|
67
|
+
readonly baseline?: PathBendBaseline;
|
|
68
|
+
/** Policy for fitting content within its available box. See {@link PathBendFit}. */
|
|
69
|
+
readonly fit?: PathBendFit;
|
|
70
|
+
/** Offset along the guide. See {@link PathBendOptions}. */
|
|
71
|
+
readonly offset?: number;
|
|
72
|
+
/** Offset perpendicular to the guide. See {@link PathBendOptions}. */
|
|
73
|
+
readonly normalOffset?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Policy for geometry extending beyond the guide's available length. See
|
|
76
|
+
* {@link PathBendOverflow}.
|
|
77
|
+
*/
|
|
78
|
+
readonly overflow?: PathBendOverflow;
|
|
79
|
+
/** Positive maximum geometric approximation error. See {@link PathBendOptions}. */
|
|
80
|
+
readonly tolerance: number;
|
|
81
|
+
/** Upper bound on the number of output path segments. See {@link PathBendOptions}. */
|
|
82
|
+
readonly maxSegments?: number;
|
|
83
|
+
}
|
|
84
|
+
export interface BendPathAlongArcOptions extends PathBendOptions {
|
|
85
|
+
readonly arc: PathBendArc;
|
|
86
|
+
}
|
|
87
|
+
/** Bends continuous geometry along an analytic circle; returns independent line geometry. */
|
|
88
|
+
export declare function bendPathAlongArc(source: PathGeometry, options: Readonly<BendPathAlongArcOptions>): PathGeometry;
|
|
89
|
+
/** Bends geometry by distance along one smooth guide contour. */
|
|
90
|
+
export declare function bendPathAlongPath(source: PathGeometry, guide: PathGeometry, options: Readonly<PathBendOptions>): PathGeometry;
|