plotboilerplate 1.26.0 → 1.27.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.
Files changed (95) hide show
  1. package/README.md +2 -0
  2. package/dist/index.esm.js +11203 -160
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.esm.min.js +1 -1
  5. package/dist/index.esm.min.js.map +1 -1
  6. package/dist/plotboilerplate.browser.min.js +1 -1
  7. package/dist/plotboilerplate.browser.min.js.map +1 -1
  8. package/dist/plotboilerplate.js +33 -11
  9. package/dist/plotboilerplate.min.js +1 -1
  10. package/package.json +6 -2
  11. package/src/cjs/PlotBoilerplate.d.ts +4 -3
  12. package/src/cjs/PlotBoilerplate.js +2 -1
  13. package/src/cjs/PlotBoilerplate.js.map +1 -1
  14. package/src/cjs/draw.d.ts +4 -2
  15. package/src/cjs/draw.js +9 -4
  16. package/src/cjs/draw.js.map +1 -1
  17. package/src/cjs/drawgl.d.ts +3 -2
  18. package/src/cjs/drawgl.js +2 -1
  19. package/src/cjs/drawgl.js.map +1 -1
  20. package/src/cjs/drawutilssvg.d.ts +9 -4
  21. package/src/cjs/drawutilssvg.js +20 -5
  22. package/src/cjs/drawutilssvg.js.map +1 -1
  23. package/src/cjs/index.d.ts +75 -0
  24. package/src/cjs/index.js +84 -0
  25. package/src/cjs/index.js.map +1 -1
  26. package/src/cjs/interfaces/DrawLib.d.ts +2 -0
  27. package/src/cjs/interfaces/DrawLib.js +1 -0
  28. package/src/cjs/interfaces/DrawLib.js.map +1 -1
  29. package/src/cjs/utils/WebColors.d.ts +2 -1
  30. package/src/cjs/utils/WebColors.js +14 -25
  31. package/src/cjs/utils/WebColors.js.map +1 -1
  32. package/src/cjs/utils/WebColorsContrast.d.ts +1 -1
  33. package/src/cjs/utils/algorithms/PolygonTesselationOutlines.d.ts +145 -0
  34. package/src/cjs/utils/algorithms/PolygonTesselationOutlines.js +269 -0
  35. package/src/cjs/utils/algorithms/PolygonTesselationOutlines.js.map +1 -0
  36. package/src/cjs/utils/datastructures/Color.js +0 -19
  37. package/src/cjs/utils/datastructures/Color.js.map +1 -1
  38. package/src/cjs/utils/datastructures/ColorGradient.d.ts +2 -0
  39. package/src/cjs/utils/datastructures/ColorGradient.js +5 -0
  40. package/src/cjs/utils/datastructures/ColorGradient.js.map +1 -1
  41. package/src/cjs/utils/datastructures/Girih.d.ts +38 -1
  42. package/src/cjs/utils/datastructures/Girih.js +71 -1
  43. package/src/cjs/utils/datastructures/Girih.js.map +1 -1
  44. package/src/cjs/utils/io/FileDrop.d.ts +2 -0
  45. package/src/cjs/utils/io/FileDrop.js +4 -0
  46. package/src/cjs/utils/io/FileDrop.js.map +1 -1
  47. package/src/esm/PlotBoilerplate.d.ts +4 -3
  48. package/src/esm/PlotBoilerplate.js +2 -1
  49. package/src/esm/PlotBoilerplate.js.map +1 -1
  50. package/src/esm/draw.d.ts +4 -2
  51. package/src/esm/draw.js +9 -4
  52. package/src/esm/draw.js.map +1 -1
  53. package/src/esm/drawgl.d.ts +3 -2
  54. package/src/esm/drawgl.js +2 -1
  55. package/src/esm/drawgl.js.map +1 -1
  56. package/src/esm/drawutilssvg.d.ts +9 -4
  57. package/src/esm/drawutilssvg.js +20 -5
  58. package/src/esm/drawutilssvg.js.map +1 -1
  59. package/src/esm/index.d.ts +75 -0
  60. package/src/esm/index.js +84 -0
  61. package/src/esm/index.js.map +1 -1
  62. package/src/esm/interfaces/DrawLib.d.ts +2 -0
  63. package/src/esm/interfaces/DrawLib.js +1 -0
  64. package/src/esm/interfaces/DrawLib.js.map +1 -1
  65. package/src/esm/utils/WebColors.d.ts +2 -1
  66. package/src/esm/utils/WebColors.js +14 -25
  67. package/src/esm/utils/WebColors.js.map +1 -1
  68. package/src/esm/utils/WebColorsContrast.d.ts +1 -1
  69. package/src/esm/utils/algorithms/PolygonTesselationOutlines.d.ts +145 -0
  70. package/src/esm/utils/algorithms/PolygonTesselationOutlines.js +262 -0
  71. package/src/esm/utils/algorithms/PolygonTesselationOutlines.js.map +1 -0
  72. package/src/esm/utils/datastructures/Color.js +0 -19
  73. package/src/esm/utils/datastructures/Color.js.map +1 -1
  74. package/src/esm/utils/datastructures/ColorGradient.d.ts +2 -0
  75. package/src/esm/utils/datastructures/ColorGradient.js +5 -0
  76. package/src/esm/utils/datastructures/ColorGradient.js.map +1 -1
  77. package/src/esm/utils/datastructures/Girih.d.ts +38 -1
  78. package/src/esm/utils/datastructures/Girih.js +71 -1
  79. package/src/esm/utils/datastructures/Girih.js.map +1 -1
  80. package/src/esm/utils/io/FileDrop.d.ts +2 -0
  81. package/src/esm/utils/io/FileDrop.js +4 -0
  82. package/src/esm/utils/io/FileDrop.js.map +1 -1
  83. package/src/ts/PlotBoilerplate.ts +4 -3
  84. package/src/ts/draw.ts +8 -3
  85. package/src/ts/drawgl.ts +3 -2
  86. package/src/ts/drawutilssvg.ts +27 -5
  87. package/src/ts/index.ts +94 -0
  88. package/src/ts/interfaces/DrawLib.ts +3 -0
  89. package/src/ts/utils/WebColors.ts +20 -33
  90. package/src/ts/utils/algorithms/PolygonTesselationOutlines.ts +296 -0
  91. package/src/ts/utils/datastructures/Color.ts +0 -19
  92. package/src/ts/utils/datastructures/ColorGradient.ts +6 -0
  93. package/src/ts/utils/datastructures/Girih.ts +78 -1
  94. package/src/ts/utils/datastructures/interfaces.ts +4 -4
  95. package/src/ts/utils/io/FileDrop.ts +5 -0
@@ -25,3 +25,78 @@ export * from "./Vertex";
25
25
  export * from "./VertexAttr";
26
26
  export * from "./VertexListeners";
27
27
  export * from "./VertTuple";
28
+ export * from "./utils/cloneVertexArray";
29
+ export * from "./utils/createRandomizedPolygon";
30
+ export * from "./utils/detectDarkMode";
31
+ export * from "./utils/findInVertexArray";
32
+ export * from "./utils/gup";
33
+ export * from "./utils/InitializationObserver";
34
+ export * from "./utils/LissajousFigure";
35
+ export * from "./utils/NGons";
36
+ export * from "./utils/Params";
37
+ export * from "./utils/PerlinNoise";
38
+ export * from "./utils/SVGPathUtils";
39
+ export * from "./utils/WebColors";
40
+ export * from "./utils/WebColorsContrast";
41
+ export * from "./utils/WebColorsMalachite";
42
+ export * from "./utils/algorithms/arrayFill";
43
+ export * from "./utils/algorithms/arrayResize";
44
+ export * from "./utils/algorithms/arrayShuffle";
45
+ export * from "./utils/algorithms/CatmullRomPath";
46
+ export * from "./utils/algorithms/CircleIntersections";
47
+ export * from "./utils/algorithms/clearDuplicateVertices";
48
+ export * from "./utils/algorithms/clearPolygonDuplicateVertices";
49
+ export * from "./utils/algorithms/ContourLineDetection";
50
+ export * from "./utils/algorithms/convexHull";
51
+ export * from "./utils/algorithms/convexPolygonIncircle";
52
+ export * from "./utils/algorithms/CubicSplinePath";
53
+ export * from "./utils/algorithms/delaunay";
54
+ export * from "./utils/algorithms/delaunay2voronoi";
55
+ export * from "./utils/algorithms/detectPaths";
56
+ export * from "./utils/algorithms/findPolygonSelfIntersections";
57
+ export * from "./utils/algorithms/getContrastColor";
58
+ export * from "./utils/algorithms/HobbyPath";
59
+ export * from "./utils/algorithms/matrixFill";
60
+ export * from "./utils/algorithms/Metaballs";
61
+ export * from "./utils/algorithms/pixelCornersToRoundPaths";
62
+ export * from "./utils/algorithms/PolygonInset";
63
+ export * from "./utils/algorithms/PolygonTesselationOutlines";
64
+ export * from "./utils/algorithms/splitPolygonToNonIntersecting";
65
+ export * from "./utils/algorithms/sutherlandHodgman";
66
+ export * from "./utils/datastructures/CircularIntervalSet";
67
+ export * from "./utils/datastructures/Color";
68
+ export * from "./utils/datastructures/ColorGradient";
69
+ export * from "./utils/datastructures/DataGrid2d";
70
+ export * from "./utils/datastructures/DataGrid2dArrayMatrix";
71
+ export * from "./utils/datastructures/DataGrid2dListAdapter";
72
+ export * from "./utils/datastructures/GenericPath";
73
+ export * from "./utils/datastructures/GeometryMesh";
74
+ export * from "./utils/datastructures/Girih";
75
+ export * from "./utils/datastructures/GirihBowtie";
76
+ export * from "./utils/datastructures/GirihDecagon";
77
+ export * from "./utils/datastructures/GirihHexagon";
78
+ export * from "./utils/datastructures/GirihPenroseRhombus";
79
+ export * from "./utils/datastructures/GirihPentagon";
80
+ export * from "./utils/datastructures/GirihRhombus";
81
+ export * from "./utils/datastructures/GirihTile";
82
+ export * from "./utils/datastructures/interfaces";
83
+ export * from "./utils/datastructures/Matrix4x4";
84
+ export * from "./utils/datastructures/VoronoiCell";
85
+ export * from "./utils/dom/components/ColorGradientPicker";
86
+ export * from "./utils/dom/components/ColorGradientSelector";
87
+ export * from "./utils/dom/getAvailableContainerSpace";
88
+ export * from "./utils/dom/getFProp";
89
+ export * from "./utils/dom/guiSizeToggler";
90
+ export * from "./utils/helpers/BezierPathInteractionHelper";
91
+ export * from "./utils/helpers/CircleHelper";
92
+ export * from "./utils/helpers/CircleSectorHelper";
93
+ export * from "./utils/helpers/TriangleHelper";
94
+ export * from "./utils/helpers/VEllipseHelper";
95
+ export * from "./utils/helpers/VEllipseSectorHelper";
96
+ export * from "./utils/io/FileDrop";
97
+ export * from "./utils/parsers/svg/parseSVGPathData";
98
+ export * from "./utils/parsers/svg/splitSVGPathData";
99
+ export * from "./utils/parsers/svg/types";
100
+ export * from "./utils/parsers/LinearColorGradientParser";
101
+ export * from "./utils/parsers/OBJParser";
102
+ export * from "./utils/parsers/STLParser";
package/src/cjs/index.js CHANGED
@@ -41,4 +41,88 @@ __exportStar(require("./Vertex"), exports);
41
41
  __exportStar(require("./VertexAttr"), exports);
42
42
  __exportStar(require("./VertexListeners"), exports);
43
43
  __exportStar(require("./VertTuple"), exports);
44
+ // Additional exports: utils
45
+ __exportStar(require("./utils/cloneVertexArray"), exports);
46
+ __exportStar(require("./utils/createRandomizedPolygon"), exports);
47
+ __exportStar(require("./utils/detectDarkMode"), exports);
48
+ __exportStar(require("./utils/findInVertexArray"), exports);
49
+ __exportStar(require("./utils/gup"), exports);
50
+ __exportStar(require("./utils/InitializationObserver"), exports);
51
+ __exportStar(require("./utils/LissajousFigure"), exports);
52
+ __exportStar(require("./utils/NGons"), exports);
53
+ __exportStar(require("./utils/Params"), exports);
54
+ __exportStar(require("./utils/PerlinNoise"), exports);
55
+ __exportStar(require("./utils/SVGPathUtils"), exports);
56
+ __exportStar(require("./utils/WebColors"), exports);
57
+ __exportStar(require("./utils/WebColorsContrast"), exports);
58
+ __exportStar(require("./utils/WebColorsMalachite"), exports);
59
+ // Additional exports: utils/algorithms
60
+ __exportStar(require("./utils/algorithms/arrayFill"), exports);
61
+ __exportStar(require("./utils/algorithms/arrayResize"), exports);
62
+ __exportStar(require("./utils/algorithms/arrayShuffle"), exports);
63
+ __exportStar(require("./utils/algorithms/CatmullRomPath"), exports);
64
+ __exportStar(require("./utils/algorithms/CircleIntersections"), exports);
65
+ __exportStar(require("./utils/algorithms/clearDuplicateVertices"), exports);
66
+ __exportStar(require("./utils/algorithms/clearPolygonDuplicateVertices"), exports);
67
+ __exportStar(require("./utils/algorithms/ContourLineDetection"), exports);
68
+ __exportStar(require("./utils/algorithms/convexHull"), exports);
69
+ __exportStar(require("./utils/algorithms/convexPolygonIncircle"), exports);
70
+ __exportStar(require("./utils/algorithms/CubicSplinePath"), exports);
71
+ __exportStar(require("./utils/algorithms/delaunay"), exports);
72
+ __exportStar(require("./utils/algorithms/delaunay2voronoi"), exports);
73
+ __exportStar(require("./utils/algorithms/detectPaths"), exports);
74
+ __exportStar(require("./utils/algorithms/findPolygonSelfIntersections"), exports);
75
+ __exportStar(require("./utils/algorithms/getContrastColor"), exports);
76
+ __exportStar(require("./utils/algorithms/HobbyPath"), exports);
77
+ __exportStar(require("./utils/algorithms/matrixFill"), exports);
78
+ __exportStar(require("./utils/algorithms/Metaballs"), exports);
79
+ __exportStar(require("./utils/algorithms/pixelCornersToRoundPaths"), exports);
80
+ __exportStar(require("./utils/algorithms/PolygonInset"), exports);
81
+ __exportStar(require("./utils/algorithms/PolygonTesselationOutlines"), exports);
82
+ __exportStar(require("./utils/algorithms/splitPolygonToNonIntersecting"), exports);
83
+ __exportStar(require("./utils/algorithms/sutherlandHodgman"), exports);
84
+ // Additional exports: utils/datastructures
85
+ __exportStar(require("./utils/datastructures/CircularIntervalSet"), exports);
86
+ __exportStar(require("./utils/datastructures/Color"), exports);
87
+ __exportStar(require("./utils/datastructures/ColorGradient"), exports);
88
+ __exportStar(require("./utils/datastructures/DataGrid2d"), exports);
89
+ __exportStar(require("./utils/datastructures/DataGrid2dArrayMatrix"), exports);
90
+ __exportStar(require("./utils/datastructures/DataGrid2dListAdapter"), exports);
91
+ __exportStar(require("./utils/datastructures/GenericPath"), exports);
92
+ __exportStar(require("./utils/datastructures/GeometryMesh"), exports);
93
+ __exportStar(require("./utils/datastructures/Girih"), exports);
94
+ __exportStar(require("./utils/datastructures/GirihBowtie"), exports);
95
+ __exportStar(require("./utils/datastructures/GirihDecagon"), exports);
96
+ __exportStar(require("./utils/datastructures/GirihHexagon"), exports);
97
+ __exportStar(require("./utils/datastructures/GirihPenroseRhombus"), exports);
98
+ __exportStar(require("./utils/datastructures/GirihPentagon"), exports);
99
+ __exportStar(require("./utils/datastructures/GirihRhombus"), exports);
100
+ __exportStar(require("./utils/datastructures/GirihTile"), exports);
101
+ __exportStar(require("./utils/datastructures/interfaces"), exports);
102
+ __exportStar(require("./utils/datastructures/Matrix4x4"), exports);
103
+ __exportStar(require("./utils/datastructures/VoronoiCell"), exports);
104
+ // Additional exports: utils/dom/components
105
+ __exportStar(require("./utils/dom/components/ColorGradientPicker"), exports);
106
+ __exportStar(require("./utils/dom/components/ColorGradientSelector"), exports);
107
+ // Additional exports: utils/dom
108
+ __exportStar(require("./utils/dom/getAvailableContainerSpace"), exports);
109
+ __exportStar(require("./utils/dom/getFProp"), exports);
110
+ __exportStar(require("./utils/dom/guiSizeToggler"), exports);
111
+ // Additional exports: utils/helpers
112
+ __exportStar(require("./utils/helpers/BezierPathInteractionHelper"), exports);
113
+ __exportStar(require("./utils/helpers/CircleHelper"), exports);
114
+ __exportStar(require("./utils/helpers/CircleSectorHelper"), exports);
115
+ __exportStar(require("./utils/helpers/TriangleHelper"), exports);
116
+ __exportStar(require("./utils/helpers/VEllipseHelper"), exports);
117
+ __exportStar(require("./utils/helpers/VEllipseSectorHelper"), exports);
118
+ // Additional exports: utils/io
119
+ __exportStar(require("./utils/io/FileDrop"), exports);
120
+ // Additional exports: utils/parsers/svg
121
+ __exportStar(require("./utils/parsers/svg/parseSVGPathData"), exports);
122
+ __exportStar(require("./utils/parsers/svg/splitSVGPathData"), exports);
123
+ __exportStar(require("./utils/parsers/svg/types"), exports);
124
+ // Additional exports: utils/parsers
125
+ __exportStar(require("./utils/parsers/LinearColorGradientParser"), exports);
126
+ __exportStar(require("./utils/parsers/OBJParser"), exports);
127
+ __exportStar(require("./utils/parsers/STLParser"), exports);
44
128
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,iDAA+B;AAC/B,qDAAmC;AACnC,yCAAuB;AACvB,2CAAyB;AACzB,iDAA+B;AAC/B,8CAA4B;AAC5B,yCAAuB;AACvB,+CAA6B;AAC7B,+CAA6B;AAC7B,yCAAuB;AACvB,iDAA+B;AAC/B,4CAA0B;AAC1B,2CAAyB;AACzB,oDAAkC;AAClC,4CAA0B;AAC1B,6CAA2B;AAC3B,iDAA+B;AAC/B,2CAAyB;AACzB,6CAA2B;AAC3B,mDAAiC;AACjC,2CAAyB;AACzB,+CAA6B;AAC7B,oDAAkC;AAClC,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,iDAA+B;AAC/B,qDAAmC;AACnC,yCAAuB;AACvB,2CAAyB;AACzB,iDAA+B;AAC/B,8CAA4B;AAC5B,yCAAuB;AACvB,+CAA6B;AAC7B,+CAA6B;AAC7B,yC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AAoC;AACpC,8EAA4D;AAC5D,+DAA6C;AAC7C,qEAAmD;AACnD,iEAA+C;AAC/C,iEAA+C;AAC/C,uEAAqD;AAErD,+BAA+B;AAC/B,sDAAoC;AAEpC,wCAAwC;AACxC,uEAAqD;AACrD,uEAAqD;AACrD,4DAA0C;AAE1C,oCAAoC;AACpC,4EAA0D;AAC1D,4DAA0C;AAC1C,4DAA0C"}
@@ -25,6 +25,7 @@
25
25
  * @modified 2023-09-29 Added the `cubicBezierArrow(...)` function to the 'DrawLib.arrow()` interface.
26
26
  * @modified 2023-09-29 Added the `lineDashes` attribute.
27
27
  * @modified 2023-09-30 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
28
+ * @modified 2026-01-04 Adding optional `lineJoin` attribute to the `StrokeOptions` interface.
28
29
  **/
29
30
  import { Bounds } from "../Bounds";
30
31
  import { Polygon } from "../Polygon";
@@ -57,6 +58,7 @@ export interface FontOptions {
57
58
  export interface StrokeOptions {
58
59
  dashOffset?: number;
59
60
  dashArray?: Array<number>;
61
+ lineJoin?: "round" | "bevel" | "miter";
60
62
  }
61
63
  /**
62
64
  * An interface all drawing libraries must implement to be used with PlotBoilerplate.
@@ -26,6 +26,7 @@
26
26
  * @modified 2023-09-29 Added the `cubicBezierArrow(...)` function to the 'DrawLib.arrow()` interface.
27
27
  * @modified 2023-09-29 Added the `lineDashes` attribute.
28
28
  * @modified 2023-09-30 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
29
+ * @modified 2026-01-04 Adding optional `lineJoin` attribute to the `StrokeOptions` interface.
29
30
  **/
30
31
  Object.defineProperty(exports, "__esModule", { value: true });
31
32
  //# sourceMappingURL=DrawLib.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawLib.js","sourceRoot":"","sources":["../../ts/interfaces/DrawLib.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BI"}
1
+ {"version":3,"file":"DrawLib.js","sourceRoot":"","sources":["../../ts/interfaces/DrawLib.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4BI"}
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * @author Ikaros Kappler
3
- * @version 1.0.1
4
3
  * @date 2018-11-10
5
4
  * @modified 2020-10-23 Ported to Typescript.
6
5
  * @modified 2020-10-30 Exporting each color under its name globally.
6
+ * @modified 2025-12-08 Replaying self defined colors by official web colors.
7
+ * @version 1.0.2
7
8
  **/
8
9
  import { Color } from "./datastructures/Color";
9
10
  export declare const Red: Color;
@@ -1,25 +1,26 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @author Ikaros Kappler
4
- * @version 1.0.1
5
4
  * @date 2018-11-10
6
5
  * @modified 2020-10-23 Ported to Typescript.
7
6
  * @modified 2020-10-30 Exporting each color under its name globally.
7
+ * @modified 2025-12-08 Replaying self defined colors by official web colors.
8
+ * @version 1.0.2
8
9
  **/
9
10
  Object.defineProperty(exports, "__esModule", { value: true });
10
11
  exports.shuffleWebColors = exports.WebColors = exports.LightGreen = exports.Green = exports.Teal = exports.Cyan = exports.LightBlue = exports.Blue = exports.Indigo = exports.DeepPurple = exports.Purple = exports.Pink = exports.Red = void 0;
11
12
  var Color_1 = require("./datastructures/Color");
12
- exports.Red = Color_1.Color.makeRGB(255, 67, 55);
13
- exports.Pink = Color_1.Color.makeRGB(232, 31, 100);
14
- exports.Purple = Color_1.Color.makeRGB(156, 39, 175);
15
- exports.DeepPurple = Color_1.Color.makeRGB(103, 59, 184);
16
- exports.Indigo = Color_1.Color.makeRGB(64, 81, 181);
17
- exports.Blue = Color_1.Color.makeRGB(35, 151, 245);
18
- exports.LightBlue = Color_1.Color.makeRGB(6, 170, 245);
19
- exports.Cyan = Color_1.Color.makeRGB(3, 189, 214);
20
- exports.Teal = Color_1.Color.makeRGB(1, 150, 137);
21
- exports.Green = Color_1.Color.makeRGB(77, 175, 82);
22
- exports.LightGreen = Color_1.Color.makeRGB(141, 195, 67);
13
+ exports.Red = Color_1.Color.Red; // Color.makeRGB(255,67,55);
14
+ exports.Pink = Color_1.Color.Pink; // Color.makeRGB(232,31,100);
15
+ exports.Purple = Color_1.Color.Purple; // Color.makeRGB(156,39,175);
16
+ exports.DeepPurple = Color_1.Color.DeepPink; // Color.makeRGB(103,59,184);
17
+ exports.Indigo = Color_1.Color.Indigo; // Color.makeRGB(64,81,181);
18
+ exports.Blue = Color_1.Color.Blue; // Color.makeRGB(35,151,245);
19
+ exports.LightBlue = Color_1.Color.LightBlue; // Color.makeRGB(6,170,245);
20
+ exports.Cyan = Color_1.Color.Cyan; // Color.makeRGB(3,189,214);
21
+ exports.Teal = Color_1.Color.Teal; // Color.makeRGB(1,150,137);
22
+ exports.Green = Color_1.Color.Green; // Color.makeRGB(77,175,82);
23
+ exports.LightGreen = Color_1.Color.LightGreen; // Color.makeRGB(141,195,67);
23
24
  /**
24
25
  * A set of beautiful web colors (I know, beauty is in the eye of the beholder).
25
26
  *
@@ -29,19 +30,7 @@ exports.LightGreen = Color_1.Color.makeRGB(141, 195, 67);
29
30
  * @requires Color
30
31
  *
31
32
  */
32
- exports.WebColors = [
33
- exports.Red,
34
- exports.Pink,
35
- exports.Purple,
36
- exports.DeepPurple,
37
- exports.Indigo,
38
- exports.Blue,
39
- exports.LightBlue,
40
- exports.Cyan,
41
- exports.Teal,
42
- exports.Green,
43
- exports.LightGreen
44
- ];
33
+ exports.WebColors = [exports.Red, exports.Pink, exports.Purple, exports.DeepPurple, exports.Indigo, exports.Blue, exports.LightBlue, exports.Cyan, exports.Teal, exports.Green, exports.LightGreen];
45
34
  /**
46
35
  * A helper function to shuffle the colors into a new order.
47
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"WebColors.js","sourceRoot":"","sources":["../../ts/utils/WebColors.ts"],"names":[],"mappings":";AAAA;;;;;;I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GAAiB,CAAC,WAAG,EAAE,YAAI,EAAE,cAAM,EAAE,kBAAU,EAAE,cAAM,EAAE,YAAI,EAAE,iBAAS,EAAE,YAAI,EAAE,YAAI,EAAE,aAAK,EAAE,kBAAU,CAAC,CAAC;AAE/H;;GAEG;AACI,IAAM,gBAAgB,GAAG,UAAC,KAAoB;IACnD,IAAM,MAAM,GAAiB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,CAAC,CAAC,CAAC,GAAG,iBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,iBAAS,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AANW,QAAA,gBAAgB,oBAM3B"}
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * @date 2020-10-27
5
5
  **/
6
- export declare const WebColorsContrast: import("./datastructures/Color").Color[];
6
+ export declare const WebColorsContrast: import("..").Color[];
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Find the outer hull outlines of a (not necessarily full connected) polygon tesellation.
3
+ *
4
+ * The method `findAllOutlinesGraph` will return a simple graph containing all vertices and edges
5
+ * that belong to the outer hull.
6
+ *
7
+ * The method `findAllOutlinesPolygons` will detect connected paths inside the graph and return
8
+ * an array of Polygons.
9
+ *
10
+ *
11
+ * @require detectPaths
12
+ *
13
+ * @author Ikaros Kappler
14
+ * @date 2026-01-20
15
+ * @version 1.0.0
16
+ */
17
+ import { Polygon } from "../../Polygon";
18
+ import { Vertex } from "../../Vertex";
19
+ import { IndexPair } from "../datastructures/interfaces";
20
+ export interface PolygonTesselationOutlinesOptions {
21
+ tolerance?: number;
22
+ removeUnusedVertices?: boolean;
23
+ }
24
+ export interface TesselationGraph {
25
+ vertices: Array<Vertex>;
26
+ edges: Array<IndexPair>;
27
+ }
28
+ /**
29
+ * Convert any non-intersecting tesselation to a graph.
30
+ * Adjadent tiles (polygons) will result in duplicate edges.
31
+ *
32
+ * @param {Polygon[]} polygons - The polygon tesselation to use.
33
+ * @return {TesselationGraph} A tesselation graph.
34
+ */
35
+ export declare const polygonTesselationToGraph: (polygons: Polygon[]) => TesselationGraph;
36
+ /**
37
+ * A class to calculate the tesselation's outer hull.
38
+ */
39
+ export declare class PolygonTesselationOutlines {
40
+ static readonly DEFAULT_TOLERANCE = 0.01;
41
+ private readonly polygons;
42
+ private readonly tolerance;
43
+ private readonly removeUnusedVertices;
44
+ /**
45
+ * @constructor
46
+ * @param {Polygon[]} polygons - The polygon tesselation to use.
47
+ * @param {PolygonTesselationOutlinesOptions} options - (optional)
48
+ */
49
+ constructor(polygons: Polygon[], options?: PolygonTesselationOutlinesOptions);
50
+ /**
51
+ * Clears duplicate edges.
52
+ *
53
+ * Note: this works only for duplicates. Triplets will not be removed.
54
+ *
55
+ * @name __eliminateDuplicateEdges
56
+ * @private
57
+ * @memberof TesselationGraph
58
+ * @instance
59
+ * @param {TesselationGraph} tesselationGraph - The tesselation graph to remove duplicate edges from.
60
+ * @return {TesselationGraph} A new tesselation graph with cleaned up edges.
61
+ */
62
+ private __eliminateDuplicateEdges;
63
+ /**
64
+ * Locate some edge that adjacent to the given vertex index
65
+ *
66
+ * @name __locateEdgeWithVertIndex
67
+ * @private
68
+ * @memberof TesselationGraph
69
+ * @instance
70
+ * @param {number} vertIndex - The vertex index to find an edge for.
71
+ * @param {TesselationGraph} tesselationGraph - The tesselation graph to remove unused vertices from.
72
+ * @return {number} The edge index that's adjacent to the given vertex index.
73
+ * @return -1 if no such edge is found.
74
+ */
75
+ private __locateEdgeWithVertIndex;
76
+ /**
77
+ * Removes all unused vertices from the graph and re-matps the edges.
78
+ *
79
+ * @name __removeUnusedVertices
80
+ * @private
81
+ * @memberof TesselationGraph
82
+ * @instance
83
+ * @param {TesselationGraph} tesselationGraph - The tesselation graph to remove unused vertices from.
84
+ * @return {TesselationGraph} A new tesselation graph.
85
+ */
86
+ private __removeUnusedVertices;
87
+ /**
88
+ * Creates a tesselation graph and removes all inner edges.
89
+ *
90
+ * @name findAllOutlinesGraph
91
+ * @private
92
+ * @memberof PolygonTesselationOutlines
93
+ * @instance
94
+ * @return {TesselationGraph} A tesselation graph containing the outer hull edges only.
95
+ */
96
+ findAllOutlinesGraph(): TesselationGraph;
97
+ /**
98
+ * Convert any generic path to a polygon. Each path segment (start point and end point)
99
+ * are interpreted as a linear segment here.
100
+ *
101
+ * @name __convertGenericPathToPolygon
102
+ * @private
103
+ * @memberof PolygonTesselationOutlines
104
+ * @instance
105
+ * @param {GenericPath} path - The path to convert.
106
+ */
107
+ private __convertGenericPathToPolygon;
108
+ /**
109
+ * Creates a tesselation graph and removes all inner edges.
110
+ *
111
+ * @name findAllOutlinesPolygons
112
+ * @private
113
+ * @memberof PolygonTesselationOutlines
114
+ * @instance
115
+ * @param {TesselationGraph} tesselationGraph - Find all outlines on the tesselation graph.
116
+ */
117
+ findAllOutlinesPolygons(tesselationGraph: TesselationGraph): Array<Polygon>;
118
+ /**
119
+ * Checks if two vertices are equal – regarding to the current tolerance setting.
120
+ *
121
+ * @name __isEqualPoint
122
+ * @private
123
+ * @memberof PolygonTesselationOutlines
124
+ * @instance
125
+ * @param {boolean} vertA - The first point.
126
+ * @param {boolean} vertB - The second point.
127
+ * @return True if the vertices are equal.
128
+ */
129
+ private __isEqualPoint;
130
+ /**
131
+ * Checks if two edges (identified as two pairs of vertices) are equal – regarding to the
132
+ * current tolerance setting.
133
+ *
134
+ * @name __isEqualEdge
135
+ * @private
136
+ * @memberof PolygonTesselationOutlines
137
+ * @instance
138
+ * @param {boolean} edgeAvertA - The first edge's point A.
139
+ * @param {boolean} edgeAvertB - The first edge's point B.
140
+ * @param {boolean} edgeBvertA - The second edge's point A.
141
+ * @param {boolean} edgeBvertB - The second edge's point B.
142
+ * @return True if the edges are equal.
143
+ */
144
+ private __isEqualEdge;
145
+ }