@motionscript/core 0.1.0 → 0.1.1-alpha.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/CHANGELOG.md +16 -0
- package/dist/assets/asset-index.d.ts +1 -8
- package/dist/assets/asset-index.d.ts.map +1 -1
- package/dist/assets/asset-index.js +1 -8
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +10 -72
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +3 -29
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts +8 -20
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -20
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +9 -51
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +13 -78
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/record.d.ts +2 -18
- package/dist/assets/record.d.ts.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -18
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +2 -11
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +2 -12
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
- package/dist/attributes/audio/effects/chain.js +1 -7
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/registry.d.ts +3 -18
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
- package/dist/attributes/audio/effects/registry.js +4 -23
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/ramp.d.ts +5 -38
- package/dist/attributes/audio/ramp.d.ts.map +1 -1
- package/dist/attributes/audio/ramp.js +3 -28
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +10 -80
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +1 -4
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +2 -12
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +2 -11
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +2 -26
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +1 -9
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +1 -8
- package/dist/attributes/audio/transition.d.ts.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/layout/alignment.d.ts +6 -38
- package/dist/attributes/layout/alignment.d.ts.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +2 -27
- package/dist/attributes/layout/insets.d.ts.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +29 -114
- package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
- package/dist/attributes/layout/matrix2d.js +26 -110
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +3 -25
- package/dist/attributes/layout/size.d.ts.map +1 -1
- package/dist/attributes/layout/size.js +2 -18
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.d.ts +16 -79
- package/dist/attributes/layout/space3d.d.ts.map +1 -1
- package/dist/attributes/layout/space3d.js +17 -81
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.d.ts +2 -23
- package/dist/attributes/layout/transform3d.d.ts.map +1 -1
- package/dist/attributes/layout/transform3d.js +1 -7
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/world-transform.d.ts +2 -16
- package/dist/attributes/layout/world-transform.d.ts.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +13 -73
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +9 -40
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +6 -45
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -37
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +11 -83
- package/dist/attributes/render3d/orbit.d.ts.map +1 -1
- package/dist/attributes/render3d/orbit.js +10 -73
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
- package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js +2 -12
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.d.ts +2 -21
- package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corners.js +2 -12
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js +3 -26
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +36 -328
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +24 -242
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
- package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js +6 -33
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +1 -6
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +1 -7
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +0 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +0 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +1 -9
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +0 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +0 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +2 -8
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +0 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +2 -9
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +0 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +1 -5
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +6 -41
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +7 -45
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +6 -30
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
- package/dist/attributes/shape/effects/spec.js +3 -9
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- package/dist/attributes/shape/fill/blend.d.ts +1 -17
- package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
- package/dist/attributes/shape/fill/blend.js +2 -15
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +17 -125
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +22 -109
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.d.ts +10 -35
- package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
- package/dist/attributes/shape/fill/coerce.js +12 -47
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +15 -91
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js +2 -13
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
- package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js +2 -8
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +6 -23
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
- package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +5 -17
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
- package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +12 -50
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +2 -13
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +2 -9
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
- package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js +8 -35
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +2 -26
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +5 -40
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.d.ts +6 -30
- package/dist/attributes/shape/fill/union.d.ts.map +1 -1
- package/dist/attributes/shape/fill/union.js +1 -9
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +15 -168
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +8 -132
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
- package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -6
- package/dist/attributes/shape/filters/index.d.ts.map +1 -1
- package/dist/attributes/shape/filters/index.js +0 -2
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +5 -35
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +7 -50
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +10 -51
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts +18 -106
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +15 -124
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.d.ts +6 -54
- package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
- package/dist/attributes/shape/path/bezier.js +10 -98
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.d.ts +1 -11
- package/dist/attributes/shape/path/index.d.ts.map +1 -1
- package/dist/attributes/shape/path/index.js +1 -11
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.d.ts +5 -41
- package/dist/attributes/shape/path/measure.d.ts.map +1 -1
- package/dist/attributes/shape/path/measure.js +8 -57
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts +4 -41
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +17 -117
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +5 -19
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.d.ts +10 -67
- package/dist/attributes/shape/path/types.d.ts.map +1 -1
- package/dist/attributes/shape/path/types.js +0 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.d.ts +9 -63
- package/dist/attributes/shape/path/walk.d.ts.map +1 -1
- package/dist/attributes/shape/path/walk.js +21 -100
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +2 -14
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/language.js +1 -8
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.d.ts +13 -78
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +1 -10
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -28
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
- package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js +0 -3
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +0 -6
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +1 -8
- package/dist/attributes/shared/operators.d.ts.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.d.ts +1 -11
- package/dist/attributes/text/index.d.ts.map +1 -1
- package/dist/attributes/text/index.js +1 -11
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +4 -30
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +7 -23
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +5 -28
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-5GLXFSCC.js +13 -0
- package/dist/browser/chunks/chunk-5GLXFSCC.js.map +7 -0
- package/dist/browser/chunks/{chunk-CCGVIR4F.js → chunk-5TDMGUXQ.js} +3 -3
- package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
- package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
- package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js +6 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +3 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -10
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.d.ts +15 -62
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js +29 -168
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.d.ts +1 -14
- package/dist/components/builtins/layout/layout.d.ts.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +11 -51
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +3 -7
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/text/number-format.d.ts +14 -47
- package/dist/components/builtins/text/number-format.d.ts.map +1 -1
- package/dist/components/builtins/text/number-format.js +19 -69
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.d.ts +3 -37
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
- package/dist/components/builtins/text/number-pattern.js +6 -48
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.d.ts +7 -25
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
- package/dist/components/builtins/text/text-defaults.js +7 -25
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.d.ts +2 -11
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
- package/dist/components/builtins/text/text-layout.js +7 -22
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +8 -46
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.d.ts +6 -51
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js +8 -46
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.d.ts +22 -117
- package/dist/components/builtins/three/three.d.ts.map +1 -1
- package/dist/components/builtins/three/three.js +5 -17
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/style.d.ts +38 -0
- package/dist/components/factory/style.d.ts.map +1 -0
- package/dist/components/factory/style.js +104 -0
- package/dist/components/factory/style.js.map +1 -0
- package/dist/components/factory/types.d.ts +9 -0
- package/dist/components/factory/types.d.ts.map +1 -1
- package/dist/components/factory/types.js +11 -0
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +0 -2
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.d.ts +12 -41
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
- package/dist/components/trees/2d/group-bounds.js +3 -22
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js +35 -127
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.d.ts +4 -36
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
- package/dist/components/trees/2d/node-motion.js +3 -31
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +3 -20
- package/dist/components/trees/2d/node-render.d.ts.map +1 -1
- package/dist/components/trees/2d/node-render.js +4 -23
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.d.ts +4 -23
- package/dist/components/trees/2d/node-space.d.ts.map +1 -1
- package/dist/components/trees/2d/node-space.js +3 -17
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.d.ts +4 -33
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
- package/dist/components/trees/2d/node-transform.js +4 -33
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +112 -622
- package/dist/components/trees/2d/node2d.d.ts.map +1 -1
- package/dist/components/trees/2d/node2d.js +131 -605
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +17 -65
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +18 -68
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.d.ts +5 -45
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
- package/dist/components/trees/node/node-editor-state.js +1 -13
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +6 -53
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +4 -33
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.d.ts +2 -15
- package/dist/components/trees/node/node-time.d.ts.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.d.ts +7 -32
- package/dist/components/trees/node/node-walk.d.ts.map +1 -1
- package/dist/components/trees/node/node-walk.js +7 -32
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.d.ts +43 -248
- package/dist/components/trees/node/node.d.ts.map +1 -1
- package/dist/components/trees/node/node.js +51 -229
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js +7 -47
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.d.ts +24 -112
- package/dist/components/trees/three/node3d.d.ts.map +1 -1
- package/dist/components/trees/three/node3d.js +22 -104
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.d.ts +9 -21
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +13 -28
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts +3 -9
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +43 -89
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +14 -37
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +22 -39
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +9 -43
- package/dist/document/deny-globals.d.ts.map +1 -1
- package/dist/document/deny-globals.js +18 -58
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts +6 -16
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +5 -11
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +5 -13
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +0 -2
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts +2 -2
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -18
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +11 -41
- package/dist/document/expression/index.d.ts.map +1 -1
- package/dist/document/expression/index.js +11 -41
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.d.ts +3 -12
- package/dist/document/expression/ops.d.ts.map +1 -1
- package/dist/document/expression/ops.js +4 -20
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts +4 -14
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +34 -55
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +2 -8
- package/dist/document/expression/refs.d.ts.map +1 -1
- package/dist/document/expression/refs.js +2 -6
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.d.ts +18 -63
- package/dist/document/expression/types.d.ts.map +1 -1
- package/dist/document/expression/types.js +4 -15
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts +6 -20
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +18 -44
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.js +2 -3
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +7 -22
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +44 -15
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.d.ts +4 -11
- package/dist/document/missing-node.d.ts.map +1 -1
- package/dist/document/missing-node.js +2 -5
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.d.ts +12 -53
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +16 -57
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +25 -62
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +18 -41
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js +4 -11
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +19 -52
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +2 -6
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +10 -20
- package/dist/document/prop-evolution.d.ts.map +1 -1
- package/dist/document/prop-evolution.js +3 -7
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.d.ts +80 -318
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +43 -147
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +11 -23
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +15 -34
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +6 -15
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +12 -21
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +56 -263
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +71 -275
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +90 -264
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +13 -30
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +10 -40
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +72 -137
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +4 -7
- package/dist/document/vocabulary.d.ts.map +1 -1
- package/dist/document/vocabulary.js +0 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +1 -11
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +6 -20
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +7 -28
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +2 -11
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +2 -22
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +11 -55
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +7 -43
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js +4 -29
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +5 -31
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/stepped-clock.d.ts +1 -16
- package/dist/platform/stepped-clock.d.ts.map +1 -1
- package/dist/platform/stepped-clock.js +1 -16
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +8 -68
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +8 -60
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +11 -45
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +10 -37
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.d.ts +4 -14
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/tree.d.ts +6 -35
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js +1 -8
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +2 -13
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +1 -12
- package/dist/props/layout.d.ts.map +1 -1
- package/dist/props/layout.js +1 -12
- package/dist/props/layout.js.map +1 -1
- package/dist/props/observer.d.ts +1 -7
- package/dist/props/observer.d.ts.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.d.ts +6 -19
- package/dist/props/slot.d.ts.map +1 -1
- package/dist/props/slot.js +5 -14
- package/dist/props/slot.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +8 -68
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +8 -69
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.d.ts +2 -16
- package/dist/render/clip-contains.d.ts.map +1 -1
- package/dist/render/clip-contains.js +21 -82
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +7 -25
- package/dist/render/clip.d.ts.map +1 -1
- package/dist/render/clip.js +5 -17
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.d.ts.map +1 -1
- package/dist/render/descriptors/ellipse.js +0 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.d.ts.map +1 -1
- package/dist/render/descriptors/line.js +0 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.d.ts +4 -32
- package/dist/render/descriptors/path-builder.d.ts.map +1 -1
- package/dist/render/descriptors/path-builder.js +3 -25
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.d.ts +1 -11
- package/dist/render/descriptors/path.d.ts.map +1 -1
- package/dist/render/descriptors/path.js +0 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.d.ts.map +1 -1
- package/dist/render/descriptors/polygon.js +0 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.d.ts.map +1 -1
- package/dist/render/descriptors/polygram.js +0 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.d.ts.map +1 -1
- package/dist/render/descriptors/rect.js +0 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.d.ts.map +1 -1
- package/dist/render/descriptors/richtext.js +0 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +17 -77
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js +13 -47
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -94
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +8 -50
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +5 -16
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js +1 -17
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +24 -116
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +23 -108
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/measure-context.d.ts +5 -29
- package/dist/render/measure-context.d.ts.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.d.ts +2 -20
- package/dist/render/null-render-context.d.ts.map +1 -1
- package/dist/render/null-render-context.js +2 -20
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +52 -208
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.d.ts +2 -19
- package/dist/render/surface.d.ts.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.d.ts +1 -17
- package/dist/render/text-defaults.d.ts.map +1 -1
- package/dist/render/text-defaults.js +6 -40
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.d.ts +12 -55
- package/dist/render/text-layout.d.ts.map +1 -1
- package/dist/render/text-layout.js +2 -16
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts +10 -32
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +2 -12
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +8 -35
- package/dist/render3d/builders.d.ts.map +1 -1
- package/dist/render3d/builders.js +8 -35
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +10 -57
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +4 -26
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +7 -45
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +15 -85
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +18 -106
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js +2 -20
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +29 -133
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +23 -110
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -16
- package/dist/render3d/index.d.ts.map +1 -1
- package/dist/render3d/index.js +1 -16
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts.map +1 -1
- package/dist/render3d/inert.js +1 -14
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.d.ts +3 -26
- package/dist/render3d/light.d.ts.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +13 -87
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js +2 -16
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.d.ts +14 -68
- package/dist/render3d/matrix4.d.ts.map +1 -1
- package/dist/render3d/matrix4.js +11 -60
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.d.ts +13 -51
- package/dist/render3d/render-context3d.d.ts.map +1 -1
- package/dist/render3d/render-context3d.js +9 -21
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.d.ts +9 -53
- package/dist/render3d/resources.d.ts.map +1 -1
- package/dist/render3d/resources.js +8 -48
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.d.ts +7 -21
- package/dist/render3d/rounded-box.d.ts.map +1 -1
- package/dist/render3d/rounded-box.js +7 -46
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +20 -78
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -53
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +12 -59
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.d.ts +2 -25
- package/dist/render3d/segments.d.ts.map +1 -1
- package/dist/render3d/segments.js +1 -11
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +25 -112
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +3 -27
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.d.ts +2 -19
- package/dist/render3d/tracking.d.ts.map +1 -1
- package/dist/render3d/tracking.js +2 -19
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +14 -60
- package/dist/render3d/transform.d.ts.map +1 -1
- package/dist/render3d/transform.js +0 -2
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +6 -48
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +4 -38
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +3 -27
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -33
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +34 -20
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +127 -31
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +14 -53
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js +6 -27
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts +7 -26
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +6 -18
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -2
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.d.ts +3 -9
- package/dist/runtime/builtin-context.d.ts.map +1 -1
- package/dist/runtime/builtin-context.js +3 -9
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +12 -39
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +21 -45
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +26 -68
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +47 -81
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +31 -85
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +16 -49
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +4 -15
- package/dist/runtime/frame-time.d.ts.map +1 -1
- package/dist/runtime/frame-time.js +5 -12
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +59 -139
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +87 -157
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +39 -96
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +98 -141
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts +8 -17
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +7 -16
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +78 -207
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +111 -226
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.d.ts +6 -14
- package/dist/runtime/playback.d.ts.map +1 -1
- package/dist/runtime/playback.js +6 -14
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/project-assets.d.ts +6 -14
- package/dist/runtime/project-assets.d.ts.map +1 -1
- package/dist/runtime/project-assets.js +7 -16
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +22 -45
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +26 -46
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.d.ts +4 -10
- package/dist/runtime/settle.d.ts.map +1 -1
- package/dist/runtime/settle.js +4 -10
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +15 -37
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +27 -44
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +18 -47
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +13 -27
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -7
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +30 -138
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +6 -26
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -6
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +6 -53
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +5 -40
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/curve.d.ts +2 -17
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +1 -6
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +0 -11
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +0 -23
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +2 -18
- package/dist/tween/ease/spec.d.ts.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/inert.d.ts +1 -14
- package/dist/tween/inert.d.ts.map +1 -1
- package/dist/tween/inert.js +1 -14
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.d.ts +2 -26
- package/dist/tween/lerp.d.ts.map +1 -1
- package/dist/tween/lerp.js +2 -26
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.d.ts +9 -50
- package/dist/tween/loop.d.ts.map +1 -1
- package/dist/tween/loop.js +6 -31
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +2 -30
- package/dist/tween/prepare.d.ts.map +1 -1
- package/dist/tween/prepare.js +2 -30
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.d.ts +4 -25
- package/dist/tween/stepper.d.ts.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.d.ts +1 -8
- package/dist/tween/to-command.d.ts.map +1 -1
- package/dist/tween/to-command.js +2 -25
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/context.d.ts +4 -29
- package/dist/util/context.d.ts.map +1 -1
- package/dist/util/context.js +3 -15
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.d.ts +4 -29
- package/dist/util/csv.d.ts.map +1 -1
- package/dist/util/csv.js +3 -22
- package/dist/util/csv.js.map +1 -1
- package/dist/util/metrics.d.ts +2 -26
- package/dist/util/metrics.d.ts.map +1 -1
- package/dist/util/metrics.js +2 -26
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.d.ts +20 -87
- package/dist/util/random.d.ts.map +1 -1
- package/dist/util/random.js +20 -87
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.d.ts +6 -35
- package/dist/util/reference.d.ts.map +1 -1
- package/dist/util/reference.js +1 -4
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.d.ts +6 -27
- package/dist/util/scheduler.d.ts.map +1 -1
- package/dist/util/scheduler.js +8 -35
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +0 -7
- package/dist/browser/chunks/chunk-N4WSN5WY.js +0 -13
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +0 -7
- package/dist/browser/chunks/chunk-WZSI3GSK.js +0 -6
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +0 -7
- package/dist/renamed-scene-names.d.ts +0 -17
- package/dist/renamed-scene-names.d.ts.map +0 -1
- package/dist/renamed-scene-names.js +0 -9
- package/dist/renamed-scene-names.js.map +0 -1
- package/dist/runtime/precompisition.d.ts +0 -24
- package/dist/runtime/precompisition.d.ts.map +0 -1
- package/dist/runtime/precompisition.js +0 -7
- package/dist/runtime/precompisition.js.map +0 -1
|
@@ -4,44 +4,24 @@ import { type Color } from "../attributes/shape/fill/color/parser.js";
|
|
|
4
4
|
import type { Vector3, Vector3Input } from "./vector3.js";
|
|
5
5
|
import type { Segments3D } from "./segments.js";
|
|
6
6
|
/**
|
|
7
|
-
* Anything not modelled by a named field, assigned straight onto the constructed
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* **Where it is applied**: materials, lights (and a light's `shadow`) and
|
|
14
|
-
* cameras. **Where it is not**: geometries, the environment and post effects. A
|
|
15
|
-
* `params` there is recorded and nothing reads it (probe: `box({ params: { name:
|
|
16
|
-
* "x" } })` leaves the built geometry's `name` empty), and in development the
|
|
17
|
-
* first one warns. Set a geometry's own fields instead.
|
|
7
|
+
* Anything not modelled by a named field, assigned straight onto the constructed object: the last resort, unsafe by
|
|
8
|
+
* construction (it bypasses the type system, and any change is a full rebuild since the renderer can't know what a
|
|
9
|
+
* key affects). **Applied** to materials, lights (and a light's `shadow`) and cameras; **not** to geometries, the
|
|
10
|
+
* environment or post effects, where it is recorded and nothing reads it (in development the first warns). Set a
|
|
11
|
+
* geometry's own fields instead.
|
|
18
12
|
*/
|
|
19
13
|
export interface Passthrough3D {
|
|
20
14
|
params?: Record<string, unknown>;
|
|
21
15
|
}
|
|
22
16
|
/**
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
* `Ellipse` has said `startAngle` / `sweep` in degrees since the beginning, so 3D
|
|
26
|
-
* says it too. It replaces three's five spellings of the same idea —
|
|
27
|
-
* `thetaStart`, `thetaLength`, `phiStart`, `phiLength` and `arc` — which differ
|
|
28
|
-
* per shape for reasons that are about three's own history rather than about
|
|
29
|
-
* anything an author is trying to draw.
|
|
30
|
-
*/
|
|
17
|
+
/** A partial revolution shared by every shape that has one: `startAngle` / `sweep` in degrees as 2D `Ellipse` says them, replacing three's per-shape spellings (`thetaStart`, `thetaLength`, `phiStart`, `phiLength`, `arc`). */
|
|
31
18
|
export interface Sweep3D {
|
|
32
19
|
/** Where the revolution begins, in **degrees**. Default 0. */
|
|
33
20
|
startAngle?: number;
|
|
34
21
|
/** How far it runs, in **degrees**. Default 360 (or 180 for a half sweep). */
|
|
35
22
|
sweep?: number;
|
|
36
23
|
}
|
|
37
|
-
/**
|
|
38
|
-
* A box.
|
|
39
|
-
*
|
|
40
|
-
* `cornerRadius` is the same control `Rect` carries in 2D and rounds all twelve
|
|
41
|
-
* edges; it is most of the difference between a scene that reads as designed and
|
|
42
|
-
* one that reads as a renderer test. See `evaluateRoundedBox` for how the
|
|
43
|
-
* surface is built.
|
|
44
|
-
*/
|
|
24
|
+
/** A box. `cornerRadius` is the same control `Rect` has in 2D and rounds all twelve edges; see `evaluateRoundedBox` for how the surface is built. */
|
|
45
25
|
export interface BoxGeometry3D extends Passthrough3D {
|
|
46
26
|
type: "box";
|
|
47
27
|
width?: number;
|
|
@@ -70,12 +50,7 @@ export interface PlaneGeometry3D extends Passthrough3D {
|
|
|
70
50
|
/** `[width, height]`. Raise to subdivide for per-vertex displacement. */
|
|
71
51
|
segments?: Segments3D;
|
|
72
52
|
}
|
|
73
|
-
/**
|
|
74
|
-
* A cylinder, or any tapered tube.
|
|
75
|
-
*
|
|
76
|
-
* `radius` takes `[top, bottom]` for a taper, which is what `radiusTop` and
|
|
77
|
-
* `radiusBottom` were — one field, and the pair reads as the thing it describes.
|
|
78
|
-
*/
|
|
53
|
+
/** A cylinder, or any tapered tube: `radius` takes `[top, bottom]` for a taper. */
|
|
79
54
|
export interface CylinderGeometry3D extends Passthrough3D, Sweep3D {
|
|
80
55
|
type: "cylinder";
|
|
81
56
|
/** A scalar, or `[top, bottom]` to taper. Default 1. */
|
|
@@ -153,12 +128,7 @@ export interface Bevel3D {
|
|
|
153
128
|
offset?: number;
|
|
154
129
|
segments?: number;
|
|
155
130
|
}
|
|
156
|
-
/**
|
|
157
|
-
* A 2D outline swept into a solid. `path` accepts the same `PathData` (SVG
|
|
158
|
-
* string or command list) or {@link PathBuilder} the 2D `Path` node takes — same
|
|
159
|
-
* name, same value — so an existing 2D outline becomes an extruded solid with no
|
|
160
|
-
* new vocabulary.
|
|
161
|
-
*/
|
|
131
|
+
/** A 2D outline swept into a solid. `path` takes the same `PathData` or {@link PathBuilder} as the 2D `Path` node, so an existing outline extrudes with no new vocabulary. */
|
|
162
132
|
export interface ExtrudeGeometry3D extends Passthrough3D {
|
|
163
133
|
type: "extrude";
|
|
164
134
|
path: PathData | PathBuilder;
|
|
@@ -185,14 +155,7 @@ export interface TubeGeometry3D extends Passthrough3D {
|
|
|
185
155
|
segments?: Segments3D;
|
|
186
156
|
closed?: boolean;
|
|
187
157
|
}
|
|
188
|
-
/**
|
|
189
|
-
* Raw vertex buffers — the general escape hatch that makes *any* computable mesh
|
|
190
|
-
* expressible without leaving pure data.
|
|
191
|
-
*
|
|
192
|
-
* `position` is required and holds `[x, y, z, x, y, z, …]`. `index` lets vertices
|
|
193
|
-
* be shared between faces. Omit `normal` and set {@link computeNormals} to have
|
|
194
|
-
* them derived.
|
|
195
|
-
*/
|
|
158
|
+
/** Raw vertex buffers: the escape hatch that makes any computable mesh expressible as pure data. `position` (`[x, y, z, ...]`) is required; `index` shares vertices between faces; omit `normal` and set {@link computeNormals} to derive them. */
|
|
196
159
|
export interface BufferGeometry3D extends Passthrough3D {
|
|
197
160
|
type: "buffer";
|
|
198
161
|
/** Flat `xyz` triples. */
|
|
@@ -207,18 +170,7 @@ export interface BufferGeometry3D extends Passthrough3D {
|
|
|
207
170
|
index?: ArrayLike<number>;
|
|
208
171
|
/** Derive vertex normals after upload — needed for correct lighting. */
|
|
209
172
|
computeNormals?: boolean;
|
|
210
|
-
/**
|
|
211
|
-
* Bump after mutating an array **in place** to force a re-upload.
|
|
212
|
-
*
|
|
213
|
-
* Reusing one `Float32Array` across frames and writing into it is the fast
|
|
214
|
-
* way to animate a mesh, but it defeats identity comparison — the renderer
|
|
215
|
-
* sees the same array object and cannot tell the contents changed. Bumping
|
|
216
|
-
* `revision` tells it explicitly.
|
|
217
|
-
*
|
|
218
|
-
* With `revision` omitted the renderer re-uploads every frame, which is
|
|
219
|
-
* correct-by-default for a buffer you built deliberately. Set
|
|
220
|
-
* {@link staticData} once the data stops changing.
|
|
221
|
-
*/
|
|
173
|
+
/** Bump after mutating an array **in place** to force a re-upload: reusing one `Float32Array` across frames is the fast way to animate a mesh but defeats identity comparison. Omitted, the renderer re-uploads every frame (correct by default); set {@link staticData} once the data stops changing. */
|
|
222
174
|
revision?: number;
|
|
223
175
|
/**
|
|
224
176
|
* Declare the arrays immutable, so the renderer compares by identity alone
|
|
@@ -229,12 +181,9 @@ export interface BufferGeometry3D extends Passthrough3D {
|
|
|
229
181
|
/** One evaluated vertex of a {@link ParametricGeometry3D} surface. */
|
|
230
182
|
export type ParametricVertex3D = Vector3 | readonly [number, number, number];
|
|
231
183
|
/**
|
|
232
|
-
* A surface sampled over a `[0,1]
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* Core evaluates the callbacks into vertex buffers at record time, so the
|
|
236
|
-
* descriptor handed to the renderer is still plain data. Re-evaluated every
|
|
237
|
-
* frame, so read the node's props and the frame time inside `vertex`.
|
|
184
|
+
* A surface sampled over a `[0,1] x [0,1]` grid: the ergonomic form of {@link BufferGeometry3D} for procedural
|
|
185
|
+
* meshes. Core evaluates the callbacks into vertex buffers, so the descriptor stays plain data; it re-evaluates
|
|
186
|
+
* every frame, so read the node's props and frame time inside `vertex`.
|
|
238
187
|
*
|
|
239
188
|
* Geo.parametric({
|
|
240
189
|
* segments: [70, 70],
|
|
@@ -252,34 +201,10 @@ export interface ParametricGeometry3D extends Passthrough3D {
|
|
|
252
201
|
color?: (u: number, v: number, position: Vector3) => Color;
|
|
253
202
|
/** Derive vertex normals. Almost always wanted for a lit surface. */
|
|
254
203
|
computeNormals?: boolean;
|
|
255
|
-
/**
|
|
256
|
-
* A value that changes exactly when {@link vertex} would return something
|
|
257
|
-
* different — supply it and the surface is re-evaluated only when it moves.
|
|
258
|
-
*
|
|
259
|
-
* Omitted (the default) the surface is re-evaluated **every frame**, which is
|
|
260
|
-
* what makes the `read the node's props and the frame time inside vertex` contract
|
|
261
|
-
* above work without any bookkeeping. It is also expensive: `segments: 80` is
|
|
262
|
-
* ~6.6k calls to `vertex`, plus normals and a full buffer re-upload, and a
|
|
263
|
-
* frame draws for any reason at all — an unrelated node being dragged, the
|
|
264
|
-
* camera orbiting, a tween elsewhere in the scene. A surface whose shape did
|
|
265
|
-
* not change pays all of that for an identical result.
|
|
266
|
-
*
|
|
267
|
-
* `vertex` is a closure, so the renderer cannot inspect what it captured;
|
|
268
|
-
* only the author knows. Derive this from exactly those captures — the
|
|
269
|
-
* domain, the amplitude, the identity of the function being plotted — and
|
|
270
|
-
* leave it out for a surface that genuinely varies with time.
|
|
271
|
-
*
|
|
272
|
-
* Same name and same role as {@link BufferGeometry3D.revision}: the explicit
|
|
273
|
-
* "this is what changed" marker. `segments` needs no help here, being plain
|
|
274
|
-
* data the renderer already compares.
|
|
275
|
-
*/
|
|
204
|
+
/** A value that changes exactly when {@link vertex} would return something different; supply it and the surface re-evaluates only when it moves. Omitted, it re-evaluates every frame (`segments: 80` is ~6.6k `vertex` calls plus normals and a buffer re-upload, on any frame at all). The renderer can't inspect what the `vertex` closure captured, so derive this from exactly those captures; omit it for a surface that varies with time. Same role as {@link BufferGeometry3D.revision}. */
|
|
276
205
|
revision?: number;
|
|
277
206
|
}
|
|
278
|
-
/**
|
|
279
|
-
* The hard edges of another geometry, as line segments — a clean wireframe
|
|
280
|
-
* outline without the diagonals of a triangulated one. Draw it with
|
|
281
|
-
* `Graphics3D.line({ segments: true })`.
|
|
282
|
-
*/
|
|
207
|
+
/** The hard edges of another geometry as line segments, for a clean wireframe without triangulation diagonals. Draw with `Graphics3D.line({ segments: true })`. */
|
|
283
208
|
export interface EdgesGeometry3D extends Passthrough3D {
|
|
284
209
|
type: "edges";
|
|
285
210
|
source: Geometry3D;
|
|
@@ -302,21 +227,8 @@ export interface ModelGeometry3D extends Passthrough3D {
|
|
|
302
227
|
export declare function cylinderRadii(radius: number | readonly [number, number] | undefined): [number, number];
|
|
303
228
|
/** Normalize {@link ExtrudeGeometry3D.bevel} to its full option set, or `null`. */
|
|
304
229
|
export declare function resolveBevel3D(bevel: number | Bevel3D | undefined): Required<Bevel3D> | null;
|
|
305
|
-
/**
|
|
306
|
-
* Evaluate a {@link ParametricGeometry3D} into concrete vertex buffers.
|
|
307
|
-
*
|
|
308
|
-
* Lives in core rather than the renderer so the grid/winding maths is
|
|
309
|
-
* backend-agnostic and unit-testable without a GPU. Called by the renderer at
|
|
310
|
-
* draw time (not at record time) so the cost is only paid when the frame is
|
|
311
|
-
* actually rasterized, and never during the asset-tracking replay.
|
|
312
|
-
*
|
|
313
|
-
* The grid is `(segments + 1)²` vertices wound counter-clockwise, so front faces
|
|
314
|
-
* point along +Y for a surface authored in the XZ plane.
|
|
315
|
-
*/
|
|
230
|
+
/** Evaluates a {@link ParametricGeometry3D} into vertex buffers. In core so the grid/winding maths is backend-agnostic and unit-testable without a GPU; the renderer calls it at draw time (not record time), so the cost is paid only when rasterized, never during the asset-tracking replay. The grid is `(segments + 1)²` vertices wound counter-clockwise, so front faces point along +Y for a surface in the XZ plane. */
|
|
316
231
|
export declare function evaluateParametric(geometry: ParametricGeometry3D): BufferGeometry3D;
|
|
317
|
-
/**
|
|
318
|
-
* Every geometry a mesh can be built from. Discriminated on `type`, so new
|
|
319
|
-
* shapes are additive.
|
|
320
|
-
*/
|
|
232
|
+
/** Every geometry a mesh can be built from, discriminated on `type`. */
|
|
321
233
|
export type Geometry3D = BoxGeometry3D | SphereGeometry3D | PlaneGeometry3D | CylinderGeometry3D | ConeGeometry3D | TorusGeometry3D | TorusKnotGeometry3D | CircleGeometry3D | RingGeometry3D | CapsuleGeometry3D | PolyhedronGeometry3D | ExtrudeGeometry3D | LatheGeometry3D | TubeGeometry3D | BufferGeometry3D | ParametricGeometry3D | EdgesGeometry3D | WireframeGeometry3D | ModelGeometry3D;
|
|
322
234
|
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/render3d/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/render3d/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;kOACkO;AAClO,MAAM,WAAW,OAAO;IACpB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,KAA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
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Evaluate a {@link ParametricGeometry3D} into concrete vertex buffers.
|
|
27
|
-
*
|
|
28
|
-
* Lives in core rather than the renderer so the grid/winding maths is
|
|
29
|
-
* backend-agnostic and unit-testable without a GPU. Called by the renderer at
|
|
30
|
-
* draw time (not at record time) so the cost is only paid when the frame is
|
|
31
|
-
* actually rasterized, and never during the asset-tracking replay.
|
|
32
|
-
*
|
|
33
|
-
* The grid is `(segments + 1)²` vertices wound counter-clockwise, so front faces
|
|
34
|
-
* point along +Y for a surface authored in the XZ plane.
|
|
35
|
-
*/
|
|
25
|
+
/** Evaluates a {@link ParametricGeometry3D} into vertex buffers. In core so the grid/winding maths is backend-agnostic and unit-testable without a GPU; the renderer calls it at draw time (not record time), so the cost is paid only when rasterized, never during the asset-tracking replay. The grid is `(segments + 1)²` vertices wound counter-clockwise, so front faces point along +Y for a surface in the XZ plane. */
|
|
36
26
|
export function evaluateParametric(geometry) {
|
|
37
27
|
const resolved = geometry.segments;
|
|
38
28
|
const [uSegments, vSegments] = typeof resolved === "number"
|
|
@@ -101,15 +91,7 @@ export function evaluateParametric(geometry) {
|
|
|
101
91
|
params: geometry.params,
|
|
102
92
|
};
|
|
103
93
|
}
|
|
104
|
-
/**
|
|
105
|
-
* A {@link Color} as **linear-light** RGB, which is what a vertex-colour buffer
|
|
106
|
-
* must hold: a renderer samples that attribute directly into its linear working
|
|
107
|
-
* space, with no decode step of its own.
|
|
108
|
-
*
|
|
109
|
-
* `parseColor` returns gamma-encoded sRGB (hex is `byte / 255`), so the sRGB
|
|
110
|
-
* transfer function has to be inverted here. Skipping this renders vertex-coloured
|
|
111
|
-
* surfaces visibly washed out.
|
|
112
|
-
*/
|
|
94
|
+
/** A {@link Color} as **linear-light** RGB, which a vertex-colour buffer must hold (the renderer samples it into linear space with no decode). `parseColor` returns gamma-encoded sRGB, so skipping the inversion renders vertex-coloured surfaces washed out. */
|
|
113
95
|
function resolveLinearRgb(color) {
|
|
114
96
|
const [r, g, b] = typeof color === "string" ? parseColor(color) : color;
|
|
115
97
|
return [srgbToLinear(r), srgbToLinear(g), srgbToLinear(b)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../src/render3d/geometry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,UAAU,EAAE,MAAM,sCAAsC,CAAC;AA0U9E,+EAA+E;AAC/E,MAAM,UAAU,aAAa,CACzB,MAAsD;IAEtD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxD,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,KAAmC;IAC9D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACpE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;IACjC,OAAO;QACH,IAAI;QACJ,2EAA2E;QAC3E,mEAAmE;QACnE,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,GAAG,CAAC;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC;QAC3B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC;KAClC,CAAC;AACN,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAA8B;IAC7D,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,CAAC,CAAC;QAClE,CAAC;IACL,CAAC;IAED,OAAO;QACH,IAAI,EAAE,QAAQ;QACd,QAAQ;QACR,EAAE;QACF,KAAK;QACL,KAAK;QACL,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,MAAM,EAAE,QAAQ,CAAC,MAAM;KAC1B,CAAC;AACN,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CAAC,KAAY;IAClC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,mEAAmE;AACnE,SAAS,YAAY,CAAC,OAAe;IACjC,OAAO,OAAO,IAAI,OAAO;QACrB,CAAC,CAAC,OAAO,GAAG,KAAK;QACjB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import type { PathData } from \"@/render/descriptors/path\";\nimport type { PathBuilder } from \"@/render/descriptors/path-builder\";\nimport { type Color, parseColor } from \"@/attributes/shape/fill/color/parser\";\nimport type { Vector3, Vector3Input } from \"./vector3\";\nimport type { Segments3D } from \"./segments\";\n\n/**\n * Anything not modelled by a named field, assigned straight onto the constructed\n * object. The documented last resort — unsafe by construction (it bypasses the\n * type system, and the renderer treats any change to it as a full rebuild since\n * it cannot know what a given key affects), but it means no author is ever\n * blocked waiting for a field to be modelled here.\n *\n * **Where it is applied**: materials, lights (and a light's `shadow`) and\n * cameras. **Where it is not**: geometries, the environment and post effects. A\n * `params` there is recorded and nothing reads it (probe: `box({ params: { name:\n * \"x\" } })` leaves the built geometry's `name` empty), and in development the\n * first one warns. Set a geometry's own fields instead.\n */\nexport interface Passthrough3D {\n params?: Record<string, unknown>;\n}\n\n/**\n * A partial revolution, shared by every shape that has one.\n *\n * `Ellipse` has said `startAngle` / `sweep` in degrees since the beginning, so 3D\n * says it too. It replaces three's five spellings of the same idea —\n * `thetaStart`, `thetaLength`, `phiStart`, `phiLength` and `arc` — which differ\n * per shape for reasons that are about three's own history rather than about\n * anything an author is trying to draw.\n */\nexport interface Sweep3D {\n /** Where the revolution begins, in **degrees**. Default 0. */\n startAngle?: number;\n /** How far it runs, in **degrees**. Default 360 (or 180 for a half sweep). */\n sweep?: number;\n}\n\n// ─── Primitives ──────────────────────────────────────────────────────────────\n\n/**\n * A box.\n *\n * `cornerRadius` is the same control `Rect` carries in 2D and rounds all twelve\n * edges; it is most of the difference between a scene that reads as designed and\n * one that reads as a renderer test. See `evaluateRoundedBox` for how the\n * surface is built.\n */\nexport interface BoxGeometry3D extends Passthrough3D {\n type: \"box\";\n width?: number;\n height?: number;\n depth?: number;\n /** Rounds every edge and corner. Clamped to the smallest half-extent. */\n cornerRadius?: number;\n /** Face subdivision, as `[x, y, z]`. Default 1. */\n segments?: Segments3D;\n}\n\n/** A sphere, or a wedge/band of one via {@link Sweep3D} and the latitude pair. */\nexport interface SphereGeometry3D extends Passthrough3D, Sweep3D {\n type: \"sphere\";\n radius?: number;\n /** `[longitude, latitude]`. Default `[32, 16]`. */\n segments?: Segments3D;\n /** Vertical band start, in **degrees** from the north pole. Default 0. */\n startLatitude?: number;\n /** Vertical band extent, in **degrees**. Default 180 (pole to pole). */\n latitudeSweep?: number;\n}\n\nexport interface PlaneGeometry3D extends Passthrough3D {\n type: \"plane\";\n width?: number;\n height?: number;\n /** `[width, height]`. Raise to subdivide for per-vertex displacement. */\n segments?: Segments3D;\n}\n\n/**\n * A cylinder, or any tapered tube.\n *\n * `radius` takes `[top, bottom]` for a taper, which is what `radiusTop` and\n * `radiusBottom` were — one field, and the pair reads as the thing it describes.\n */\nexport interface CylinderGeometry3D extends Passthrough3D, Sweep3D {\n type: \"cylinder\";\n /** A scalar, or `[top, bottom]` to taper. Default 1. */\n radius?: number | readonly [number, number];\n height?: number;\n /** `[radial, height]`. Default `[32, 1]`. */\n segments?: Segments3D;\n /** Draw the end caps. Default true. */\n capped?: boolean;\n}\n\nexport interface ConeGeometry3D extends Passthrough3D, Sweep3D {\n type: \"cone\";\n radius?: number;\n height?: number;\n /** `[radial, height]`. Default `[32, 1]`. */\n segments?: Segments3D;\n /** Draw the base cap. Default true. */\n capped?: boolean;\n}\n\nexport interface TorusGeometry3D extends Passthrough3D, Sweep3D {\n type: \"torus\";\n /** Distance from the centre to the middle of the ring. */\n radius?: number;\n /** Thickness of the ring itself. Default 0.4. */\n thickness?: number;\n /** `[radial, tubular]`. Default `[16, 48]`. */\n segments?: Segments3D;\n}\n\nexport interface TorusKnotGeometry3D extends Passthrough3D {\n type: \"torusKnot\";\n radius?: number;\n /** Thickness of the strand. Default 0.4. */\n thickness?: number;\n /** `[tubular, radial]`. Default `[64, 8]`. */\n segments?: Segments3D;\n /** Winding counts as `[around the axis, around the torus]`. Default `[2, 3]`. */\n windings?: readonly [number, number];\n}\n\nexport interface CircleGeometry3D extends Passthrough3D, Sweep3D {\n type: \"circle\";\n radius?: number;\n /** Default 32. */\n segments?: Segments3D;\n}\n\n/** A flat annulus — a disc with a hole. */\nexport interface RingGeometry3D extends Passthrough3D, Sweep3D {\n type: \"ring\";\n /** Outer radius. Default 1. */\n radius?: number;\n /** Inner radius — the size of the hole. Default 0.5. */\n innerRadius?: number;\n /** `[around, radial]`. Default `[32, 1]`. */\n segments?: Segments3D;\n}\n\nexport interface CapsuleGeometry3D extends Passthrough3D {\n type: \"capsule\";\n /** Default 0.5. */\n radius?: number;\n /** Length of the straight mid-section, excluding the caps. Default 1. */\n height?: number;\n /** `[radial, cap]`. Default `[16, 8]`. */\n segments?: Segments3D;\n}\n\nexport interface PolyhedronGeometry3D extends Passthrough3D {\n type: \"polyhedron\";\n shape: \"tetrahedron\" | \"octahedron\" | \"icosahedron\" | \"dodecahedron\";\n radius?: number;\n /** Subdivision. Raising this on an icosahedron approximates a sphere. */\n segments?: Segments3D;\n}\n\n// ─── Path-derived (reuses core's own 2D path vocabulary) ─────────────────────\n\n/** How an extrusion's edge is chamfered. A bare number is the bevel's size. */\nexport interface Bevel3D {\n size?: number;\n thickness?: number;\n offset?: number;\n segments?: number;\n}\n\n/**\n * A 2D outline swept into a solid. `path` accepts the same `PathData` (SVG\n * string or command list) or {@link PathBuilder} the 2D `Path` node takes — same\n * name, same value — so an existing 2D outline becomes an extruded solid with no\n * new vocabulary.\n */\nexport interface ExtrudeGeometry3D extends Passthrough3D {\n type: \"extrude\";\n path: PathData | PathBuilder;\n depth?: number;\n /** Curve flattening resolution. Default 12. */\n segments?: Segments3D;\n /** A number is the bevel size; an object tunes the rest. Omit for no bevel. */\n bevel?: number | Bevel3D;\n}\n\n/** A profile revolved about the Y axis — vases, bowls, turned shapes. */\nexport interface LatheGeometry3D extends Passthrough3D, Sweep3D {\n type: \"lathe\";\n /** Profile points in the XY plane; `x` is the radius, `y` the height. */\n points: readonly Vector3Input[];\n /** Default 12. */\n segments?: Segments3D;\n}\n\n/** A circular cross-section swept along a 3D curve. */\nexport interface TubeGeometry3D extends Passthrough3D {\n type: \"tube\";\n points: readonly Vector3Input[];\n radius?: number;\n /** `[along the curve, around it]`. Default `[64, 8]`. */\n segments?: Segments3D;\n closed?: boolean;\n}\n\n// ─── Arbitrary vertex data ───────────────────────────────────────────────────\n\n/**\n * Raw vertex buffers — the general escape hatch that makes *any* computable mesh\n * expressible without leaving pure data.\n *\n * `position` is required and holds `[x, y, z, x, y, z, …]`. `index` lets vertices\n * be shared between faces. Omit `normal` and set {@link computeNormals} to have\n * them derived.\n */\nexport interface BufferGeometry3D extends Passthrough3D {\n type: \"buffer\";\n /** Flat `xyz` triples. */\n position: ArrayLike<number>;\n /** Flat `xyz` triples. Omit and set {@link computeNormals} to derive them. */\n normal?: ArrayLike<number>;\n /** Flat `uv` pairs. */\n uv?: ArrayLike<number>;\n /** Flat linear `rgb` triples. Needs `vertexColors: true` on the material. */\n color?: ArrayLike<number>;\n /** Triangle indices into the arrays above. */\n index?: ArrayLike<number>;\n /** Derive vertex normals after upload — needed for correct lighting. */\n computeNormals?: boolean;\n /**\n * Bump after mutating an array **in place** to force a re-upload.\n *\n * Reusing one `Float32Array` across frames and writing into it is the fast\n * way to animate a mesh, but it defeats identity comparison — the renderer\n * sees the same array object and cannot tell the contents changed. Bumping\n * `revision` tells it explicitly.\n *\n * With `revision` omitted the renderer re-uploads every frame, which is\n * correct-by-default for a buffer you built deliberately. Set\n * {@link staticData} once the data stops changing.\n */\n revision?: number;\n /**\n * Declare the arrays immutable, so the renderer compares by identity alone\n * and skips the per-frame re-upload. Only safe when you never mutate in place.\n */\n staticData?: boolean;\n}\n\n/** One evaluated vertex of a {@link ParametricGeometry3D} surface. */\nexport type ParametricVertex3D = Vector3 | readonly [number, number, number];\n\n/**\n * A surface sampled over a `[0,1] × [0,1]` grid — the ergonomic form of\n * {@link BufferGeometry3D} for procedural meshes (waves, terrain, ribbons).\n *\n * Core evaluates the callbacks into vertex buffers at record time, so the\n * descriptor handed to the renderer is still plain data. Re-evaluated every\n * frame, so read the node's props and the frame time inside `vertex`.\n *\n * Geo.parametric({\n * segments: [70, 70],\n * vertex: (u, v) => ({ x: (u - 0.5) * 20, y: wave(u, v, t), z: (v - 0.5) * 20 }),\n * computeNormals: true,\n * })\n */\nexport interface ParametricGeometry3D extends Passthrough3D {\n type: \"parametric\";\n /** Grid resolution as `[u, v]`, or one number for both. */\n segments: Segments3D;\n /** Position for grid coordinate `(u, v)`, both in `[0, 1]`. */\n vertex: (u: number, v: number) => ParametricVertex3D;\n /** Optional per-vertex colour. Needs `vertexColors: true` on the material. */\n color?: (u: number, v: number, position: Vector3) => Color;\n /** Derive vertex normals. Almost always wanted for a lit surface. */\n computeNormals?: boolean;\n /**\n * A value that changes exactly when {@link vertex} would return something\n * different — supply it and the surface is re-evaluated only when it moves.\n *\n * Omitted (the default) the surface is re-evaluated **every frame**, which is\n * what makes the `read the node's props and the frame time inside vertex` contract\n * above work without any bookkeeping. It is also expensive: `segments: 80` is\n * ~6.6k calls to `vertex`, plus normals and a full buffer re-upload, and a\n * frame draws for any reason at all — an unrelated node being dragged, the\n * camera orbiting, a tween elsewhere in the scene. A surface whose shape did\n * not change pays all of that for an identical result.\n *\n * `vertex` is a closure, so the renderer cannot inspect what it captured;\n * only the author knows. Derive this from exactly those captures — the\n * domain, the amplitude, the identity of the function being plotted — and\n * leave it out for a surface that genuinely varies with time.\n *\n * Same name and same role as {@link BufferGeometry3D.revision}: the explicit\n * \"this is what changed\" marker. `segments` needs no help here, being plain\n * data the renderer already compares.\n */\n revision?: number;\n}\n\n// ─── Derived ─────────────────────────────────────────────────────────────────\n\n/**\n * The hard edges of another geometry, as line segments — a clean wireframe\n * outline without the diagonals of a triangulated one. Draw it with\n * `Graphics3D.line({ segments: true })`.\n */\nexport interface EdgesGeometry3D extends Passthrough3D {\n type: \"edges\";\n source: Geometry3D;\n /** Minimum dihedral angle in **degrees** for an edge to count. Default 1. */\n thresholdAngle?: number;\n}\n\n/** Every triangle edge of another geometry, as line segments. */\nexport interface WireframeGeometry3D extends Passthrough3D {\n type: \"wireframe\";\n source: Geometry3D;\n}\n\n/** Geometry taken from a loaded model file, by node name. */\nexport interface ModelGeometry3D extends Passthrough3D {\n type: \"modelGeometry\";\n src: string;\n /** Which node of the model to take. Defaults to the first mesh found. */\n node?: string;\n}\n\n/** Normalize {@link CylinderGeometry3D.radius} to its `[top, bottom]` pair. */\nexport function cylinderRadii(\n radius: number | readonly [number, number] | undefined,\n): [number, number] {\n if (radius === undefined) return [1, 1];\n if (typeof radius === \"number\") return [radius, radius];\n return [radius[0] ?? 1, radius[1] ?? radius[0] ?? 1];\n}\n\n/** Normalize {@link ExtrudeGeometry3D.bevel} to its full option set, or `null`. */\nexport function resolveBevel3D(bevel: number | Bevel3D | undefined): Required<Bevel3D> | null {\n if (bevel === undefined) return null;\n const options = typeof bevel === \"number\" ? { size: bevel } : bevel;\n const size = options.size ?? 0.1;\n return {\n size,\n // Scaled off `size` rather than defaulted independently, so the one-number\n // form produces a bevel with sane proportions instead of a sliver.\n thickness: options.thickness ?? size * 2,\n offset: options.offset ?? 0,\n segments: options.segments ?? 3,\n };\n}\n\n/**\n * Evaluate a {@link ParametricGeometry3D} into concrete vertex buffers.\n *\n * Lives in core rather than the renderer so the grid/winding maths is\n * backend-agnostic and unit-testable without a GPU. Called by the renderer at\n * draw time (not at record time) so the cost is only paid when the frame is\n * actually rasterized, and never during the asset-tracking replay.\n *\n * The grid is `(segments + 1)²` vertices wound counter-clockwise, so front faces\n * point along +Y for a surface authored in the XZ plane.\n */\nexport function evaluateParametric(geometry: ParametricGeometry3D): BufferGeometry3D {\n const resolved = geometry.segments;\n const [uSegments, vSegments] = typeof resolved === \"number\"\n ? [resolved, resolved]\n : [resolved[0] ?? 1, resolved[1] ?? resolved[0] ?? 1];\n\n const uCount = Math.max(1, Math.floor(uSegments)) + 1;\n const vCount = Math.max(1, Math.floor(vSegments)) + 1;\n\n const position = new Float32Array(uCount * vCount * 3);\n const uv = new Float32Array(uCount * vCount * 2);\n const color = geometry.color ? new Float32Array(uCount * vCount * 3) : undefined;\n\n const scratch: Vector3 = { x: 0, y: 0, z: 0 };\n\n for (let vi = 0; vi < vCount; vi++) {\n const v = vi / (vCount - 1);\n for (let ui = 0; ui < uCount; ui++) {\n const u = ui / (uCount - 1);\n const index = vi * uCount + ui;\n\n const vertex = geometry.vertex(u, v);\n if (Array.isArray(vertex)) {\n scratch.x = vertex[0]; scratch.y = vertex[1]; scratch.z = vertex[2];\n } else {\n const p = vertex as Vector3;\n scratch.x = p.x; scratch.y = p.y; scratch.z = p.z;\n }\n\n position[index * 3] = scratch.x;\n position[index * 3 + 1] = scratch.y;\n position[index * 3 + 2] = scratch.z;\n\n uv[index * 2] = u;\n uv[index * 2 + 1] = v;\n\n if (color && geometry.color) {\n const rgba = resolveLinearRgb(geometry.color(u, v, scratch));\n color[index * 3] = rgba[0];\n color[index * 3 + 1] = rgba[1];\n color[index * 3 + 2] = rgba[2];\n }\n }\n }\n\n // Two triangles per cell. Uint32 because a 256² grid already exceeds Uint16.\n const index = new Uint32Array((uCount - 1) * (vCount - 1) * 6);\n let cursor = 0;\n for (let vi = 0; vi < vCount - 1; vi++) {\n for (let ui = 0; ui < uCount - 1; ui++) {\n const a = vi * uCount + ui;\n const b = a + 1;\n const c = a + uCount;\n const d = c + 1;\n index[cursor++] = a; index[cursor++] = c; index[cursor++] = b;\n index[cursor++] = b; index[cursor++] = c; index[cursor++] = d;\n }\n }\n\n return {\n type: \"buffer\",\n position,\n uv,\n color,\n index,\n computeNormals: geometry.computeNormals,\n params: geometry.params,\n };\n}\n\n/**\n * A {@link Color} as **linear-light** RGB, which is what a vertex-colour buffer\n * must hold: a renderer samples that attribute directly into its linear working\n * space, with no decode step of its own.\n *\n * `parseColor` returns gamma-encoded sRGB (hex is `byte / 255`), so the sRGB\n * transfer function has to be inverted here. Skipping this renders vertex-coloured\n * surfaces visibly washed out.\n */\nfunction resolveLinearRgb(color: Color): readonly [number, number, number] {\n const [r, g, b] = typeof color === \"string\" ? parseColor(color) : color;\n return [srgbToLinear(r), srgbToLinear(g), srgbToLinear(b)];\n}\n\n/** Inverse sRGB transfer function (IEC 61966-2-1), per channel. */\nfunction srgbToLinear(channel: number): number {\n return channel <= 0.04045\n ? channel / 12.92\n : Math.pow((channel + 0.055) / 1.055, 2.4);\n}\n\n/**\n * Every geometry a mesh can be built from. Discriminated on `type`, so new\n * shapes are additive.\n */\nexport type Geometry3D =\n | BoxGeometry3D\n | SphereGeometry3D\n | PlaneGeometry3D\n | CylinderGeometry3D\n | ConeGeometry3D\n | TorusGeometry3D\n | TorusKnotGeometry3D\n | CircleGeometry3D\n | RingGeometry3D\n | CapsuleGeometry3D\n | PolyhedronGeometry3D\n | ExtrudeGeometry3D\n | LatheGeometry3D\n | TubeGeometry3D\n | BufferGeometry3D\n | ParametricGeometry3D\n | EdgesGeometry3D\n | WireframeGeometry3D\n | ModelGeometry3D;\n"]}
|
|
1
|
+
{"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../src/render3d/geometry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAuP9E,+EAA+E;AAC/E,MAAM,UAAU,aAAa,CACzB,MAAsD;IAEtD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxD,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,KAAmC;IAC9D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACpE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;IACjC,OAAO;QACH,IAAI;QACJ,2EAA2E;QAC3E,mEAAmE;QACnE,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,GAAG,CAAC;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC;QAC3B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC;KAClC,CAAC;AACN,CAAC;AAED,gaAAga;AACha,MAAM,UAAU,kBAAkB,CAAC,QAA8B;IAC7D,MAAM,QAAQ,GAAG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,CAAC;IACL,CAAC;IAED,OAAO;QACH,IAAI,EAAE,QAAQ;QACd,QAAQ;QACR,EAAE;QACF,KAAK;QACL,KAAK;QACL,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,MAAM,EAAE,QAAQ,CAAC,MAAM;KAC1B,CAAC;AACN,CAAC;AAED,kQAAkQ;AAClQ,SAAS,gBAAgB,CAAC,KAAY;IAClC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,mEAAmE;AACnE,SAAS,YAAY,CAAC,OAAe;IACjC,OAAO,OAAO,IAAI,OAAO;QACrB,CAAC,CAAC,OAAO,GAAG,KAAK;QACjB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import type { PathData } from \"@/render/descriptors/path\";\nimport type { PathBuilder } from \"@/render/descriptors/path-builder\";\nimport { type Color, parseColor } from \"@/attributes/shape/fill/color/parser\";\nimport type { Vector3, Vector3Input } from \"./vector3\";\nimport type { Segments3D } from \"./segments\";\n\n/**\n * Anything not modelled by a named field, assigned straight onto the constructed object: the last resort, unsafe by\n * construction (it bypasses the type system, and any change is a full rebuild since the renderer can't know what a\n * key affects). **Applied** to materials, lights (and a light's `shadow`) and cameras; **not** to geometries, the\n * environment or post effects, where it is recorded and nothing reads it (in development the first warns). Set a\n * geometry's own fields instead.\n */\nexport interface Passthrough3D {\n params?: Record<string, unknown>;\n}\n\n/**\n /** A partial revolution shared by every shape that has one: `startAngle` / `sweep` in degrees as 2D `Ellipse` says them, replacing three's per-shape spellings (`thetaStart`, `thetaLength`, `phiStart`, `phiLength`, `arc`). */\nexport interface Sweep3D {\n /** Where the revolution begins, in **degrees**. Default 0. */\n startAngle?: number;\n /** How far it runs, in **degrees**. Default 360 (or 180 for a half sweep). */\n sweep?: number;\n}\n\n/** A box. `cornerRadius` is the same control `Rect` has in 2D and rounds all twelve edges; see `evaluateRoundedBox` for how the surface is built. */\nexport interface BoxGeometry3D extends Passthrough3D {\n type: \"box\";\n width?: number;\n height?: number;\n depth?: number;\n /** Rounds every edge and corner. Clamped to the smallest half-extent. */\n cornerRadius?: number;\n /** Face subdivision, as `[x, y, z]`. Default 1. */\n segments?: Segments3D;\n}\n\n/** A sphere, or a wedge/band of one via {@link Sweep3D} and the latitude pair. */\nexport interface SphereGeometry3D extends Passthrough3D, Sweep3D {\n type: \"sphere\";\n radius?: number;\n /** `[longitude, latitude]`. Default `[32, 16]`. */\n segments?: Segments3D;\n /** Vertical band start, in **degrees** from the north pole. Default 0. */\n startLatitude?: number;\n /** Vertical band extent, in **degrees**. Default 180 (pole to pole). */\n latitudeSweep?: number;\n}\n\nexport interface PlaneGeometry3D extends Passthrough3D {\n type: \"plane\";\n width?: number;\n height?: number;\n /** `[width, height]`. Raise to subdivide for per-vertex displacement. */\n segments?: Segments3D;\n}\n\n/** A cylinder, or any tapered tube: `radius` takes `[top, bottom]` for a taper. */\nexport interface CylinderGeometry3D extends Passthrough3D, Sweep3D {\n type: \"cylinder\";\n /** A scalar, or `[top, bottom]` to taper. Default 1. */\n radius?: number | readonly [number, number];\n height?: number;\n /** `[radial, height]`. Default `[32, 1]`. */\n segments?: Segments3D;\n /** Draw the end caps. Default true. */\n capped?: boolean;\n}\n\nexport interface ConeGeometry3D extends Passthrough3D, Sweep3D {\n type: \"cone\";\n radius?: number;\n height?: number;\n /** `[radial, height]`. Default `[32, 1]`. */\n segments?: Segments3D;\n /** Draw the base cap. Default true. */\n capped?: boolean;\n}\n\nexport interface TorusGeometry3D extends Passthrough3D, Sweep3D {\n type: \"torus\";\n /** Distance from the centre to the middle of the ring. */\n radius?: number;\n /** Thickness of the ring itself. Default 0.4. */\n thickness?: number;\n /** `[radial, tubular]`. Default `[16, 48]`. */\n segments?: Segments3D;\n}\n\nexport interface TorusKnotGeometry3D extends Passthrough3D {\n type: \"torusKnot\";\n radius?: number;\n /** Thickness of the strand. Default 0.4. */\n thickness?: number;\n /** `[tubular, radial]`. Default `[64, 8]`. */\n segments?: Segments3D;\n /** Winding counts as `[around the axis, around the torus]`. Default `[2, 3]`. */\n windings?: readonly [number, number];\n}\n\nexport interface CircleGeometry3D extends Passthrough3D, Sweep3D {\n type: \"circle\";\n radius?: number;\n /** Default 32. */\n segments?: Segments3D;\n}\n\n/** A flat annulus — a disc with a hole. */\nexport interface RingGeometry3D extends Passthrough3D, Sweep3D {\n type: \"ring\";\n /** Outer radius. Default 1. */\n radius?: number;\n /** Inner radius — the size of the hole. Default 0.5. */\n innerRadius?: number;\n /** `[around, radial]`. Default `[32, 1]`. */\n segments?: Segments3D;\n}\n\nexport interface CapsuleGeometry3D extends Passthrough3D {\n type: \"capsule\";\n /** Default 0.5. */\n radius?: number;\n /** Length of the straight mid-section, excluding the caps. Default 1. */\n height?: number;\n /** `[radial, cap]`. Default `[16, 8]`. */\n segments?: Segments3D;\n}\n\nexport interface PolyhedronGeometry3D extends Passthrough3D {\n type: \"polyhedron\";\n shape: \"tetrahedron\" | \"octahedron\" | \"icosahedron\" | \"dodecahedron\";\n radius?: number;\n /** Subdivision. Raising this on an icosahedron approximates a sphere. */\n segments?: Segments3D;\n}\n\n/** How an extrusion's edge is chamfered. A bare number is the bevel's size. */\nexport interface Bevel3D {\n size?: number;\n thickness?: number;\n offset?: number;\n segments?: number;\n}\n\n/** A 2D outline swept into a solid. `path` takes the same `PathData` or {@link PathBuilder} as the 2D `Path` node, so an existing outline extrudes with no new vocabulary. */\nexport interface ExtrudeGeometry3D extends Passthrough3D {\n type: \"extrude\";\n path: PathData | PathBuilder;\n depth?: number;\n /** Curve flattening resolution. Default 12. */\n segments?: Segments3D;\n /** A number is the bevel size; an object tunes the rest. Omit for no bevel. */\n bevel?: number | Bevel3D;\n}\n\n/** A profile revolved about the Y axis — vases, bowls, turned shapes. */\nexport interface LatheGeometry3D extends Passthrough3D, Sweep3D {\n type: \"lathe\";\n /** Profile points in the XY plane; `x` is the radius, `y` the height. */\n points: readonly Vector3Input[];\n /** Default 12. */\n segments?: Segments3D;\n}\n\n/** A circular cross-section swept along a 3D curve. */\nexport interface TubeGeometry3D extends Passthrough3D {\n type: \"tube\";\n points: readonly Vector3Input[];\n radius?: number;\n /** `[along the curve, around it]`. Default `[64, 8]`. */\n segments?: Segments3D;\n closed?: boolean;\n}\n\n/** Raw vertex buffers: the escape hatch that makes any computable mesh expressible as pure data. `position` (`[x, y, z, ...]`) is required; `index` shares vertices between faces; omit `normal` and set {@link computeNormals} to derive them. */\nexport interface BufferGeometry3D extends Passthrough3D {\n type: \"buffer\";\n /** Flat `xyz` triples. */\n position: ArrayLike<number>;\n /** Flat `xyz` triples. Omit and set {@link computeNormals} to derive them. */\n normal?: ArrayLike<number>;\n /** Flat `uv` pairs. */\n uv?: ArrayLike<number>;\n /** Flat linear `rgb` triples. Needs `vertexColors: true` on the material. */\n color?: ArrayLike<number>;\n /** Triangle indices into the arrays above. */\n index?: ArrayLike<number>;\n /** Derive vertex normals after upload — needed for correct lighting. */\n computeNormals?: boolean;\n /** Bump after mutating an array **in place** to force a re-upload: reusing one `Float32Array` across frames is the fast way to animate a mesh but defeats identity comparison. Omitted, the renderer re-uploads every frame (correct by default); set {@link staticData} once the data stops changing. */\n revision?: number;\n /**\n * Declare the arrays immutable, so the renderer compares by identity alone\n * and skips the per-frame re-upload. Only safe when you never mutate in place.\n */\n staticData?: boolean;\n}\n\n/** One evaluated vertex of a {@link ParametricGeometry3D} surface. */\nexport type ParametricVertex3D = Vector3 | readonly [number, number, number];\n\n/**\n * A surface sampled over a `[0,1] x [0,1]` grid: the ergonomic form of {@link BufferGeometry3D} for procedural\n * meshes. Core evaluates the callbacks into vertex buffers, so the descriptor stays plain data; it re-evaluates\n * every frame, so read the node's props and frame time inside `vertex`.\n *\n * Geo.parametric({\n * segments: [70, 70],\n * vertex: (u, v) => ({ x: (u - 0.5) * 20, y: wave(u, v, t), z: (v - 0.5) * 20 }),\n * computeNormals: true,\n * })\n */\nexport interface ParametricGeometry3D extends Passthrough3D {\n type: \"parametric\";\n /** Grid resolution as `[u, v]`, or one number for both. */\n segments: Segments3D;\n /** Position for grid coordinate `(u, v)`, both in `[0, 1]`. */\n vertex: (u: number, v: number) => ParametricVertex3D;\n /** Optional per-vertex colour. Needs `vertexColors: true` on the material. */\n color?: (u: number, v: number, position: Vector3) => Color;\n /** Derive vertex normals. Almost always wanted for a lit surface. */\n computeNormals?: boolean;\n /** A value that changes exactly when {@link vertex} would return something different; supply it and the surface re-evaluates only when it moves. Omitted, it re-evaluates every frame (`segments: 80` is ~6.6k `vertex` calls plus normals and a buffer re-upload, on any frame at all). The renderer can't inspect what the `vertex` closure captured, so derive this from exactly those captures; omit it for a surface that varies with time. Same role as {@link BufferGeometry3D.revision}. */\n revision?: number;\n}\n\n/** The hard edges of another geometry as line segments, for a clean wireframe without triangulation diagonals. Draw with `Graphics3D.line({ segments: true })`. */\nexport interface EdgesGeometry3D extends Passthrough3D {\n type: \"edges\";\n source: Geometry3D;\n /** Minimum dihedral angle in **degrees** for an edge to count. Default 1. */\n thresholdAngle?: number;\n}\n\n/** Every triangle edge of another geometry, as line segments. */\nexport interface WireframeGeometry3D extends Passthrough3D {\n type: \"wireframe\";\n source: Geometry3D;\n}\n\n/** Geometry taken from a loaded model file, by node name. */\nexport interface ModelGeometry3D extends Passthrough3D {\n type: \"modelGeometry\";\n src: string;\n /** Which node of the model to take. Defaults to the first mesh found. */\n node?: string;\n}\n\n/** Normalize {@link CylinderGeometry3D.radius} to its `[top, bottom]` pair. */\nexport function cylinderRadii(\n radius: number | readonly [number, number] | undefined,\n): [number, number] {\n if (radius === undefined) return [1, 1];\n if (typeof radius === \"number\") return [radius, radius];\n return [radius[0] ?? 1, radius[1] ?? radius[0] ?? 1];\n}\n\n/** Normalize {@link ExtrudeGeometry3D.bevel} to its full option set, or `null`. */\nexport function resolveBevel3D(bevel: number | Bevel3D | undefined): Required<Bevel3D> | null {\n if (bevel === undefined) return null;\n const options = typeof bevel === \"number\" ? { size: bevel } : bevel;\n const size = options.size ?? 0.1;\n return {\n size,\n // Scaled off `size` rather than defaulted independently, so the one-number\n // form produces a bevel with sane proportions instead of a sliver.\n thickness: options.thickness ?? size * 2,\n offset: options.offset ?? 0,\n segments: options.segments ?? 3,\n };\n}\n\n/** Evaluates a {@link ParametricGeometry3D} into vertex buffers. In core so the grid/winding maths is backend-agnostic and unit-testable without a GPU; the renderer calls it at draw time (not record time), so the cost is paid only when rasterized, never during the asset-tracking replay. The grid is `(segments + 1)²` vertices wound counter-clockwise, so front faces point along +Y for a surface in the XZ plane. */\nexport function evaluateParametric(geometry: ParametricGeometry3D): BufferGeometry3D {\n const resolved = geometry.segments;\n const [uSegments, vSegments] = typeof resolved === \"number\"\n ? [resolved, resolved]\n : [resolved[0] ?? 1, resolved[1] ?? resolved[0] ?? 1];\n\n const uCount = Math.max(1, Math.floor(uSegments)) + 1;\n const vCount = Math.max(1, Math.floor(vSegments)) + 1;\n\n const position = new Float32Array(uCount * vCount * 3);\n const uv = new Float32Array(uCount * vCount * 2);\n const color = geometry.color ? new Float32Array(uCount * vCount * 3) : undefined;\n\n const scratch: Vector3 = { x: 0, y: 0, z: 0 };\n\n for (let vi = 0; vi < vCount; vi++) {\n const v = vi / (vCount - 1);\n for (let ui = 0; ui < uCount; ui++) {\n const u = ui / (uCount - 1);\n const index = vi * uCount + ui;\n\n const vertex = geometry.vertex(u, v);\n if (Array.isArray(vertex)) {\n scratch.x = vertex[0]; scratch.y = vertex[1]; scratch.z = vertex[2];\n } else {\n const p = vertex as Vector3;\n scratch.x = p.x; scratch.y = p.y; scratch.z = p.z;\n }\n\n position[index * 3] = scratch.x;\n position[index * 3 + 1] = scratch.y;\n position[index * 3 + 2] = scratch.z;\n\n uv[index * 2] = u;\n uv[index * 2 + 1] = v;\n\n if (color && geometry.color) {\n const rgba = resolveLinearRgb(geometry.color(u, v, scratch));\n color[index * 3] = rgba[0];\n color[index * 3 + 1] = rgba[1];\n color[index * 3 + 2] = rgba[2];\n }\n }\n }\n\n // Two triangles per cell. Uint32 because a 256² grid already exceeds Uint16.\n const index = new Uint32Array((uCount - 1) * (vCount - 1) * 6);\n let cursor = 0;\n for (let vi = 0; vi < vCount - 1; vi++) {\n for (let ui = 0; ui < uCount - 1; ui++) {\n const a = vi * uCount + ui;\n const b = a + 1;\n const c = a + uCount;\n const d = c + 1;\n index[cursor++] = a; index[cursor++] = c; index[cursor++] = b;\n index[cursor++] = b; index[cursor++] = c; index[cursor++] = d;\n }\n }\n\n return {\n type: \"buffer\",\n position,\n uv,\n color,\n index,\n computeNormals: geometry.computeNormals,\n params: geometry.params,\n };\n}\n\n/** A {@link Color} as **linear-light** RGB, which a vertex-colour buffer must hold (the renderer samples it into linear space with no decode). `parseColor` returns gamma-encoded sRGB, so skipping the inversion renders vertex-coloured surfaces washed out. */\nfunction resolveLinearRgb(color: Color): readonly [number, number, number] {\n const [r, g, b] = typeof color === \"string\" ? parseColor(color) : color;\n return [srgbToLinear(r), srgbToLinear(g), srgbToLinear(b)];\n}\n\n/** Inverse sRGB transfer function (IEC 61966-2-1), per channel. */\nfunction srgbToLinear(channel: number): number {\n return channel <= 0.04045\n ? channel / 12.92\n : Math.pow((channel + 0.055) / 1.055, 2.4);\n}\n\n/** Every geometry a mesh can be built from, discriminated on `type`. */\nexport type Geometry3D =\n | BoxGeometry3D\n | SphereGeometry3D\n | PlaneGeometry3D\n | CylinderGeometry3D\n | ConeGeometry3D\n | TorusGeometry3D\n | TorusKnotGeometry3D\n | CircleGeometry3D\n | RingGeometry3D\n | CapsuleGeometry3D\n | PolyhedronGeometry3D\n | ExtrudeGeometry3D\n | LatheGeometry3D\n | TubeGeometry3D\n | BufferGeometry3D\n | ParametricGeometry3D\n | EdgesGeometry3D\n | WireframeGeometry3D\n | ModelGeometry3D;\n"]}
|
|
@@ -9,32 +9,14 @@ import type { Vector3Input } from "./vector3.js";
|
|
|
9
9
|
export interface ModelAnimation3D {
|
|
10
10
|
/** Clip name, or its index in the file. Defaults to the first clip. */
|
|
11
11
|
clip?: string | number;
|
|
12
|
-
/**
|
|
13
|
-
* Seconds into the clip. **Explicit by design** — the renderer seeks to this
|
|
14
|
-
* time rather than advancing by a delta, which is what keeps a model's
|
|
15
|
-
* animation identical whether the frame was reached by playing forward or by
|
|
16
|
-
* scrubbing backwards.
|
|
17
|
-
*/
|
|
12
|
+
/** Seconds into the clip. **Explicit by design**: the renderer seeks to it rather than advancing by a delta, so animation is identical whether reached by playing forward or scrubbing back. */
|
|
18
13
|
time: number;
|
|
19
14
|
/** Blend weight, for cross-fading clips. Default 1. */
|
|
20
15
|
weight?: number;
|
|
21
16
|
}
|
|
22
|
-
/**
|
|
23
|
-
* How a `line` op connects its points: in order, or as disjoint start/end pairs,
|
|
24
|
-
* or in order and closed back to the start.
|
|
25
|
-
*/
|
|
17
|
+
/** How a `line` op connects its points: in order, as disjoint start/end pairs, or in order and closed back to the start. */
|
|
26
18
|
export type LineMode3D = "strip" | "segments" | "loop";
|
|
27
|
-
/**
|
|
28
|
-
* One recorded operation in a {@link Graphics3D} command list.
|
|
29
|
-
*
|
|
30
|
-
* Every op draws something. Hierarchy, lights and the camera are *scene*
|
|
31
|
-
* concerns, recorded by the `Node3D` tree into a `Scene3D` — this is only ever
|
|
32
|
-
* "what one node paints", which is exactly what a `Graphics2D` is in 2D.
|
|
33
|
-
*
|
|
34
|
-
* A drawable's geometry and material are *inline sub-descriptors*, not ops,
|
|
35
|
-
* because in a 3D scene graph they are properties of an object rather than
|
|
36
|
-
* children of it.
|
|
37
|
-
*/
|
|
19
|
+
/** One recorded operation in a {@link Graphics3D} command list: what one node paints, like a `Graphics2D`. Hierarchy, lights and the camera are scene concerns recorded into a `Scene3D`. Geometry and material are inline sub-descriptors, not ops, since in a 3D graph they are properties of an object rather than children. */
|
|
38
20
|
export type Graphics3DOp = {
|
|
39
21
|
kind: "mesh";
|
|
40
22
|
geometry: Geometry3D;
|
|
@@ -72,28 +54,15 @@ export type Graphics3DOp = {
|
|
|
72
54
|
override?: Readonly<Record<string, Material3D>>;
|
|
73
55
|
transform?: Transform3D;
|
|
74
56
|
};
|
|
75
|
-
/**
|
|
76
|
-
* Op kinds that put something in the scene (as opposed to shaping the tree).
|
|
77
|
-
*
|
|
78
|
-
* Shared with `Scene3D`, whose op list is this one plus `push`/`pop`/`light`/
|
|
79
|
-
* `camera` — so "is anything actually drawn here" has a single definition.
|
|
80
|
-
*/
|
|
57
|
+
/** Op kinds that put something in the scene; shared with `Scene3D` (this list plus `push`/`pop`/`light`/`camera`) so "is anything drawn here" has one definition. */
|
|
81
58
|
/** @internal */
|
|
82
59
|
export declare const DRAWABLE_KINDS: ReadonlySet<string>;
|
|
83
60
|
/**
|
|
84
|
-
* Material fields promoted onto the geometry sugar methods
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* `
|
|
88
|
-
*
|
|
89
|
-
* (how light behaves on it) rather than colour, which is the line Spline's
|
|
90
|
-
* material panel draws too and the reason those stay separate fields.
|
|
91
|
-
*
|
|
92
|
-
* These desugar at record time into a full {@link Material3D} — `standard` by
|
|
93
|
-
* default, `basic` when {@link unlit} is set — so the recorded op list stays
|
|
94
|
-
* canonical. Pass {@link material} to bypass the shorthand entirely; every
|
|
95
|
-
* renderer-level knob that is not a design decision (`depthWrite`, `alphaTest`,
|
|
96
|
-
* `toneMapped`, `polygonOffset`, …) lives there and only there.
|
|
61
|
+
* Material fields promoted onto the geometry sugar methods so the common case is one flat call:
|
|
62
|
+
* `.box({ width: 2, fill: "red", roughness: 0.3 })`. `fill` is the whole 2D fill vocabulary ({@link Fill3D}); the
|
|
63
|
+
* rest is surface response rather than colour. These desugar at record time into a full {@link Material3D}
|
|
64
|
+
* (`standard`, or `basic` when {@link unlit}), keeping the op list canonical. {@link material} bypasses the
|
|
65
|
+
* shorthand; renderer-level knobs (`depthWrite`, `alphaTest`, `toneMapped`, `polygonOffset`, ...) live only there.
|
|
97
66
|
*/
|
|
98
67
|
export interface MaterialShorthand3D {
|
|
99
68
|
/** A full descriptor (or an array, for multi-material). Wins over the rest. */
|
|
@@ -125,12 +94,9 @@ export interface MaterialShorthand3D {
|
|
|
125
94
|
/** Transform + material shorthand, accepted by every geometry sugar method. */
|
|
126
95
|
export type MeshShorthand3D = Transform3D & MaterialShorthand3D;
|
|
127
96
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* Exported because `Mesh3D` desugars the identical bag from its own props: this
|
|
132
|
-
* is where `fill` becomes `color`-or-`map`, and two copies of that decision is
|
|
133
|
-
* two chances for a node and a builder call to paint differently.
|
|
97
|
+
* Builds the material a shorthand bag describes; always one, so a drawable op never needs "...or the default"
|
|
98
|
+
* handling. Exported because `Mesh3D` desugars the same bag from its props: one place decides how `fill` becomes
|
|
99
|
+
* `color`-or-`map`, so a node and a builder call paint alike.
|
|
134
100
|
*
|
|
135
101
|
* @internal
|
|
136
102
|
*/
|
|
@@ -138,72 +104,32 @@ export declare function resolveMaterialShorthand3D(source: MaterialShorthand3D):
|
|
|
138
104
|
/** Geometry params only, with `type` and the inherited passthrough removed. */
|
|
139
105
|
type ParamsOf<G> = Omit<G, "type">;
|
|
140
106
|
/**
|
|
141
|
-
* What one 3D node draws
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* sprites, models), each with its own geometry, material and local transform.
|
|
145
|
-
* That is the whole surface: it holds no camera, no lights and no hierarchy,
|
|
146
|
-
* because those are properties of a *scene* rather than of a thing in one, and
|
|
147
|
-
* the `Node3D` tree owns them. The exact division `Graphics2D` and
|
|
148
|
-
* `RenderContext2D` already make in 2D.
|
|
107
|
+
* What one 3D node draws: the `Graphics2D` of 3D. Records an ordered list of drawables (meshes, instanced meshes,
|
|
108
|
+
* points, lines, sprites, models), each with its own geometry, material and local transform; camera, lights and
|
|
109
|
+
* hierarchy belong to the `Node3D` tree and its scene. A built `Graphics3D` is spliced into a {@link RenderContext3D}.
|
|
149
110
|
*
|
|
150
111
|
* render: (ctx) => ctx.draw(new Graphics3D()
|
|
151
112
|
* .box({ width: 2, cornerRadius: 0.15, fill: "#e0533d", roughness: 0.3 })),
|
|
152
113
|
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* ── One flat bag, deliberately ────────────────────────────────────────────────
|
|
157
|
-
* `Graphics2D` paints with a *chained* `.rect(…).fill(…)`, and this does not,
|
|
158
|
-
* which is the one place the two recorders diverge on purpose. In 2D a `fill` is
|
|
159
|
-
* a **group-scoped op** covering the shapes recorded before it; in 3D a material
|
|
160
|
-
* belongs to exactly one object, because a mesh *is* geometry plus material.
|
|
161
|
-
* A chained `.box().fill()` would imply a group material that has nothing to
|
|
162
|
-
* scope over, so the shape and what it is made of are stated together instead.
|
|
163
|
-
*
|
|
164
|
-
* ── Angles are DEGREES ────────────────────────────────────────────────────────
|
|
165
|
-
* Every angle here — Euler rotations, sweep arcs, UV rotation — is in degrees,
|
|
166
|
-
* matching the engine's 2D `rotation`. The renderer converts.
|
|
114
|
+
* One flat bag, not chained paint: in 2D a `fill` is a group-scoped op over earlier shapes, but in 3D a material
|
|
115
|
+
* belongs to exactly one object, so shape and material are stated together.
|
|
167
116
|
*
|
|
168
|
-
*
|
|
169
|
-
* A `Graphics3D` is rebuilt from scratch every frame, so animation is just
|
|
170
|
-
* reading the node's own state while building:
|
|
117
|
+
* Angles are DEGREES (Euler rotations, sweep arcs, UV rotation), matching 2D `rotation`; the renderer converts.
|
|
171
118
|
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* state: { spin: 0, lift: Types.custom<Vector3>([0, 0, 0], { lerp: lerpVector3 }) },
|
|
175
|
-
* render: (ctx, s) => ctx.draw(new Graphics3D()
|
|
176
|
-
* .box({ rotation: [0, s.spin, 0], position: s.lift })),
|
|
177
|
-
* });
|
|
178
|
-
* // a `to` of { spin: 360 } over two seconds turns it
|
|
119
|
+
* Rebuilt from scratch every frame, so animation is reading the node's own state while building. A state entry
|
|
120
|
+
* holding a non-number needs an explicit tween (`lerpVector3`, `lerpEuler3`, `slerpQuaternion`) or `to()` leaves it alone.
|
|
179
121
|
*
|
|
180
|
-
*
|
|
181
|
-
* tween (`lerpVector3`, `lerpEuler3`, `slerpQuaternion`) or `to()` has nothing
|
|
182
|
-
* to interpolate it with and leaves it alone.
|
|
122
|
+
* Reconciliation identity is derived from the owning `Node3D` plus a signature of what the op draws; there is no `key` to set.
|
|
183
123
|
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* `Node3D` plus a signature of what the op actually draws, so a builder that
|
|
188
|
-
* emits ops conditionally reuses the right cache entry with nothing written by
|
|
189
|
-
* hand. There is no `key` to set.
|
|
190
|
-
*
|
|
191
|
-
* ── What is cheap to animate ──────────────────────────────────────────────────
|
|
192
|
-
* Transforms and most material values are in-place writes, so they cost nothing
|
|
193
|
-
* per frame. **Geometry parameters are not** — three geometries are immutable, so
|
|
194
|
-
* tweening `.box({ width: this.size })` reallocates the mesh every frame. Scale
|
|
195
|
-
* the object instead: `.box({ width: 1, scale: [this.size, 1, 1] })`. The fields marked
|
|
196
|
-
* "structural" on `MaterialCommon3D` recompile the shader program and should be
|
|
197
|
-
* set once, not tweened.
|
|
124
|
+
* Transforms and most material values are cheap in-place writes. Geometry parameters are not (three geometries are
|
|
125
|
+
* immutable, so tweening `.box({ width })` reallocates every frame): scale the object instead. Fields marked
|
|
126
|
+
* "structural" on `MaterialCommon3D` recompile the shader and should be set once.
|
|
198
127
|
*/
|
|
199
128
|
export declare class Graphics3D {
|
|
200
129
|
private _ops;
|
|
201
130
|
/** Append one op, flagging (in development) inputs no renderer acts on. */
|
|
202
131
|
private record;
|
|
203
|
-
/**
|
|
204
|
-
* Record a mesh from an explicit geometry and material. The geometry sugar
|
|
205
|
-
* methods below all funnel here.
|
|
206
|
-
*/
|
|
132
|
+
/** Records a mesh from an explicit geometry and material; the sugar methods below funnel here. */
|
|
207
133
|
mesh(geometry: Geometry3D, material?: Material3D | readonly Material3D[], transform?: Transform3D): this;
|
|
208
134
|
/** Record a mesh from a geometry `type` plus a flat shorthand bag. */
|
|
209
135
|
private sugar;
|
|
@@ -221,35 +147,19 @@ export declare class Graphics3D {
|
|
|
221
147
|
extrude(options: ParamsOf<ExtrudeGeometry3D> & MeshShorthand3D): this;
|
|
222
148
|
lathe(options: ParamsOf<LatheGeometry3D> & MeshShorthand3D): this;
|
|
223
149
|
tube(options: ParamsOf<TubeGeometry3D> & MeshShorthand3D): this;
|
|
224
|
-
/**
|
|
225
|
-
* Record many copies of one geometry in a single draw call. The way to put
|
|
226
|
-
* thousands of objects on screen — a plain `mesh` per copy would not keep up.
|
|
227
|
-
*
|
|
228
|
-
* g3.instances(Geo.box({ width: 0.2 }), Mat.standard({ color: "cyan" }),
|
|
229
|
-
* positions.map(p => ({ position: p })))
|
|
230
|
-
*/
|
|
150
|
+
/** Records many copies of one geometry in a single draw call, for thousands of objects where a `mesh` per copy wouldn't keep up. */
|
|
231
151
|
instances(geometry: Geometry3D, material: Material3D, instances: readonly Transform3D[], options?: {
|
|
232
152
|
colors?: readonly Color[];
|
|
233
153
|
transform?: Transform3D;
|
|
234
154
|
}): this;
|
|
235
155
|
/** Record a point cloud — one sprite-like dot per vertex of `geometry`. */
|
|
236
156
|
points(geometry: Geometry3D, material?: Material3D, transform?: Transform3D): this;
|
|
237
|
-
/**
|
|
238
|
-
* Record a line. Give it either explicit `points` or a `geometry` (typically
|
|
239
|
-
* `Geo.edges(...)` for a wireframe outline).
|
|
240
|
-
*
|
|
241
|
-
* `closed` joins the last point back to the first, as the 2D `line` op's
|
|
242
|
-
* own field does. `segments` treats the points as disjoint start/end pairs
|
|
243
|
-
* instead — the form `Geo.edges(...)` produces. (There is no subdivision to
|
|
244
|
-
* confuse it with: a line is drawn from the points it is given.)
|
|
245
|
-
*/
|
|
157
|
+
/** Records a line from explicit `points` or a `geometry` (typically `Geo.edges(...)`). `closed` joins the last point to the first; `segments` treats points as disjoint start/end pairs, the form `Geo.edges(...)` produces. */
|
|
246
158
|
line(options: {
|
|
247
159
|
points?: readonly Vector3Input[];
|
|
248
160
|
geometry?: Geometry3D;
|
|
249
161
|
material?: Material3D;
|
|
250
|
-
/** Join the last point back to the first. */
|
|
251
162
|
closed?: boolean;
|
|
252
|
-
/** Treat the points as disjoint start/end pairs. */
|
|
253
163
|
segments?: boolean;
|
|
254
164
|
/** The line's paint. Cap and join have no meaning on a GL line. */
|
|
255
165
|
stroke?: LineStroke3D;
|
|
@@ -262,14 +172,7 @@ export declare class Graphics3D {
|
|
|
262
172
|
material?: Material3D;
|
|
263
173
|
opacity?: number;
|
|
264
174
|
} & Transform3D): this;
|
|
265
|
-
/**
|
|
266
|
-
* Record a loaded model. **glTF/GLB only**: any other format (an `.obj`, say)
|
|
267
|
-
* resolves to an empty slot and draws nothing, and in development the first
|
|
268
|
-
* one recorded warns.
|
|
269
|
-
*
|
|
270
|
-
* Baked animation is sampled by explicit `time`, never advanced by a delta, so
|
|
271
|
-
* a model stays frame-identical under scrubbing.
|
|
272
|
-
*/
|
|
175
|
+
/** Records a loaded model. **glTF/GLB only**: any other format resolves to an empty slot and draws nothing (in development the first warns). Baked animation is sampled by explicit `time`, so a model stays frame-identical under scrubbing. */
|
|
273
176
|
model(options: {
|
|
274
177
|
src: string;
|
|
275
178
|
animation?: ModelAnimation3D | readonly ModelAnimation3D[];
|
|
@@ -280,14 +183,7 @@ export declare class Graphics3D {
|
|
|
280
183
|
/** True when this node draws nothing. */
|
|
281
184
|
isEmpty(): boolean;
|
|
282
185
|
}
|
|
283
|
-
/**
|
|
284
|
-
* A 3D line's paint, named after the 2D `Stroke` it mirrors.
|
|
285
|
-
*
|
|
286
|
-
* `cap`, `join` and the rest of the 2D stroke vocabulary are deliberately absent:
|
|
287
|
-
* they describe a stroked *path*, and a GL line has no outline to cap. Note that
|
|
288
|
-
* `weight` above 1 is ignored by most WebGL implementations — for a genuinely
|
|
289
|
-
* thick line, draw a `tube`.
|
|
290
|
-
*/
|
|
186
|
+
/** A 3D line's paint, mirroring the 2D `Stroke`. `cap`/`join` are absent (a GL line has no outline to cap); `weight` above 1 is ignored by most WebGL implementations, so draw a `tube` for a thick line. */
|
|
291
187
|
export interface LineStroke3D {
|
|
292
188
|
/** The line's colour. Named `fill` to match the 2D `Stroke`. */
|
|
293
189
|
fill?: Color;
|