paper 0.16.0 → 1.0.0-rc.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 +294 -0
- package/LICENSE.txt +1 -1
- package/MIGRATION.md +402 -0
- package/README.md +137 -143
- package/dist/esm/anim/Tween.js +404 -0
- package/dist/esm/basic/Line.js +252 -0
- package/dist/esm/basic/Matrix.js +603 -0
- package/dist/esm/basic/Point.js +738 -0
- package/dist/esm/basic/Rectangle.js +788 -0
- package/dist/esm/basic/Size.js +368 -0
- package/dist/esm/boolean/graph.js +950 -0
- package/dist/esm/boolean/index.js +143 -0
- package/dist/esm/boolean/operations.js +94 -0
- package/dist/esm/boolean/split.js +89 -0
- package/dist/esm/canvas/blendModes.js +115 -0
- package/dist/esm/canvas/canvasProvider.js +102 -0
- package/dist/esm/constants.js +130 -0
- package/dist/esm/core/Base.js +52 -0
- package/dist/esm/core/Emitter.js +215 -0
- package/dist/esm/core/features.js +53 -0
- package/dist/esm/core/serialization.js +174 -0
- package/dist/esm/core.js +15 -0
- package/dist/esm/dom/domElement.js +112 -0
- package/dist/esm/dom/domEvent.js +106 -0
- package/dist/esm/env.js +66 -0
- package/dist/esm/event/DrawEvent.js +38 -0
- package/dist/esm/event/Event.js +79 -0
- package/dist/esm/event/Key.js +236 -0
- package/dist/esm/event/KeyEvent.js +39 -0
- package/dist/esm/event/MouseEvent.js +91 -0
- package/dist/esm/hosted/HostItem.js +60 -0
- package/dist/esm/hosted/Hosting.js +1061 -0
- package/dist/esm/hosted/index.js +20 -0
- package/dist/esm/index.js +38 -0
- package/dist/esm/internal.js +115 -0
- package/dist/esm/item/Effect.js +256 -0
- package/dist/esm/item/EffectInstance.js +184 -0
- package/dist/esm/item/Group.js +293 -0
- package/dist/esm/item/HitResult.js +126 -0
- package/dist/esm/item/Item.js +3339 -0
- package/dist/esm/item/ItemDefinition.js +95 -0
- package/dist/esm/item/Layer.js +69 -0
- package/dist/esm/item/Project.js +1013 -0
- package/dist/esm/item/Raster.js +722 -0
- package/dist/esm/item/Shape.js +355 -0
- package/dist/esm/item/SymbolDefinition.js +68 -0
- package/dist/esm/item/SymbolItem.js +131 -0
- package/dist/esm/item/bounds.js +324 -0
- package/dist/esm/item/draw.js +525 -0
- package/dist/esm/item/effects.js +124 -0
- package/dist/esm/item/expand.js +87 -0
- package/dist/esm/item/hitTest.js +203 -0
- package/dist/esm/item/hosting.js +12 -0
- package/dist/esm/item/props.js +12 -0
- package/dist/esm/item/query.js +139 -0
- package/dist/esm/item/sampling.js +67 -0
- package/dist/esm/item/transform.js +128 -0
- package/dist/esm/net/http.js +26 -0
- package/dist/esm/node/CanvasAdapter.js +137 -0
- package/dist/esm/node/index.js +150 -0
- package/dist/esm/node/peers.js +27 -0
- package/dist/esm/offset/curves.js +866 -0
- package/dist/esm/offset/index.js +70 -0
- package/dist/esm/offset/offset.js +178 -0
- package/dist/esm/offset/outline.js +91 -0
- package/dist/esm/offset/pen.js +298 -0
- package/dist/esm/offset/profile.js +772 -0
- package/dist/esm/offset/round.js +213 -0
- package/dist/esm/offset/sweep.js +100 -0
- package/dist/esm/paperscript/PaperScript.js +832 -0
- package/dist/esm/paperscript/autoload.js +27 -0
- package/dist/esm/paperscript/index.js +17 -0
- package/dist/esm/path/CompoundPath.js +367 -0
- package/dist/esm/path/Curve.js +996 -0
- package/dist/esm/path/CurveLocation.js +462 -0
- package/dist/esm/path/Path.js +1761 -0
- package/dist/esm/path/PathFlattener.js +186 -0
- package/dist/esm/path/PathItem.js +757 -0
- package/dist/esm/path/Segment.js +640 -0
- package/dist/esm/path/SegmentPoint.js +106 -0
- package/dist/esm/path/StrokeProfile.js +387 -0
- package/dist/esm/path/StrokeProfileStop.js +207 -0
- package/dist/esm/path/boolean.js +284 -0
- package/dist/esm/path/bounds.js +257 -0
- package/dist/esm/path/crossing.js +114 -0
- package/dist/esm/path/draw.js +161 -0
- package/dist/esm/path/hitTest.js +259 -0
- package/dist/esm/path/offset.js +152 -0
- package/dist/esm/path/shapes.js +231 -0
- package/dist/esm/path/smooth.js +84 -0
- package/dist/esm/path/values.js +40 -0
- package/dist/esm/scope/PaperScope.js +288 -0
- package/dist/esm/scope/PaperScopeItem.js +74 -0
- package/dist/esm/smoothing/index.js +71 -0
- package/dist/esm/style/Color.js +917 -0
- package/dist/esm/style/Gradient.js +191 -0
- package/dist/esm/style/GradientStop.js +168 -0
- package/dist/esm/style/PatternDefinition.js +383 -0
- package/dist/esm/style/Style.js +503 -0
- package/dist/esm/svg/index.js +27 -0
- package/dist/esm/svg/svgElement.js +97 -0
- package/dist/esm/svg/svgExport.js +847 -0
- package/dist/esm/svg/svgImport.js +1101 -0
- package/dist/esm/svg/svgStyles.js +96 -0
- package/dist/esm/text/AreaText.js +190 -0
- package/dist/esm/text/PathText.js +111 -0
- package/dist/esm/text/PointText.js +92 -0
- package/dist/esm/text/TextItem.js +538 -0
- package/dist/esm/text/TextRange.js +169 -0
- package/dist/esm/text/TextStory.js +394 -0
- package/dist/esm/text/areaLayout.js +439 -0
- package/dist/esm/text/layout.js +265 -0
- package/dist/esm/text/measure.js +57 -0
- package/dist/esm/text/pathLayout.js +93 -0
- package/dist/esm/tool/Tool.js +284 -0
- package/dist/esm/tool/ToolEvent.js +232 -0
- package/dist/esm/util/Formatter.js +57 -0
- package/dist/esm/util/collisions.js +216 -0
- package/dist/esm/util/list.js +110 -0
- package/dist/esm/util/numerical.js +656 -0
- package/dist/esm/util/object.js +81 -0
- package/dist/esm/util/string.js +29 -0
- package/dist/esm/util/uid.js +31 -0
- package/dist/esm/values/arcs.js +243 -0
- package/dist/esm/values/curve.js +975 -0
- package/dist/esm/values/fit.js +290 -0
- package/dist/esm/values/index.js +23 -0
- package/dist/esm/values/intersections.js +869 -0
- package/dist/esm/values/matrix.js +114 -0
- package/dist/esm/values/path.js +174 -0
- package/dist/esm/values/profile.js +221 -0
- package/dist/esm/values/region.js +63 -0
- package/dist/esm/values/smooth.js +248 -0
- package/dist/esm/values/svg.js +287 -0
- package/dist/esm/view/CanvasView.js +106 -0
- package/dist/esm/view/View.js +775 -0
- package/dist/esm/view/input.js +527 -0
- package/dist/paper-full.js +33083 -22681
- package/dist/paper-full.min.js +36 -31
- package/dist/paper-hosted.js +33898 -23223
- package/dist/paper-hosted.min.js +37 -0
- package/dist/paper-slim.js +28581 -0
- package/dist/paper-slim.min.js +17 -0
- package/dist/types/anim/Tween.d.ts +164 -0
- package/dist/types/basic/Line.d.ts +136 -0
- package/dist/types/basic/Matrix.d.ts +387 -0
- package/dist/types/basic/Point.d.ts +781 -0
- package/dist/types/basic/Rectangle.d.ts +550 -0
- package/dist/types/basic/Size.d.ts +457 -0
- package/dist/types/boolean/graph.d.ts +123 -0
- package/dist/types/boolean/index.d.ts +74 -0
- package/dist/types/boolean/operations.d.ts +9 -0
- package/dist/types/boolean/split.d.ts +19 -0
- package/dist/types/canvas/blendModes.d.ts +18 -0
- package/dist/types/canvas/canvasProvider.d.ts +32 -0
- package/dist/types/constants.d.ts +112 -0
- package/dist/types/core/Base.d.ts +50 -0
- package/dist/types/core/Emitter.d.ts +49 -0
- package/dist/types/core/features.d.ts +41 -0
- package/dist/types/core/serialization.d.ts +44 -0
- package/dist/types/core.d.ts +18 -0
- package/dist/types/dom/domElement.d.ts +33 -0
- package/dist/types/dom/domEvent.d.ts +29 -0
- package/dist/types/env.d.ts +26 -0
- package/dist/types/event/DrawEvent.d.ts +27 -0
- package/dist/types/event/Event.d.ts +47 -0
- package/dist/types/event/Key.d.ts +82 -0
- package/dist/types/event/KeyEvent.d.ts +35 -0
- package/dist/types/event/MouseEvent.d.ts +78 -0
- package/dist/types/hosted/HostItem.d.ts +26 -0
- package/dist/types/hosted/Hosting.d.ts +273 -0
- package/dist/types/hosted/index.d.ts +10 -0
- package/dist/types/index.d.ts +64 -0
- package/dist/types/internal.d.ts +101 -0
- package/dist/types/item/Effect.d.ts +128 -0
- package/dist/types/item/EffectInstance.d.ts +81 -0
- package/dist/types/item/Group.d.ts +225 -0
- package/dist/types/item/HitResult.d.ts +94 -0
- package/dist/types/item/Item.d.ts +2927 -0
- package/dist/types/item/ItemDefinition.d.ts +25 -0
- package/dist/types/item/Layer.d.ts +80 -0
- package/dist/types/item/Project.d.ts +748 -0
- package/dist/types/item/Raster.d.ts +431 -0
- package/dist/types/item/Shape.d.ts +219 -0
- package/dist/types/item/SymbolDefinition.d.ts +98 -0
- package/dist/types/item/SymbolItem.d.ts +92 -0
- package/dist/types/item/bounds.d.ts +56 -0
- package/dist/types/item/draw.d.ts +23 -0
- package/dist/types/item/effects.d.ts +22 -0
- package/dist/types/item/expand.d.ts +7 -0
- package/dist/types/item/hitTest.d.ts +10 -0
- package/dist/types/item/hosting.d.ts +20 -0
- package/dist/types/item/props.d.ts +35 -0
- package/dist/types/item/query.d.ts +14 -0
- package/dist/types/item/sampling.d.ts +5 -0
- package/dist/types/item/transform.d.ts +3 -0
- package/dist/types/net/http.d.ts +6 -0
- package/dist/types/node/CanvasAdapter.d.ts +19 -0
- package/dist/types/node/index.d.ts +60 -0
- package/dist/types/node/peers.d.ts +2 -0
- package/dist/types/offset/curves.d.ts +22 -0
- package/dist/types/offset/index.d.ts +65 -0
- package/dist/types/offset/offset.d.ts +18 -0
- package/dist/types/offset/outline.d.ts +14 -0
- package/dist/types/offset/pen.d.ts +36 -0
- package/dist/types/offset/profile.d.ts +37 -0
- package/dist/types/offset/round.d.ts +18 -0
- package/dist/types/offset/sweep.d.ts +44 -0
- package/dist/types/paperscript/PaperScript.d.ts +114 -0
- package/dist/types/paperscript/autoload.d.ts +1 -0
- package/dist/types/paperscript/index.d.ts +7 -0
- package/dist/types/path/CompoundPath.d.ts +183 -0
- package/dist/types/path/Curve.d.ts +567 -0
- package/dist/types/path/CurveLocation.d.ts +164 -0
- package/dist/types/path/Path.d.ts +1361 -0
- package/dist/types/path/PathFlattener.d.ts +48 -0
- package/dist/types/path/PathItem.d.ts +1190 -0
- package/dist/types/path/Segment.d.ts +335 -0
- package/dist/types/path/SegmentPoint.d.ts +1 -0
- package/dist/types/path/StrokeProfile.d.ts +74 -0
- package/dist/types/path/StrokeProfileStop.d.ts +110 -0
- package/dist/types/path/boolean.d.ts +24 -0
- package/dist/types/path/bounds.d.ts +24 -0
- package/dist/types/path/crossing.d.ts +2 -0
- package/dist/types/path/draw.d.ts +6 -0
- package/dist/types/path/hitTest.d.ts +8 -0
- package/dist/types/path/offset.d.ts +14 -0
- package/dist/types/path/shapes.d.ts +20 -0
- package/dist/types/path/smooth.d.ts +18 -0
- package/dist/types/path/values.d.ts +8 -0
- package/dist/types/scope/PaperScope.d.ts +182 -0
- package/dist/types/scope/PaperScopeItem.d.ts +26 -0
- package/dist/types/smoothing/index.d.ts +26 -0
- package/dist/types/style/Color.d.ts +829 -0
- package/dist/types/style/Gradient.d.ts +130 -0
- package/dist/types/style/GradientStop.d.ts +126 -0
- package/dist/types/style/PatternDefinition.d.ts +185 -0
- package/dist/types/style/Style.d.ts +757 -0
- package/dist/types/svg/index.d.ts +14 -0
- package/dist/types/svg/svgElement.d.ts +32 -0
- package/dist/types/svg/svgExport.d.ts +19 -0
- package/dist/types/svg/svgImport.d.ts +13 -0
- package/dist/types/svg/svgStyles.d.ts +20 -0
- package/dist/types/text/AreaText.d.ts +104 -0
- package/dist/types/text/PathText.d.ts +78 -0
- package/dist/types/text/PointText.d.ts +50 -0
- package/dist/types/text/TextItem.d.ts +163 -0
- package/dist/types/text/TextRange.d.ts +98 -0
- package/dist/types/text/TextStory.d.ts +119 -0
- package/dist/types/text/areaLayout.d.ts +3 -0
- package/dist/types/text/layout.d.ts +43 -0
- package/dist/types/text/measure.d.ts +7 -0
- package/dist/types/text/pathLayout.d.ts +3 -0
- package/dist/types/tool/Tool.d.ts +356 -0
- package/dist/types/tool/ToolEvent.d.ts +134 -0
- package/dist/types/util/Formatter.d.ts +34 -0
- package/dist/types/util/collisions.d.ts +77 -0
- package/dist/types/util/list.d.ts +23 -0
- package/dist/types/util/numerical.d.ts +196 -0
- package/dist/types/util/object.d.ts +19 -0
- package/dist/types/util/string.d.ts +12 -0
- package/dist/types/util/uid.d.ts +7 -0
- package/dist/types/values/arcs.d.ts +10 -0
- package/dist/types/values/curve.d.ts +42 -0
- package/dist/types/values/fit.d.ts +26 -0
- package/dist/types/values/index.d.ts +10 -0
- package/dist/types/values/intersections.d.ts +11 -0
- package/dist/types/values/matrix.d.ts +19 -0
- package/dist/types/values/path.d.ts +26 -0
- package/dist/types/values/profile.d.ts +41 -0
- package/dist/types/values/region.d.ts +13 -0
- package/dist/types/values/smooth.d.ts +39 -0
- package/dist/types/values/svg.d.ts +47 -0
- package/dist/types/view/CanvasView.d.ts +37 -0
- package/dist/types/view/View.d.ts +700 -0
- package/dist/types/view/input.d.ts +28 -0
- package/package.json +90 -58
- package/dist/docs/assets/css/docs.css +0 -414
- package/dist/docs/assets/js/codemirror.js +0 -4
- package/dist/docs/assets/js/docs.js +0 -493
- package/dist/docs/assets/js/jquery.js +0 -6
- package/dist/docs/assets/js/paper.js +0 -23759
- package/dist/docs/classes/AreaText.html +0 -8708
- package/dist/docs/classes/ChangeFlag.html +0 -385
- package/dist/docs/classes/Color.html +0 -2205
- package/dist/docs/classes/CompoundPath.html +0 -9168
- package/dist/docs/classes/Curve.html +0 -2326
- package/dist/docs/classes/CurveLocation.html +0 -673
- package/dist/docs/classes/Event.html +0 -177
- package/dist/docs/classes/Gradient.html +0 -241
- package/dist/docs/classes/GradientStop.html +0 -274
- package/dist/docs/classes/Group.html +0 -7139
- package/dist/docs/classes/HitResult.html +0 -241
- package/dist/docs/classes/HostItem.html +0 -6836
- package/dist/docs/classes/Item.html +0 -6892
- package/dist/docs/classes/Key.html +0 -140
- package/dist/docs/classes/KeyEvent.html +0 -309
- package/dist/docs/classes/Layer.html +0 -7122
- package/dist/docs/classes/Matrix.html +0 -1745
- package/dist/docs/classes/MouseEvent.html +0 -356
- package/dist/docs/classes/PaperScope.html +0 -548
- package/dist/docs/classes/PaperScript.html +0 -202
- package/dist/docs/classes/Path.html +0 -12064
- package/dist/docs/classes/PathItem.html +0 -8930
- package/dist/docs/classes/PathText.html +0 -8578
- package/dist/docs/classes/Point.html +0 -2860
- package/dist/docs/classes/PointText.html +0 -8489
- package/dist/docs/classes/Project.html +0 -1604
- package/dist/docs/classes/Raster.html +0 -8069
- package/dist/docs/classes/Rectangle.html +0 -1698
- package/dist/docs/classes/Segment.html +0 -1017
- package/dist/docs/classes/Shape.html +0 -7570
- package/dist/docs/classes/Size.html +0 -1915
- package/dist/docs/classes/Style.html +0 -1765
- package/dist/docs/classes/SymbolDefinition.html +0 -312
- package/dist/docs/classes/SymbolItem.html +0 -6999
- package/dist/docs/classes/TextItem.html +0 -8332
- package/dist/docs/classes/TextRange.html +0 -186
- package/dist/docs/classes/TextStory.html +0 -355
- package/dist/docs/classes/Tool.html +0 -888
- package/dist/docs/classes/ToolEvent.html +0 -525
- package/dist/docs/classes/Tween.html +0 -390
- package/dist/docs/classes/View.html +0 -2108
- package/dist/docs/classes/global.html +0 -426
- package/dist/docs/classes/index.html +0 -88
- package/dist/docs/index.html +0 -11
- package/dist/node/canvas.js +0 -68
- package/dist/node/extend.js +0 -156
- package/dist/node/self.js +0 -67
- package/dist/paper-core.d.ts +0 -1
- package/dist/paper-core.js +0 -21834
- package/dist/paper-core.min.js +0 -32
- package/dist/paper.d.ts +0 -9630
- package/examples/Animated/AnimatedStar.html +0 -53
- package/examples/Animated/BooleanOperations.html +0 -115
- package/examples/Animated/CandyCrash.html +0 -151
- package/examples/Animated/Extruded.html +0 -50
- package/examples/Animated/Lines.html +0 -53
- package/examples/Animated/Smoothing.html +0 -70
- package/examples/Animated/Space.html +0 -86
- package/examples/Animated/SpaceUsingShapes.html +0 -79
- package/examples/Games/Paperoids.html +0 -569
- package/examples/JSON/Circle Testing.html +0 -34
- package/examples/JSON/Compound Path.html +0 -25
- package/examples/JSON/Empty Path Testing.html +0 -31
- package/examples/JSON/Gradients.html +0 -34
- package/examples/JSON/Group Transform.html +0 -28
- package/examples/JSON/Line Testing.html +0 -44
- package/examples/JSON/Random Path Testing.html +0 -42
- package/examples/JSON/Raster.html +0 -29
- package/examples/JSON/Rect and Attribute Testing.html +0 -56
- package/examples/JSON/Rotated Primitives.html +0 -55
- package/examples/JSON/Selection.html +0 -43
- package/examples/JSON/Shapes.html +0 -54
- package/examples/JSON/Symbols.html +0 -30
- package/examples/JSON/Text Testing.html +0 -38
- package/examples/JSON/Tiger.html +0 -19
- package/examples/JSON/Transform Test 1.html +0 -32
- package/examples/JSON/Transform Test 2.html +0 -30
- package/examples/Node.js/AnimatedStar.js +0 -52
- package/examples/Node.js/BooleanOperations.js +0 -36
- package/examples/Node.js/JSONtoPDF.js +0 -20
- package/examples/Node.js/Raster.js +0 -32
- package/examples/Node.js/RasterRemote.js +0 -33
- package/examples/Node.js/SvgExport.js +0 -52
- package/examples/Node.js/SvgImport.js +0 -23
- package/examples/Node.js/Tadpoles.js +0 -16
- package/examples/Node.js/Tadpoles.pjs +0 -278
- package/examples/Node.js/in.json +0 -1
- package/examples/Node.js/in.svg +0 -16
- package/examples/Paperjs.org/BooleanOperattions.html +0 -115
- package/examples/Paperjs.org/BouncingBalls.html +0 -103
- package/examples/Paperjs.org/Chain.html +0 -54
- package/examples/Paperjs.org/DivisionRaster.html +0 -72
- package/examples/Paperjs.org/FutureSplash.html +0 -122
- package/examples/Paperjs.org/HitTesting.html +0 -103
- package/examples/Paperjs.org/InteractiveTiger.html +0 -777
- package/examples/Paperjs.org/MetaBalls.html +0 -132
- package/examples/Paperjs.org/NyanRainbow.html +0 -202
- package/examples/Paperjs.org/PathIntersections.html +0 -76
- package/examples/Paperjs.org/Qbertify.html +0 -146
- package/examples/Paperjs.org/RadialRainbows.html +0 -80
- package/examples/Paperjs.org/RoundedRectangles.html +0 -41
- package/examples/Paperjs.org/SatieLikedToDraw.html +0 -140
- package/examples/Paperjs.org/Simplify.html +0 -63
- package/examples/Paperjs.org/SpiralRaster.html +0 -120
- package/examples/Paperjs.org/Tadpoles.html +0 -283
- package/examples/Paperjs.org/Voronoi.html +0 -134
- package/examples/Rasters/PhyllotaxisRaster.html +0 -96
- package/examples/Rasters/Raster.html +0 -34
- package/examples/Rasters/RotationRaster.html +0 -44
- package/examples/Rasters/Smoothing.html +0 -36
- package/examples/SVG Export/Circle Testing.html +0 -32
- package/examples/SVG Export/Clipping.html +0 -17
- package/examples/SVG Export/Compound Path.html +0 -22
- package/examples/SVG Export/Empty Path Testing.html +0 -28
- package/examples/SVG Export/Gradients.html +0 -52
- package/examples/SVG Export/Group Transform.html +0 -25
- package/examples/SVG Export/Line Testing.html +0 -41
- package/examples/SVG Export/Random Path Testing.html +0 -39
- package/examples/SVG Export/Raster.html +0 -21
- package/examples/SVG Export/Rect and Attribute Testing.html +0 -53
- package/examples/SVG Export/Rotated Primitives.html +0 -80
- package/examples/SVG Export/Shapes.html +0 -58
- package/examples/SVG Export/Symbols.html +0 -27
- package/examples/SVG Export/Text Testing.html +0 -45
- package/examples/SVG Export/Tiger.html +0 -23
- package/examples/SVG Export/Transform Test 1.html +0 -29
- package/examples/SVG Export/Transform Test 2.html +0 -27
- package/examples/SVG Import/Arcs.html +0 -78
- package/examples/SVG Import/Butterfly.html +0 -223
- package/examples/SVG Import/Circle and Ellipse Testing.html +0 -26
- package/examples/SVG Import/Clipping.html +0 -100
- package/examples/SVG Import/From File.html +0 -30
- package/examples/SVG Import/Gradient.html +0 -138
- package/examples/SVG Import/Gradients.html +0 -30
- package/examples/SVG Import/Inkscape Pivot.html +0 -52
- package/examples/SVG Import/Inkscape.html +0 -88
- package/examples/SVG Import/Line Testing.html +0 -24
- package/examples/SVG Import/MoreGradients.html +0 -107
- package/examples/SVG Import/Multiple Paths Test 1.html +0 -42
- package/examples/SVG Import/Multiple Paths Test 2.html +0 -33
- package/examples/SVG Import/Nested Groups Test.html +0 -78
- package/examples/SVG Import/Polybezier.html +0 -43
- package/examples/SVG Import/Rect Testing.html +0 -25
- package/examples/SVG Import/Symbols.html +0 -24
- package/examples/SVG Import/Testing.html +0 -40
- package/examples/SVG Import/Text Testing.html +0 -19
- package/examples/SVG Import/Tiger.html +0 -742
- package/examples/SVG Import/Transform Testing.html +0 -22
- package/examples/SVG Import/Viewbox.html +0 -38
- package/examples/Scripts/Arcs.html +0 -39
- package/examples/Scripts/AreaText.html +0 -65
- package/examples/Scripts/BlendModes.html +0 -77
- package/examples/Scripts/BooleanOperations.html +0 -937
- package/examples/Scripts/CompoundPath.html +0 -19
- package/examples/Scripts/CurveTimeParameterization.html +0 -61
- package/examples/Scripts/HslColor.html +0 -53
- package/examples/Scripts/PathStructure.html +0 -82
- package/examples/Scripts/PathTangents.html +0 -73
- package/examples/Scripts/PathText.html +0 -48
- package/examples/Scripts/Resize.html +0 -42
- package/examples/Scripts/RoundRectangle.html +0 -28
- package/examples/Scripts/Shapes.html +0 -54
- package/examples/Scripts/StrokeBounds.html +0 -101
- package/examples/Scripts/StrokeScaling.html +0 -65
- package/examples/Scripts/TextRanges.html +0 -51
- package/examples/Tools/BezierTool.html +0 -90
- package/examples/Tools/Circles.html +0 -28
- package/examples/Tools/Clouds.html +0 -35
- package/examples/Tools/DrippingBrush.html +0 -73
- package/examples/Tools/FancyBrush.html +0 -82
- package/examples/Tools/Grid.html +0 -44
- package/examples/Tools/MultiLines.html +0 -44
- package/examples/Tools/MultipleTools.html +0 -44
- package/examples/Tools/PathEditing.html +0 -95
- package/examples/Tools/SquareRounded.html +0 -76
- package/examples/Tools/Stars.html +0 -38
- package/examples/Tools/Vektor.html +0 -200
- package/examples/Tools/Wave.html +0 -50
- package/examples/Tools/WormFarm.html +0 -88
- package/examples/Worker/Main.html +0 -53
- package/examples/Worker/Worker.js +0 -14
- package/examples/css/style.css +0 -12
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
import { Base, CurveLocation, Line, Path, Point, Rectangle, Segment } from '../internal.ts';
|
|
2
|
+
import type { PointLike, SelectablePoint } from '../basic/Point.ts';
|
|
3
|
+
import type { Matrix } from '../basic/Matrix.ts';
|
|
4
|
+
import type { CurveType, CurveValues } from '../values/curve.ts';
|
|
5
|
+
import type { JSONDictionary, JSONOptions } from '../core/serialization.ts';
|
|
6
|
+
/**
|
|
7
|
+
* The Curve object represents the parts of a path that are connected by
|
|
8
|
+
* two following {@link Segment} objects. The curves of a path can be accessed
|
|
9
|
+
* through its {@link Path#curves} array.
|
|
10
|
+
*
|
|
11
|
+
* While a segment describe the anchor point and its incoming and outgoing
|
|
12
|
+
* handles, a Curve object describes the curve passing between two such
|
|
13
|
+
* segments. Curves and segments represent two different ways of looking at the
|
|
14
|
+
* same thing, but focusing on different aspects. Curves for example offer many
|
|
15
|
+
* convenient ways to work with parts of the path, finding lengths, positions or
|
|
16
|
+
* tangents at given offsets.
|
|
17
|
+
*/
|
|
18
|
+
export declare class Curve extends Base {
|
|
19
|
+
#private;
|
|
20
|
+
_path: Path | null;
|
|
21
|
+
_segment1: Segment;
|
|
22
|
+
_segment2: Segment;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new curve object between two segments, which are copied.
|
|
25
|
+
*
|
|
26
|
+
* @param segment1 the first segment of the curve
|
|
27
|
+
* @param segment2 the second segment of the curve
|
|
28
|
+
*/
|
|
29
|
+
constructor(segment1: Segment, segment2: Segment);
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new curve object from its anchor points and handles.
|
|
32
|
+
*
|
|
33
|
+
* @param point1 the first anchor point of the curve
|
|
34
|
+
* @param handle1 the handle of the first anchor point, relative to it
|
|
35
|
+
* @param handle2 the handle of the second anchor point, relative to it
|
|
36
|
+
* @param point2 the second anchor point of the curve
|
|
37
|
+
*/
|
|
38
|
+
constructor(point1: PointLike, handle1: PointLike, handle2: PointLike, point2: PointLike);
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new curve object from another curve, from an object with its
|
|
41
|
+
* points and handles as {@link #toString()} prints them, or from the
|
|
42
|
+
* values that {@link #values} holds.
|
|
43
|
+
*
|
|
44
|
+
* @param object the curve, the object with its points and handles, or
|
|
45
|
+
* the curve values
|
|
46
|
+
*/
|
|
47
|
+
constructor(object?: {
|
|
48
|
+
segment1: Segment;
|
|
49
|
+
segment2: Segment;
|
|
50
|
+
} | {
|
|
51
|
+
point1: PointLike;
|
|
52
|
+
handle1?: PointLike;
|
|
53
|
+
handle2?: PointLike;
|
|
54
|
+
point2: PointLike;
|
|
55
|
+
} | number[]);
|
|
56
|
+
_serialize(options: JSONOptions, dictionary: JSONDictionary): any;
|
|
57
|
+
_changed(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Returns a copy of the curve.
|
|
60
|
+
*/
|
|
61
|
+
clone(): Curve;
|
|
62
|
+
/**
|
|
63
|
+
* Returns a string representation of the curve.
|
|
64
|
+
*
|
|
65
|
+
* @return a string representation of the curve
|
|
66
|
+
*/
|
|
67
|
+
toString(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Determines the type of cubic Bézier curve via discriminant
|
|
70
|
+
* classification, as well as the curve-time parameters of the associated
|
|
71
|
+
* points of inflection, loops, cusps, etc.
|
|
72
|
+
*
|
|
73
|
+
* @return the curve classification information as an object, see
|
|
74
|
+
* options
|
|
75
|
+
* @result info.type {String} the type of Bézier curve, possible values are:
|
|
76
|
+
* {@values 'line', 'quadratic', 'serpentine', 'cusp', 'loop', 'arch'}
|
|
77
|
+
* @result info.roots {Number[]} the curve-time parameters of the
|
|
78
|
+
* associated points of inflection for serpentine curves, loops, cusps,
|
|
79
|
+
etc
|
|
80
|
+
*/
|
|
81
|
+
classify(): {
|
|
82
|
+
type: CurveType;
|
|
83
|
+
roots: number[] | null;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Removes the curve from the path that it belongs to, by removing its
|
|
87
|
+
* second segment and merging its handle with the first segment.
|
|
88
|
+
* @return {@true if the curve was removed}
|
|
89
|
+
*/
|
|
90
|
+
remove(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The first anchor point of the curve.
|
|
93
|
+
*/
|
|
94
|
+
get point1(): SelectablePoint;
|
|
95
|
+
set point1(point: PointLike);
|
|
96
|
+
/**
|
|
97
|
+
* The second anchor point of the curve.
|
|
98
|
+
*/
|
|
99
|
+
get point2(): SelectablePoint;
|
|
100
|
+
set point2(point: PointLike);
|
|
101
|
+
/**
|
|
102
|
+
* The handle point that describes the tangent in the first anchor point.
|
|
103
|
+
*/
|
|
104
|
+
get handle1(): SelectablePoint;
|
|
105
|
+
set handle1(point: PointLike);
|
|
106
|
+
/**
|
|
107
|
+
* The handle point that describes the tangent in the second anchor point.
|
|
108
|
+
*/
|
|
109
|
+
get handle2(): SelectablePoint;
|
|
110
|
+
set handle2(point: PointLike);
|
|
111
|
+
/**
|
|
112
|
+
* The first segment of the curve.
|
|
113
|
+
*/
|
|
114
|
+
get segment1(): Segment;
|
|
115
|
+
/**
|
|
116
|
+
* The second segment of the curve.
|
|
117
|
+
*/
|
|
118
|
+
get segment2(): Segment;
|
|
119
|
+
/**
|
|
120
|
+
* The path that the curve belongs to.
|
|
121
|
+
*/
|
|
122
|
+
get path(): Path | null;
|
|
123
|
+
/**
|
|
124
|
+
* The index of the curve in the {@link Path#curves} array.
|
|
125
|
+
*/
|
|
126
|
+
get index(): number | null;
|
|
127
|
+
/**
|
|
128
|
+
* The next curve in the {@link Path#curves} array that the curve
|
|
129
|
+
* belongs to.
|
|
130
|
+
*/
|
|
131
|
+
get next(): Curve | null;
|
|
132
|
+
/**
|
|
133
|
+
* The previous curve in the {@link Path#curves} array that the curve
|
|
134
|
+
* belongs to.
|
|
135
|
+
*/
|
|
136
|
+
get previous(): Curve | null;
|
|
137
|
+
/**
|
|
138
|
+
* Checks if this is the first curve in the {@link Path#curves} array.
|
|
139
|
+
*
|
|
140
|
+
* @return {@true if this is the first curve}
|
|
141
|
+
*/
|
|
142
|
+
isFirst(): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Checks if this is the last curve in the {@link Path#curves} array.
|
|
145
|
+
*
|
|
146
|
+
* @return {@true if this is the last curve}
|
|
147
|
+
*/
|
|
148
|
+
isLast(): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Specifies whether the points and handles of the curve are selected.
|
|
151
|
+
*/
|
|
152
|
+
get selected(): boolean;
|
|
153
|
+
set selected(selected: boolean);
|
|
154
|
+
/**
|
|
155
|
+
* An array of 8 float values, describing this curve's geometry in four
|
|
156
|
+
* absolute x/y pairs (point1, handle1, handle2, point2), as a new array on
|
|
157
|
+
* each read. This format is used internally for efficient processing of
|
|
158
|
+
* curve geometries, e.g. when calculating intersections or bounds.
|
|
159
|
+
*
|
|
160
|
+
* Note that the handles are converted to absolute coordinates.
|
|
161
|
+
*/
|
|
162
|
+
get values(): CurveValues;
|
|
163
|
+
/**
|
|
164
|
+
* An array of 4 point objects, describing this curve's geometry in absolute
|
|
165
|
+
* coordinates (point1, handle1, handle2, point2).
|
|
166
|
+
*
|
|
167
|
+
* Note that the handles are converted to absolute coordinates.
|
|
168
|
+
*/
|
|
169
|
+
get points(): Point[];
|
|
170
|
+
/**
|
|
171
|
+
* The approximated length of the curve.
|
|
172
|
+
*/
|
|
173
|
+
get length(): number;
|
|
174
|
+
/**
|
|
175
|
+
* The area that the curve's geometry is covering.
|
|
176
|
+
*/
|
|
177
|
+
get area(): number;
|
|
178
|
+
/**
|
|
179
|
+
* @private
|
|
180
|
+
*/
|
|
181
|
+
get line(): Line;
|
|
182
|
+
/**
|
|
183
|
+
* Creates a new curve as a sub-curve from this curve, its range defined by
|
|
184
|
+
* the given curve-time parameters. If `from` is larger than `to`, then
|
|
185
|
+
* the resulting curve will have its direction reversed.
|
|
186
|
+
*
|
|
187
|
+
* @param from the curve-time parameter at which the sub-curve
|
|
188
|
+
* starts
|
|
189
|
+
* @param to the curve-time parameter at which the sub-curve
|
|
190
|
+
* ends
|
|
191
|
+
* @return the newly created sub-curve
|
|
192
|
+
*/
|
|
193
|
+
getPart(from: number, to: number): Curve;
|
|
194
|
+
/**
|
|
195
|
+
* Returns the length of the part of the curve between the given
|
|
196
|
+
* curve-time parameters.
|
|
197
|
+
*
|
|
198
|
+
* @param from the curve-time parameter at which the part starts
|
|
199
|
+
* @param to the curve-time parameter at which the part ends
|
|
200
|
+
* @return the length of the part
|
|
201
|
+
*/
|
|
202
|
+
getPartLength(from: number, to: number): number;
|
|
203
|
+
/**
|
|
204
|
+
* Divides the curve into two curves at the given offset or location. The
|
|
205
|
+
* curve itself is modified and becomes the first part, the second part is
|
|
206
|
+
* returned as a new curve. If the curve belongs to a path item, a new
|
|
207
|
+
* segment is inserted into the path at the given location, and the second
|
|
208
|
+
* part becomes a part of the path as well.
|
|
209
|
+
*
|
|
210
|
+
* @param location the offset or location on the
|
|
211
|
+
* curve at which to divide
|
|
212
|
+
* @return the second part of the divided curve if the location is
|
|
213
|
+
* valid, `null` otherwise
|
|
214
|
+
* @see #divideAtTime(time)
|
|
215
|
+
*/
|
|
216
|
+
divideAt(location: number | CurveLocation): Curve | null;
|
|
217
|
+
/**
|
|
218
|
+
* Divides the curve into two curves at the given curve-time parameter. The
|
|
219
|
+
* curve itself is modified and becomes the first part, the second part is
|
|
220
|
+
* returned as a new curve. If the modified curve belongs to a path item,
|
|
221
|
+
* the second part is also added to the path.
|
|
222
|
+
*
|
|
223
|
+
* @param time the curve-time parameter on the curve at which to
|
|
224
|
+
* divide
|
|
225
|
+
* @return the second part of the divided curve, if the offset is
|
|
226
|
+
* within the valid range, `null` otherwise.
|
|
227
|
+
* @see #divideAt(location)
|
|
228
|
+
*/
|
|
229
|
+
divideAtTime(time: number): Curve | null;
|
|
230
|
+
/**
|
|
231
|
+
* Splits the path this curve belongs to at the given offset. After
|
|
232
|
+
* splitting, the path will be open. If the path was open already, splitting
|
|
233
|
+
* will result in two paths.
|
|
234
|
+
*
|
|
235
|
+
* @param location the offset or location on the
|
|
236
|
+
* curve at which to split
|
|
237
|
+
* @return the newly created path after splitting, if any
|
|
238
|
+
* @see Path#splitAt(location)
|
|
239
|
+
*/
|
|
240
|
+
splitAt(location: number | CurveLocation): Path | null;
|
|
241
|
+
/**
|
|
242
|
+
* Splits the path this curve belongs to at the given curve-time parameter.
|
|
243
|
+
* After splitting, the path will be open. If the path was open already,
|
|
244
|
+
* splitting will result in two paths.
|
|
245
|
+
*
|
|
246
|
+
* @param time the curve-time parameter on the curve at which to
|
|
247
|
+
* split
|
|
248
|
+
* @return the newly created path after splitting, if any
|
|
249
|
+
* @see Path#splitAt(location)
|
|
250
|
+
*/
|
|
251
|
+
splitAtTime(time: number): Path | null;
|
|
252
|
+
/**
|
|
253
|
+
* Returns a reversed version of the curve, without modifying the curve
|
|
254
|
+
* itself.
|
|
255
|
+
*
|
|
256
|
+
* @return a reversed version of the curve
|
|
257
|
+
*/
|
|
258
|
+
reversed(): Curve;
|
|
259
|
+
/**
|
|
260
|
+
* Clears the curve's handles by setting their coordinates to zero,
|
|
261
|
+
* turning the curve into a straight line.
|
|
262
|
+
*/
|
|
263
|
+
clearHandles(): void;
|
|
264
|
+
/**
|
|
265
|
+
* {@grouptitle Bounding Boxes}
|
|
266
|
+
*
|
|
267
|
+
* The bounding rectangle of the curve excluding stroke width.
|
|
268
|
+
*/
|
|
269
|
+
get bounds(): Rectangle;
|
|
270
|
+
/**
|
|
271
|
+
* The bounding rectangle of the curve including stroke width.
|
|
272
|
+
*/
|
|
273
|
+
get strokeBounds(): Rectangle;
|
|
274
|
+
/**
|
|
275
|
+
* The bounding rectangle of the curve including handles.
|
|
276
|
+
*/
|
|
277
|
+
get handleBounds(): Rectangle;
|
|
278
|
+
/**
|
|
279
|
+
* {@grouptitle Curve Tests}
|
|
280
|
+
*
|
|
281
|
+
* Checks if this curve has any curve handles set. Handles of which both
|
|
282
|
+
* coordinates are 0 within a tolerance of 1e-12 count as not set, see
|
|
283
|
+
* {@link Point#isZero()}.
|
|
284
|
+
*
|
|
285
|
+
* @return {@true if the curve has handles set}
|
|
286
|
+
* @see Curve#handle1
|
|
287
|
+
* @see Curve#handle2
|
|
288
|
+
* @see Segment#hasHandles()
|
|
289
|
+
* @see Path#hasHandles()
|
|
290
|
+
*/
|
|
291
|
+
hasHandles(): boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Checks if this curve has any length.
|
|
294
|
+
*
|
|
295
|
+
* @param [epsilon=0] the epsilon against which to compare the
|
|
296
|
+
* curve's length
|
|
297
|
+
* @return {@true if the curve is longer than the given epsilon}
|
|
298
|
+
*/
|
|
299
|
+
hasLength(epsilon?: number): boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Checks if the two curves describe straight lines that are
|
|
302
|
+
* collinear, meaning they run in parallel.
|
|
303
|
+
*
|
|
304
|
+
* @param curve the other curve to check against
|
|
305
|
+
* @return {@true if the two lines are collinear}
|
|
306
|
+
*/
|
|
307
|
+
isCollinear(curve: Curve | null): boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Checks if the curve is a straight horizontal line.
|
|
310
|
+
*
|
|
311
|
+
* @return {@true if the line is horizontal}
|
|
312
|
+
*/
|
|
313
|
+
isHorizontal(): boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Checks if the curve is a straight vertical line.
|
|
316
|
+
*
|
|
317
|
+
* @return {@true if the line is vertical}
|
|
318
|
+
*/
|
|
319
|
+
isVertical(): boolean;
|
|
320
|
+
/**
|
|
321
|
+
* {@grouptitle Positions on Curves}
|
|
322
|
+
*
|
|
323
|
+
* Calculates the curve location at the specified offset on the curve, or
|
|
324
|
+
* `null` if the offset exceeds the length of the curve.
|
|
325
|
+
*
|
|
326
|
+
* @param offset the offset on the curve
|
|
327
|
+
* @return the curve location at the specified offset
|
|
328
|
+
*/
|
|
329
|
+
getLocationAt(offset: number): CurveLocation | null;
|
|
330
|
+
/**
|
|
331
|
+
* Calculates the curve location at the specified curve-time parameter on
|
|
332
|
+
* the curve, or `null` if the parameter lies outside of `0..1`.
|
|
333
|
+
*
|
|
334
|
+
* @param time the curve-time parameter on the curve
|
|
335
|
+
* @return the curve location at the specified curve-time parameter
|
|
336
|
+
*/
|
|
337
|
+
getLocationAtTime(time: number | null): CurveLocation | null;
|
|
338
|
+
/**
|
|
339
|
+
* Calculates the curve-time parameter of the specified offset on the path,
|
|
340
|
+
* relative to the provided start parameter. If offset is a negative value,
|
|
341
|
+
* the parameter is searched to the left of the start parameter. If no start
|
|
342
|
+
* parameter is provided, a default of `0` for positive values of `offset`
|
|
343
|
+
* and `1` for negative values of `offset`.
|
|
344
|
+
*
|
|
345
|
+
* @param offset the offset at which to find the curve-time, in
|
|
346
|
+
* curve length units
|
|
347
|
+
* @param [start] the curve-time in relation to which the offset is
|
|
348
|
+
* determined
|
|
349
|
+
* @return the curve-time parameter at the specified location, or
|
|
350
|
+
* `null` if the offset exceeds the length of the curve
|
|
351
|
+
*/
|
|
352
|
+
getTimeAt(offset: number, start?: number): number | null;
|
|
353
|
+
/**
|
|
354
|
+
* Calculates the curve-time parameters where the curve is tangential to
|
|
355
|
+
* provided tangent. Note that tangents at the start or end are included.
|
|
356
|
+
*
|
|
357
|
+
* @param tangent the tangent to which the curve must be tangential
|
|
358
|
+
* @return at most two curve-time parameters, where the curve is
|
|
359
|
+
* tangential to the given tangent
|
|
360
|
+
*/
|
|
361
|
+
getTimesWithTangent(tangent: PointLike | number, y?: number): number[];
|
|
362
|
+
/**
|
|
363
|
+
* Returns the curve-time parameters of the peaks of the curve: where its
|
|
364
|
+
* first derivative is perpendicular to its second, so that its speed is
|
|
365
|
+
* the least or the most. They are similar to the extrema of its curvature,
|
|
366
|
+
* and cheaper to find.
|
|
367
|
+
*
|
|
368
|
+
* @return the curve-time parameters of the peaks
|
|
369
|
+
*/
|
|
370
|
+
getPeaks(): number[];
|
|
371
|
+
/**
|
|
372
|
+
* Calculates the curve offset at the specified curve-time parameter on
|
|
373
|
+
* the curve.
|
|
374
|
+
*
|
|
375
|
+
* @param time the curve-time parameter on the curve
|
|
376
|
+
* @return the curve offset at the specified curve-time parameter
|
|
377
|
+
*/
|
|
378
|
+
getOffsetAtTime(time: number): number;
|
|
379
|
+
/**
|
|
380
|
+
* Returns the curve location of the specified point if it lies on the
|
|
381
|
+
* curve, `null` otherwise.
|
|
382
|
+
*
|
|
383
|
+
* @param point the point on the curve
|
|
384
|
+
* @return the curve location of the specified point
|
|
385
|
+
*/
|
|
386
|
+
getLocationOf(point: PointLike | number, y?: number): CurveLocation | null;
|
|
387
|
+
/**
|
|
388
|
+
* Returns the length of the path from its beginning up to the
|
|
389
|
+
* specified point if it lies on the path, `null` otherwise.
|
|
390
|
+
*
|
|
391
|
+
* @param point the point on the path
|
|
392
|
+
* @return the length of the path up to the specified point
|
|
393
|
+
*/
|
|
394
|
+
getOffsetOf(point: PointLike | number, y?: number): number | null;
|
|
395
|
+
/**
|
|
396
|
+
* Returns the curve-time parameter of the specified point if it lies on the
|
|
397
|
+
* curve, `null` otherwise.
|
|
398
|
+
* Note that if there is more than one possible solution in a
|
|
399
|
+
* self-intersecting curve, the first found result is returned.
|
|
400
|
+
*
|
|
401
|
+
* @param point the point on the curve
|
|
402
|
+
* @return the curve-time parameter of the specified point
|
|
403
|
+
*/
|
|
404
|
+
getTimeOf(point: PointLike | number, y?: number): number | null;
|
|
405
|
+
/**
|
|
406
|
+
* Returns the nearest location on the curve to the specified point.
|
|
407
|
+
*
|
|
408
|
+
* @param point the point for which we search the nearest location
|
|
409
|
+
* @return the location on the curve that's the closest to
|
|
410
|
+
* the specified point
|
|
411
|
+
*/
|
|
412
|
+
getNearestLocation(point: PointLike | number, y?: number): CurveLocation;
|
|
413
|
+
/**
|
|
414
|
+
* Returns the nearest point on the curve to the specified point.
|
|
415
|
+
*
|
|
416
|
+
* @param point the point for which we search the nearest point
|
|
417
|
+
* @return the point on the curve that's the closest to the
|
|
418
|
+
* specified point
|
|
419
|
+
*/
|
|
420
|
+
getNearestPoint(point: PointLike | number, y?: number): Point;
|
|
421
|
+
static getIntersections(curves1: Curve[], curves2: Curve[] | null, include?: ((location: CurveLocation) => boolean) | null, matrix1?: Matrix | null, matrix2?: Matrix | null, _returnFirst?: boolean): CurveLocation[];
|
|
422
|
+
/**
|
|
423
|
+
* Returns all intersections between two {@link Curve} objects as an
|
|
424
|
+
* array of {@link CurveLocation} objects.
|
|
425
|
+
*
|
|
426
|
+
* @param curve the other curve to find the intersections with
|
|
427
|
+
* (if the curve itself or `null` is passed, the self intersection
|
|
428
|
+
* of the curve is returned, if it exists)
|
|
429
|
+
* @return the locations of all intersections between
|
|
430
|
+
* the curves
|
|
431
|
+
*/
|
|
432
|
+
getIntersections(curve?: Curve): CurveLocation[];
|
|
433
|
+
/**
|
|
434
|
+
* Checks if this curve appears as a straight line. This can mean that
|
|
435
|
+
* it has no handles defined, or that the handles run collinear with the
|
|
436
|
+
* line that connects the curve's start and end point, not falling
|
|
437
|
+
* outside of the line.
|
|
438
|
+
*
|
|
439
|
+
* @return {@true if the curve is straight}
|
|
440
|
+
*/
|
|
441
|
+
isStraight(): boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Checks if this curve is parametrically linear, meaning that it is
|
|
444
|
+
* straight and its handles are positioned at 1/3 and 2/3 of the total
|
|
445
|
+
* length of the curve.
|
|
446
|
+
*
|
|
447
|
+
* @return {@true if the curve is parametrically linear}
|
|
448
|
+
*/
|
|
449
|
+
isLinear(): boolean;
|
|
450
|
+
/**
|
|
451
|
+
* Calculates the point on the curve at the given location.
|
|
452
|
+
*
|
|
453
|
+
* @param location the offset or location on the
|
|
454
|
+
* curve
|
|
455
|
+
* @return the point on the curve at the given location, or `null` if the
|
|
456
|
+
* location isn't on the curve
|
|
457
|
+
*/
|
|
458
|
+
getPointAt(location: number | CurveLocation): Point | null;
|
|
459
|
+
/**
|
|
460
|
+
* Calculates the point on the curve at the given curve-time parameter.
|
|
461
|
+
*
|
|
462
|
+
* @param time the curve-time parameter on the curve
|
|
463
|
+
* @return the point on the curve at the given curve-time parameter, or `null`
|
|
464
|
+
* for times outside 0 to 1
|
|
465
|
+
*/
|
|
466
|
+
getPointAtTime(time: number): Point | null;
|
|
467
|
+
/**
|
|
468
|
+
* Calculates the normalized tangent vector of the curve at the given
|
|
469
|
+
* location.
|
|
470
|
+
*
|
|
471
|
+
* @param location the offset or location on the
|
|
472
|
+
* curve
|
|
473
|
+
* @return the normalized tangent of the curve at the given location, or
|
|
474
|
+
* `null` if the location isn't on the curve
|
|
475
|
+
*/
|
|
476
|
+
getTangentAt(location: number | CurveLocation): Point | null;
|
|
477
|
+
/**
|
|
478
|
+
* Calculates the normalized tangent vector of the curve at the given
|
|
479
|
+
* curve-time parameter.
|
|
480
|
+
*
|
|
481
|
+
* @param time the curve-time parameter on the curve
|
|
482
|
+
* @return the normalized tangent of the curve at the given curve-time
|
|
483
|
+
* parameter, or `null` for times outside 0 to 1
|
|
484
|
+
*/
|
|
485
|
+
getTangentAtTime(time: number): Point | null;
|
|
486
|
+
/**
|
|
487
|
+
* Calculates the normal vector of the curve at the given location.
|
|
488
|
+
*
|
|
489
|
+
* @param location the offset or location on the
|
|
490
|
+
* curve
|
|
491
|
+
* @return the normal of the curve at the given location, or `null` if the
|
|
492
|
+
* location isn't on the curve
|
|
493
|
+
*/
|
|
494
|
+
getNormalAt(location: number | CurveLocation): Point | null;
|
|
495
|
+
/**
|
|
496
|
+
* Calculates the normal vector of the curve at the given curve-time
|
|
497
|
+
* parameter.
|
|
498
|
+
*
|
|
499
|
+
* @param time the curve-time parameter on the curve
|
|
500
|
+
* @return the normal of the curve at the given curve-time parameter, or
|
|
501
|
+
* `null` for times outside 0 to 1
|
|
502
|
+
*/
|
|
503
|
+
getNormalAtTime(time: number): Point | null;
|
|
504
|
+
/**
|
|
505
|
+
* Calculates the weighted tangent vector of the curve at the given
|
|
506
|
+
* location, its length reflecting the curve velocity at that location.
|
|
507
|
+
*
|
|
508
|
+
* @param location the offset or location on the
|
|
509
|
+
* curve
|
|
510
|
+
* @return the weighted tangent of the curve at the given location, or `null`
|
|
511
|
+
* if the location isn't on the curve
|
|
512
|
+
*/
|
|
513
|
+
getWeightedTangentAt(location: number | CurveLocation): Point | null;
|
|
514
|
+
/**
|
|
515
|
+
* Calculates the weighted tangent vector of the curve at the given
|
|
516
|
+
* curve-time parameter, its length reflecting the curve velocity there.
|
|
517
|
+
*
|
|
518
|
+
* @param time the curve-time parameter on the curve
|
|
519
|
+
* @return the weighted tangent of the curve at the given curve-time
|
|
520
|
+
* parameter, or `null` for times outside 0 to 1
|
|
521
|
+
*/
|
|
522
|
+
getWeightedTangentAtTime(time: number): Point | null;
|
|
523
|
+
/**
|
|
524
|
+
* Calculates the weighted normal vector of the curve at the given location,
|
|
525
|
+
* its length reflecting the curve velocity at that location.
|
|
526
|
+
*
|
|
527
|
+
* @param location the offset or location on the
|
|
528
|
+
* curve
|
|
529
|
+
* @return the weighted normal of the curve at the given location, or `null`
|
|
530
|
+
* if the location isn't on the curve
|
|
531
|
+
*/
|
|
532
|
+
getWeightedNormalAt(location: number | CurveLocation): Point | null;
|
|
533
|
+
/**
|
|
534
|
+
* Calculates the weighted normal vector of the curve at the given
|
|
535
|
+
* curve-time parameter, its length reflecting the curve velocity there.
|
|
536
|
+
*
|
|
537
|
+
* @param time the curve-time parameter on the curve
|
|
538
|
+
* @return the weighted normal of the curve at the given curve-time parameter,
|
|
539
|
+
* or `null` for times outside 0 to 1
|
|
540
|
+
*/
|
|
541
|
+
getWeightedNormalAtTime(time: number): Point | null;
|
|
542
|
+
/**
|
|
543
|
+
* Calculates the curvature of the curve at the given location. Curvatures
|
|
544
|
+
* indicate how sharply a curve changes direction. A straight line has zero
|
|
545
|
+
* curvature, where as a circle has a constant curvature. The curve's radius
|
|
546
|
+
* at the given location is the reciprocal value of its curvature.
|
|
547
|
+
*
|
|
548
|
+
* @param location the offset or location on the
|
|
549
|
+
* curve
|
|
550
|
+
* @return the curvature of the curve at the given location, or `null` if the
|
|
551
|
+
* location isn't on the curve
|
|
552
|
+
*/
|
|
553
|
+
getCurvatureAt(location: number | CurveLocation): number | null;
|
|
554
|
+
/**
|
|
555
|
+
* Calculates the curvature of the curve at the given curve-time
|
|
556
|
+
* parameter. Curvatures indicate how sharply a curve changes direction. A
|
|
557
|
+
* straight line has zero curvature, where as a circle has a constant
|
|
558
|
+
* curvature. The curve's radius at the given curve-time parameter is the
|
|
559
|
+
* reciprocal value of its curvature.
|
|
560
|
+
*
|
|
561
|
+
* @param time the curve-time parameter on the curve
|
|
562
|
+
* @return the curvature of the curve at the given curve-time parameter, or
|
|
563
|
+
* `null` for times outside 0 to 1
|
|
564
|
+
*/
|
|
565
|
+
getCurvatureAtTime(time: number): number | null;
|
|
566
|
+
}
|
|
567
|
+
export declare function getCurveValues(segment1: Segment, segment2: Segment, matrix?: Matrix | null, straight?: boolean): CurveValues;
|