plotboilerplate 1.28.0 → 1.28.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/package.json +1 -1
- package/src/_cjs/BezierPath.d.ts +0 -610
- package/src/_cjs/BezierPath.js +0 -1127
- package/src/_cjs/BezierPath.js.map +0 -1
- package/src/_cjs/Bounds.d.ts +0 -252
- package/src/_cjs/Bounds.js +0 -320
- package/src/_cjs/Bounds.js.map +0 -1
- package/src/_cjs/Circle.d.ts +0 -214
- package/src/_cjs/Circle.js +0 -339
- package/src/_cjs/Circle.js.map +0 -1
- package/src/_cjs/CircleSector.d.ts +0 -211
- package/src/_cjs/CircleSector.js +0 -364
- package/src/_cjs/CircleSector.js.map +0 -1
- package/src/_cjs/CubicBezierCurve.d.ts +0 -656
- package/src/_cjs/CubicBezierCurve.js +0 -1062
- package/src/_cjs/CubicBezierCurve.js.map +0 -1
- package/src/_cjs/Grid.d.ts +0 -83
- package/src/_cjs/Grid.js +0 -90
- package/src/_cjs/Grid.js.map +0 -1
- package/src/_cjs/KeyHandler.d.ts +0 -177
- package/src/_cjs/KeyHandler.js +0 -435
- package/src/_cjs/KeyHandler.js.map +0 -1
- package/src/_cjs/Line.d.ts +0 -134
- package/src/_cjs/Line.js +0 -220
- package/src/_cjs/Line.js.map +0 -1
- package/src/_cjs/MouseHandler.d.ts +0 -283
- package/src/_cjs/MouseHandler.js +0 -423
- package/src/_cjs/MouseHandler.js.map +0 -1
- package/src/_cjs/PBImage.d.ts +0 -81
- package/src/_cjs/PBImage.js +0 -61
- package/src/_cjs/PBImage.js.map +0 -1
- package/src/_cjs/PBText.d.ts +0 -118
- package/src/_cjs/PBText.js +0 -63
- package/src/_cjs/PBText.js.map +0 -1
- package/src/_cjs/PlotBoilerplate.d.ts +0 -899
- package/src/_cjs/PlotBoilerplate.js +0 -2348
- package/src/_cjs/PlotBoilerplate.js.map +0 -1
- package/src/_cjs/Polygon.d.ts +0 -520
- package/src/_cjs/Polygon.js +0 -933
- package/src/_cjs/Polygon.js.map +0 -1
- package/src/_cjs/SVGBuilder.d.ts +0 -47
- package/src/_cjs/SVGBuilder.js +0 -100
- package/src/_cjs/SVGBuilder.js.map +0 -1
- package/src/_cjs/Triangle.d.ts +0 -392
- package/src/_cjs/Triangle.js +0 -497
- package/src/_cjs/Triangle.js.map +0 -1
- package/src/_cjs/UIDGenerator.d.ts +0 -12
- package/src/_cjs/UIDGenerator.js +0 -21
- package/src/_cjs/UIDGenerator.js.map +0 -1
- package/src/_cjs/VEllipse.d.ts +0 -319
- package/src/_cjs/VEllipse.js +0 -578
- package/src/_cjs/VEllipse.js.map +0 -1
- package/src/_cjs/VEllipseSector.d.ts +0 -230
- package/src/_cjs/VEllipseSector.js +0 -428
- package/src/_cjs/VEllipseSector.js.map +0 -1
- package/src/_cjs/Vector.d.ts +0 -126
- package/src/_cjs/Vector.js +0 -199
- package/src/_cjs/Vector.js.map +0 -1
- package/src/_cjs/VertTuple.d.ts +0 -284
- package/src/_cjs/VertTuple.js +0 -348
- package/src/_cjs/VertTuple.js.map +0 -1
- package/src/_cjs/Vertex.d.ts +0 -498
- package/src/_cjs/Vertex.js +0 -703
- package/src/_cjs/Vertex.js.map +0 -1
- package/src/_cjs/VertexAttr.d.ts +0 -72
- package/src/_cjs/VertexAttr.js +0 -59
- package/src/_cjs/VertexAttr.js.map +0 -1
- package/src/_cjs/VertexListeners.d.ts +0 -208
- package/src/_cjs/VertexListeners.js +0 -267
- package/src/_cjs/VertexListeners.js.map +0 -1
- package/src/_cjs/draw.d.ts +0 -657
- package/src/_cjs/draw.js +0 -1164
- package/src/_cjs/draw.js.map +0 -1
- package/src/_cjs/drawgl.d.ts +0 -544
- package/src/_cjs/drawgl.js +0 -794
- package/src/_cjs/drawgl.js.map +0 -1
- package/src/_cjs/drawutilssvg.d.ts +0 -954
- package/src/_cjs/drawutilssvg.js +0 -1713
- package/src/_cjs/drawutilssvg.js.map +0 -1
- package/src/_cjs/entry-glsupport.js +0 -28
- package/src/_cjs/entry.js +0 -29
- package/src/_cjs/geomutils.d.ts +0 -77
- package/src/_cjs/geomutils.js +0 -126
- package/src/_cjs/geomutils.js.map +0 -1
- package/src/_cjs/index.d.ts +0 -102
- package/src/_cjs/index.js +0 -128
- package/src/_cjs/index.js.map +0 -1
- package/src/_cjs/interfaces/DrawLib.d.ts +0 -582
- package/src/_cjs/interfaces/DrawLib.js +0 -32
- package/src/_cjs/interfaces/DrawLib.js.map +0 -1
- package/src/_cjs/interfaces/additionals.d.ts +0 -95
- package/src/_cjs/interfaces/additionals.js +0 -3
- package/src/_cjs/interfaces/additionals.js.map +0 -1
- package/src/_cjs/interfaces/core.d.ts +0 -286
- package/src/_cjs/interfaces/core.js +0 -30
- package/src/_cjs/interfaces/core.js.map +0 -1
- package/src/_cjs/interfaces/externals.d.ts +0 -56
- package/src/_cjs/interfaces/externals.js +0 -8
- package/src/_cjs/interfaces/externals.js.map +0 -1
- package/src/_cjs/interfaces/index.d.ts +0 -4
- package/src/_cjs/interfaces/index.js +0 -21
- package/src/_cjs/interfaces/index.js.map +0 -1
- package/src/_cjs/module.d.ts +0 -26
- package/src/_cjs/module.js +0 -60
- package/src/_cjs/module.js.map +0 -1
- package/src/_cjs/utils/InitializationObserver.d.ts +0 -18
- package/src/_cjs/utils/InitializationObserver.js +0 -63
- package/src/_cjs/utils/InitializationObserver.js.map +0 -1
- package/src/_cjs/utils/LissajousFigure.d.ts +0 -34
- package/src/_cjs/utils/LissajousFigure.js +0 -100
- package/src/_cjs/utils/LissajousFigure.js.map +0 -1
- package/src/_cjs/utils/NGons.d.ts +0 -13
- package/src/_cjs/utils/NGons.js +0 -36
- package/src/_cjs/utils/NGons.js.map +0 -1
- package/src/_cjs/utils/Params.d.ts +0 -17
- package/src/_cjs/utils/Params.js +0 -53
- package/src/_cjs/utils/Params.js.map +0 -1
- package/src/_cjs/utils/PerlinNoise.d.ts +0 -19
- package/src/_cjs/utils/PerlinNoise.js +0 -352
- package/src/_cjs/utils/PerlinNoise.js.map +0 -1
- package/src/_cjs/utils/SVGPathUtils.d.ts +0 -22
- package/src/_cjs/utils/SVGPathUtils.js +0 -45
- package/src/_cjs/utils/SVGPathUtils.js.map +0 -1
- package/src/_cjs/utils/WebColors.d.ts +0 -35
- package/src/_cjs/utils/WebColors.js +0 -58
- package/src/_cjs/utils/WebColors.js.map +0 -1
- package/src/_cjs/utils/WebColorsContrast.d.ts +0 -6
- package/src/_cjs/utils/WebColorsContrast.js +0 -12
- package/src/_cjs/utils/WebColorsContrast.js.map +0 -1
- package/src/_cjs/utils/WebColorsMalachite.d.ts +0 -12
- package/src/_cjs/utils/WebColorsMalachite.js +0 -28
- package/src/_cjs/utils/WebColorsMalachite.js.map +0 -1
- package/src/_cjs/utils/_gup.js_ +0 -13
- package/src/_cjs/utils/algorithms/CatmullRomPath.d.ts +0 -60
- package/src/_cjs/utils/algorithms/CatmullRomPath.js +0 -108
- package/src/_cjs/utils/algorithms/CatmullRomPath.js.map +0 -1
- package/src/_cjs/utils/algorithms/CircleIntersections.d.ts +0 -170
- package/src/_cjs/utils/algorithms/CircleIntersections.js +0 -310
- package/src/_cjs/utils/algorithms/CircleIntersections.js.map +0 -1
- package/src/_cjs/utils/algorithms/ContourLineDetection.d.ts +0 -150
- package/src/_cjs/utils/algorithms/ContourLineDetection.js +0 -367
- package/src/_cjs/utils/algorithms/ContourLineDetection.js.map +0 -1
- package/src/_cjs/utils/algorithms/CubicSplinePath.d.ts +0 -63
- package/src/_cjs/utils/algorithms/CubicSplinePath.js +0 -175
- package/src/_cjs/utils/algorithms/CubicSplinePath.js.map +0 -1
- package/src/_cjs/utils/algorithms/HobbyPath.d.ts +0 -81
- package/src/_cjs/utils/algorithms/HobbyPath.js +0 -278
- package/src/_cjs/utils/algorithms/HobbyPath.js.map +0 -1
- package/src/_cjs/utils/algorithms/Metaballs.d.ts +0 -30
- package/src/_cjs/utils/algorithms/Metaballs.js +0 -114
- package/src/_cjs/utils/algorithms/Metaballs.js.map +0 -1
- package/src/_cjs/utils/algorithms/PolygonInset.d.ts +0 -184
- package/src/_cjs/utils/algorithms/PolygonInset.js +0 -431
- package/src/_cjs/utils/algorithms/PolygonInset.js.map +0 -1
- package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
- package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.js +0 -269
- package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
- package/src/_cjs/utils/algorithms/arrayFill.d.ts +0 -8
- package/src/_cjs/utils/algorithms/arrayFill.js +0 -18
- package/src/_cjs/utils/algorithms/arrayFill.js.map +0 -1
- package/src/_cjs/utils/algorithms/arrayResize.d.ts +0 -8
- package/src/_cjs/utils/algorithms/arrayResize.js +0 -24
- package/src/_cjs/utils/algorithms/arrayResize.js.map +0 -1
- package/src/_cjs/utils/algorithms/arrayShuffle.d.ts +0 -8
- package/src/_cjs/utils/algorithms/arrayShuffle.js +0 -15
- package/src/_cjs/utils/algorithms/arrayShuffle.js.map +0 -1
- package/src/_cjs/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
- package/src/_cjs/utils/algorithms/clearDuplicateVertices.js +0 -51
- package/src/_cjs/utils/algorithms/clearDuplicateVertices.js.map +0 -1
- package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
- package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.js +0 -61
- package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
- package/src/_cjs/utils/algorithms/convexHull.d.ts +0 -23
- package/src/_cjs/utils/algorithms/convexHull.js +0 -71
- package/src/_cjs/utils/algorithms/convexHull.js.map +0 -1
- package/src/_cjs/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
- package/src/_cjs/utils/algorithms/convexPolygonIncircle.js +0 -145
- package/src/_cjs/utils/algorithms/convexPolygonIncircle.js.map +0 -1
- package/src/_cjs/utils/algorithms/delaunay.d.ts +0 -30
- package/src/_cjs/utils/algorithms/delaunay.js +0 -158
- package/src/_cjs/utils/algorithms/delaunay.js.map +0 -1
- package/src/_cjs/utils/algorithms/delaunay2voronoi.d.ts +0 -25
- package/src/_cjs/utils/algorithms/delaunay2voronoi.js +0 -104
- package/src/_cjs/utils/algorithms/delaunay2voronoi.js.map +0 -1
- package/src/_cjs/utils/algorithms/detectPaths.d.ts +0 -21
- package/src/_cjs/utils/algorithms/detectPaths.js +0 -169
- package/src/_cjs/utils/algorithms/detectPaths.js.map +0 -1
- package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
- package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.js +0 -51
- package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
- package/src/_cjs/utils/algorithms/getContrastColor.d.ts +0 -13
- package/src/_cjs/utils/algorithms/getContrastColor.js +0 -26
- package/src/_cjs/utils/algorithms/getContrastColor.js.map +0 -1
- package/src/_cjs/utils/algorithms/matrixFill.d.ts +0 -10
- package/src/_cjs/utils/algorithms/matrixFill.js +0 -21
- package/src/_cjs/utils/algorithms/matrixFill.js.map +0 -1
- package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
- package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.js +0 -270
- package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
- package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
- package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.js +0 -102
- package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
- package/src/_cjs/utils/algorithms/sutherlandHodgman.d.ts +0 -16
- package/src/_cjs/utils/algorithms/sutherlandHodgman.js +0 -76
- package/src/_cjs/utils/algorithms/sutherlandHodgman.js.map +0 -1
- package/src/_cjs/utils/cloneVertexArray.d.ts +0 -13
- package/src/_cjs/utils/cloneVertexArray.js +0 -23
- package/src/_cjs/utils/cloneVertexArray.js.map +0 -1
- package/src/_cjs/utils/createRandomizedPolygon.d.ts +0 -14
- package/src/_cjs/utils/createRandomizedPolygon.js +0 -32
- package/src/_cjs/utils/createRandomizedPolygon.js.map +0 -1
- package/src/_cjs/utils/creategui.js +0 -434
- package/src/_cjs/utils/dat.gui.arrowbounce.polyfill.js +0 -128
- package/src/_cjs/utils/dat.gui.title.polyfill.js +0 -35
- package/src/_cjs/utils/datastructures/CircularIntervalSet.d.ts +0 -83
- package/src/_cjs/utils/datastructures/CircularIntervalSet.js +0 -163
- package/src/_cjs/utils/datastructures/CircularIntervalSet.js.map +0 -1
- package/src/_cjs/utils/datastructures/Color.d.ts +0 -391
- package/src/_cjs/utils/datastructures/Color.js +0 -1084
- package/src/_cjs/utils/datastructures/Color.js.map +0 -1
- package/src/_cjs/utils/datastructures/ColorGradient.d.ts +0 -81
- package/src/_cjs/utils/datastructures/ColorGradient.js +0 -176
- package/src/_cjs/utils/datastructures/ColorGradient.js.map +0 -1
- package/src/_cjs/utils/datastructures/DataGrid2d.d.ts +0 -53
- package/src/_cjs/utils/datastructures/DataGrid2d.js +0 -20
- package/src/_cjs/utils/datastructures/DataGrid2d.js.map +0 -1
- package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
- package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.js +0 -155
- package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
- package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
- package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.js +0 -84
- package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
- package/src/_cjs/utils/datastructures/GenericPath.d.ts +0 -86
- package/src/_cjs/utils/datastructures/GenericPath.js +0 -122
- package/src/_cjs/utils/datastructures/GenericPath.js.map +0 -1
- package/src/_cjs/utils/datastructures/GeometryMesh.d.ts +0 -49
- package/src/_cjs/utils/datastructures/GeometryMesh.js +0 -58
- package/src/_cjs/utils/datastructures/GeometryMesh.js.map +0 -1
- package/src/_cjs/utils/datastructures/Girih.d.ts +0 -181
- package/src/_cjs/utils/datastructures/Girih.js +0 -266
- package/src/_cjs/utils/datastructures/Girih.js.map +0 -1
- package/src/_cjs/utils/datastructures/GirihBowtie.d.ts +0 -37
- package/src/_cjs/utils/datastructures/GirihBowtie.js +0 -152
- package/src/_cjs/utils/datastructures/GirihBowtie.js.map +0 -1
- package/src/_cjs/utils/datastructures/GirihDecagon.d.ts +0 -52
- package/src/_cjs/utils/datastructures/GirihDecagon.js +0 -132
- package/src/_cjs/utils/datastructures/GirihDecagon.js.map +0 -1
- package/src/_cjs/utils/datastructures/GirihHexagon.d.ts +0 -39
- package/src/_cjs/utils/datastructures/GirihHexagon.js +0 -200
- package/src/_cjs/utils/datastructures/GirihHexagon.js.map +0 -1
- package/src/_cjs/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
- package/src/_cjs/utils/datastructures/GirihPenroseRhombus.js +0 -189
- package/src/_cjs/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
- package/src/_cjs/utils/datastructures/GirihPentagon.d.ts +0 -37
- package/src/_cjs/utils/datastructures/GirihPentagon.js +0 -109
- package/src/_cjs/utils/datastructures/GirihPentagon.js.map +0 -1
- package/src/_cjs/utils/datastructures/GirihRhombus.d.ts +0 -38
- package/src/_cjs/utils/datastructures/GirihRhombus.js +0 -155
- package/src/_cjs/utils/datastructures/GirihRhombus.js.map +0 -1
- package/src/_cjs/utils/datastructures/GirihTile.d.ts +0 -283
- package/src/_cjs/utils/datastructures/GirihTile.js +0 -308
- package/src/_cjs/utils/datastructures/GirihTile.js.map +0 -1
- package/src/_cjs/utils/datastructures/Matrix4x4.d.ts +0 -244
- package/src/_cjs/utils/datastructures/Matrix4x4.js +0 -262
- package/src/_cjs/utils/datastructures/Matrix4x4.js.map +0 -1
- package/src/_cjs/utils/datastructures/VoronoiCell.d.ts +0 -122
- package/src/_cjs/utils/datastructures/VoronoiCell.js +0 -183
- package/src/_cjs/utils/datastructures/VoronoiCell.js.map +0 -1
- package/src/_cjs/utils/datastructures/interfaces.d.ts +0 -13
- package/src/_cjs/utils/datastructures/interfaces.js +0 -10
- package/src/_cjs/utils/datastructures/interfaces.js.map +0 -1
- package/src/_cjs/utils/detectDarkMode.d.ts +0 -10
- package/src/_cjs/utils/detectDarkMode.js +0 -41
- package/src/_cjs/utils/detectDarkMode.js.map +0 -1
- package/src/_cjs/utils/dom/components/ColorGradientPicker.d.ts +0 -246
- package/src/_cjs/utils/dom/components/ColorGradientPicker.js +0 -667
- package/src/_cjs/utils/dom/components/ColorGradientPicker.js.map +0 -1
- package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.d.ts +0 -129
- package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.js +0 -520
- package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.js.map +0 -1
- package/src/_cjs/utils/dom/components/ColorGradientSelector.d.ts +0 -118
- package/src/_cjs/utils/dom/components/ColorGradientSelector.js +0 -327
- package/src/_cjs/utils/dom/components/ColorGradientSelector.js.map +0 -1
- package/src/_cjs/utils/dom/components/Test.d.ts +0 -7
- package/src/_cjs/utils/dom/components/Test.js +0 -30
- package/src/_cjs/utils/dom/components/Test.js.map +0 -1
- package/src/_cjs/utils/dom/getAvailableContainerSpace.d.ts +0 -2
- package/src/_cjs/utils/dom/getAvailableContainerSpace.js +0 -29
- package/src/_cjs/utils/dom/getAvailableContainerSpace.js.map +0 -1
- package/src/_cjs/utils/dom/getFProp.d.ts +0 -5
- package/src/_cjs/utils/dom/getFProp.js +0 -12
- package/src/_cjs/utils/dom/getFProp.js.map +0 -1
- package/src/_cjs/utils/dom/guiSizeToggler.d.ts +0 -18
- package/src/_cjs/utils/dom/guiSizeToggler.js +0 -44
- package/src/_cjs/utils/dom/guiSizeToggler.js.map +0 -1
- package/src/_cjs/utils/findInVertexArray.d.ts +0 -19
- package/src/_cjs/utils/findInVertexArray.js +0 -29
- package/src/_cjs/utils/findInVertexArray.js.map +0 -1
- package/src/_cjs/utils/getFProp.d.ts +0 -5
- package/src/_cjs/utils/getFProp.js +0 -12
- package/src/_cjs/utils/getFProp.js.map +0 -1
- package/src/_cjs/utils/gup.d.ts +0 -14
- package/src/_cjs/utils/gup.js +0 -31
- package/src/_cjs/utils/gup.js.map +0 -1
- package/src/_cjs/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
- package/src/_cjs/utils/helpers/BezierPathInteractionHelper.js +0 -655
- package/src/_cjs/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
- package/src/_cjs/utils/helpers/CircleHelper.d.ts +0 -73
- package/src/_cjs/utils/helpers/CircleHelper.js +0 -93
- package/src/_cjs/utils/helpers/CircleHelper.js.map +0 -1
- package/src/_cjs/utils/helpers/CircleSectorHelper.d.ts +0 -90
- package/src/_cjs/utils/helpers/CircleSectorHelper.js +0 -114
- package/src/_cjs/utils/helpers/CircleSectorHelper.js.map +0 -1
- package/src/_cjs/utils/helpers/TriangleHelper.d.ts +0 -57
- package/src/_cjs/utils/helpers/TriangleHelper.js +0 -83
- package/src/_cjs/utils/helpers/TriangleHelper.js.map +0 -1
- package/src/_cjs/utils/helpers/VEllipseHelper.d.ts +0 -32
- package/src/_cjs/utils/helpers/VEllipseHelper.js +0 -88
- package/src/_cjs/utils/helpers/VEllipseHelper.js.map +0 -1
- package/src/_cjs/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
- package/src/_cjs/utils/helpers/VEllipseSectorHelper.js +0 -135
- package/src/_cjs/utils/helpers/VEllipseSectorHelper.js.map +0 -1
- package/src/_cjs/utils/io/DndFileHandler.d.ts +0 -63
- package/src/_cjs/utils/io/DndFileHandler.js +0 -112
- package/src/_cjs/utils/io/DndFileHandler.js.map +0 -1
- package/src/_cjs/utils/io/FileDrop.d.ts +0 -110
- package/src/_cjs/utils/io/FileDrop.js +0 -177
- package/src/_cjs/utils/io/FileDrop.js.map +0 -1
- package/src/_cjs/utils/lil.gui.arrowbounce.polyfill.js +0 -133
- package/src/_cjs/utils/lil.gui.title.polyfill.js +0 -32
- package/src/_cjs/utils/module.js +0 -18
- package/src/_cjs/utils/parsers/LinearColorGradientParser.d.ts +0 -78
- package/src/_cjs/utils/parsers/LinearColorGradientParser.js +0 -224
- package/src/_cjs/utils/parsers/LinearColorGradientParser.js.map +0 -1
- package/src/_cjs/utils/parsers/OBJParser.d.ts +0 -24
- package/src/_cjs/utils/parsers/OBJParser.js +0 -77
- package/src/_cjs/utils/parsers/OBJParser.js.map +0 -1
- package/src/_cjs/utils/parsers/STLParser.d.ts +0 -61
- package/src/_cjs/utils/parsers/STLParser.js +0 -182
- package/src/_cjs/utils/parsers/STLParser.js.map +0 -1
- package/src/_cjs/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
- package/src/_cjs/utils/parsers/svg/parseSVGPathData.js +0 -486
- package/src/_cjs/utils/parsers/svg/parseSVGPathData.js.map +0 -1
- package/src/_cjs/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
- package/src/_cjs/utils/parsers/svg/splitSVGPathData.js +0 -53
- package/src/_cjs/utils/parsers/svg/splitSVGPathData.js.map +0 -1
- package/src/_cjs/utils/parsers/svg/types.d.ts +0 -63
- package/src/_cjs/utils/parsers/svg/types.js +0 -17
- package/src/_cjs/utils/parsers/svg/types.js.map +0 -1
- package/src/_cjs/utils/ts-runner.js +0 -146
- package/src/_cjs/utils/tsAsyncScriptLoader.js +0 -74
- package/src/_esm/BezierPath.d.ts +0 -610
- package/src/_esm/BezierPath.js +0 -1124
- package/src/_esm/BezierPath.js.map +0 -1
- package/src/_esm/Bounds.d.ts +0 -252
- package/src/_esm/Bounds.js +0 -317
- package/src/_esm/Bounds.js.map +0 -1
- package/src/_esm/Circle.d.ts +0 -214
- package/src/_esm/Circle.js +0 -335
- package/src/_esm/Circle.js.map +0 -1
- package/src/_esm/CircleSector.d.ts +0 -211
- package/src/_esm/CircleSector.js +0 -359
- package/src/_esm/CircleSector.js.map +0 -1
- package/src/_esm/CubicBezierCurve.d.ts +0 -656
- package/src/_esm/CubicBezierCurve.js +0 -1057
- package/src/_esm/CubicBezierCurve.js.map +0 -1
- package/src/_esm/Grid.d.ts +0 -83
- package/src/_esm/Grid.js +0 -89
- package/src/_esm/Grid.js.map +0 -1
- package/src/_esm/KeyHandler.d.ts +0 -177
- package/src/_esm/KeyHandler.js +0 -434
- package/src/_esm/KeyHandler.js.map +0 -1
- package/src/_esm/Line.d.ts +0 -134
- package/src/_esm/Line.js +0 -200
- package/src/_esm/Line.js.map +0 -1
- package/src/_esm/MouseHandler.d.ts +0 -283
- package/src/_esm/MouseHandler.js +0 -397
- package/src/_esm/MouseHandler.js.map +0 -1
- package/src/_esm/PBImage.d.ts +0 -81
- package/src/_esm/PBImage.js +0 -60
- package/src/_esm/PBImage.js.map +0 -1
- package/src/_esm/PBText.d.ts +0 -118
- package/src/_esm/PBText.js +0 -62
- package/src/_esm/PBText.js.map +0 -1
- package/src/_esm/PlotBoilerplate.d.ts +0 -899
- package/src/_esm/PlotBoilerplate.js +0 -2347
- package/src/_esm/PlotBoilerplate.js.map +0 -1
- package/src/_esm/Polygon.d.ts +0 -520
- package/src/_esm/Polygon.js +0 -924
- package/src/_esm/Polygon.js.map +0 -1
- package/src/_esm/SVGBuilder.d.ts +0 -47
- package/src/_esm/SVGBuilder.js +0 -95
- package/src/_esm/SVGBuilder.js.map +0 -1
- package/src/_esm/Triangle.d.ts +0 -392
- package/src/_esm/Triangle.js +0 -493
- package/src/_esm/Triangle.js.map +0 -1
- package/src/_esm/UIDGenerator.d.ts +0 -12
- package/src/_esm/UIDGenerator.js +0 -18
- package/src/_esm/UIDGenerator.js.map +0 -1
- package/src/_esm/VEllipse.d.ts +0 -319
- package/src/_esm/VEllipse.js +0 -574
- package/src/_esm/VEllipse.js.map +0 -1
- package/src/_esm/VEllipseSector.d.ts +0 -230
- package/src/_esm/VEllipseSector.js +0 -422
- package/src/_esm/VEllipseSector.js.map +0 -1
- package/src/_esm/Vector.d.ts +0 -126
- package/src/_esm/Vector.js +0 -181
- package/src/_esm/Vector.js.map +0 -1
- package/src/_esm/VertTuple.d.ts +0 -284
- package/src/_esm/VertTuple.js +0 -347
- package/src/_esm/VertTuple.js.map +0 -1
- package/src/_esm/Vertex.d.ts +0 -498
- package/src/_esm/Vertex.js +0 -702
- package/src/_esm/Vertex.js.map +0 -1
- package/src/_esm/VertexAttr.d.ts +0 -72
- package/src/_esm/VertexAttr.js +0 -58
- package/src/_esm/VertexAttr.js.map +0 -1
- package/src/_esm/VertexListeners.d.ts +0 -209
- package/src/_esm/VertexListeners.js +0 -270
- package/src/_esm/VertexListeners.js.map +0 -1
- package/src/_esm/draw.d.ts +0 -657
- package/src/_esm/draw.js +0 -1159
- package/src/_esm/draw.js.map +0 -1
- package/src/_esm/drawgl.d.ts +0 -544
- package/src/_esm/drawgl.js +0 -812
- package/src/_esm/drawgl.js.map +0 -1
- package/src/_esm/drawutilssvg.d.ts +0 -954
- package/src/_esm/drawutilssvg.js +0 -1705
- package/src/_esm/drawutilssvg.js.map +0 -1
- package/src/_esm/entry-glsupport.js +0 -28
- package/src/_esm/entry.js +0 -29
- package/src/_esm/geomutils.d.ts +0 -77
- package/src/_esm/geomutils.js +0 -126
- package/src/_esm/geomutils.js.map +0 -1
- package/src/_esm/index.d.ts +0 -102
- package/src/_esm/index.js +0 -128
- package/src/_esm/index.js.map +0 -1
- package/src/_esm/interfaces/DrawLib.d.ts +0 -582
- package/src/_esm/interfaces/DrawLib.js +0 -32
- package/src/_esm/interfaces/DrawLib.js.map +0 -1
- package/src/_esm/interfaces/additionals.d.ts +0 -95
- package/src/_esm/interfaces/additionals.js +0 -3
- package/src/_esm/interfaces/additionals.js.map +0 -1
- package/src/_esm/interfaces/core.d.ts +0 -286
- package/src/_esm/interfaces/core.js +0 -30
- package/src/_esm/interfaces/core.js.map +0 -1
- package/src/_esm/interfaces/externals.d.ts +0 -56
- package/src/_esm/interfaces/externals.js +0 -8
- package/src/_esm/interfaces/externals.js.map +0 -1
- package/src/_esm/interfaces/index.d.ts +0 -4
- package/src/_esm/interfaces/index.js +0 -21
- package/src/_esm/interfaces/index.js.map +0 -1
- package/src/_esm/module.d.ts +0 -26
- package/src/_esm/module.js +0 -60
- package/src/_esm/module.js.map +0 -1
- package/src/_esm/src/ts/BezierPath.d.ts +0 -610
- package/src/_esm/src/ts/BezierPath.js +0 -1120
- package/src/_esm/src/ts/BezierPath.js.map +0 -1
- package/src/_esm/src/ts/Bounds.d.ts +0 -252
- package/src/_esm/src/ts/Bounds.js +0 -313
- package/src/_esm/src/ts/Bounds.js.map +0 -1
- package/src/_esm/src/ts/Circle.d.ts +0 -214
- package/src/_esm/src/ts/Circle.js +0 -331
- package/src/_esm/src/ts/Circle.js.map +0 -1
- package/src/_esm/src/ts/CircleSector.d.ts +0 -211
- package/src/_esm/src/ts/CircleSector.js +0 -355
- package/src/_esm/src/ts/CircleSector.js.map +0 -1
- package/src/_esm/src/ts/CubicBezierCurve.d.ts +0 -656
- package/src/_esm/src/ts/CubicBezierCurve.js +0 -1053
- package/src/_esm/src/ts/CubicBezierCurve.js.map +0 -1
- package/src/_esm/src/ts/Grid.d.ts +0 -83
- package/src/_esm/src/ts/Grid.js +0 -85
- package/src/_esm/src/ts/Grid.js.map +0 -1
- package/src/_esm/src/ts/KeyHandler.d.ts +0 -177
- package/src/_esm/src/ts/KeyHandler.js +0 -430
- package/src/_esm/src/ts/KeyHandler.js.map +0 -1
- package/src/_esm/src/ts/Line.d.ts +0 -134
- package/src/_esm/src/ts/Line.js +0 -196
- package/src/_esm/src/ts/Line.js.map +0 -1
- package/src/_esm/src/ts/MouseHandler.d.ts +0 -283
- package/src/_esm/src/ts/MouseHandler.js +0 -391
- package/src/_esm/src/ts/MouseHandler.js.map +0 -1
- package/src/_esm/src/ts/PBImage.d.ts +0 -81
- package/src/_esm/src/ts/PBImage.js +0 -56
- package/src/_esm/src/ts/PBImage.js.map +0 -1
- package/src/_esm/src/ts/PBText.d.ts +0 -118
- package/src/_esm/src/ts/PBText.js +0 -58
- package/src/_esm/src/ts/PBText.js.map +0 -1
- package/src/_esm/src/ts/PlotBoilerplate.d.ts +0 -899
- package/src/_esm/src/ts/PlotBoilerplate.js +0 -2340
- package/src/_esm/src/ts/PlotBoilerplate.js.map +0 -1
- package/src/_esm/src/ts/Polygon.d.ts +0 -520
- package/src/_esm/src/ts/Polygon.js +0 -920
- package/src/_esm/src/ts/Polygon.js.map +0 -1
- package/src/_esm/src/ts/Triangle.d.ts +0 -392
- package/src/_esm/src/ts/Triangle.js +0 -489
- package/src/_esm/src/ts/Triangle.js.map +0 -1
- package/src/_esm/src/ts/UIDGenerator.d.ts +0 -12
- package/src/_esm/src/ts/UIDGenerator.js +0 -14
- package/src/_esm/src/ts/UIDGenerator.js.map +0 -1
- package/src/_esm/src/ts/VEllipse.d.ts +0 -319
- package/src/_esm/src/ts/VEllipse.js +0 -570
- package/src/_esm/src/ts/VEllipse.js.map +0 -1
- package/src/_esm/src/ts/VEllipseSector.d.ts +0 -230
- package/src/_esm/src/ts/VEllipseSector.js +0 -418
- package/src/_esm/src/ts/VEllipseSector.js.map +0 -1
- package/src/_esm/src/ts/Vector.d.ts +0 -126
- package/src/_esm/src/ts/Vector.js +0 -177
- package/src/_esm/src/ts/Vector.js.map +0 -1
- package/src/_esm/src/ts/VertTuple.d.ts +0 -284
- package/src/_esm/src/ts/VertTuple.js +0 -343
- package/src/_esm/src/ts/VertTuple.js.map +0 -1
- package/src/_esm/src/ts/Vertex.d.ts +0 -498
- package/src/_esm/src/ts/Vertex.js +0 -698
- package/src/_esm/src/ts/Vertex.js.map +0 -1
- package/src/_esm/src/ts/VertexAttr.d.ts +0 -72
- package/src/_esm/src/ts/VertexAttr.js +0 -54
- package/src/_esm/src/ts/VertexAttr.js.map +0 -1
- package/src/_esm/src/ts/VertexListeners.d.ts +0 -209
- package/src/_esm/src/ts/VertexListeners.js +0 -266
- package/src/_esm/src/ts/VertexListeners.js.map +0 -1
- package/src/_esm/src/ts/draw.d.ts +0 -657
- package/src/_esm/src/ts/draw.js +0 -1155
- package/src/_esm/src/ts/draw.js.map +0 -1
- package/src/_esm/src/ts/drawgl.d.ts +0 -544
- package/src/_esm/src/ts/drawgl.js +0 -808
- package/src/_esm/src/ts/drawgl.js.map +0 -1
- package/src/_esm/src/ts/drawutilssvg.d.ts +0 -954
- package/src/_esm/src/ts/drawutilssvg.js +0 -1701
- package/src/_esm/src/ts/drawutilssvg.js.map +0 -1
- package/src/_esm/src/ts/geomutils.d.ts +0 -77
- package/src/_esm/src/ts/geomutils.js +0 -123
- package/src/_esm/src/ts/geomutils.js.map +0 -1
- package/src/_esm/src/ts/index.d.ts +0 -102
- package/src/_esm/src/ts/index.js +0 -112
- package/src/_esm/src/ts/index.js.map +0 -1
- package/src/_esm/src/ts/interfaces/DrawLib.d.ts +0 -582
- package/src/_esm/src/ts/interfaces/DrawLib.js +0 -31
- package/src/_esm/src/ts/interfaces/DrawLib.js.map +0 -1
- package/src/_esm/src/ts/interfaces/additionals.d.ts +0 -95
- package/src/_esm/src/ts/interfaces/additionals.js +0 -2
- package/src/_esm/src/ts/interfaces/additionals.js.map +0 -1
- package/src/_esm/src/ts/interfaces/core.d.ts +0 -286
- package/src/_esm/src/ts/interfaces/core.js +0 -29
- package/src/_esm/src/ts/interfaces/core.js.map +0 -1
- package/src/_esm/src/ts/interfaces/externals.d.ts +0 -56
- package/src/_esm/src/ts/interfaces/externals.js +0 -7
- package/src/_esm/src/ts/interfaces/externals.js.map +0 -1
- package/src/_esm/src/ts/interfaces/index.d.ts +0 -4
- package/src/_esm/src/ts/interfaces/index.js +0 -5
- package/src/_esm/src/ts/interfaces/index.js.map +0 -1
- package/src/_esm/src/ts/module.d.ts +0 -26
- package/src/_esm/src/ts/module.js +0 -38
- package/src/_esm/src/ts/module.js.map +0 -1
- package/src/_esm/src/ts/utils/InitializationObserver.d.ts +0 -18
- package/src/_esm/src/ts/utils/InitializationObserver.js +0 -57
- package/src/_esm/src/ts/utils/InitializationObserver.js.map +0 -1
- package/src/_esm/src/ts/utils/LissajousFigure.d.ts +0 -34
- package/src/_esm/src/ts/utils/LissajousFigure.js +0 -95
- package/src/_esm/src/ts/utils/LissajousFigure.js.map +0 -1
- package/src/_esm/src/ts/utils/NGons.d.ts +0 -13
- package/src/_esm/src/ts/utils/NGons.js +0 -33
- package/src/_esm/src/ts/utils/NGons.js.map +0 -1
- package/src/_esm/src/ts/utils/Params.d.ts +0 -17
- package/src/_esm/src/ts/utils/Params.js +0 -48
- package/src/_esm/src/ts/utils/Params.js.map +0 -1
- package/src/_esm/src/ts/utils/PerlinNoise.d.ts +0 -19
- package/src/_esm/src/ts/utils/PerlinNoise.js +0 -346
- package/src/_esm/src/ts/utils/PerlinNoise.js.map +0 -1
- package/src/_esm/src/ts/utils/SVGPathUtils.d.ts +0 -22
- package/src/_esm/src/ts/utils/SVGPathUtils.js +0 -42
- package/src/_esm/src/ts/utils/SVGPathUtils.js.map +0 -1
- package/src/_esm/src/ts/utils/WebColors.d.ts +0 -35
- package/src/_esm/src/ts/utils/WebColors.js +0 -54
- package/src/_esm/src/ts/utils/WebColors.js.map +0 -1
- package/src/_esm/src/ts/utils/WebColorsContrast.d.ts +0 -6
- package/src/_esm/src/ts/utils/WebColorsContrast.js +0 -9
- package/src/_esm/src/ts/utils/WebColorsContrast.js.map +0 -1
- package/src/_esm/src/ts/utils/WebColorsMalachite.d.ts +0 -12
- package/src/_esm/src/ts/utils/WebColorsMalachite.js +0 -25
- package/src/_esm/src/ts/utils/WebColorsMalachite.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.d.ts +0 -60
- package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.js +0 -103
- package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/CircleIntersections.d.ts +0 -170
- package/src/_esm/src/ts/utils/algorithms/CircleIntersections.js +0 -303
- package/src/_esm/src/ts/utils/algorithms/CircleIntersections.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.d.ts +0 -150
- package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.js +0 -362
- package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.d.ts +0 -63
- package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.js +0 -170
- package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/HobbyPath.d.ts +0 -81
- package/src/_esm/src/ts/utils/algorithms/HobbyPath.js +0 -273
- package/src/_esm/src/ts/utils/algorithms/HobbyPath.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/Metaballs.d.ts +0 -30
- package/src/_esm/src/ts/utils/algorithms/Metaballs.js +0 -109
- package/src/_esm/src/ts/utils/algorithms/Metaballs.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/PolygonInset.d.ts +0 -184
- package/src/_esm/src/ts/utils/algorithms/PolygonInset.js +0 -424
- package/src/_esm/src/ts/utils/algorithms/PolygonInset.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
- package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.js +0 -262
- package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/arrayFill.d.ts +0 -8
- package/src/_esm/src/ts/utils/algorithms/arrayFill.js +0 -14
- package/src/_esm/src/ts/utils/algorithms/arrayFill.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/arrayResize.d.ts +0 -8
- package/src/_esm/src/ts/utils/algorithms/arrayResize.js +0 -20
- package/src/_esm/src/ts/utils/algorithms/arrayResize.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/arrayShuffle.d.ts +0 -8
- package/src/_esm/src/ts/utils/algorithms/arrayShuffle.js +0 -11
- package/src/_esm/src/ts/utils/algorithms/arrayShuffle.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
- package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.js +0 -47
- package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
- package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.js +0 -57
- package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/convexHull.d.ts +0 -23
- package/src/_esm/src/ts/utils/algorithms/convexHull.js +0 -67
- package/src/_esm/src/ts/utils/algorithms/convexHull.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
- package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.js +0 -141
- package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/delaunay.d.ts +0 -30
- package/src/_esm/src/ts/utils/algorithms/delaunay.js +0 -153
- package/src/_esm/src/ts/utils/algorithms/delaunay.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.d.ts +0 -25
- package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.js +0 -99
- package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/detectPaths.d.ts +0 -21
- package/src/_esm/src/ts/utils/algorithms/detectPaths.js +0 -165
- package/src/_esm/src/ts/utils/algorithms/detectPaths.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
- package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.js +0 -47
- package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/getContrastColor.d.ts +0 -13
- package/src/_esm/src/ts/utils/algorithms/getContrastColor.js +0 -22
- package/src/_esm/src/ts/utils/algorithms/getContrastColor.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/matrixFill.d.ts +0 -10
- package/src/_esm/src/ts/utils/algorithms/matrixFill.js +0 -17
- package/src/_esm/src/ts/utils/algorithms/matrixFill.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
- package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.js +0 -266
- package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
- package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.js +0 -99
- package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
- package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.d.ts +0 -16
- package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.js +0 -72
- package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.js.map +0 -1
- package/src/_esm/src/ts/utils/cloneVertexArray.d.ts +0 -13
- package/src/_esm/src/ts/utils/cloneVertexArray.js +0 -19
- package/src/_esm/src/ts/utils/cloneVertexArray.js.map +0 -1
- package/src/_esm/src/ts/utils/createRandomizedPolygon.d.ts +0 -14
- package/src/_esm/src/ts/utils/createRandomizedPolygon.js +0 -28
- package/src/_esm/src/ts/utils/createRandomizedPolygon.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.d.ts +0 -83
- package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.js +0 -158
- package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/Color.d.ts +0 -391
- package/src/_esm/src/ts/utils/datastructures/Color.js +0 -1063
- package/src/_esm/src/ts/utils/datastructures/Color.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/ColorGradient.d.ts +0 -81
- package/src/_esm/src/ts/utils/datastructures/ColorGradient.js +0 -171
- package/src/_esm/src/ts/utils/datastructures/ColorGradient.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/DataGrid2d.d.ts +0 -53
- package/src/_esm/src/ts/utils/datastructures/DataGrid2d.js +0 -19
- package/src/_esm/src/ts/utils/datastructures/DataGrid2d.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
- package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.js +0 -150
- package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
- package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.js +0 -79
- package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GenericPath.d.ts +0 -86
- package/src/_esm/src/ts/utils/datastructures/GenericPath.js +0 -117
- package/src/_esm/src/ts/utils/datastructures/GenericPath.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GeometryMesh.d.ts +0 -49
- package/src/_esm/src/ts/utils/datastructures/GeometryMesh.js +0 -53
- package/src/_esm/src/ts/utils/datastructures/GeometryMesh.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/Girih.d.ts +0 -181
- package/src/_esm/src/ts/utils/datastructures/Girih.js +0 -261
- package/src/_esm/src/ts/utils/datastructures/Girih.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GirihBowtie.d.ts +0 -37
- package/src/_esm/src/ts/utils/datastructures/GirihBowtie.js +0 -130
- package/src/_esm/src/ts/utils/datastructures/GirihBowtie.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GirihDecagon.d.ts +0 -52
- package/src/_esm/src/ts/utils/datastructures/GirihDecagon.js +0 -110
- package/src/_esm/src/ts/utils/datastructures/GirihDecagon.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GirihHexagon.d.ts +0 -39
- package/src/_esm/src/ts/utils/datastructures/GirihHexagon.js +0 -178
- package/src/_esm/src/ts/utils/datastructures/GirihHexagon.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
- package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.js +0 -167
- package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GirihPentagon.d.ts +0 -37
- package/src/_esm/src/ts/utils/datastructures/GirihPentagon.js +0 -87
- package/src/_esm/src/ts/utils/datastructures/GirihPentagon.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GirihRhombus.d.ts +0 -38
- package/src/_esm/src/ts/utils/datastructures/GirihRhombus.js +0 -133
- package/src/_esm/src/ts/utils/datastructures/GirihRhombus.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/GirihTile.d.ts +0 -283
- package/src/_esm/src/ts/utils/datastructures/GirihTile.js +0 -286
- package/src/_esm/src/ts/utils/datastructures/GirihTile.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/Matrix4x4.d.ts +0 -244
- package/src/_esm/src/ts/utils/datastructures/Matrix4x4.js +0 -246
- package/src/_esm/src/ts/utils/datastructures/Matrix4x4.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/VoronoiCell.d.ts +0 -122
- package/src/_esm/src/ts/utils/datastructures/VoronoiCell.js +0 -178
- package/src/_esm/src/ts/utils/datastructures/VoronoiCell.js.map +0 -1
- package/src/_esm/src/ts/utils/datastructures/interfaces.d.ts +0 -13
- package/src/_esm/src/ts/utils/datastructures/interfaces.js +0 -9
- package/src/_esm/src/ts/utils/datastructures/interfaces.js.map +0 -1
- package/src/_esm/src/ts/utils/detectDarkMode.d.ts +0 -10
- package/src/_esm/src/ts/utils/detectDarkMode.js +0 -37
- package/src/_esm/src/ts/utils/detectDarkMode.js.map +0 -1
- package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.d.ts +0 -246
- package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.js +0 -743
- package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.js.map +0 -1
- package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.d.ts +0 -118
- package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.js +0 -339
- package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.js.map +0 -1
- package/src/_esm/src/ts/utils/dom/components/Test.d.ts +0 -7
- package/src/_esm/src/ts/utils/dom/components/Test.js +0 -26
- package/src/_esm/src/ts/utils/dom/components/Test.js.map +0 -1
- package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.d.ts +0 -2
- package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.js +0 -25
- package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.js.map +0 -1
- package/src/_esm/src/ts/utils/dom/getFProp.d.ts +0 -5
- package/src/_esm/src/ts/utils/dom/getFProp.js +0 -8
- package/src/_esm/src/ts/utils/dom/getFProp.js.map +0 -1
- package/src/_esm/src/ts/utils/dom/guiSizeToggler.d.ts +0 -18
- package/src/_esm/src/ts/utils/dom/guiSizeToggler.js +0 -40
- package/src/_esm/src/ts/utils/dom/guiSizeToggler.js.map +0 -1
- package/src/_esm/src/ts/utils/findInVertexArray.d.ts +0 -19
- package/src/_esm/src/ts/utils/findInVertexArray.js +0 -25
- package/src/_esm/src/ts/utils/findInVertexArray.js.map +0 -1
- package/src/_esm/src/ts/utils/gup.d.ts +0 -14
- package/src/_esm/src/ts/utils/gup.js +0 -27
- package/src/_esm/src/ts/utils/gup.js.map +0 -1
- package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
- package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.js +0 -648
- package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
- package/src/_esm/src/ts/utils/helpers/CircleHelper.d.ts +0 -73
- package/src/_esm/src/ts/utils/helpers/CircleHelper.js +0 -88
- package/src/_esm/src/ts/utils/helpers/CircleHelper.js.map +0 -1
- package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.d.ts +0 -90
- package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.js +0 -109
- package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.js.map +0 -1
- package/src/_esm/src/ts/utils/helpers/TriangleHelper.d.ts +0 -57
- package/src/_esm/src/ts/utils/helpers/TriangleHelper.js +0 -78
- package/src/_esm/src/ts/utils/helpers/TriangleHelper.js.map +0 -1
- package/src/_esm/src/ts/utils/helpers/VEllipseHelper.d.ts +0 -32
- package/src/_esm/src/ts/utils/helpers/VEllipseHelper.js +0 -83
- package/src/_esm/src/ts/utils/helpers/VEllipseHelper.js.map +0 -1
- package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
- package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.js +0 -130
- package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.js.map +0 -1
- package/src/_esm/src/ts/utils/io/FileDrop.d.ts +0 -110
- package/src/_esm/src/ts/utils/io/FileDrop.js +0 -171
- package/src/_esm/src/ts/utils/io/FileDrop.js.map +0 -1
- package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.d.ts +0 -78
- package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.js +0 -217
- package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.js.map +0 -1
- package/src/_esm/src/ts/utils/parsers/OBJParser.d.ts +0 -24
- package/src/_esm/src/ts/utils/parsers/OBJParser.js +0 -72
- package/src/_esm/src/ts/utils/parsers/OBJParser.js.map +0 -1
- package/src/_esm/src/ts/utils/parsers/STLParser.d.ts +0 -61
- package/src/_esm/src/ts/utils/parsers/STLParser.js +0 -175
- package/src/_esm/src/ts/utils/parsers/STLParser.js.map +0 -1
- package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
- package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.js +0 -482
- package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.js.map +0 -1
- package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
- package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.js +0 -49
- package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.js.map +0 -1
- package/src/_esm/src/ts/utils/parsers/svg/types.d.ts +0 -63
- package/src/_esm/src/ts/utils/parsers/svg/types.js +0 -16
- package/src/_esm/src/ts/utils/parsers/svg/types.js.map +0 -1
- package/src/_esm/utils/InitializationObserver.d.ts +0 -18
- package/src/_esm/utils/InitializationObserver.js +0 -61
- package/src/_esm/utils/InitializationObserver.js.map +0 -1
- package/src/_esm/utils/LissajousFigure.d.ts +0 -34
- package/src/_esm/utils/LissajousFigure.js +0 -99
- package/src/_esm/utils/LissajousFigure.js.map +0 -1
- package/src/_esm/utils/NGons.d.ts +0 -13
- package/src/_esm/utils/NGons.js +0 -36
- package/src/_esm/utils/NGons.js.map +0 -1
- package/src/_esm/utils/Params.d.ts +0 -17
- package/src/_esm/utils/Params.js +0 -52
- package/src/_esm/utils/Params.js.map +0 -1
- package/src/_esm/utils/PerlinNoise.d.ts +0 -19
- package/src/_esm/utils/PerlinNoise.js +0 -350
- package/src/_esm/utils/PerlinNoise.js.map +0 -1
- package/src/_esm/utils/SVGPathUtils.d.ts +0 -22
- package/src/_esm/utils/SVGPathUtils.js +0 -45
- package/src/_esm/utils/SVGPathUtils.js.map +0 -1
- package/src/_esm/utils/WebColors.d.ts +0 -35
- package/src/_esm/utils/WebColors.js +0 -58
- package/src/_esm/utils/WebColors.js.map +0 -1
- package/src/_esm/utils/WebColorsContrast.d.ts +0 -6
- package/src/_esm/utils/WebColorsContrast.js +0 -12
- package/src/_esm/utils/WebColorsContrast.js.map +0 -1
- package/src/_esm/utils/WebColorsMalachite.d.ts +0 -12
- package/src/_esm/utils/WebColorsMalachite.js +0 -28
- package/src/_esm/utils/WebColorsMalachite.js.map +0 -1
- package/src/_esm/utils/algorithms/CatmullRomPath.d.ts +0 -60
- package/src/_esm/utils/algorithms/CatmullRomPath.js +0 -107
- package/src/_esm/utils/algorithms/CatmullRomPath.js.map +0 -1
- package/src/_esm/utils/algorithms/CircleIntersections.d.ts +0 -170
- package/src/_esm/utils/algorithms/CircleIntersections.js +0 -307
- package/src/_esm/utils/algorithms/CircleIntersections.js.map +0 -1
- package/src/_esm/utils/algorithms/ContourLineDetection.d.ts +0 -150
- package/src/_esm/utils/algorithms/ContourLineDetection.js +0 -366
- package/src/_esm/utils/algorithms/ContourLineDetection.js.map +0 -1
- package/src/_esm/utils/algorithms/CubicSplinePath.d.ts +0 -63
- package/src/_esm/utils/algorithms/CubicSplinePath.js +0 -174
- package/src/_esm/utils/algorithms/CubicSplinePath.js.map +0 -1
- package/src/_esm/utils/algorithms/HobbyPath.d.ts +0 -81
- package/src/_esm/utils/algorithms/HobbyPath.js +0 -277
- package/src/_esm/utils/algorithms/HobbyPath.js.map +0 -1
- package/src/_esm/utils/algorithms/Metaballs.d.ts +0 -30
- package/src/_esm/utils/algorithms/Metaballs.js +0 -113
- package/src/_esm/utils/algorithms/Metaballs.js.map +0 -1
- package/src/_esm/utils/algorithms/PolygonInset.d.ts +0 -184
- package/src/_esm/utils/algorithms/PolygonInset.js +0 -428
- package/src/_esm/utils/algorithms/PolygonInset.js.map +0 -1
- package/src/_esm/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
- package/src/_esm/utils/algorithms/PolygonTesselationOutlines.js +0 -267
- package/src/_esm/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
- package/src/_esm/utils/algorithms/arrayFill.d.ts +0 -8
- package/src/_esm/utils/algorithms/arrayFill.js +0 -18
- package/src/_esm/utils/algorithms/arrayFill.js.map +0 -1
- package/src/_esm/utils/algorithms/arrayResize.d.ts +0 -8
- package/src/_esm/utils/algorithms/arrayResize.js +0 -24
- package/src/_esm/utils/algorithms/arrayResize.js.map +0 -1
- package/src/_esm/utils/algorithms/arrayShuffle.d.ts +0 -8
- package/src/_esm/utils/algorithms/arrayShuffle.js +0 -15
- package/src/_esm/utils/algorithms/arrayShuffle.js.map +0 -1
- package/src/_esm/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
- package/src/_esm/utils/algorithms/clearDuplicateVertices.js +0 -51
- package/src/_esm/utils/algorithms/clearDuplicateVertices.js.map +0 -1
- package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
- package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.js +0 -61
- package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
- package/src/_esm/utils/algorithms/convexHull.d.ts +0 -23
- package/src/_esm/utils/algorithms/convexHull.js +0 -71
- package/src/_esm/utils/algorithms/convexHull.js.map +0 -1
- package/src/_esm/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
- package/src/_esm/utils/algorithms/convexPolygonIncircle.js +0 -145
- package/src/_esm/utils/algorithms/convexPolygonIncircle.js.map +0 -1
- package/src/_esm/utils/algorithms/createRandomizedPolygon.d.ts +0 -14
- package/src/_esm/utils/algorithms/createRandomizedPolygon.js +0 -28
- package/src/_esm/utils/algorithms/createRandomizedPolygon.js.map +0 -1
- package/src/_esm/utils/algorithms/delaunay.d.ts +0 -30
- package/src/_esm/utils/algorithms/delaunay.js +0 -157
- package/src/_esm/utils/algorithms/delaunay.js.map +0 -1
- package/src/_esm/utils/algorithms/delaunay2voronoi.d.ts +0 -25
- package/src/_esm/utils/algorithms/delaunay2voronoi.js +0 -103
- package/src/_esm/utils/algorithms/delaunay2voronoi.js.map +0 -1
- package/src/_esm/utils/algorithms/detectPaths.d.ts +0 -21
- package/src/_esm/utils/algorithms/detectPaths.js +0 -169
- package/src/_esm/utils/algorithms/detectPaths.js.map +0 -1
- package/src/_esm/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
- package/src/_esm/utils/algorithms/findPolygonSelfIntersections.js +0 -51
- package/src/_esm/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
- package/src/_esm/utils/algorithms/getContrastColor.d.ts +0 -13
- package/src/_esm/utils/algorithms/getContrastColor.js +0 -26
- package/src/_esm/utils/algorithms/getContrastColor.js.map +0 -1
- package/src/_esm/utils/algorithms/matrixFill.d.ts +0 -10
- package/src/_esm/utils/algorithms/matrixFill.js +0 -21
- package/src/_esm/utils/algorithms/matrixFill.js.map +0 -1
- package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
- package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.js +0 -270
- package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
- package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
- package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.js +0 -102
- package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
- package/src/_esm/utils/algorithms/sutherlandHodgman.d.ts +0 -16
- package/src/_esm/utils/algorithms/sutherlandHodgman.js +0 -76
- package/src/_esm/utils/algorithms/sutherlandHodgman.js.map +0 -1
- package/src/_esm/utils/cloneVertexArray.d.ts +0 -13
- package/src/_esm/utils/cloneVertexArray.js +0 -23
- package/src/_esm/utils/cloneVertexArray.js.map +0 -1
- package/src/_esm/utils/createRandomizedPolygon.d.ts +0 -14
- package/src/_esm/utils/createRandomizedPolygon.js +0 -32
- package/src/_esm/utils/createRandomizedPolygon.js.map +0 -1
- package/src/_esm/utils/datastructures/CircularIntervalSet.d.ts +0 -83
- package/src/_esm/utils/datastructures/CircularIntervalSet.js +0 -162
- package/src/_esm/utils/datastructures/CircularIntervalSet.js.map +0 -1
- package/src/_esm/utils/datastructures/Color.d.ts +0 -391
- package/src/_esm/utils/datastructures/Color.js +0 -1067
- package/src/_esm/utils/datastructures/Color.js.map +0 -1
- package/src/_esm/utils/datastructures/ColorGradient.d.ts +0 -81
- package/src/_esm/utils/datastructures/ColorGradient.js +0 -175
- package/src/_esm/utils/datastructures/ColorGradient.js.map +0 -1
- package/src/_esm/utils/datastructures/DataGrid2d.d.ts +0 -53
- package/src/_esm/utils/datastructures/DataGrid2d.js +0 -20
- package/src/_esm/utils/datastructures/DataGrid2d.js.map +0 -1
- package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
- package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.js +0 -154
- package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
- package/src/_esm/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
- package/src/_esm/utils/datastructures/DataGrid2dListAdapter.js +0 -83
- package/src/_esm/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
- package/src/_esm/utils/datastructures/GenericPath.d.ts +0 -86
- package/src/_esm/utils/datastructures/GenericPath.js +0 -121
- package/src/_esm/utils/datastructures/GenericPath.js.map +0 -1
- package/src/_esm/utils/datastructures/GeometryMesh.d.ts +0 -49
- package/src/_esm/utils/datastructures/GeometryMesh.js +0 -57
- package/src/_esm/utils/datastructures/GeometryMesh.js.map +0 -1
- package/src/_esm/utils/datastructures/Girih.d.ts +0 -181
- package/src/_esm/utils/datastructures/Girih.js +0 -265
- package/src/_esm/utils/datastructures/Girih.js.map +0 -1
- package/src/_esm/utils/datastructures/GirihBowtie.d.ts +0 -37
- package/src/_esm/utils/datastructures/GirihBowtie.js +0 -134
- package/src/_esm/utils/datastructures/GirihBowtie.js.map +0 -1
- package/src/_esm/utils/datastructures/GirihDecagon.d.ts +0 -52
- package/src/_esm/utils/datastructures/GirihDecagon.js +0 -114
- package/src/_esm/utils/datastructures/GirihDecagon.js.map +0 -1
- package/src/_esm/utils/datastructures/GirihHexagon.d.ts +0 -39
- package/src/_esm/utils/datastructures/GirihHexagon.js +0 -182
- package/src/_esm/utils/datastructures/GirihHexagon.js.map +0 -1
- package/src/_esm/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
- package/src/_esm/utils/datastructures/GirihPenroseRhombus.js +0 -171
- package/src/_esm/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
- package/src/_esm/utils/datastructures/GirihPentagon.d.ts +0 -37
- package/src/_esm/utils/datastructures/GirihPentagon.js +0 -91
- package/src/_esm/utils/datastructures/GirihPentagon.js.map +0 -1
- package/src/_esm/utils/datastructures/GirihRhombus.d.ts +0 -38
- package/src/_esm/utils/datastructures/GirihRhombus.js +0 -137
- package/src/_esm/utils/datastructures/GirihRhombus.js.map +0 -1
- package/src/_esm/utils/datastructures/GirihTile.d.ts +0 -283
- package/src/_esm/utils/datastructures/GirihTile.js +0 -290
- package/src/_esm/utils/datastructures/GirihTile.js.map +0 -1
- package/src/_esm/utils/datastructures/Matrix4x4.d.ts +0 -244
- package/src/_esm/utils/datastructures/Matrix4x4.js +0 -250
- package/src/_esm/utils/datastructures/Matrix4x4.js.map +0 -1
- package/src/_esm/utils/datastructures/VoronoiCell.d.ts +0 -122
- package/src/_esm/utils/datastructures/VoronoiCell.js +0 -182
- package/src/_esm/utils/datastructures/VoronoiCell.js.map +0 -1
- package/src/_esm/utils/datastructures/interfaces.d.ts +0 -13
- package/src/_esm/utils/datastructures/interfaces.js +0 -10
- package/src/_esm/utils/datastructures/interfaces.js.map +0 -1
- package/src/_esm/utils/detectDarkMode.d.ts +0 -10
- package/src/_esm/utils/detectDarkMode.js +0 -41
- package/src/_esm/utils/detectDarkMode.js.map +0 -1
- package/src/_esm/utils/dom/components/ColorGradientPicker.d.ts +0 -246
- package/src/_esm/utils/dom/components/ColorGradientPicker.js +0 -780
- package/src/_esm/utils/dom/components/ColorGradientPicker.js.map +0 -1
- package/src/_esm/utils/dom/components/ColorGradientPickerJSX.d.ts +0 -129
- package/src/_esm/utils/dom/components/ColorGradientPickerJSX.js +0 -582
- package/src/_esm/utils/dom/components/ColorGradientPickerJSX.js.map +0 -1
- package/src/_esm/utils/dom/components/ColorGradientSelector.d.ts +0 -118
- package/src/_esm/utils/dom/components/ColorGradientSelector.js +0 -376
- package/src/_esm/utils/dom/components/ColorGradientSelector.js.map +0 -1
- package/src/_esm/utils/dom/components/Test.d.ts +0 -7
- package/src/_esm/utils/dom/components/Test.js +0 -63
- package/src/_esm/utils/dom/components/Test.js.map +0 -1
- package/src/_esm/utils/dom/getAvailableContainerSpace.d.ts +0 -2
- package/src/_esm/utils/dom/getAvailableContainerSpace.js +0 -29
- package/src/_esm/utils/dom/getAvailableContainerSpace.js.map +0 -1
- package/src/_esm/utils/dom/getFProp.d.ts +0 -5
- package/src/_esm/utils/dom/getFProp.js +0 -12
- package/src/_esm/utils/dom/getFProp.js.map +0 -1
- package/src/_esm/utils/dom/guiSizeToggler.d.ts +0 -18
- package/src/_esm/utils/dom/guiSizeToggler.js +0 -44
- package/src/_esm/utils/dom/guiSizeToggler.js.map +0 -1
- package/src/_esm/utils/findInVertexArray.d.ts +0 -19
- package/src/_esm/utils/findInVertexArray.js +0 -29
- package/src/_esm/utils/findInVertexArray.js.map +0 -1
- package/src/_esm/utils/getFProp.d.ts +0 -5
- package/src/_esm/utils/getFProp.js +0 -8
- package/src/_esm/utils/getFProp.js.map +0 -1
- package/src/_esm/utils/gup.d.ts +0 -14
- package/src/_esm/utils/gup.js +0 -31
- package/src/_esm/utils/gup.js.map +0 -1
- package/src/_esm/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
- package/src/_esm/utils/helpers/BezierPathInteractionHelper.js +0 -655
- package/src/_esm/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
- package/src/_esm/utils/helpers/CircleHelper.d.ts +0 -73
- package/src/_esm/utils/helpers/CircleHelper.js +0 -92
- package/src/_esm/utils/helpers/CircleHelper.js.map +0 -1
- package/src/_esm/utils/helpers/CircleSectorHelper.d.ts +0 -90
- package/src/_esm/utils/helpers/CircleSectorHelper.js +0 -113
- package/src/_esm/utils/helpers/CircleSectorHelper.js.map +0 -1
- package/src/_esm/utils/helpers/TriangleHelper.d.ts +0 -57
- package/src/_esm/utils/helpers/TriangleHelper.js +0 -82
- package/src/_esm/utils/helpers/TriangleHelper.js.map +0 -1
- package/src/_esm/utils/helpers/VEllipseHelper.d.ts +0 -32
- package/src/_esm/utils/helpers/VEllipseHelper.js +0 -87
- package/src/_esm/utils/helpers/VEllipseHelper.js.map +0 -1
- package/src/_esm/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
- package/src/_esm/utils/helpers/VEllipseSectorHelper.js +0 -134
- package/src/_esm/utils/helpers/VEllipseSectorHelper.js.map +0 -1
- package/src/_esm/utils/io/DndFileHandler.d.ts +0 -63
- package/src/_esm/utils/io/DndFileHandler.js +0 -106
- package/src/_esm/utils/io/DndFileHandler.js.map +0 -1
- package/src/_esm/utils/io/FileDrop.d.ts +0 -110
- package/src/_esm/utils/io/FileDrop.js +0 -175
- package/src/_esm/utils/io/FileDrop.js.map +0 -1
- package/src/_esm/utils/parsers/LinearColorGradientParser.d.ts +0 -78
- package/src/_esm/utils/parsers/LinearColorGradientParser.js +0 -223
- package/src/_esm/utils/parsers/LinearColorGradientParser.js.map +0 -1
- package/src/_esm/utils/parsers/OBJParser.d.ts +0 -25
- package/src/_esm/utils/parsers/OBJParser.js +0 -78
- package/src/_esm/utils/parsers/OBJParser.js.map +0 -1
- package/src/_esm/utils/parsers/STLParser.d.ts +0 -61
- package/src/_esm/utils/parsers/STLParser.js +0 -179
- package/src/_esm/utils/parsers/STLParser.js.map +0 -1
- package/src/_esm/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
- package/src/_esm/utils/parsers/svg/parseSVGPathData.js +0 -486
- package/src/_esm/utils/parsers/svg/parseSVGPathData.js.map +0 -1
- package/src/_esm/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
- package/src/_esm/utils/parsers/svg/splitSVGPathData.js +0 -53
- package/src/_esm/utils/parsers/svg/splitSVGPathData.js.map +0 -1
- package/src/_esm/utils/parsers/svg/types.d.ts +0 -63
- package/src/_esm/utils/parsers/svg/types.js +0 -17
- package/src/_esm/utils/parsers/svg/types.js.map +0 -1
|
@@ -1,920 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Ikaros Kappler
|
|
3
|
-
* @date 2018-04-14
|
|
4
|
-
* @modified 2018-11-17 Added the containsVert function.
|
|
5
|
-
* @modified 2018-12-04 Added the toSVGString function.
|
|
6
|
-
* @modified 2019-03-20 Added JSDoc tags.
|
|
7
|
-
* @modified 2019-10-25 Added the scale function.
|
|
8
|
-
* @modified 2019-11-06 JSDoc update.
|
|
9
|
-
* @modified 2019-11-07 Added toCubicBezierPath(number) function.
|
|
10
|
-
* @modified 2019-11-22 Added the rotate(number,Vertex) function.
|
|
11
|
-
* @modified 2020-03-24 Ported this class from vanilla-JS to Typescript.
|
|
12
|
-
* @modified 2020-10-30 Added the `addVertex` function.
|
|
13
|
-
* @modified 2020-10-31 Added the `getVertexAt` function.
|
|
14
|
-
* @modified 2020-11-06 Added the `move` function.
|
|
15
|
-
* @modified 2020-11-10 Added the `getBounds` function.
|
|
16
|
-
* @modified 2020-11-11 Generalized `move(Vertex)` to `move(XYCoords)`.
|
|
17
|
-
* @modified 2021-01-20 Added UID.
|
|
18
|
-
* @modified 2021-01-29 Added the `signedArea` function (was global function in the demos before).
|
|
19
|
-
* @modified 2021-01-29 Added the `isClockwise` function.
|
|
20
|
-
* @modified 2021-01-29 Added the `area` function.
|
|
21
|
-
* @modified 2021-01-29 Changed the param type for `containsVert` from Vertex to XYCoords.
|
|
22
|
-
* @modified 2021-12-14 Added the `perimeter()` function.
|
|
23
|
-
* @modified 2021-12-16 Added the `getEvenDistributionPolygon()` function.
|
|
24
|
-
* @modified 2022-02-02 Added the `destroy` method.
|
|
25
|
-
* @modified 2022-02-02 Cleared the `Polygon.toSVGString` function (deprecated). Use `drawutilssvg` instead.
|
|
26
|
-
* @modified 2022-03-08 Added the `Polygon.clone()` function.
|
|
27
|
-
* @modified 2023-09-25 Added the `Polygon.getInterpolationPolygon(number)` function.
|
|
28
|
-
* @modified 2023-09-25 Added the `Polygon.lineIntersections(Line,boolean)` function.
|
|
29
|
-
* @modified 2023-09-29 Added the `Polygon.closestLineIntersection(Line,boolean)` function.
|
|
30
|
-
* @modified 2023-11-24 Added the `Polygon.containsPolygon(Polygon)' function.
|
|
31
|
-
* @modified 2024-10-12 Added the `getEdgeAt` method.
|
|
32
|
-
* @modified 2024-10-30 Added the `getEdges` method.
|
|
33
|
-
* @modified 2024-12-02 Added the `elimitateColinearEdges` method.
|
|
34
|
-
* @modified 2025-02-12 Added the `containsVerts` method to test multiple vertices for containment.
|
|
35
|
-
* @modified 2025-03-28 Added the `Polygon.utils.locateLineIntersecion` static helper method.
|
|
36
|
-
* @modified 2025-03-28 Added the `Polygon.lineIntersectionTangents` method.
|
|
37
|
-
* @modified 2025-04-09 Added the `Polygon.getCentroid` method.
|
|
38
|
-
* @modified 2025-05-16 Class `Polygon` now implements `IBounded`.
|
|
39
|
-
* @modified 2025-05-20 Tweaking `Polygon.getInnerAngleAt` and `Polygo.isAngleAcute` to handle indices out of array bounds as well.
|
|
40
|
-
* @modified 2025-06-07 Adding `Polygon.closestLineIntersectionIndex` to determine line intersections plus detected edge index.
|
|
41
|
-
* @version 1.16.0
|
|
42
|
-
*
|
|
43
|
-
* @file Polygon
|
|
44
|
-
* @public
|
|
45
|
-
**/
|
|
46
|
-
import { BezierPath } from "./BezierPath";
|
|
47
|
-
import { Bounds } from "./Bounds";
|
|
48
|
-
import { Line } from "./Line";
|
|
49
|
-
import { Triangle } from "./Triangle";
|
|
50
|
-
import { UIDGenerator } from "./UIDGenerator";
|
|
51
|
-
import { Vector } from "./Vector";
|
|
52
|
-
import { Vertex } from "./Vertex";
|
|
53
|
-
import { geomutils } from "./geomutils";
|
|
54
|
-
/**
|
|
55
|
-
* @classdesc A polygon class. Any polygon consists of an array of vertices; polygons can be open or closed.
|
|
56
|
-
*
|
|
57
|
-
* @requires BezierPath
|
|
58
|
-
* @requires Bounds
|
|
59
|
-
* @requires SVGSerializabe
|
|
60
|
-
* @requires UID
|
|
61
|
-
* @requires UIDGenerator
|
|
62
|
-
* @requires Vertex
|
|
63
|
-
* @requires XYCoords
|
|
64
|
-
*/
|
|
65
|
-
export class Polygon {
|
|
66
|
-
/**
|
|
67
|
-
* The constructor.
|
|
68
|
-
*
|
|
69
|
-
* @constructor
|
|
70
|
-
* @name Polygon
|
|
71
|
-
* @param {Vertex[]} vertices - An array of 2d vertices that shape the polygon.
|
|
72
|
-
* @param {boolean} isOpen - Indicates if the polygon should be rendered as an open or closed shape.
|
|
73
|
-
**/
|
|
74
|
-
constructor(vertices, isOpen) {
|
|
75
|
-
/**
|
|
76
|
-
* Required to generate proper CSS classes and other class related IDs.
|
|
77
|
-
**/
|
|
78
|
-
this.className = "Polygon";
|
|
79
|
-
this.uid = UIDGenerator.next();
|
|
80
|
-
if (typeof vertices == "undefined") {
|
|
81
|
-
vertices = [];
|
|
82
|
-
}
|
|
83
|
-
this.vertices = vertices;
|
|
84
|
-
this.isOpen = isOpen || false;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Add a vertex to the end of the `vertices` array.
|
|
88
|
-
*
|
|
89
|
-
* @method addVertex
|
|
90
|
-
* @param {Vertex} vert - The vertex to add.
|
|
91
|
-
* @instance
|
|
92
|
-
* @memberof Polygon
|
|
93
|
-
**/
|
|
94
|
-
addVertex(vert) {
|
|
95
|
-
this.vertices.push(vert);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Add a vertex at a particular position of the `vertices` array.
|
|
99
|
-
*
|
|
100
|
-
* @method addVertexAt
|
|
101
|
-
* @param {Vertex} vert - The vertex to add.
|
|
102
|
-
* @param {number} index - The position to add the vertex at. Will be handled modulo.
|
|
103
|
-
* @instance
|
|
104
|
-
* @memberof Polygon
|
|
105
|
-
**/
|
|
106
|
-
addVertexAt(vert, index) {
|
|
107
|
-
// var moduloIndex = index % (this.vertices.length + 1);
|
|
108
|
-
this.vertices.splice(index, 0, vert);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Get a new instance of the line at the given start index. The returned line will consist
|
|
112
|
-
* of the vertex at `vertIndex` and `vertIndex+1` (will be handled modulo).
|
|
113
|
-
*
|
|
114
|
-
* @method getEdgeAt
|
|
115
|
-
* @param {number} vertIndex - The vertex index of the line to start.
|
|
116
|
-
* @instance
|
|
117
|
-
* @memberof Polygon
|
|
118
|
-
* @return {Line}
|
|
119
|
-
**/
|
|
120
|
-
getEdgeAt(vertIndex) {
|
|
121
|
-
return new Line(this.getVertexAt(vertIndex), this.getVertexAt(vertIndex + 1));
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Converts this polygon into a sequence of lines. Please note that each time
|
|
125
|
-
* this method is called new lines are created. The underlying line vertices are no clones
|
|
126
|
-
* (instances).
|
|
127
|
-
*
|
|
128
|
-
* @method getEdges
|
|
129
|
-
* @instance
|
|
130
|
-
* @memberof Polygon
|
|
131
|
-
* @return {Array<Line>}
|
|
132
|
-
*/
|
|
133
|
-
getEdges() {
|
|
134
|
-
const lines = [];
|
|
135
|
-
for (var i = 0; i + 1 < this.vertices.length; i++) {
|
|
136
|
-
// var line = this.getLineAt(i).clone();
|
|
137
|
-
lines.push(this.getEdgeAt(i));
|
|
138
|
-
}
|
|
139
|
-
if (!this.isOpen && this.vertices.length > 0) {
|
|
140
|
-
lines.push(this.getEdgeAt(this.vertices.length - 1));
|
|
141
|
-
}
|
|
142
|
-
return lines;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Checks if the angle at the given polygon vertex (index) is acute. Please not that this is
|
|
146
|
-
* only working for clockwise polygons. If this polygon is not clockwise please use the
|
|
147
|
-
* `isClockwise` method and reverse polygon vertices if needed.
|
|
148
|
-
*
|
|
149
|
-
* @method isAngleAcute
|
|
150
|
-
* @instance
|
|
151
|
-
* @memberof Polygon
|
|
152
|
-
* @param {number} vertIndex - The index of the polygon vertex to check.
|
|
153
|
-
* @returns {boolean} `true` is angle is acute, `false` is obtuse.
|
|
154
|
-
*/
|
|
155
|
-
getInnerAngleAt(vertIndex) {
|
|
156
|
-
const p2 = this.vertices[vertIndex % this.vertices.length];
|
|
157
|
-
const p1 = this.vertices[(vertIndex + this.vertices.length - 1) % this.vertices.length].clone();
|
|
158
|
-
const p3 = this.vertices[(vertIndex + 1) % this.vertices.length].clone();
|
|
159
|
-
// See
|
|
160
|
-
// https://math.stackexchange.com/questions/149959/how-to-find-the-interior-angle-of-an-irregular-pentagon-or-polygon
|
|
161
|
-
// π−arccos((P2−P1)⋅(P3−P2)|P2−P1||P3−P2|)
|
|
162
|
-
// Check if triangle is acute (will be used later)
|
|
163
|
-
// Acute angles and obtuse angles need to be handled differently.
|
|
164
|
-
const isAcute = this.isAngleAcute(vertIndex);
|
|
165
|
-
// Differences
|
|
166
|
-
const zero = new Vertex(0, 0);
|
|
167
|
-
const p2mp1 = new Vertex(p2.x - p1.x, p2.y - p1.y);
|
|
168
|
-
const p3mp2 = new Vertex(p3.x - p2.x, p3.y - p2.y);
|
|
169
|
-
const p2mp1_len = zero.distance(p2mp1);
|
|
170
|
-
const p3mp2_len = zero.distance(p3mp2);
|
|
171
|
-
// Dot products
|
|
172
|
-
const dotProduct = geomutils.dotProduct(p2mp1, p3mp2);
|
|
173
|
-
const lengthProduct = p2mp1_len * p3mp2_len;
|
|
174
|
-
if (isAcute) {
|
|
175
|
-
return Math.PI - Math.acos(dotProduct / lengthProduct);
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
return Math.PI + Math.acos(dotProduct / lengthProduct);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Checks if the angle at the given polygon vertex (index) is acute.
|
|
183
|
-
*
|
|
184
|
-
* @method isAngleAcute
|
|
185
|
-
* @instance
|
|
186
|
-
* @memberof Polygon
|
|
187
|
-
* @param {number} vertIndex - The index of the polygon vertex to check.
|
|
188
|
-
* @returns {boolean} `true` is angle is acute, `false` is obtuse.
|
|
189
|
-
*/
|
|
190
|
-
isAngleAcute(vertIndex) {
|
|
191
|
-
const A = this.vertices[(vertIndex + this.vertices.length - 1) % this.vertices.length].clone();
|
|
192
|
-
const B = this.vertices[vertIndex % this.vertices.length];
|
|
193
|
-
const C = this.vertices[(vertIndex + 1) % this.vertices.length].clone();
|
|
194
|
-
// Find local winding number for triangle A B C
|
|
195
|
-
const windingNumber = Triangle.utils.determinant(A, B, C);
|
|
196
|
-
// console.log("vertIndex", vertIndex, "windingNumber", windingNumber);
|
|
197
|
-
return windingNumber < 0;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Get the polygon vertex at the given position (index).
|
|
201
|
-
*
|
|
202
|
-
* The index may exceed the total vertex count, and will be wrapped around then (modulo).
|
|
203
|
-
*
|
|
204
|
-
* For k >= 0:
|
|
205
|
-
* - getVertexAt( vertices.length ) == getVertexAt( 0 )
|
|
206
|
-
* - getVertexAt( vertices.length + k ) == getVertexAt( k )
|
|
207
|
-
* - getVertexAt( -k ) == getVertexAt( vertices.length -k )
|
|
208
|
-
*
|
|
209
|
-
* @method getVertexAt
|
|
210
|
-
* @param {number} index - The index of the desired vertex.
|
|
211
|
-
* @instance
|
|
212
|
-
* @memberof Polygon
|
|
213
|
-
* @return {Vertex} At the given index.
|
|
214
|
-
**/
|
|
215
|
-
getVertexAt(index) {
|
|
216
|
-
if (index < 0) {
|
|
217
|
-
return this.vertices[this.vertices.length - (Math.abs(index) % this.vertices.length)];
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
return this.vertices[index % this.vertices.length];
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Move the polygon's vertices by the given amount.
|
|
225
|
-
*
|
|
226
|
-
* @method move
|
|
227
|
-
* @param {XYCoords} amount - The amount to move.
|
|
228
|
-
* @instance
|
|
229
|
-
* @memberof Polygon
|
|
230
|
-
* @return {Polygon} this for chaining
|
|
231
|
-
**/
|
|
232
|
-
move(amount) {
|
|
233
|
-
for (var i in this.vertices) {
|
|
234
|
-
this.vertices[i].add(amount);
|
|
235
|
-
}
|
|
236
|
-
return this;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Check if the given vertex is inside this polygon.<br>
|
|
240
|
-
* <br>
|
|
241
|
-
* Ray-casting algorithm found at<br>
|
|
242
|
-
* https://stackoverflow.com/questions/22521982/check-if-point-inside-a-polygon
|
|
243
|
-
*
|
|
244
|
-
* @method containsVert
|
|
245
|
-
* @param {XYCoords} vert - The vertex to check.
|
|
246
|
-
* @return {boolean} True if the passed vertex is inside this polygon. The polygon is considered closed.
|
|
247
|
-
* @instance
|
|
248
|
-
* @memberof Polygon
|
|
249
|
-
**/
|
|
250
|
-
containsVert(vert) {
|
|
251
|
-
// ray-casting algorithm based on
|
|
252
|
-
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
|
|
253
|
-
var inside = false;
|
|
254
|
-
for (var i = 0, j = this.vertices.length - 1; i < this.vertices.length; j = i++) {
|
|
255
|
-
let xi = this.vertices[i].x, yi = this.vertices[i].y;
|
|
256
|
-
let xj = this.vertices[j].x, yj = this.vertices[j].y;
|
|
257
|
-
var intersect = yi > vert.y != yj > vert.y && vert.x < ((xj - xi) * (vert.y - yi)) / (yj - yi) + xi;
|
|
258
|
-
if (intersect) {
|
|
259
|
-
inside = !inside;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return inside;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Check if all given vertices are inside this polygon.<br>
|
|
266
|
-
* <br>
|
|
267
|
-
* This method just uses the `Polygon.containsVert` method.
|
|
268
|
-
*
|
|
269
|
-
* @method containsVerts
|
|
270
|
-
* @param {XYCoords[]} verts - The vertices to check.
|
|
271
|
-
* @return {boolean} True if all passed vertices are inside this polygon. The polygon is considered closed.
|
|
272
|
-
* @instance
|
|
273
|
-
* @memberof Polygon
|
|
274
|
-
**/
|
|
275
|
-
containsVerts(verts) {
|
|
276
|
-
return verts.every((vert) => this.containsVert(vert));
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Check if the passed polygon is completly contained inside this polygon.
|
|
280
|
-
*
|
|
281
|
-
* This means:
|
|
282
|
-
* - all polygon's vertices must be inside this polygon.
|
|
283
|
-
* - the polygon has no edge intersections with this polygon.
|
|
284
|
-
*
|
|
285
|
-
* @param {Polygon} polygon - The polygon to check if contained.
|
|
286
|
-
* @return {boolean}
|
|
287
|
-
*/
|
|
288
|
-
containsPolygon(polygon) {
|
|
289
|
-
for (var i = 0; i < polygon.vertices.length; i++) {
|
|
290
|
-
if (!this.containsVert(polygon.vertices[i])) {
|
|
291
|
-
return false;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
// All vertices are inside; check for intersections
|
|
295
|
-
const lineSegment = new Line(new Vertex(), new Vertex());
|
|
296
|
-
for (var i = 0; i < polygon.vertices.length; i++) {
|
|
297
|
-
lineSegment.a.set(polygon.vertices[i]);
|
|
298
|
-
lineSegment.b.set(polygon.vertices[(i + 1) % polygon.vertices.length]);
|
|
299
|
-
if (this.lineIntersections(lineSegment, true).length > 0) {
|
|
300
|
-
// Current segment has intersection(s) with this polygon.
|
|
301
|
-
return false;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
return true;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Calculate the area of the given polygon (unsigned).
|
|
308
|
-
*
|
|
309
|
-
* Note that this does not work for self-intersecting polygons.
|
|
310
|
-
*
|
|
311
|
-
* @method area
|
|
312
|
-
* @instance
|
|
313
|
-
* @memberof Polygon
|
|
314
|
-
* @return {number}
|
|
315
|
-
*/
|
|
316
|
-
area() {
|
|
317
|
-
return Polygon.utils.area(this.vertices);
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Calulate the signed polyon area by interpreting the polygon as a matrix
|
|
321
|
-
* and calculating its determinant.
|
|
322
|
-
*
|
|
323
|
-
* @method signedArea
|
|
324
|
-
* @instance
|
|
325
|
-
* @memberof Polygon
|
|
326
|
-
* @return {number}
|
|
327
|
-
*/
|
|
328
|
-
signedArea() {
|
|
329
|
-
return Polygon.utils.signedArea(this.vertices);
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Get the winding order of this polgon: clockwise or counterclockwise.
|
|
333
|
-
*
|
|
334
|
-
* @method isClockwise
|
|
335
|
-
* @instance
|
|
336
|
-
* @memberof Polygon
|
|
337
|
-
* @return {boolean}
|
|
338
|
-
*/
|
|
339
|
-
isClockwise() {
|
|
340
|
-
// return Polygon.utils.signedArea(this.vertices) < 0;
|
|
341
|
-
return Polygon.utils.isClockwise(this.vertices);
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Get the perimeter of this polygon.
|
|
345
|
-
* The perimeter is the absolute length of the outline.
|
|
346
|
-
*
|
|
347
|
-
* If this polygon is open then the last segment (connecting the first and the
|
|
348
|
-
* last vertex) will be skipped.
|
|
349
|
-
*
|
|
350
|
-
* @method perimeter
|
|
351
|
-
* @instance
|
|
352
|
-
* @memberof Polygon
|
|
353
|
-
* @return {number}
|
|
354
|
-
*/
|
|
355
|
-
perimeter() {
|
|
356
|
-
let length = 0;
|
|
357
|
-
for (var i = 1; i < this.vertices.length; i++) {
|
|
358
|
-
length += this.vertices[i - 1].distance(this.vertices[i]);
|
|
359
|
-
}
|
|
360
|
-
if (!this.isOpen && this.vertices.length > 1) {
|
|
361
|
-
length += this.vertices[0].distance(this.vertices[this.vertices.length - 1]);
|
|
362
|
-
}
|
|
363
|
-
return length;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Scale the polygon relative to the given center.
|
|
367
|
-
*
|
|
368
|
-
* @method scale
|
|
369
|
-
* @param {number} factor - The scale factor.
|
|
370
|
-
* @param {Vertex} center - The center of scaling.
|
|
371
|
-
* @return {Polygon} this, for chaining.
|
|
372
|
-
* @instance
|
|
373
|
-
* @memberof Polygon
|
|
374
|
-
**/
|
|
375
|
-
scale(factor, center) {
|
|
376
|
-
for (var i in this.vertices) {
|
|
377
|
-
if (typeof this.vertices[i].scale == "function")
|
|
378
|
-
this.vertices[i].scale(factor, center);
|
|
379
|
-
else
|
|
380
|
-
console.log("There seems to be a null vertex!", this.vertices[i]);
|
|
381
|
-
}
|
|
382
|
-
return this;
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Rotate the polygon around the given center.
|
|
386
|
-
*
|
|
387
|
-
* @method rotate
|
|
388
|
-
* @param {number} angle - The rotation angle.
|
|
389
|
-
* @param {Vertex} center - The center of rotation.
|
|
390
|
-
* @instance
|
|
391
|
-
* @memberof Polygon
|
|
392
|
-
* @return {Polygon} this, for chaining.
|
|
393
|
-
**/
|
|
394
|
-
rotate(angle, center) {
|
|
395
|
-
for (var i in this.vertices) {
|
|
396
|
-
this.vertices[i].rotate(angle, center);
|
|
397
|
-
}
|
|
398
|
-
return this;
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Get the mean `center` of this polygon by calculating the mean value of all vertices.
|
|
402
|
-
*
|
|
403
|
-
* Mean: (v[0] + v[1] + ... v[n-1]) / n
|
|
404
|
-
*
|
|
405
|
-
* @method getMeanCenter
|
|
406
|
-
* @instance
|
|
407
|
-
* @memberof Polygon
|
|
408
|
-
* @return {Vertex|null} `null` is no vertices are available.
|
|
409
|
-
*/
|
|
410
|
-
getMeanCenter() {
|
|
411
|
-
if (this.vertices.length === 0) {
|
|
412
|
-
return null;
|
|
413
|
-
}
|
|
414
|
-
const center = this.vertices[0].clone();
|
|
415
|
-
for (var i = 1; i < this.vertices.length; i++) {
|
|
416
|
-
center.add(this.vertices[i]);
|
|
417
|
-
}
|
|
418
|
-
center.x /= this.vertices.length;
|
|
419
|
-
center.y /= this.vertices.length;
|
|
420
|
-
return center;
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Get centroid.
|
|
424
|
-
* Centroids define the barycenter of any non self-intersecting convex polygon.
|
|
425
|
-
*
|
|
426
|
-
* If the polygon is self intersecting or non konvex then the barycenter is not well defined.
|
|
427
|
-
*
|
|
428
|
-
* https://mathworld.wolfram.com/PolygonCentroid.html
|
|
429
|
-
*
|
|
430
|
-
* @method getCentroid
|
|
431
|
-
* @instance
|
|
432
|
-
* @memberof Polygon
|
|
433
|
-
* @returns {Vertex|null}
|
|
434
|
-
*/
|
|
435
|
-
getCentroid() {
|
|
436
|
-
if (this.vertices.length === 0) {
|
|
437
|
-
return null;
|
|
438
|
-
}
|
|
439
|
-
const center = new Vertex(0.0, 0.0);
|
|
440
|
-
const n = this.vertices.length;
|
|
441
|
-
for (var i = 0; i < n; i++) {
|
|
442
|
-
// center.add(this.vertices[i]);
|
|
443
|
-
const cur = this.vertices[i];
|
|
444
|
-
const next = this.vertices[(i + 1) % n];
|
|
445
|
-
var factor = cur.x * next.y - next.x * cur.y;
|
|
446
|
-
center.x += (cur.x + next.x) * factor;
|
|
447
|
-
center.y += (cur.y + next.y) * factor;
|
|
448
|
-
}
|
|
449
|
-
const area = this.area();
|
|
450
|
-
center.x *= 1 / (6 * area);
|
|
451
|
-
center.y *= 1 / (6 * area);
|
|
452
|
-
return center;
|
|
453
|
-
}
|
|
454
|
-
//--- BEGIN --- Implement interface `Intersectable`
|
|
455
|
-
/**
|
|
456
|
-
* Get all line intersections with this polygon.
|
|
457
|
-
*
|
|
458
|
-
* This method returns all intersections (as vertices) with this shape. The returned array of vertices is in no specific order.
|
|
459
|
-
*
|
|
460
|
-
* See demo `47-closest-vector-projection-on-polygon` for how it works.
|
|
461
|
-
*
|
|
462
|
-
* @param {VertTuple} line - The line to find intersections with.
|
|
463
|
-
* @param {boolean} inVectorBoundsOnly - If set to true only intersecion points on the passed vector are returned (located strictly between start and end vertex).
|
|
464
|
-
* @returns {Array<Vertex>} - An array of all intersections within the polygon bounds.
|
|
465
|
-
*/
|
|
466
|
-
lineIntersections(line, inVectorBoundsOnly = false) {
|
|
467
|
-
// Find the intersections of all lines inside the edge bounds
|
|
468
|
-
return Polygon.utils
|
|
469
|
-
.locateLineIntersecion(line, this.vertices, this.isOpen, inVectorBoundsOnly)
|
|
470
|
-
.map(intersectionTuple => intersectionTuple.intersection);
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Get all line intersections of this polygon and their tangents along the shape.
|
|
474
|
-
*
|
|
475
|
-
* This method returns all intersection tangents (as vectors) with this shape. The returned array of vectors is in no specific order.
|
|
476
|
-
*
|
|
477
|
-
* @param line
|
|
478
|
-
* @param inVectorBoundsOnly
|
|
479
|
-
* @returns
|
|
480
|
-
*/
|
|
481
|
-
lineIntersectionTangents(line, inVectorBoundsOnly = false) {
|
|
482
|
-
// Find the intersection tangents of all lines inside the edge bounds
|
|
483
|
-
return Polygon.utils.locateLineIntersecion(line, this.vertices, this.isOpen, inVectorBoundsOnly).map(intersectionTuple => {
|
|
484
|
-
const polyLine = this.getEdgeAt(intersectionTuple.edgeIndex);
|
|
485
|
-
return new Vector(polyLine.a.clone(), polyLine.b.clone()).moveTo(intersectionTuple.intersection);
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
//--- END --- Implement interface `Intersectable`
|
|
489
|
-
/**
|
|
490
|
-
* Get all line intersections of this polygon and their tangents along the shape.
|
|
491
|
-
*
|
|
492
|
-
* This method returns all intersection tangents (as vectors) with this shape. The returned array of vectors is in no specific order.
|
|
493
|
-
*
|
|
494
|
-
* @param line
|
|
495
|
-
* @param inVectorBoundsOnly
|
|
496
|
-
* @returns
|
|
497
|
-
*/
|
|
498
|
-
lineIntersectionTangentsIndices(line, inVectorBoundsOnly = false) {
|
|
499
|
-
// Find the intersection tangents of all lines inside the edge bounds
|
|
500
|
-
return Polygon.utils.locateLineIntersecion(line, this.vertices, this.isOpen, inVectorBoundsOnly).map(intersectionTuple => {
|
|
501
|
-
const polyLine = this.getEdgeAt(intersectionTuple.edgeIndex);
|
|
502
|
-
return {
|
|
503
|
-
intersection: new Vector(polyLine.a.clone(), polyLine.b.clone()).moveTo(intersectionTuple.intersection),
|
|
504
|
-
edgeIndex: intersectionTuple.edgeIndex
|
|
505
|
-
};
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Get the closest line-polygon-intersection point (closest the line point A).
|
|
510
|
-
*
|
|
511
|
-
* See demo `47-closest-vector-projection-on-polygon` for how it works.
|
|
512
|
-
*
|
|
513
|
-
* @param {VertTuple} line - The line to find intersections with.
|
|
514
|
-
* @param {boolean} inVectorBoundsOnly - If set to true only intersecion points on the passed vector are considered (located strictly between start and end vertex).
|
|
515
|
-
* @returns {Vertex | null} - The intersection point within the polygon bounds.
|
|
516
|
-
*/
|
|
517
|
-
closestLineIntersection(line, inVectorBoundsOnly = false) {
|
|
518
|
-
var closestInterSectionIndex = this.closestLineIntersectionIndex(line, inVectorBoundsOnly);
|
|
519
|
-
if (closestInterSectionIndex) {
|
|
520
|
-
return closestInterSectionIndex.intersection;
|
|
521
|
-
}
|
|
522
|
-
else {
|
|
523
|
-
return null;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* Get the closest line-polygon-intersection point (closest the line point A) plus the edge index..
|
|
528
|
-
*
|
|
529
|
-
* See demo `63-measure-angles-on-polygon` for how it works.
|
|
530
|
-
*
|
|
531
|
-
* @param {VertTuple} line - The line to find intersections with.
|
|
532
|
-
* @param {boolean} inVectorBoundsOnly - If set to true only intersecion points on the passed vector are considered (located strictly between start and end vertex).
|
|
533
|
-
* @returns {PolygonIntersectionTuple| null} - A pair containing the intersection point and the affected polygon edge index.
|
|
534
|
-
*/
|
|
535
|
-
closestLineIntersectionIndex(line, inVectorBoundsOnly = false) {
|
|
536
|
-
const allIntersections = this.lineIntersections(line, inVectorBoundsOnly);
|
|
537
|
-
if (allIntersections.length <= 0) {
|
|
538
|
-
// Empty polygon -> no intersections
|
|
539
|
-
return null;
|
|
540
|
-
}
|
|
541
|
-
// Find the closest intersection
|
|
542
|
-
let closestIntersection = new Vertex(Number.MAX_VALUE, Number.MAX_VALUE);
|
|
543
|
-
let closestInterSectionIndex = -1;
|
|
544
|
-
let curDist = Number.MAX_VALUE;
|
|
545
|
-
for (var i = 0; i < allIntersections.length; i++) {
|
|
546
|
-
const curVert = allIntersections[i];
|
|
547
|
-
const dist = curVert.distance(line.a);
|
|
548
|
-
if (dist < curDist) {
|
|
549
|
-
// && line.hasPoint(curVert)) {
|
|
550
|
-
curDist = dist;
|
|
551
|
-
closestIntersection = curVert;
|
|
552
|
-
closestInterSectionIndex = i;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
// return [closestIntersection, closestInterSectionIndex];
|
|
556
|
-
return { edgeIndex: closestInterSectionIndex, intersection: closestIntersection };
|
|
557
|
-
}
|
|
558
|
-
/**
|
|
559
|
-
* Construct a new polygon from this polygon with more vertices on each edge. The
|
|
560
|
-
* interpolation count determines the number of additional vertices on each edge.
|
|
561
|
-
* An interpolation count of `0` will return a polygon that equals the source
|
|
562
|
-
* polygon.
|
|
563
|
-
*
|
|
564
|
-
* @param {number} interpolationCount
|
|
565
|
-
* @returns {Polygon} A polygon with `interpolationCount` more vertices (as as factor).
|
|
566
|
-
*/
|
|
567
|
-
getInterpolationPolygon(interpolationCount) {
|
|
568
|
-
const verts = [];
|
|
569
|
-
for (var i = 0; i < this.vertices.length; i++) {
|
|
570
|
-
const curVert = this.vertices[i];
|
|
571
|
-
const nextVert = this.vertices[(i + 1) % this.vertices.length];
|
|
572
|
-
verts.push(curVert.clone());
|
|
573
|
-
// Add interpolation points
|
|
574
|
-
if (!this.isOpen || i + 1 !== this.vertices.length) {
|
|
575
|
-
const lerpAmount = 1.0 / (interpolationCount + 1);
|
|
576
|
-
for (var j = 1; j <= interpolationCount; j++) {
|
|
577
|
-
verts.push(curVert.clone().lerp(nextVert, lerpAmount * j));
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
return new Polygon(verts, this.isOpen);
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* Convert this polygon into a new polygon with n evenly distributed vertices.
|
|
585
|
-
*
|
|
586
|
-
* @param {number} pointCount - Must not be negative.
|
|
587
|
-
*/
|
|
588
|
-
getEvenDistributionPolygon(pointCount) {
|
|
589
|
-
if (pointCount <= 0) {
|
|
590
|
-
throw new Error("pointCount must be larger than zero; is " + pointCount + ".");
|
|
591
|
-
}
|
|
592
|
-
const result = new Polygon([], this.isOpen);
|
|
593
|
-
if (this.vertices.length === 0) {
|
|
594
|
-
return result;
|
|
595
|
-
}
|
|
596
|
-
// Fetch and add the start point from the source polygon
|
|
597
|
-
let polygonPoint = new Vertex(this.vertices[0]);
|
|
598
|
-
result.vertices.push(polygonPoint);
|
|
599
|
-
if (this.vertices.length === 1) {
|
|
600
|
-
return result;
|
|
601
|
-
}
|
|
602
|
-
const perimeter = this.perimeter();
|
|
603
|
-
const stepSize = perimeter / pointCount;
|
|
604
|
-
const n = this.vertices.length;
|
|
605
|
-
let polygonIndex = 1;
|
|
606
|
-
let nextPolygonPoint = new Vertex(this.vertices[1]);
|
|
607
|
-
let segmentLength = polygonPoint.distance(nextPolygonPoint);
|
|
608
|
-
let loopMax = this.isOpen ? n : n + 1;
|
|
609
|
-
let curSegmentU = stepSize;
|
|
610
|
-
var i = 1;
|
|
611
|
-
while (i < pointCount && polygonIndex < loopMax) {
|
|
612
|
-
// Check if next eq point is inside this segment
|
|
613
|
-
if (curSegmentU < segmentLength) {
|
|
614
|
-
let newPoint = polygonPoint.clone().lerpAbs(nextPolygonPoint, curSegmentU);
|
|
615
|
-
result.vertices.push(newPoint);
|
|
616
|
-
curSegmentU += stepSize;
|
|
617
|
-
i++;
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
polygonIndex++;
|
|
621
|
-
polygonPoint = nextPolygonPoint;
|
|
622
|
-
nextPolygonPoint = new Vertex(this.vertices[polygonIndex % n]);
|
|
623
|
-
curSegmentU = curSegmentU - segmentLength;
|
|
624
|
-
segmentLength = polygonPoint.distance(nextPolygonPoint);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
return result;
|
|
628
|
-
}
|
|
629
|
-
//--- BEGIN --- Implement interface `IBounded`
|
|
630
|
-
/**
|
|
631
|
-
* Get the bounding box (bounds) of this polygon.
|
|
632
|
-
*
|
|
633
|
-
* @method getBounds
|
|
634
|
-
* @instance
|
|
635
|
-
* @memberof Polygon
|
|
636
|
-
* @return {Bounds} The rectangular bounds of this polygon.
|
|
637
|
-
**/
|
|
638
|
-
getBounds() {
|
|
639
|
-
return Bounds.computeFromVertices(this.vertices);
|
|
640
|
-
}
|
|
641
|
-
//--- END --- Implement interface `IBounded`
|
|
642
|
-
/**
|
|
643
|
-
* Create a deep copy of this polygon.
|
|
644
|
-
*
|
|
645
|
-
* @method clone
|
|
646
|
-
* @instance
|
|
647
|
-
* @memberof Polygon
|
|
648
|
-
* @return {Polygon} The cloned polygon.
|
|
649
|
-
*/
|
|
650
|
-
clone() {
|
|
651
|
-
return new Polygon(this.vertices.map(vert => vert.clone()), this.isOpen);
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* Create a new polygon without colinear adjacent edges. This method does not midify the current polygon
|
|
655
|
-
* but creates a new one.
|
|
656
|
-
*
|
|
657
|
-
* Please note that this method does NOT create deep clones of the vertices. Use Polygon.clone() if you need to.
|
|
658
|
-
*
|
|
659
|
-
* Please also note that the `tolerance` may become really large here, as the denominator of two closely
|
|
660
|
-
* parallel lines is usually pretty large. See the demo `57-eliminate-colinear-polygon-edges` to get
|
|
661
|
-
* an impression of how denominators work.
|
|
662
|
-
*
|
|
663
|
-
* @method elimitateColinearEdges
|
|
664
|
-
* @instance
|
|
665
|
-
* @memberof Polygon
|
|
666
|
-
* @param {number?} tolerance - (default is 1.0) The epsilon to detect co-linear edges.
|
|
667
|
-
* @return {Polygon} A new polygon without co-linear adjacent edges – respective the given epsilon.
|
|
668
|
-
*/
|
|
669
|
-
elimitateColinearEdges(tolerance) {
|
|
670
|
-
const eps = typeof tolerance === "undefined" ? 1.0 : tolerance;
|
|
671
|
-
const verts = this.vertices.slice(); // Creates a shallow copy
|
|
672
|
-
let i = 0;
|
|
673
|
-
var lineA = new Line(new Vertex(), new Vertex());
|
|
674
|
-
var lineB = new Line(new Vertex(), new Vertex());
|
|
675
|
-
while (i + 1 < verts.length && verts.length > 2) {
|
|
676
|
-
const vertA = verts[i];
|
|
677
|
-
const vertB = verts[(i + 1) % verts.length];
|
|
678
|
-
lineA.a = vertA;
|
|
679
|
-
lineA.b = vertB;
|
|
680
|
-
lineB.a = vertB;
|
|
681
|
-
let areColinear = false;
|
|
682
|
-
let j = i + 2;
|
|
683
|
-
do {
|
|
684
|
-
let vertC = verts[j % verts.length];
|
|
685
|
-
lineB.b = vertC;
|
|
686
|
-
areColinear = lineA.colinear(lineB, eps);
|
|
687
|
-
// console.log("are colinear?", i, i + 1, j, areColinear);
|
|
688
|
-
if (areColinear) {
|
|
689
|
-
j++;
|
|
690
|
-
}
|
|
691
|
-
} while (areColinear);
|
|
692
|
-
// Now j points to the first vertex that's NOT colinear to the current lineA
|
|
693
|
-
// -> delete all vertices in between
|
|
694
|
-
if (j - i > 2) {
|
|
695
|
-
// Means: there have been 'colinear vertices' in between
|
|
696
|
-
verts.splice(i + 1, j - i - 2);
|
|
697
|
-
}
|
|
698
|
-
i++;
|
|
699
|
-
}
|
|
700
|
-
return new Polygon(verts, this.isOpen);
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* Convert this polygon to a sequence of quadratic Bézier curves.<br>
|
|
704
|
-
* <br>
|
|
705
|
-
* The first vertex in the returned array is the start point.<br>
|
|
706
|
-
* The following sequence are pairs of control-point-and-end-point:
|
|
707
|
-
* <pre>startPoint, controlPoint0, pathPoint1, controlPoint1, pathPoint2, controlPoint2, ..., endPoint</pre>
|
|
708
|
-
*
|
|
709
|
-
* @method toQuadraticBezierData
|
|
710
|
-
* @return {Vertex[]} An array of 2d vertices that shape the quadratic Bézier curve.
|
|
711
|
-
* @instance
|
|
712
|
-
* @memberof Polygon
|
|
713
|
-
**/
|
|
714
|
-
toQuadraticBezierData() {
|
|
715
|
-
if (this.vertices.length < 3)
|
|
716
|
-
return [];
|
|
717
|
-
var qbezier = [];
|
|
718
|
-
var cc0 = this.vertices[0];
|
|
719
|
-
var cc1 = this.vertices[1];
|
|
720
|
-
var edgeCenter = new Vertex(cc0.x + (cc1.x - cc0.x) / 2, cc0.y + (cc1.y - cc0.y) / 2);
|
|
721
|
-
qbezier.push(edgeCenter);
|
|
722
|
-
var limit = this.isOpen ? this.vertices.length : this.vertices.length + 1;
|
|
723
|
-
for (var t = 1; t < limit; t++) {
|
|
724
|
-
cc0 = this.vertices[t % this.vertices.length];
|
|
725
|
-
cc1 = this.vertices[(t + 1) % this.vertices.length];
|
|
726
|
-
var edgeCenter = new Vertex(cc0.x + (cc1.x - cc0.x) / 2, cc0.y + (cc1.y - cc0.y) / 2);
|
|
727
|
-
qbezier.push(cc0);
|
|
728
|
-
qbezier.push(edgeCenter);
|
|
729
|
-
cc0 = cc1;
|
|
730
|
-
}
|
|
731
|
-
return qbezier;
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Convert this polygon to a quadratic bezier curve, represented as an SVG data string.
|
|
735
|
-
*
|
|
736
|
-
* @method toQuadraticBezierSVGString
|
|
737
|
-
* @return {string} The 'd' part for an SVG 'path' element.
|
|
738
|
-
* @instance
|
|
739
|
-
* @memberof Polygon
|
|
740
|
-
**/
|
|
741
|
-
toQuadraticBezierSVGString() {
|
|
742
|
-
var qdata = this.toQuadraticBezierData();
|
|
743
|
-
if (qdata.length == 0)
|
|
744
|
-
return "";
|
|
745
|
-
var buffer = ["M " + qdata[0].x + " " + qdata[0].y];
|
|
746
|
-
for (var i = 1; i < qdata.length; i += 2) {
|
|
747
|
-
buffer.push("Q " + qdata[i].x + " " + qdata[i].y + ", " + qdata[i + 1].x + " " + qdata[i + 1].y);
|
|
748
|
-
}
|
|
749
|
-
return buffer.join(" ");
|
|
750
|
-
}
|
|
751
|
-
/**
|
|
752
|
-
* Convert this polygon to a sequence of cubic Bézier curves.<br>
|
|
753
|
-
* <br>
|
|
754
|
-
* The first vertex in the returned array is the start point.<br>
|
|
755
|
-
* The following sequence are triplets of (first-control-point, secnond-control-point, end-point):<br>
|
|
756
|
-
* <pre>startPoint, controlPoint0_0, controlPoint1_1, pathPoint1, controlPoint1_0, controlPoint1_1, ..., endPoint</pre>
|
|
757
|
-
*
|
|
758
|
-
* @method toCubicBezierData
|
|
759
|
-
* @param {number=} threshold - An optional threshold (default=1.0) how strong the curve segments
|
|
760
|
-
* should over-/under-drive. Should be between 0.0 and 1.0 for best
|
|
761
|
-
* results but other values are allowed.
|
|
762
|
-
* @return {Vertex[]} An array of 2d vertices that shape the cubic Bézier curve.
|
|
763
|
-
* @instance
|
|
764
|
-
* @memberof Polygon
|
|
765
|
-
**/
|
|
766
|
-
toCubicBezierData(threshold) {
|
|
767
|
-
if (typeof threshold == "undefined")
|
|
768
|
-
threshold = 1.0;
|
|
769
|
-
if (this.vertices.length < 3)
|
|
770
|
-
return [];
|
|
771
|
-
var cbezier = [];
|
|
772
|
-
var a = this.vertices[0];
|
|
773
|
-
var b = this.vertices[1];
|
|
774
|
-
var edgeCenter = new Vertex(a.x + (b.x - a.x) / 2, a.y + (b.y - a.y) / 2);
|
|
775
|
-
cbezier.push(edgeCenter);
|
|
776
|
-
var limit = this.isOpen ? this.vertices.length - 1 : this.vertices.length;
|
|
777
|
-
for (var t = 0; t < limit; t++) {
|
|
778
|
-
var a = this.vertices[t % this.vertices.length];
|
|
779
|
-
var b = this.vertices[(t + 1) % this.vertices.length];
|
|
780
|
-
var c = this.vertices[(t + 2) % this.vertices.length];
|
|
781
|
-
var aCenter = new Vertex(a.x + (b.x - a.x) / 2, a.y + (b.y - a.y) / 2);
|
|
782
|
-
var bCenter = new Vertex(b.x + (c.x - b.x) / 2, b.y + (c.y - b.y) / 2);
|
|
783
|
-
var a2 = new Vertex(aCenter.x + (b.x - aCenter.x) * threshold, aCenter.y + (b.y - aCenter.y) * threshold);
|
|
784
|
-
var b0 = new Vertex(bCenter.x + (b.x - bCenter.x) * threshold, bCenter.y + (b.y - bCenter.y) * threshold);
|
|
785
|
-
cbezier.push(a2);
|
|
786
|
-
cbezier.push(b0);
|
|
787
|
-
cbezier.push(bCenter);
|
|
788
|
-
}
|
|
789
|
-
return cbezier;
|
|
790
|
-
}
|
|
791
|
-
/**
|
|
792
|
-
* Convert this polygon to a cubic bezier curve, represented as an SVG data string.
|
|
793
|
-
*
|
|
794
|
-
* @method toCubicBezierSVGString
|
|
795
|
-
* @return {string} The 'd' part for an SVG 'path' element.
|
|
796
|
-
* @instance
|
|
797
|
-
* @memberof Polygon
|
|
798
|
-
**/
|
|
799
|
-
toCubicBezierSVGString(threshold) {
|
|
800
|
-
var qdata = this.toCubicBezierData(threshold);
|
|
801
|
-
if (qdata.length == 0) {
|
|
802
|
-
return "";
|
|
803
|
-
}
|
|
804
|
-
var buffer = ["M " + qdata[0].x + " " + qdata[0].y];
|
|
805
|
-
for (var i = 1; i < qdata.length; i += 3) {
|
|
806
|
-
buffer.push("C " +
|
|
807
|
-
qdata[i].x +
|
|
808
|
-
" " +
|
|
809
|
-
qdata[i].y +
|
|
810
|
-
", " +
|
|
811
|
-
qdata[i + 1].x +
|
|
812
|
-
" " +
|
|
813
|
-
qdata[i + 1].y +
|
|
814
|
-
", " +
|
|
815
|
-
qdata[i + 2].x +
|
|
816
|
-
" " +
|
|
817
|
-
qdata[i + 2].y);
|
|
818
|
-
}
|
|
819
|
-
return buffer.join(" ");
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* Convert this polygon to a cubic bezier path instance.
|
|
823
|
-
*
|
|
824
|
-
* @method toCubicBezierPath
|
|
825
|
-
* @param {number} threshold - The threshold, usually from 0.0 to 1.0.
|
|
826
|
-
* @return {BezierPath} - A bezier path instance.
|
|
827
|
-
* @instance
|
|
828
|
-
* @memberof Polygon
|
|
829
|
-
**/
|
|
830
|
-
toCubicBezierPath(threshold) {
|
|
831
|
-
var qdata = this.toCubicBezierData(threshold);
|
|
832
|
-
// Conver the linear path vertices to a two-dimensional path array
|
|
833
|
-
var pathdata = [];
|
|
834
|
-
for (var i = 0; i + 3 < qdata.length; i += 3) {
|
|
835
|
-
pathdata.push([qdata[i], qdata[i + 3], qdata[i + 1], qdata[i + 2]]);
|
|
836
|
-
}
|
|
837
|
-
return BezierPath.fromArray(pathdata);
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* This function should invalidate any installed listeners and invalidate this object.
|
|
841
|
-
* After calling this function the object might not hold valid data any more and
|
|
842
|
-
* should not be used.
|
|
843
|
-
*/
|
|
844
|
-
destroy() {
|
|
845
|
-
for (var i = 0; i < this.vertices.length; i++) {
|
|
846
|
-
this.vertices[i].destroy();
|
|
847
|
-
}
|
|
848
|
-
this.isDestroyed = true;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
Polygon.utils = {
|
|
852
|
-
/**
|
|
853
|
-
* Calculate the area of the given polygon (unsigned).
|
|
854
|
-
*
|
|
855
|
-
* Note that this does not work for self-intersecting polygons.
|
|
856
|
-
*
|
|
857
|
-
* @name area
|
|
858
|
-
* @return {number}
|
|
859
|
-
*/
|
|
860
|
-
area(vertices) {
|
|
861
|
-
// Found at:
|
|
862
|
-
// https://stackoverflow.com/questions/16285134/calculating-polygon-area
|
|
863
|
-
let total = 0.0;
|
|
864
|
-
for (var i = 0, l = vertices.length; i < l; i++) {
|
|
865
|
-
const addX = vertices[i].x;
|
|
866
|
-
const addY = vertices[(i + 1) % l].y;
|
|
867
|
-
const subX = vertices[(i + 1) % l].x;
|
|
868
|
-
const subY = vertices[i].y;
|
|
869
|
-
total += addX * addY * 0.5;
|
|
870
|
-
total -= subX * subY * 0.5;
|
|
871
|
-
}
|
|
872
|
-
return Math.abs(total);
|
|
873
|
-
},
|
|
874
|
-
isClockwise(vertices) {
|
|
875
|
-
return Polygon.utils.signedArea(vertices) < 0;
|
|
876
|
-
},
|
|
877
|
-
/**
|
|
878
|
-
* Calulate the signed polyon area by interpreting the polygon as a matrix
|
|
879
|
-
* and calculating its determinant.
|
|
880
|
-
*
|
|
881
|
-
* @name signedArea
|
|
882
|
-
* @return {number}
|
|
883
|
-
*/
|
|
884
|
-
signedArea(vertices) {
|
|
885
|
-
let sum = 0;
|
|
886
|
-
const n = vertices.length;
|
|
887
|
-
for (var i = 0; i < n; i++) {
|
|
888
|
-
const j = (i + 1) % n;
|
|
889
|
-
sum += (vertices[j].x - vertices[i].x) * (vertices[i].y + vertices[j].y);
|
|
890
|
-
}
|
|
891
|
-
return sum;
|
|
892
|
-
},
|
|
893
|
-
/**
|
|
894
|
-
* Find intersections of a line with a polygon (vertices).
|
|
895
|
-
*
|
|
896
|
-
* @param {VertTuple<any>} line - The line to find intersections with.
|
|
897
|
-
* @param {Array<Vertex>} vertices - The polygon's vertices.
|
|
898
|
-
* @param {boolean} isOpen - True if the polygon is open, false otherwise.
|
|
899
|
-
* @param {boolean} inVectorBoundsOnly - If only intersections in strict vector bounds should be returned.
|
|
900
|
-
* @returns
|
|
901
|
-
*/
|
|
902
|
-
locateLineIntersecion(line, vertices, isOpen, inVectorBoundsOnly) {
|
|
903
|
-
// Find the intersections of all lines inside the edge bounds
|
|
904
|
-
const intersectionPoints = [];
|
|
905
|
-
var n = isOpen ? vertices.length - 1 : vertices.length;
|
|
906
|
-
for (var i = 0; i < n; i++) {
|
|
907
|
-
const polyLine = new Line(vertices[i % n], vertices[(i + 1) % n]);
|
|
908
|
-
const intersection = polyLine.intersection(line);
|
|
909
|
-
// true => only inside bounds
|
|
910
|
-
// ignore last edge if open
|
|
911
|
-
if (intersection !== null &&
|
|
912
|
-
polyLine.hasPoint(intersection, true) &&
|
|
913
|
-
(!inVectorBoundsOnly || line.hasPoint(intersection, inVectorBoundsOnly))) {
|
|
914
|
-
intersectionPoints.push({ edgeIndex: i, intersection: intersection });
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
return intersectionPoints;
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
//# sourceMappingURL=Polygon.js.map
|