plotboilerplate 1.21.0 → 1.23.0
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/README.md +2 -0
- package/dist/index.esm.js +252 -77
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/plotboilerplate.browser.min.js +1 -1
- package/dist/plotboilerplate.browser.min.js.map +1 -1
- package/dist/plotboilerplate.js +522 -338
- package/dist/plotboilerplate.min.js +1 -1
- package/package.json +7 -5
- package/src/cjs/BezierPath.js.map +1 -1
- package/src/cjs/Bounds.js +1 -1
- package/src/cjs/Bounds.js.map +1 -1
- package/src/cjs/Circle.js.map +1 -1
- package/src/cjs/CircleSector.d.ts +64 -1
- package/src/cjs/CircleSector.js +121 -1
- package/src/cjs/CircleSector.js.map +1 -1
- package/src/cjs/CubicBezierCurve.js +2 -2
- package/src/cjs/CubicBezierCurve.js.map +1 -1
- package/src/cjs/Grid.js.map +1 -1
- package/src/cjs/KeyHandler.d.ts +1 -1
- package/src/cjs/KeyHandler.js +13 -13
- package/src/cjs/KeyHandler.js.map +1 -1
- package/src/cjs/Line.js +2 -0
- package/src/cjs/Line.js.map +1 -1
- package/src/cjs/MouseHandler.d.ts +2 -2
- package/src/cjs/MouseHandler.js +7 -5
- package/src/cjs/MouseHandler.js.map +1 -1
- package/src/cjs/PlotBoilerplate.d.ts +1 -1
- package/src/cjs/PlotBoilerplate.js +77 -63
- package/src/cjs/PlotBoilerplate.js.map +1 -1
- package/src/cjs/Polygon.d.ts +13 -1
- package/src/cjs/Polygon.js +30 -1
- package/src/cjs/Polygon.js.map +1 -1
- package/src/cjs/Triangle.js +1 -1
- package/src/cjs/Triangle.js.map +1 -1
- package/src/cjs/UIDGenerator.js +1 -1
- package/src/cjs/UIDGenerator.js.map +1 -1
- package/src/cjs/VEllipse.js.map +1 -1
- package/src/cjs/VEllipseSector.js +1 -1
- package/src/cjs/VEllipseSector.js.map +1 -1
- package/src/cjs/Vector.js +2 -0
- package/src/cjs/Vector.js.map +1 -1
- package/src/cjs/VertTuple.js.map +1 -1
- package/src/cjs/Vertex.d.ts +3 -2
- package/src/cjs/Vertex.js +13 -7
- package/src/cjs/Vertex.js.map +1 -1
- package/src/cjs/VertexAttr.d.ts +2 -1
- package/src/cjs/VertexAttr.js +2 -1
- package/src/cjs/VertexAttr.js.map +1 -1
- package/src/cjs/VertexListeners.d.ts +1 -1
- package/src/cjs/VertexListeners.js.map +1 -1
- package/src/cjs/draw.js +1 -1
- package/src/cjs/draw.js.map +1 -1
- package/src/cjs/drawgl.js.map +1 -1
- package/src/cjs/drawutilssvg.d.ts +17 -3
- package/src/cjs/drawutilssvg.js +97 -91
- package/src/cjs/drawutilssvg.js.map +1 -1
- package/src/cjs/geomutils.js +2 -2
- package/src/cjs/geomutils.js.map +1 -1
- package/src/cjs/index.js +5 -1
- package/src/cjs/index.js.map +1 -1
- package/src/cjs/interfaces/DrawLib.d.ts +2 -2
- package/src/cjs/interfaces/core.d.ts +3 -3
- package/src/cjs/interfaces/index.js +5 -1
- package/src/cjs/interfaces/index.js.map +1 -1
- package/src/cjs/utils/NGons.d.ts +13 -0
- package/src/cjs/utils/NGons.js +36 -0
- package/src/cjs/utils/NGons.js.map +1 -0
- package/src/cjs/utils/Params.d.ts +15 -0
- package/src/cjs/utils/Params.js +49 -0
- package/src/cjs/utils/Params.js.map +1 -0
- package/src/cjs/utils/WebColors.js.map +1 -1
- package/src/cjs/utils/WebColorsContrast.js +1 -1
- package/src/cjs/utils/WebColorsContrast.js.map +1 -1
- package/src/cjs/utils/algorithms/CatmullRomPath.js.map +1 -1
- package/src/cjs/utils/algorithms/CircleIntersections.d.ts +3 -2
- package/src/cjs/utils/algorithms/CircleIntersections.js +12 -20
- package/src/cjs/utils/algorithms/CircleIntersections.js.map +1 -1
- package/src/cjs/utils/algorithms/ContourLineDetection.d.ts +150 -0
- package/src/cjs/utils/algorithms/ContourLineDetection.js +367 -0
- package/src/cjs/utils/algorithms/ContourLineDetection.js.map +1 -0
- package/src/cjs/utils/algorithms/CubicSplinePath.js.map +1 -1
- package/src/cjs/utils/algorithms/HobbyPath.js.map +1 -1
- package/src/cjs/utils/algorithms/Metaballs.d.ts +30 -0
- package/src/cjs/utils/algorithms/Metaballs.js +114 -0
- package/src/cjs/utils/algorithms/Metaballs.js.map +1 -0
- package/src/cjs/utils/algorithms/arrayResize.d.ts +8 -0
- package/src/cjs/utils/algorithms/arrayResize.js +24 -0
- package/src/cjs/utils/algorithms/arrayResize.js.map +1 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.d.ts +21 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.js +48 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.js.map +1 -0
- package/src/cjs/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
- package/src/cjs/utils/algorithms/convexHull.js.map +1 -1
- package/src/cjs/utils/algorithms/convexPolygonIncircle.js.map +1 -1
- package/src/cjs/utils/algorithms/delaunay.js.map +1 -1
- package/src/cjs/utils/algorithms/delaunay2voronoi.js.map +1 -1
- package/src/cjs/utils/algorithms/detectPaths.js.map +1 -1
- package/src/cjs/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
- package/src/cjs/utils/algorithms/matrixFill.js +1 -1
- package/src/cjs/utils/algorithms/matrixFill.js.map +1 -1
- package/src/cjs/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
- package/src/cjs/utils/algorithms/sutherlandHodgman.js.map +1 -1
- package/src/cjs/utils/cloneVertexArray.js.map +1 -1
- package/src/cjs/utils/creategui.js +20 -12
- package/src/cjs/utils/datastructures/CircularIntervalSet.js.map +1 -1
- package/src/cjs/utils/datastructures/Color.d.ts +2 -1
- package/src/cjs/utils/datastructures/Color.js +35 -16
- package/src/cjs/utils/datastructures/Color.js.map +1 -1
- package/src/cjs/utils/datastructures/DataGrid2d.d.ts +47 -0
- package/src/cjs/utils/datastructures/DataGrid2d.js +20 -0
- package/src/cjs/utils/datastructures/DataGrid2d.js.map +1 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +65 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js +84 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js.map +1 -0
- package/src/cjs/utils/datastructures/GenericPath.d.ts +14 -3
- package/src/cjs/utils/datastructures/GenericPath.js +20 -3
- package/src/cjs/utils/datastructures/GenericPath.js.map +1 -1
- package/src/cjs/utils/datastructures/Girih.d.ts +3 -2
- package/src/cjs/utils/datastructures/Girih.js +2 -1
- package/src/cjs/utils/datastructures/Girih.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihBowtie.js +2 -0
- package/src/cjs/utils/datastructures/GirihBowtie.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihDecagon.js +2 -0
- package/src/cjs/utils/datastructures/GirihDecagon.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihHexagon.js +2 -0
- package/src/cjs/utils/datastructures/GirihHexagon.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihPenroseRhombus.js +3 -1
- package/src/cjs/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihPentagon.js +2 -0
- package/src/cjs/utils/datastructures/GirihPentagon.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihRhombus.js +2 -0
- package/src/cjs/utils/datastructures/GirihRhombus.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihTile.js +4 -2
- package/src/cjs/utils/datastructures/GirihTile.js.map +1 -1
- package/src/cjs/utils/datastructures/Matrix4x4.js.map +1 -1
- package/src/cjs/utils/datastructures/VoronoiCell.js.map +1 -1
- package/src/cjs/utils/datastructures/interfaces.d.ts +3 -3
- package/src/cjs/utils/detectDarkMode.js.map +1 -1
- package/src/cjs/utils/dom/getAvailableContainerSpace.js +1 -1
- package/src/cjs/utils/dom/getAvailableContainerSpace.js.map +1 -1
- package/src/cjs/utils/findInVertexArray.js.map +1 -1
- package/src/cjs/utils/gup.d.ts +8 -0
- package/src/cjs/utils/gup.js +8 -0
- package/src/cjs/utils/gup.js.map +1 -1
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.js +3 -2
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
- package/src/cjs/utils/helpers/CircleHelper.d.ts +38 -3
- package/src/cjs/utils/helpers/CircleHelper.js +51 -11
- package/src/cjs/utils/helpers/CircleHelper.js.map +1 -1
- package/src/cjs/utils/helpers/CircleSectorHelper.d.ts +47 -1
- package/src/cjs/utils/helpers/CircleSectorHelper.js +85 -14
- package/src/cjs/utils/helpers/CircleSectorHelper.js.map +1 -1
- package/src/cjs/utils/io/FileDrop.d.ts +3 -3
- package/src/cjs/utils/io/FileDrop.js.map +1 -1
- package/src/cjs/utils/parsers/OBJParser.d.ts +2 -2
- package/src/cjs/utils/parsers/OBJParser.js.map +1 -1
- package/src/cjs/utils/parsers/STLParser.d.ts +4 -3
- package/src/cjs/utils/parsers/STLParser.js +62 -12
- package/src/cjs/utils/parsers/STLParser.js.map +1 -1
- package/src/cjs/utils/parsers/svg/parseSVGPathData.js +1 -1
- package/src/cjs/utils/parsers/svg/parseSVGPathData.js.map +1 -1
- package/src/cjs/utils/parsers/svg/splitSVGPathData.js.map +1 -1
- package/src/cjs/utils/parsers/svg/types.d.ts +13 -13
- package/src/createDemoDrawables.js +48 -3
- package/src/esm/BezierPath.js.map +1 -1
- package/src/esm/Bounds.js.map +1 -1
- package/src/esm/Circle.js.map +1 -1
- package/src/esm/CircleSector.d.ts +64 -1
- package/src/esm/CircleSector.js +121 -1
- package/src/esm/CircleSector.js.map +1 -1
- package/src/esm/CubicBezierCurve.js.map +1 -1
- package/src/esm/Grid.js.map +1 -1
- package/src/esm/KeyHandler.d.ts +1 -1
- package/src/esm/KeyHandler.js +13 -13
- package/src/esm/KeyHandler.js.map +1 -1
- package/src/esm/Line.js.map +1 -1
- package/src/esm/MouseHandler.d.ts +2 -2
- package/src/esm/MouseHandler.js +4 -4
- package/src/esm/MouseHandler.js.map +1 -1
- package/src/esm/PlotBoilerplate.d.ts +1 -1
- package/src/esm/PlotBoilerplate.js +43 -29
- package/src/esm/PlotBoilerplate.js.map +1 -1
- package/src/esm/Polygon.d.ts +13 -1
- package/src/esm/Polygon.js +30 -1
- package/src/esm/Polygon.js.map +1 -1
- package/src/esm/Triangle.js.map +1 -1
- package/src/esm/VEllipse.js.map +1 -1
- package/src/esm/VEllipseSector.js +1 -1
- package/src/esm/VEllipseSector.js.map +1 -1
- package/src/esm/Vector.js.map +1 -1
- package/src/esm/VertTuple.js.map +1 -1
- package/src/esm/Vertex.d.ts +3 -2
- package/src/esm/Vertex.js +9 -3
- package/src/esm/Vertex.js.map +1 -1
- package/src/esm/VertexAttr.d.ts +2 -1
- package/src/esm/VertexAttr.js +2 -1
- package/src/esm/VertexAttr.js.map +1 -1
- package/src/esm/VertexListeners.d.ts +1 -1
- package/src/esm/VertexListeners.js.map +1 -1
- package/src/esm/draw.js.map +1 -1
- package/src/esm/drawgl.js.map +1 -1
- package/src/esm/drawutilssvg.d.ts +17 -3
- package/src/esm/drawutilssvg.js +28 -22
- package/src/esm/drawutilssvg.js.map +1 -1
- package/src/esm/geomutils.js +2 -2
- package/src/esm/geomutils.js.map +1 -1
- package/src/esm/interfaces/DrawLib.d.ts +2 -2
- package/src/esm/interfaces/core.d.ts +3 -3
- package/src/esm/utils/NGons.d.ts +13 -0
- package/src/esm/utils/NGons.js +33 -0
- package/src/esm/utils/NGons.js.map +1 -0
- package/src/esm/utils/Params.d.ts +15 -0
- package/src/esm/utils/Params.js +44 -0
- package/src/esm/utils/Params.js.map +1 -0
- package/src/esm/utils/WebColors.js.map +1 -1
- package/src/esm/utils/algorithms/CatmullRomPath.js.map +1 -1
- package/src/esm/utils/algorithms/CircleIntersections.d.ts +3 -2
- package/src/esm/utils/algorithms/CircleIntersections.js +11 -19
- package/src/esm/utils/algorithms/CircleIntersections.js.map +1 -1
- package/src/esm/utils/algorithms/ContourLineDetection.d.ts +150 -0
- package/src/esm/utils/algorithms/ContourLineDetection.js +362 -0
- package/src/esm/utils/algorithms/ContourLineDetection.js.map +1 -0
- package/src/esm/utils/algorithms/CubicSplinePath.js.map +1 -1
- package/src/esm/utils/algorithms/HobbyPath.js.map +1 -1
- package/src/esm/utils/algorithms/Metaballs.d.ts +30 -0
- package/src/esm/utils/algorithms/Metaballs.js +109 -0
- package/src/esm/utils/algorithms/Metaballs.js.map +1 -0
- package/src/esm/utils/algorithms/arrayResize.d.ts +8 -0
- package/src/esm/utils/algorithms/arrayResize.js +20 -0
- package/src/esm/utils/algorithms/arrayResize.js.map +1 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.d.ts +21 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.js +44 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.js.map +1 -0
- package/src/esm/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
- package/src/esm/utils/algorithms/convexHull.js.map +1 -1
- package/src/esm/utils/algorithms/convexPolygonIncircle.js.map +1 -1
- package/src/esm/utils/algorithms/delaunay.js.map +1 -1
- package/src/esm/utils/algorithms/delaunay2voronoi.js.map +1 -1
- package/src/esm/utils/algorithms/detectPaths.js.map +1 -1
- package/src/esm/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
- package/src/esm/utils/algorithms/matrixFill.js.map +1 -1
- package/src/esm/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
- package/src/esm/utils/algorithms/sutherlandHodgman.js.map +1 -1
- package/src/esm/utils/cloneVertexArray.js.map +1 -1
- package/src/esm/utils/datastructures/CircularIntervalSet.js.map +1 -1
- package/src/esm/utils/datastructures/Color.d.ts +2 -1
- package/src/esm/utils/datastructures/Color.js +33 -14
- package/src/esm/utils/datastructures/Color.js.map +1 -1
- package/src/esm/utils/datastructures/DataGrid2d.d.ts +47 -0
- package/src/esm/utils/datastructures/DataGrid2d.js +19 -0
- package/src/esm/utils/datastructures/DataGrid2d.js.map +1 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.d.ts +65 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.js +79 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.js.map +1 -0
- package/src/esm/utils/datastructures/GenericPath.d.ts +14 -3
- package/src/esm/utils/datastructures/GenericPath.js +20 -3
- package/src/esm/utils/datastructures/GenericPath.js.map +1 -1
- package/src/esm/utils/datastructures/Girih.d.ts +3 -2
- package/src/esm/utils/datastructures/Girih.js +2 -1
- package/src/esm/utils/datastructures/Girih.js.map +1 -1
- package/src/esm/utils/datastructures/GirihBowtie.js.map +1 -1
- package/src/esm/utils/datastructures/GirihDecagon.js.map +1 -1
- package/src/esm/utils/datastructures/GirihHexagon.js.map +1 -1
- package/src/esm/utils/datastructures/GirihPenroseRhombus.js +1 -1
- package/src/esm/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
- package/src/esm/utils/datastructures/GirihPentagon.js.map +1 -1
- package/src/esm/utils/datastructures/GirihRhombus.js.map +1 -1
- package/src/esm/utils/datastructures/GirihTile.js.map +1 -1
- package/src/esm/utils/datastructures/Matrix4x4.js.map +1 -1
- package/src/esm/utils/datastructures/VoronoiCell.js.map +1 -1
- package/src/esm/utils/datastructures/interfaces.d.ts +3 -3
- package/src/esm/utils/detectDarkMode.js.map +1 -1
- package/src/esm/utils/findInVertexArray.js.map +1 -1
- package/src/esm/utils/gup.d.ts +8 -0
- package/src/esm/utils/gup.js +8 -0
- package/src/esm/utils/gup.js.map +1 -1
- package/src/esm/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
- package/src/esm/utils/helpers/BezierPathInteractionHelper.js +3 -2
- package/src/esm/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
- package/src/esm/utils/helpers/CircleHelper.d.ts +38 -3
- package/src/esm/utils/helpers/CircleHelper.js +51 -11
- package/src/esm/utils/helpers/CircleHelper.js.map +1 -1
- package/src/esm/utils/helpers/CircleSectorHelper.d.ts +47 -1
- package/src/esm/utils/helpers/CircleSectorHelper.js +85 -14
- package/src/esm/utils/helpers/CircleSectorHelper.js.map +1 -1
- package/src/esm/utils/io/FileDrop.d.ts +3 -3
- package/src/esm/utils/io/FileDrop.js.map +1 -1
- package/src/esm/utils/parsers/OBJParser.d.ts +2 -2
- package/src/esm/utils/parsers/OBJParser.js.map +1 -1
- package/src/esm/utils/parsers/STLParser.d.ts +4 -3
- package/src/esm/utils/parsers/STLParser.js +63 -13
- package/src/esm/utils/parsers/STLParser.js.map +1 -1
- package/src/esm/utils/parsers/svg/parseSVGPathData.js.map +1 -1
- package/src/esm/utils/parsers/svg/splitSVGPathData.js.map +1 -1
- package/src/esm/utils/parsers/svg/types.d.ts +13 -13
- package/src/index-gl.js +77 -85
- package/src/index.js +124 -129
- package/src/ts/CircleSector.ts +134 -3
- package/src/ts/PlotBoilerplate.ts +20 -11
- package/src/ts/Polygon.ts +31 -1
- package/src/ts/Vertex.ts +8 -3
- package/src/ts/VertexAttr.ts +3 -2
- package/src/ts/drawutilssvg.ts +38 -25
- package/src/ts/geomutils.ts +60 -64
- package/src/ts/interfaces/DrawLib.ts +0 -15
- package/src/ts/utils/NGons.ts +35 -0
- package/src/ts/utils/Params.ts +47 -0
- package/src/ts/utils/algorithms/CircleIntersections.ts +280 -288
- package/src/ts/utils/algorithms/ContourLineDetection.ts +485 -0
- package/src/ts/utils/algorithms/Metaballs.ts +144 -0
- package/src/ts/utils/algorithms/arrayResize.ts +22 -0
- package/src/ts/utils/algorithms/clearDuplicateVertices.ts +49 -0
- package/src/ts/utils/datastructures/Color.ts +39 -15
- package/src/ts/utils/datastructures/DataGrid2d.ts +54 -0
- package/src/ts/utils/datastructures/DataGrid2dListAdapter.ts +121 -0
- package/src/ts/utils/datastructures/GenericPath.ts +21 -3
- package/src/ts/utils/datastructures/Girih.ts +9 -8
- package/src/ts/utils/gup.ts +10 -2
- package/src/ts/utils/helpers/BezierPathInteractionHelper.ts +9 -8
- package/src/ts/utils/helpers/CircleHelper.ts +70 -22
- package/src/ts/utils/helpers/CircleSectorHelper.ts +101 -17
- package/src/ts/utils/parsers/STLParser.ts +50 -16
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @author Ikaros Kappler
|
|
4
4
|
* @date 2020-10-05
|
|
5
5
|
* @modified 2021-02-08 Fixed a lot of es2015 compatibility issues.
|
|
6
|
-
* @
|
|
6
|
+
* @modified 2024-02-23 Fixed some null-type conflicts.
|
|
7
|
+
* @version 1.0.2
|
|
7
8
|
* @file CircleIntersections
|
|
8
9
|
* @public
|
|
9
10
|
**/
|
|
@@ -52,7 +53,7 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
52
53
|
for (var i = 0; i < intervalSets.length; i++) {
|
|
53
54
|
maxSetLength = Math.max(maxSetLength, intervalSets[i].intervals.length);
|
|
54
55
|
}
|
|
55
|
-
var usedIntervals = matrixFill_1.matrixFill(intervalSets.length, maxSetLength, false);
|
|
56
|
+
var usedIntervals = (0, matrixFill_1.matrixFill)(intervalSets.length, maxSetLength, false);
|
|
56
57
|
var path = null;
|
|
57
58
|
var pathList = [];
|
|
58
59
|
while ((path = CircleIntersections.findOuterPartition(circles, intervalSets, usedIntervals)) != null) {
|
|
@@ -60,7 +61,6 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
60
61
|
}
|
|
61
62
|
return pathList;
|
|
62
63
|
};
|
|
63
|
-
;
|
|
64
64
|
/**
|
|
65
65
|
* Find all connected outer path partitions (as CircleSectors).
|
|
66
66
|
*
|
|
@@ -88,7 +88,6 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
88
88
|
} // END for
|
|
89
89
|
return partitionsAsArcs;
|
|
90
90
|
};
|
|
91
|
-
;
|
|
92
91
|
/**
|
|
93
92
|
* Build the n*n intersection matrix: contains the radical line at (i,j) if circle i and circle j do intersect;
|
|
94
93
|
* conatins null at (i,j) otherwise.
|
|
@@ -107,8 +106,9 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
107
106
|
CircleIntersections.buildRadicalLineMatrix = function (circles) {
|
|
108
107
|
var radicalLines = [];
|
|
109
108
|
for (var i = 0; i < circles.length; i++) {
|
|
110
|
-
if (!radicalLines[i])
|
|
111
|
-
radicalLines[i] = arrayFill_1.arrayFill(circles.length, null);
|
|
109
|
+
if (!radicalLines[i]) {
|
|
110
|
+
radicalLines[i] = (0, arrayFill_1.arrayFill)(circles.length, null);
|
|
111
|
+
}
|
|
112
112
|
for (var j = 0; j < circles.length; j++) {
|
|
113
113
|
if (i == j)
|
|
114
114
|
continue;
|
|
@@ -116,17 +116,18 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
116
116
|
continue;
|
|
117
117
|
radicalLines[i][j] = circles[i].circleIntersection(circles[j]);
|
|
118
118
|
// Build symmetrical matrix
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
var tmpRadLine = radicalLines[i][j];
|
|
120
|
+
if (tmpRadLine) {
|
|
121
|
+
if (!radicalLines[j]) {
|
|
122
|
+
radicalLines[j] = (0, arrayFill_1.arrayFill)(circles.length, null);
|
|
123
|
+
}
|
|
122
124
|
// Use reverse line
|
|
123
|
-
radicalLines[j][i] = new Line_1.Line(
|
|
125
|
+
radicalLines[j][i] = new Line_1.Line(tmpRadLine.b, tmpRadLine.a);
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
return radicalLines;
|
|
128
130
|
};
|
|
129
|
-
;
|
|
130
131
|
/**
|
|
131
132
|
* Find all circles (indices) which are completely located inside another circle.
|
|
132
133
|
*
|
|
@@ -151,7 +152,6 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
151
152
|
}
|
|
152
153
|
return innerCircleIndices;
|
|
153
154
|
};
|
|
154
|
-
;
|
|
155
155
|
/**
|
|
156
156
|
* Calculate all outer circle intervals (sections that belong to the outermost line), dermined by the given
|
|
157
157
|
* circles and their radical lines.
|
|
@@ -183,7 +183,6 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
183
183
|
}
|
|
184
184
|
return intervalSets;
|
|
185
185
|
};
|
|
186
|
-
;
|
|
187
186
|
/**
|
|
188
187
|
* Calculate the next connected partition from the given set of circles and outer path intervals. The function
|
|
189
188
|
* will pick a random unused circle interval and detect all adjacent intervals until a closed partition
|
|
@@ -210,10 +209,8 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
210
209
|
usedIntervals[intLocation.i][intLocation.j] = true;
|
|
211
210
|
intLocation = CircleIntersections.findAdjacentInterval(circles, intLocation, intervalSets, usedIntervals, 0.001);
|
|
212
211
|
}
|
|
213
|
-
;
|
|
214
212
|
return path.length == 0 ? null : path;
|
|
215
213
|
};
|
|
216
|
-
;
|
|
217
214
|
/**
|
|
218
215
|
* Convert a radical line (belonging to a circle) into an interval: start angle and end angle.
|
|
219
216
|
*
|
|
@@ -239,7 +236,6 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
239
236
|
angleB = Math.PI * 2 + angleB;
|
|
240
237
|
return [angleA, angleB];
|
|
241
238
|
};
|
|
242
|
-
;
|
|
243
239
|
/**
|
|
244
240
|
* This is a helper fuction used by `findOuterCircleIntervals`.
|
|
245
241
|
*
|
|
@@ -258,7 +254,6 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
258
254
|
var interval = CircleIntersections.radicalLineToInterval(circle, radicalLine);
|
|
259
255
|
intervalSet.intersect(interval[1], interval[0]);
|
|
260
256
|
};
|
|
261
|
-
;
|
|
262
257
|
/**
|
|
263
258
|
* Pick a random unused circle interval. This function is used by the `findOuterPartition` function, which
|
|
264
259
|
* starts the detection with any random section.
|
|
@@ -281,7 +276,6 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
281
276
|
}
|
|
282
277
|
return null;
|
|
283
278
|
};
|
|
284
|
-
;
|
|
285
279
|
/**
|
|
286
280
|
* Find the next adjacent circle interval for the given interval.
|
|
287
281
|
* starts the detection with any random section.
|
|
@@ -310,9 +304,7 @@ var CircleIntersections = /** @class */ (function () {
|
|
|
310
304
|
}
|
|
311
305
|
return null;
|
|
312
306
|
};
|
|
313
|
-
;
|
|
314
307
|
return CircleIntersections;
|
|
315
308
|
}());
|
|
316
309
|
exports.CircleIntersections = CircleIntersections;
|
|
317
|
-
;
|
|
318
310
|
//# sourceMappingURL=CircleIntersections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircleIntersections.js","sourceRoot":"","sources":["../../../ts/utils/algorithms/CircleIntersections.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"CircleIntersections.js","sourceRoot":"","sources":["../../../ts/utils/algorithms/CircleIntersections.ts"],"names":[],"mappings":";AAAA;;;;;;;;IAQI;;;AAEJ,yCAAwC;AACxC,2CAA0C;AAE1C,mDAAkD;AAClD,mCAAkC;AAClC,6EAA4E;AAG5E;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAA;IAoSA,CAAC;IAnSC;;;;;;;;;QASI;IACG,uCAAmB,GAA1B,UAA2B,OAAsB,EAAE,YAAwC;QACzF,0EAA0E;QAC1E,sDAAsD;QACtD,IAAI,YAAY,GAAW,CAAC,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1E,CAAC;QACD,IAAM,aAAa,GAAoB,IAAA,uBAAU,EAAU,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;QAErG,IAAI,IAAI,GAA4B,IAAI,CAAC;QACzC,IAAI,QAAQ,GAA4B,EAAE,CAAC;QAC3C,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAA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AEf,IAAI,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACvE,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAChE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC1D,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACjC,SAAS;gBACX,CAAC;gBACD,IAAI,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBAC5C,IAAI,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,IAAI,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,OAAO;oBAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YACxE,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACH,0BAAC;AAAD,CAAC,AApSD,IAoSC;AApSY,kDAAmB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function to detect contour lines from 3D terrain data.
|
|
3
|
+
*
|
|
4
|
+
* For usage see demo `./demos/48-contour-plot`.
|
|
5
|
+
*
|
|
6
|
+
* @requires detectPaths
|
|
7
|
+
* @requires GenericPath
|
|
8
|
+
* @author Ikaros Kappler
|
|
9
|
+
* @date 2023-11-05
|
|
10
|
+
* @modified 2023-11-20 Addig path detection on a triangle based grid.
|
|
11
|
+
* @version 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
import { Line } from "../../Line";
|
|
14
|
+
import { IDataGrid2d } from "../datastructures/DataGrid2d";
|
|
15
|
+
import { GenericPath } from "../datastructures/GenericPath";
|
|
16
|
+
export declare class ContourLineDetection {
|
|
17
|
+
private dataGrid;
|
|
18
|
+
private rawLinearPathSegments;
|
|
19
|
+
static CLOSE_GAP_TYPE_NONE: number;
|
|
20
|
+
static CLOSE_GAP_TYPE_ABOVE: number;
|
|
21
|
+
static CLOSE_GAP_TYPE_BELOW: number;
|
|
22
|
+
debugMode: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new instance for calculating contour lines from the given data grid.
|
|
25
|
+
* @param {IDataGrid2d<number>} dataGrid - The data grid to use. Must not contain any NaN or null values.
|
|
26
|
+
* @param {boolean=?} debugMode - (optional) Pass `true` to log warnings on (rare) critical edge cases where the algorithm might fail.
|
|
27
|
+
*/
|
|
28
|
+
constructor(dataGrid: IDataGrid2d<number>, debugMode?: boolean);
|
|
29
|
+
/**
|
|
30
|
+
* Detect contour paths from the underlying data source.
|
|
31
|
+
*
|
|
32
|
+
* @param {number} criticalHeightValue - The height value. If above data's maximum or below data's minimum then the result will be empty (no intersections).
|
|
33
|
+
* @param {number} options.closeGapType - `CLOSE_GAP_TYPE_NONE` or `CLOSE_GAP_TYPE_ABOVE` or `CLOSE_GAP_TYPE_BELOW`.
|
|
34
|
+
* @param {boolean=false} options.useTriangles - If set to true the detection will split each face3 quad into two triangle faces.
|
|
35
|
+
* @param {pathDetectEpsilon=0.000001} options.pathDetectEpsilon - (optional) The epsilon to tell if two points are located 'in the same place'. Used for connected path detection. If not specified the value `0.0000001` is used.
|
|
36
|
+
* @param {pointEliminationEpsilon=0.0000001} options.pointEliminationEpsilon - (optional) The epsilon for duplicate point elimination (default is 0.000001).
|
|
37
|
+
* @param {function?} onRawSegmentsDetected - (optional) Get the interim result of all detected single lines before path detection starts; DO NOT MODIFY the array.
|
|
38
|
+
* @returns {Array<GenericPath>} - A list of connected paths that resemble the contour lines of the data/terrain at the given height value.
|
|
39
|
+
*/
|
|
40
|
+
detectContourPaths(criticalHeightValue: number, options?: {
|
|
41
|
+
closeGapType: number;
|
|
42
|
+
useTriangles?: boolean;
|
|
43
|
+
pointEliminationEpsilon?: number;
|
|
44
|
+
pathDetectEpsilon?: number;
|
|
45
|
+
onRawSegmentsDetected?: (rawSegmentsDoNotModifiy: Array<Line>) => void;
|
|
46
|
+
}): Array<GenericPath>;
|
|
47
|
+
/**
|
|
48
|
+
* This function will calculate a single intersecion line of the given face4 data
|
|
49
|
+
* segment. If the given face does not intersect with the plane at the given `heightValue`
|
|
50
|
+
* then no segments will be stored.
|
|
51
|
+
*
|
|
52
|
+
* @param {number} xIndex - The x position (index) of the data face.
|
|
53
|
+
* @param {number} yIndex - The y position (index) of the data face.
|
|
54
|
+
* @param {[[number,number],[number,number]]} heightFace - The data sample that composes the face4 as a two-dimensional number array.
|
|
55
|
+
* @param {number} heightValue - The height value of the intersection plane to check for.
|
|
56
|
+
* @returns {Line|null}
|
|
57
|
+
*/
|
|
58
|
+
private findHeight4FaceIntersectionLine;
|
|
59
|
+
/**
|
|
60
|
+
* This function will calculate a single intersecion line of the given face4 data
|
|
61
|
+
* segment. If the given face does not intersect with the plane at the given `heightValue`
|
|
62
|
+
* then no segments will be stored.
|
|
63
|
+
*
|
|
64
|
+
* @param {number} xIndex - The x position (index) of the data face.
|
|
65
|
+
* @param {number} yIndex - The y position (index) of the data face.
|
|
66
|
+
* @param {[[number,number],[number,number]]} heightFace - The data sample that composes the face4 as a two-dimensional number array.
|
|
67
|
+
* @param {number} heightValue - The height value of the intersection plane to check for.
|
|
68
|
+
* @returns {Line|null}
|
|
69
|
+
*/
|
|
70
|
+
private findHeightFaceIntersectionLines;
|
|
71
|
+
/**
|
|
72
|
+
* This function will calculate a single intersecion line of the given face3 data
|
|
73
|
+
* segment. If the given face does not intersect with the plane at the given `heightValue`
|
|
74
|
+
* then no segments will be stored.
|
|
75
|
+
*
|
|
76
|
+
* @param {number} xIndexA - The x position (index) of the first triangle data point.
|
|
77
|
+
* @param {number} yIndexA - The y position (index) of the first triangle data point.
|
|
78
|
+
* @param {[[number,number],[number,number]]} heightFace - The data sample that composes the face4 as a two-dimensional number array.
|
|
79
|
+
* @param {number} heightValue - The height value of the intersection plane to check for.
|
|
80
|
+
* @returns {Line|null}
|
|
81
|
+
*/
|
|
82
|
+
private findHeighteFace3IntersectionLine;
|
|
83
|
+
/**
|
|
84
|
+
* This procedure will look at the face4 at the ((x,y),(nextX,nextY)) position – which are four values –
|
|
85
|
+
* and determines the local contour lines for these cases.
|
|
86
|
+
*
|
|
87
|
+
* This is used to detect and calculate edge cases on the borders of the underliying height data:
|
|
88
|
+
* * left and right border (x=0, x=data.xSegmentCount)
|
|
89
|
+
* * top and bottom border (x=y, x=data.ySegmentCount)
|
|
90
|
+
*
|
|
91
|
+
* Resulting path segments will be stored in the global `rawLinearPathSegments` array for further processing.
|
|
92
|
+
*
|
|
93
|
+
* @param {number} x
|
|
94
|
+
* @param {number} y
|
|
95
|
+
* @param {number} nextX
|
|
96
|
+
* @param {number} nextY
|
|
97
|
+
* @param {number} criticalHeightValue
|
|
98
|
+
* @param {number} closeGapType - CLOSE_GAP_TYPE_ABOVE or CLOSE_GAP_TYPE_BELOW.
|
|
99
|
+
* @return {void}
|
|
100
|
+
*/
|
|
101
|
+
detectAboveBelowLerpSegment(x: number, y: number, nextX: number, nextY: number, criticalHeightValue: number, closeGapType: number): void;
|
|
102
|
+
/**
|
|
103
|
+
* Checks if both value are on the same side of the critical value (above or below). The `closeGapType`
|
|
104
|
+
* indictes if `CLOSE_GAP_TYPE_BELOW` or `CLOSE_GAP_TYPE_ABOVE` should be used as a rule.
|
|
105
|
+
*
|
|
106
|
+
* @param {number} valueA
|
|
107
|
+
* @param {number} valueB
|
|
108
|
+
* @param {number} criticalValue
|
|
109
|
+
* @param {number} closeGapType
|
|
110
|
+
* @returns {boolean}
|
|
111
|
+
*/
|
|
112
|
+
private areBothValuesOnRequiredPlaneSide;
|
|
113
|
+
/**
|
|
114
|
+
* Test if a given numeric value (`curValue`) is between the given values `valA` and `valB`.
|
|
115
|
+
* Value A and B don't need to be in ascending order, so `valA <= curValue <= valB` and `valB <= curvalue <= valA`
|
|
116
|
+
* will do the job.
|
|
117
|
+
*
|
|
118
|
+
* @param {number} valA - The first of the two bounds.
|
|
119
|
+
* @param {number} valB - The second of the two bounds.
|
|
120
|
+
* @param {number} curValue - The value to check if it is between (or equal) to the given bounds.
|
|
121
|
+
* @returns {boolean}
|
|
122
|
+
*/
|
|
123
|
+
private isBetween;
|
|
124
|
+
/**
|
|
125
|
+
* Get a 'lerp' value - which is some sort of percentage/ratio for the `curValue` inside the
|
|
126
|
+
* range of the given interval `[valA ... valB]`.
|
|
127
|
+
*
|
|
128
|
+
* Examples:
|
|
129
|
+
* * getLerpRatio(0,100,50) === 0.5
|
|
130
|
+
* * getLerpRatio(50,100,75) === 0.5
|
|
131
|
+
* * getLerpRatio(0,100,0) === 0.0
|
|
132
|
+
* * getLerpRatio(0,100,100) === 1.0
|
|
133
|
+
* * getLerpRatio(0,100,-50) === -0.5
|
|
134
|
+
*
|
|
135
|
+
* @param {number} valA
|
|
136
|
+
* @param {number} valB
|
|
137
|
+
* @param {number} curValue
|
|
138
|
+
* @returns
|
|
139
|
+
*/
|
|
140
|
+
private getLerpRatio;
|
|
141
|
+
/**
|
|
142
|
+
* Helper function to lerp a numeric value.
|
|
143
|
+
*
|
|
144
|
+
* @param {number} min - The min (start) value. Doesn't necesarily need to be the smaller one.
|
|
145
|
+
* @param {number} max - The max (end) value. Doesn't necesarily need to be the larger one.
|
|
146
|
+
* @param {number} ratio - The lerp ratio; usually a value between 0.0 and 1.0, but other values a valid for linear interpolation, too.
|
|
147
|
+
* @returns {number}
|
|
148
|
+
*/
|
|
149
|
+
private lerp;
|
|
150
|
+
}
|