plotboilerplate 1.23.3 → 1.25.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 +19 -1
- package/dist/index.esm.js +1684 -394
- 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 +12450 -11120
- package/dist/plotboilerplate.min.js +1 -1
- package/package.json +9 -5
- package/src/cjs/BezierPath.d.ts +41 -5
- package/src/cjs/BezierPath.js +52 -2
- package/src/cjs/BezierPath.js.map +1 -1
- package/src/cjs/Bounds.d.ts +67 -3
- package/src/cjs/Bounds.js +101 -3
- package/src/cjs/Bounds.js.map +1 -1
- package/src/cjs/Circle.d.ts +46 -4
- package/src/cjs/Circle.js +82 -3
- package/src/cjs/Circle.js.map +1 -1
- package/src/cjs/CircleSector.d.ts +51 -2
- package/src/cjs/CircleSector.js +112 -3
- package/src/cjs/CircleSector.js.map +1 -1
- package/src/cjs/CubicBezierCurve.d.ts +113 -7
- package/src/cjs/CubicBezierCurve.js +281 -33
- package/src/cjs/CubicBezierCurve.js.map +1 -1
- package/src/cjs/Line.d.ts +38 -3
- package/src/cjs/Line.js +64 -1
- package/src/cjs/Line.js.map +1 -1
- package/src/cjs/PlotBoilerplate.d.ts +37 -6
- package/src/cjs/PlotBoilerplate.js +224 -125
- package/src/cjs/PlotBoilerplate.js.map +1 -1
- package/src/cjs/Polygon.d.ts +68 -5
- package/src/cjs/Polygon.js +143 -22
- package/src/cjs/Polygon.js.map +1 -1
- package/src/cjs/Triangle.d.ts +52 -3
- package/src/cjs/Triangle.js +80 -1
- package/src/cjs/Triangle.js.map +1 -1
- package/src/cjs/VEllipse.d.ts +62 -3
- package/src/cjs/VEllipse.js +181 -17
- package/src/cjs/VEllipse.js.map +1 -1
- package/src/cjs/VEllipseSector.d.ts +86 -2
- package/src/cjs/VEllipseSector.js +148 -4
- package/src/cjs/VEllipseSector.js.map +1 -1
- package/src/cjs/Vector.d.ts +12 -2
- package/src/cjs/Vector.js +15 -2
- package/src/cjs/Vector.js.map +1 -1
- package/src/cjs/VertTuple.d.ts +28 -4
- package/src/cjs/VertTuple.js +36 -3
- package/src/cjs/VertTuple.js.map +1 -1
- package/src/cjs/Vertex.d.ts +31 -4
- package/src/cjs/Vertex.js +35 -1
- package/src/cjs/Vertex.js.map +1 -1
- package/src/cjs/interfaces/core.d.ts +67 -0
- package/src/cjs/interfaces/core.js +4 -0
- package/src/cjs/interfaces/core.js.map +1 -1
- package/src/cjs/utils/algorithms/convexPolygonIncircle.d.ts +2 -1
- package/src/cjs/utils/algorithms/convexPolygonIncircle.js +14 -6
- package/src/cjs/utils/algorithms/convexPolygonIncircle.js.map +1 -1
- package/src/cjs/utils/createRandomizedPolygon.d.ts +14 -0
- package/src/cjs/utils/createRandomizedPolygon.js +32 -0
- package/src/cjs/utils/createRandomizedPolygon.js.map +1 -0
- package/src/cjs/utils/datastructures/Color.d.ts +147 -1
- package/src/cjs/utils/datastructures/Color.js +385 -41
- package/src/cjs/utils/datastructures/Color.js.map +1 -1
- package/src/cjs/utils/datastructures/ColorGradient.d.ts +79 -0
- package/src/cjs/utils/datastructures/ColorGradient.js +171 -0
- package/src/cjs/utils/datastructures/ColorGradient.js.map +1 -0
- package/src/cjs/utils/dom/components/ColorGradientPicker.d.ts +245 -0
- package/src/cjs/utils/dom/components/ColorGradientPicker.js +667 -0
- package/src/cjs/utils/dom/components/ColorGradientPicker.js.map +1 -0
- package/src/cjs/utils/dom/components/ColorGradientPickerJSX.d.ts +129 -0
- package/src/cjs/utils/dom/components/ColorGradientPickerJSX.js +520 -0
- package/src/cjs/utils/dom/components/ColorGradientPickerJSX.js.map +1 -0
- package/src/cjs/utils/dom/components/ColorGradientSelector.d.ts +117 -0
- package/src/cjs/utils/dom/components/ColorGradientSelector.js +325 -0
- package/src/cjs/utils/dom/components/ColorGradientSelector.js.map +1 -0
- package/src/cjs/utils/dom/components/Test.d.ts +7 -0
- package/src/cjs/utils/dom/components/Test.js +30 -0
- package/src/cjs/utils/dom/components/Test.js.map +1 -0
- package/src/cjs/utils/dom/guiSizeToggler.js +1 -1
- package/src/cjs/utils/dom/guiSizeToggler.js.map +1 -1
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.d.ts +16 -8
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.js +49 -28
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
- package/src/cjs/utils/helpers/CircleHelper.d.ts +10 -1
- package/src/cjs/utils/helpers/CircleHelper.js +13 -2
- package/src/cjs/utils/helpers/CircleHelper.js.map +1 -1
- package/src/cjs/utils/helpers/CircleSectorHelper.d.ts +11 -2
- package/src/cjs/utils/helpers/CircleSectorHelper.js +20 -20
- package/src/cjs/utils/helpers/CircleSectorHelper.js.map +1 -1
- package/src/cjs/utils/helpers/TriangleHelper.d.ts +57 -0
- package/src/cjs/utils/helpers/TriangleHelper.js +83 -0
- package/src/cjs/utils/helpers/TriangleHelper.js.map +1 -0
- package/src/cjs/utils/helpers/VEllipseHelper.d.ts +32 -0
- package/src/cjs/utils/helpers/VEllipseHelper.js +88 -0
- package/src/cjs/utils/helpers/VEllipseHelper.js.map +1 -0
- package/src/cjs/utils/helpers/VEllipseSectorHelper.d.ts +44 -4
- package/src/cjs/utils/helpers/VEllipseSectorHelper.js +108 -25
- package/src/cjs/utils/helpers/VEllipseSectorHelper.js.map +1 -1
- package/src/cjs/utils/parsers/LinearColorGradientParser.d.ts +78 -0
- package/src/cjs/utils/parsers/LinearColorGradientParser.js +224 -0
- package/src/cjs/utils/parsers/LinearColorGradientParser.js.map +1 -0
- package/src/createDemoDrawables.js +4 -1
- package/src/esm/BezierPath.d.ts +41 -5
- package/src/esm/BezierPath.js +50 -2
- package/src/esm/BezierPath.js.map +1 -1
- package/src/esm/Bounds.d.ts +67 -3
- package/src/esm/Bounds.js +101 -3
- package/src/esm/Bounds.js.map +1 -1
- package/src/esm/Circle.d.ts +46 -4
- package/src/esm/Circle.js +79 -3
- package/src/esm/Circle.js.map +1 -1
- package/src/esm/CircleSector.d.ts +51 -2
- package/src/esm/CircleSector.js +108 -3
- package/src/esm/CircleSector.js.map +1 -1
- package/src/esm/CubicBezierCurve.d.ts +113 -7
- package/src/esm/CubicBezierCurve.js +277 -33
- package/src/esm/CubicBezierCurve.js.map +1 -1
- package/src/esm/Line.d.ts +38 -3
- package/src/esm/Line.js +62 -1
- package/src/esm/Line.js.map +1 -1
- package/src/esm/PlotBoilerplate.d.ts +37 -6
- package/src/esm/PlotBoilerplate.js +224 -125
- package/src/esm/PlotBoilerplate.js.map +1 -1
- package/src/esm/Polygon.d.ts +68 -5
- package/src/esm/Polygon.js +138 -22
- package/src/esm/Polygon.js.map +1 -1
- package/src/esm/Triangle.d.ts +52 -3
- package/src/esm/Triangle.js +77 -1
- package/src/esm/Triangle.js.map +1 -1
- package/src/esm/VEllipse.d.ts +62 -3
- package/src/esm/VEllipse.js +178 -17
- package/src/esm/VEllipse.js.map +1 -1
- package/src/esm/VEllipseSector.d.ts +86 -2
- package/src/esm/VEllipseSector.js +146 -7
- package/src/esm/VEllipseSector.js.map +1 -1
- package/src/esm/Vector.d.ts +12 -2
- package/src/esm/Vector.js +15 -2
- package/src/esm/Vector.js.map +1 -1
- package/src/esm/VertTuple.d.ts +28 -4
- package/src/esm/VertTuple.js +36 -3
- package/src/esm/VertTuple.js.map +1 -1
- package/src/esm/Vertex.d.ts +31 -4
- package/src/esm/Vertex.js +35 -1
- package/src/esm/Vertex.js.map +1 -1
- package/src/esm/interfaces/core.d.ts +67 -0
- package/src/esm/interfaces/core.js +4 -0
- package/src/esm/interfaces/core.js.map +1 -1
- package/src/esm/utils/algorithms/convexPolygonIncircle.d.ts +2 -1
- package/src/esm/utils/algorithms/convexPolygonIncircle.js +15 -7
- package/src/esm/utils/algorithms/convexPolygonIncircle.js.map +1 -1
- package/src/esm/utils/algorithms/createRandomizedPolygon.d.ts +14 -0
- package/src/esm/utils/algorithms/createRandomizedPolygon.js +28 -0
- package/src/esm/utils/algorithms/createRandomizedPolygon.js.map +1 -0
- package/src/esm/utils/createRandomizedPolygon.d.ts +14 -0
- package/src/esm/utils/createRandomizedPolygon.js +28 -0
- package/src/esm/utils/createRandomizedPolygon.js.map +1 -0
- package/src/esm/utils/datastructures/Color.d.ts +147 -1
- package/src/esm/utils/datastructures/Color.js +386 -42
- package/src/esm/utils/datastructures/Color.js.map +1 -1
- package/src/esm/utils/datastructures/ColorGradient.d.ts +79 -0
- package/src/esm/utils/datastructures/ColorGradient.js +166 -0
- package/src/esm/utils/datastructures/ColorGradient.js.map +1 -0
- package/src/esm/utils/dom/components/ColorGradientPicker.d.ts +245 -0
- package/src/esm/utils/dom/components/ColorGradientPicker.js +732 -0
- package/src/esm/utils/dom/components/ColorGradientPicker.js.map +1 -0
- package/src/esm/utils/dom/components/ColorGradientPickerJSX.d.ts +129 -0
- package/src/esm/utils/dom/components/ColorGradientPickerJSX.js +582 -0
- package/src/esm/utils/dom/components/ColorGradientPickerJSX.js.map +1 -0
- package/src/esm/utils/dom/components/ColorGradientSelector.d.ts +117 -0
- package/src/esm/utils/dom/components/ColorGradientSelector.js +332 -0
- package/src/esm/utils/dom/components/ColorGradientSelector.js.map +1 -0
- package/src/esm/utils/dom/components/Test.d.ts +7 -0
- package/src/esm/utils/dom/components/Test.js +26 -0
- package/src/esm/utils/dom/components/Test.js.map +1 -0
- package/src/esm/utils/dom/guiSizeToggler.js +1 -1
- package/src/esm/utils/dom/guiSizeToggler.js.map +1 -1
- package/src/esm/utils/helpers/BezierPathInteractionHelper.d.ts +16 -8
- package/src/esm/utils/helpers/BezierPathInteractionHelper.js +47 -27
- package/src/esm/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
- package/src/esm/utils/helpers/CircleHelper.d.ts +10 -1
- package/src/esm/utils/helpers/CircleHelper.js +13 -2
- package/src/esm/utils/helpers/CircleHelper.js.map +1 -1
- package/src/esm/utils/helpers/CircleSectorHelper.d.ts +11 -2
- package/src/esm/utils/helpers/CircleSectorHelper.js +20 -20
- package/src/esm/utils/helpers/CircleSectorHelper.js.map +1 -1
- package/src/esm/utils/helpers/TriangleHelper.d.ts +57 -0
- package/src/esm/utils/helpers/TriangleHelper.js +78 -0
- package/src/esm/utils/helpers/TriangleHelper.js.map +1 -0
- package/src/esm/utils/helpers/VEllipseHelper.d.ts +32 -0
- package/src/esm/utils/helpers/VEllipseHelper.js +83 -0
- package/src/esm/utils/helpers/VEllipseHelper.js.map +1 -0
- package/src/esm/utils/helpers/VEllipseSectorHelper.d.ts +44 -4
- package/src/esm/utils/helpers/VEllipseSectorHelper.js +107 -24
- package/src/esm/utils/helpers/VEllipseSectorHelper.js.map +1 -1
- package/src/esm/utils/parsers/LinearColorGradientParser.d.ts +78 -0
- package/src/esm/utils/parsers/LinearColorGradientParser.js +217 -0
- package/src/esm/utils/parsers/LinearColorGradientParser.js.map +1 -0
- package/src/external.d.ts +9 -0
- package/src/ts/BezierPath.ts +58 -5
- package/src/ts/Bounds.ts +110 -6
- package/src/ts/Circle.ts +87 -5
- package/src/ts/CircleSector.ts +115 -5
- package/src/ts/CubicBezierCurve.ts +332 -42
- package/src/ts/Line.ts +66 -3
- package/src/ts/PlotBoilerplate.ts +236 -114
- package/src/ts/Polygon.ts +164 -29
- package/src/ts/Triangle.ts +85 -3
- package/src/ts/VEllipse.ts +214 -19
- package/src/ts/VEllipseSector.ts +154 -8
- package/src/ts/Vector.ts +16 -2
- package/src/ts/VertTuple.ts +39 -4
- package/src/ts/Vertex.ts +40 -4
- package/src/ts/interfaces/core.ts +73 -0
- package/src/ts/utils/algorithms/convexPolygonIncircle.ts +82 -78
- package/src/ts/utils/createRandomizedPolygon.ts +31 -0
- package/src/ts/utils/datastructures/Color.ts +423 -44
- package/src/ts/utils/datastructures/ColorGradient.ts +196 -0
- package/src/ts/utils/dom/components/ColorGradientPicker.tsx +877 -0
- package/src/ts/utils/dom/components/ColorGradientSelector.tsx +445 -0
- package/src/ts/utils/dom/components/Test.tsx +44 -0
- package/src/ts/utils/dom/components/_ColorGradientPicker_raw.ts_ +392 -0
- package/src/ts/utils/dom/guiSizeToggler.ts +1 -1
- package/src/ts/utils/helpers/BezierPathInteractionHelper.ts +61 -35
- package/src/ts/utils/helpers/CircleHelper.ts +17 -3
- package/src/ts/utils/helpers/CircleSectorHelper.ts +118 -126
- package/src/ts/utils/helpers/TriangleHelper.ts +102 -0
- package/src/ts/utils/helpers/VEllipseHelper.ts +115 -0
- package/src/ts/utils/helpers/VEllipseSectorHelper.ts +144 -26
- package/src/ts/utils/parsers/LinearColorGradientParser.ts +297 -0
package/src/esm/Circle.d.ts
CHANGED
|
@@ -12,13 +12,16 @@
|
|
|
12
12
|
* @modified 2022-08-15 Added the `containsPoint` function.
|
|
13
13
|
* @modified 2022-08-23 Added the `lineIntersection` function.
|
|
14
14
|
* @modified 2022-08-23 Added the `closestPoint` function.
|
|
15
|
-
* @
|
|
15
|
+
* @modified 2025-04-09 Added the `Circle.move(amount: XYCoords)` method.
|
|
16
|
+
* @modified 2025-04-16 Class `Circle` now implements interface `Intersectable`.
|
|
17
|
+
* @version 1.5.0
|
|
16
18
|
**/
|
|
19
|
+
import { Bounds } from "./Bounds";
|
|
17
20
|
import { Line } from "./Line";
|
|
18
21
|
import { Vector } from "./Vector";
|
|
19
22
|
import { VertTuple } from "./VertTuple";
|
|
20
23
|
import { Vertex } from "./Vertex";
|
|
21
|
-
import { SVGSerializable, UID, XYCoords } from "./interfaces";
|
|
24
|
+
import { IBounded, Intersectable, SVGSerializable, UID, XYCoords } from "./interfaces";
|
|
22
25
|
/**
|
|
23
26
|
* @classdesc A simple circle: center point and radius.
|
|
24
27
|
*
|
|
@@ -30,7 +33,7 @@ import { SVGSerializable, UID, XYCoords } from "./interfaces";
|
|
|
30
33
|
* @requires UID
|
|
31
34
|
* @requires UIDGenerator
|
|
32
35
|
**/
|
|
33
|
-
export declare class Circle implements SVGSerializable {
|
|
36
|
+
export declare class Circle implements IBounded, Intersectable, SVGSerializable {
|
|
34
37
|
/**
|
|
35
38
|
* Required to generate proper CSS classes and other class related IDs.
|
|
36
39
|
**/
|
|
@@ -72,6 +75,16 @@ export declare class Circle implements SVGSerializable {
|
|
|
72
75
|
* @param {number} radius - The radius of the circle.
|
|
73
76
|
*/
|
|
74
77
|
constructor(center: Vertex, radius: number);
|
|
78
|
+
/**
|
|
79
|
+
* Move the circle by the given amount.
|
|
80
|
+
*
|
|
81
|
+
* @method move
|
|
82
|
+
* @param {XYCoords} amount - The amount to move.
|
|
83
|
+
* @instance
|
|
84
|
+
* @memberof Circle
|
|
85
|
+
* @return {Circle} this for chaining
|
|
86
|
+
**/
|
|
87
|
+
move(amount: XYCoords): Circle;
|
|
75
88
|
/**
|
|
76
89
|
* Check if the given circle is fully contained inside this circle.
|
|
77
90
|
*
|
|
@@ -129,6 +142,15 @@ export declare class Circle implements SVGSerializable {
|
|
|
129
142
|
* @memberof Circle
|
|
130
143
|
**/
|
|
131
144
|
tangentAt(angle: number): Vector;
|
|
145
|
+
/**
|
|
146
|
+
* Get the bounding box (bounds) of this Circle.
|
|
147
|
+
*
|
|
148
|
+
* @method getBounds
|
|
149
|
+
* @instance
|
|
150
|
+
* @memberof Circle
|
|
151
|
+
* @return {Bounds} The rectangular bounds of this Circle.
|
|
152
|
+
**/
|
|
153
|
+
getBounds(): Bounds;
|
|
132
154
|
/**
|
|
133
155
|
* Calculate the intersection points (if exists) with the given circle.
|
|
134
156
|
*
|
|
@@ -146,10 +168,30 @@ export declare class Circle implements SVGSerializable {
|
|
|
146
168
|
* @instance
|
|
147
169
|
* @memberof Circle
|
|
148
170
|
* @param {Vertex} a- The first of the two points defining the line.
|
|
149
|
-
* @param {
|
|
171
|
+
* @param {XYCoords} b - The second of the two points defining the line.
|
|
150
172
|
* @return {Line|null} The intersection points (as a line) or null if this circle does not intersect the line given.
|
|
151
173
|
**/
|
|
152
174
|
lineIntersection(a: Vertex, b: XYCoords): Line | null;
|
|
175
|
+
/**
|
|
176
|
+
* Get all line intersections with this circle.
|
|
177
|
+
*
|
|
178
|
+
* This method returns all intersections (as vertices) with this shape. The returned array of vertices is in no specific order.
|
|
179
|
+
*
|
|
180
|
+
* @param {VertTuple} line - The line to find intersections with.
|
|
181
|
+
* @param {boolean} inVectorBoundsOnly - If set to true only intersecion points on the passed vector are returned (located strictly between start and end vertex).
|
|
182
|
+
* @returns {Array<Vertex>} - An array of all intersections with the circle outline.
|
|
183
|
+
*/
|
|
184
|
+
lineIntersections(line: VertTuple<any>, inVectorBoundsOnly?: boolean): Array<Vertex>;
|
|
185
|
+
/**
|
|
186
|
+
* Get all line intersections of this polygon and their tangents along the shape.
|
|
187
|
+
*
|
|
188
|
+
* This method returns all intersection tangents (as vectors) with this shape. The returned array of vectors is in no specific order.
|
|
189
|
+
*
|
|
190
|
+
* @param line
|
|
191
|
+
* @param lineIntersectionTangents
|
|
192
|
+
* @returns
|
|
193
|
+
*/
|
|
194
|
+
lineIntersectionTangents(line: VertTuple<any>, inVectorBoundsOnly?: boolean): Array<Vector>;
|
|
153
195
|
/**
|
|
154
196
|
* Calculate the closest point on the outline of this circle to the given point.
|
|
155
197
|
*
|
package/src/esm/Circle.js
CHANGED
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
* @modified 2022-08-15 Added the `containsPoint` function.
|
|
13
13
|
* @modified 2022-08-23 Added the `lineIntersection` function.
|
|
14
14
|
* @modified 2022-08-23 Added the `closestPoint` function.
|
|
15
|
-
* @
|
|
15
|
+
* @modified 2025-04-09 Added the `Circle.move(amount: XYCoords)` method.
|
|
16
|
+
* @modified 2025-04-16 Class `Circle` now implements interface `Intersectable`.
|
|
17
|
+
* @version 1.5.0
|
|
16
18
|
**/
|
|
19
|
+
import { Bounds } from "./Bounds";
|
|
17
20
|
import { Line } from "./Line";
|
|
18
21
|
import { UIDGenerator } from "./UIDGenerator";
|
|
19
22
|
import { Vector } from "./Vector";
|
|
@@ -47,6 +50,19 @@ export class Circle {
|
|
|
47
50
|
this.center = center;
|
|
48
51
|
this.radius = radius;
|
|
49
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Move the circle by the given amount.
|
|
55
|
+
*
|
|
56
|
+
* @method move
|
|
57
|
+
* @param {XYCoords} amount - The amount to move.
|
|
58
|
+
* @instance
|
|
59
|
+
* @memberof Circle
|
|
60
|
+
* @return {Circle} this for chaining
|
|
61
|
+
**/
|
|
62
|
+
move(amount) {
|
|
63
|
+
this.center.add(amount);
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
50
66
|
/**
|
|
51
67
|
* Check if the given circle is fully contained inside this circle.
|
|
52
68
|
*
|
|
@@ -117,7 +133,21 @@ export class Circle {
|
|
|
117
133
|
const pointA = Circle.circleUtils.vertAt(angle, this.radius);
|
|
118
134
|
// Construct the perpendicular of the line in point a. Then move relative to center.
|
|
119
135
|
return new Vector(pointA, new Vertex(0, 0)).add(this.center).perp();
|
|
136
|
+
// return (new Vector(this.center.clone(), pointA).add(pointA) as Vector).perp() as Vector;
|
|
120
137
|
}
|
|
138
|
+
//--- BEGIN --- Implement interface `Intersectable`
|
|
139
|
+
/**
|
|
140
|
+
* Get the bounding box (bounds) of this Circle.
|
|
141
|
+
*
|
|
142
|
+
* @method getBounds
|
|
143
|
+
* @instance
|
|
144
|
+
* @memberof Circle
|
|
145
|
+
* @return {Bounds} The rectangular bounds of this Circle.
|
|
146
|
+
**/
|
|
147
|
+
getBounds() {
|
|
148
|
+
return new Bounds(this.center.clone().subXY(Math.abs(this.radius), Math.abs(this.radius)), this.center.clone().addXY(Math.abs(this.radius), Math.abs(this.radius)));
|
|
149
|
+
}
|
|
150
|
+
//--- END --- Implement interface `Intersectable`
|
|
121
151
|
/**
|
|
122
152
|
* Calculate the intersection points (if exists) with the given circle.
|
|
123
153
|
*
|
|
@@ -177,7 +207,7 @@ export class Circle {
|
|
|
177
207
|
* @instance
|
|
178
208
|
* @memberof Circle
|
|
179
209
|
* @param {Vertex} a- The first of the two points defining the line.
|
|
180
|
-
* @param {
|
|
210
|
+
* @param {XYCoords} b - The second of the two points defining the line.
|
|
181
211
|
* @return {Line|null} The intersection points (as a line) or null if this circle does not intersect the line given.
|
|
182
212
|
**/
|
|
183
213
|
lineIntersection(a, b) {
|
|
@@ -210,8 +240,54 @@ export class Circle {
|
|
|
210
240
|
interA.y = (-det * diff.x + Math.abs(diff.y) * sqrt) / distSquared;
|
|
211
241
|
interB.y = (-det * diff.x - Math.abs(diff.y) * sqrt) / distSquared;
|
|
212
242
|
return new Line(interA.add(this.center), interB.add(this.center));
|
|
213
|
-
// return new Line(interA, interB);
|
|
214
243
|
}
|
|
244
|
+
//--- BEGIN --- Implement interface `Intersectable`
|
|
245
|
+
/**
|
|
246
|
+
* Get all line intersections with this circle.
|
|
247
|
+
*
|
|
248
|
+
* This method returns all intersections (as vertices) with this shape. The returned array of vertices is in no specific order.
|
|
249
|
+
*
|
|
250
|
+
* @param {VertTuple} line - The line to find intersections with.
|
|
251
|
+
* @param {boolean} inVectorBoundsOnly - If set to true only intersecion points on the passed vector are returned (located strictly between start and end vertex).
|
|
252
|
+
* @returns {Array<Vertex>} - An array of all intersections with the circle outline.
|
|
253
|
+
*/
|
|
254
|
+
lineIntersections(line, inVectorBoundsOnly = false) {
|
|
255
|
+
// Find the intersections of all lines inside the edge bounds
|
|
256
|
+
const intersectioLine = this.lineIntersection(line.a, line.b);
|
|
257
|
+
if (!intersectioLine) {
|
|
258
|
+
return [];
|
|
259
|
+
}
|
|
260
|
+
if (inVectorBoundsOnly) {
|
|
261
|
+
// const maxDist = line.length();
|
|
262
|
+
return [intersectioLine.a, intersectioLine.b].filter((vert) => line.hasPoint(vert, true));
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
return [intersectioLine.a, intersectioLine.b];
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Get all line intersections of this polygon and their tangents along the shape.
|
|
270
|
+
*
|
|
271
|
+
* This method returns all intersection tangents (as vectors) with this shape. The returned array of vectors is in no specific order.
|
|
272
|
+
*
|
|
273
|
+
* @param line
|
|
274
|
+
* @param lineIntersectionTangents
|
|
275
|
+
* @returns
|
|
276
|
+
*/
|
|
277
|
+
lineIntersectionTangents(line, inVectorBoundsOnly = false) {
|
|
278
|
+
// Find the intersections of all lines plus their tangents inside the circle bounds
|
|
279
|
+
const interSectionPoints = this.lineIntersections(line, inVectorBoundsOnly);
|
|
280
|
+
return interSectionPoints.map((vert) => {
|
|
281
|
+
// Calculate angle
|
|
282
|
+
const lineFromCenter = new Line(this.center, vert);
|
|
283
|
+
const angle = lineFromCenter.angle();
|
|
284
|
+
// console.log("angle", (angle / Math.PI) * 180.0);
|
|
285
|
+
// const angle = Math.random() * Math.PI * 2; // TODO
|
|
286
|
+
// Calculate tangent at angle
|
|
287
|
+
return this.tangentAt(angle);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
//--- END --- Implement interface `Intersectable`
|
|
215
291
|
/**
|
|
216
292
|
* Calculate the closest point on the outline of this circle to the given point.
|
|
217
293
|
*
|
package/src/esm/Circle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../ts/Circle.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../ts/Circle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;IAiBI;AAEJ,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;;;;;;;IAUI;AACJ,MA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,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAClE,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,8FAA8F;YAC9F,OAAO,IAAI,MAAM,EAAE,CAAC;QACtB,CAAC;QACD,wBAAwB;QACxB,IAAI,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1E,OAAO,gBAAgB,CAAC,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,OAAO,gBAAgB,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;EASD,YAAY;AAPL,kBAAW,GAAG;IACnB,MAAM,EAAE,CAAC,KAAa,EAAE,MAAc,EAAE,EAAE;QACxC;mDACkC;QAClC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;IACxE,CAAC;CACF,AANiB,CAMhB"}
|
|
@@ -8,11 +8,18 @@
|
|
|
8
8
|
* @modified 2024-03-08 Added the `containsAngle` method.
|
|
9
9
|
* @modified 2024-03-09 Added the `circleSectorIntersection` method to find coherent sector intersections..
|
|
10
10
|
* @modified 2024-03-09 Added the `angleAt` method to determine any angle at some ratio.
|
|
11
|
+
* @modified 2025-04-02 Adding the `CircleSector.lineIntersections` and `CircleSector.lineIntersectionTangents` and implementing `Intersectable`.
|
|
12
|
+
* @modified 2025-04-09 Adding the `CircleSector.move()` method.
|
|
13
|
+
* @modified 2025-04-19 Tweaking the `CircleSector.containsAngle` method: all values (input angle, start- and end- angle) are wrapped into [0,2*PI) now.
|
|
14
|
+
* @modified 2025-04-19 Class `CircleSector` implements interface `Bounded` now (method `getBounds` added).
|
|
11
15
|
* @version 1.2.0
|
|
12
16
|
**/
|
|
17
|
+
import { Bounds } from "./Bounds";
|
|
13
18
|
import { Circle } from "./Circle";
|
|
19
|
+
import { Vector } from "./Vector";
|
|
20
|
+
import { VertTuple } from "./VertTuple";
|
|
14
21
|
import { Vertex } from "./Vertex";
|
|
15
|
-
import { SVGPathParams, SVGSerializable, UID, XYCoords } from "./interfaces";
|
|
22
|
+
import { IBounded, Intersectable, SVGPathParams, SVGSerializable, UID, XYCoords } from "./interfaces";
|
|
16
23
|
/**
|
|
17
24
|
* @classdesc A simple circle sector: circle, start- and end-angle.
|
|
18
25
|
*
|
|
@@ -22,7 +29,7 @@ import { SVGPathParams, SVGSerializable, UID, XYCoords } from "./interfaces";
|
|
|
22
29
|
* @requires UIDGenerator
|
|
23
30
|
* @requires XYCoords
|
|
24
31
|
**/
|
|
25
|
-
export declare class CircleSector implements SVGSerializable {
|
|
32
|
+
export declare class CircleSector implements IBounded, Intersectable, SVGSerializable {
|
|
26
33
|
/**
|
|
27
34
|
* Required to generate proper CSS classes and other class related IDs.
|
|
28
35
|
**/
|
|
@@ -71,6 +78,28 @@ export declare class CircleSector implements SVGSerializable {
|
|
|
71
78
|
* @param {number} endAngle - The end angle of the sector.
|
|
72
79
|
*/
|
|
73
80
|
constructor(circle: Circle, startAngle: number, endAngle: number);
|
|
81
|
+
/**
|
|
82
|
+
* Get the bounds of this ellipse.
|
|
83
|
+
*
|
|
84
|
+
* The bounds are approximated by the underlying segment buffer; the more segment there are,
|
|
85
|
+
* the more accurate will be the returned bounds.
|
|
86
|
+
*
|
|
87
|
+
* @method getBounds
|
|
88
|
+
* @instance
|
|
89
|
+
* @memberof VEllipse
|
|
90
|
+
* @return {Bounds} The bounds of this curve.
|
|
91
|
+
**/
|
|
92
|
+
getBounds(): Bounds;
|
|
93
|
+
/**
|
|
94
|
+
* Move the circle sector by the given amount.
|
|
95
|
+
*
|
|
96
|
+
* @method move
|
|
97
|
+
* @param {XYCoords} amount - The amount to move.
|
|
98
|
+
* @instance
|
|
99
|
+
* @memberof CircleSector
|
|
100
|
+
* @return {CircleSector} this for chaining
|
|
101
|
+
**/
|
|
102
|
+
move(amount: XYCoords): CircleSector;
|
|
74
103
|
/**
|
|
75
104
|
* Checks wether the given angle (must be inside 0 and PI*2) is contained inside this sector.
|
|
76
105
|
*
|
|
@@ -123,6 +152,26 @@ export declare class CircleSector implements SVGSerializable {
|
|
|
123
152
|
* @return {CircleSector | null} The intersecion of both sectors or null if they don't intersect.
|
|
124
153
|
*/
|
|
125
154
|
circleSectorIntersection(sector: CircleSector): CircleSector | null;
|
|
155
|
+
/**
|
|
156
|
+
* Get the line intersections as vectors with this ellipse.
|
|
157
|
+
*
|
|
158
|
+
* @method lineIntersections
|
|
159
|
+
* @instance
|
|
160
|
+
* @param {VertTuple<Vector> ray - The line/ray to intersect this ellipse with.
|
|
161
|
+
* @param {boolean} inVectorBoundsOnly - (default=false) Set to true if only intersections within the vector bounds are of interest.
|
|
162
|
+
* @returns
|
|
163
|
+
*/
|
|
164
|
+
lineIntersections(ray: VertTuple<Vector>, inVectorBoundsOnly?: boolean): Array<Vertex>;
|
|
165
|
+
/**
|
|
166
|
+
* Get all line intersections of this polygon and their tangents along the shape.
|
|
167
|
+
*
|
|
168
|
+
* This method returns all intersection tangents (as vectors) with this shape. The returned array of vectors is in no specific order.
|
|
169
|
+
*
|
|
170
|
+
* @param line
|
|
171
|
+
* @param lineIntersectionTangents
|
|
172
|
+
* @returns
|
|
173
|
+
*/
|
|
174
|
+
lineIntersectionTangents(line: VertTuple<any>, inVectorBoundsOnly?: boolean): Array<Vector>;
|
|
126
175
|
/**
|
|
127
176
|
* This function should invalidate any installed listeners and invalidate this object.
|
|
128
177
|
* After calling this function the object might not hold valid data any more and
|
package/src/esm/CircleSector.js
CHANGED
|
@@ -8,10 +8,18 @@
|
|
|
8
8
|
* @modified 2024-03-08 Added the `containsAngle` method.
|
|
9
9
|
* @modified 2024-03-09 Added the `circleSectorIntersection` method to find coherent sector intersections..
|
|
10
10
|
* @modified 2024-03-09 Added the `angleAt` method to determine any angle at some ratio.
|
|
11
|
+
* @modified 2025-04-02 Adding the `CircleSector.lineIntersections` and `CircleSector.lineIntersectionTangents` and implementing `Intersectable`.
|
|
12
|
+
* @modified 2025-04-09 Adding the `CircleSector.move()` method.
|
|
13
|
+
* @modified 2025-04-19 Tweaking the `CircleSector.containsAngle` method: all values (input angle, start- and end- angle) are wrapped into [0,2*PI) now.
|
|
14
|
+
* @modified 2025-04-19 Class `CircleSector` implements interface `Bounded` now (method `getBounds` added).
|
|
11
15
|
* @version 1.2.0
|
|
12
16
|
**/
|
|
17
|
+
import { Bounds } from "./Bounds";
|
|
13
18
|
import { Circle } from "./Circle";
|
|
19
|
+
import { Line } from "./Line";
|
|
14
20
|
import { UIDGenerator } from "./UIDGenerator";
|
|
21
|
+
import { Vertex } from "./Vertex";
|
|
22
|
+
import { geomutils } from "./geomutils";
|
|
15
23
|
/**
|
|
16
24
|
* @classdesc A simple circle sector: circle, start- and end-angle.
|
|
17
25
|
*
|
|
@@ -41,6 +49,49 @@ export class CircleSector {
|
|
|
41
49
|
this.startAngle = startAngle;
|
|
42
50
|
this.endAngle = endAngle;
|
|
43
51
|
}
|
|
52
|
+
//--- BEGIN --- Implement interface `IBounded`
|
|
53
|
+
/**
|
|
54
|
+
* Get the bounds of this ellipse.
|
|
55
|
+
*
|
|
56
|
+
* The bounds are approximated by the underlying segment buffer; the more segment there are,
|
|
57
|
+
* the more accurate will be the returned bounds.
|
|
58
|
+
*
|
|
59
|
+
* @method getBounds
|
|
60
|
+
* @instance
|
|
61
|
+
* @memberof VEllipse
|
|
62
|
+
* @return {Bounds} The bounds of this curve.
|
|
63
|
+
**/
|
|
64
|
+
getBounds() {
|
|
65
|
+
const _self = this;
|
|
66
|
+
const circleBounds = this.circle.getBounds();
|
|
67
|
+
// Calculage angles from east, west, north and south box points and check if they are inside
|
|
68
|
+
const candidates = [
|
|
69
|
+
circleBounds.getNorthPoint(),
|
|
70
|
+
circleBounds.getSouthPoint(),
|
|
71
|
+
circleBounds.getWestPoint(),
|
|
72
|
+
circleBounds.getEastPoint()
|
|
73
|
+
].filter((point) => {
|
|
74
|
+
// Check for each candidate points if they are contained in this sector. Drop if not.
|
|
75
|
+
const angle = new Line(_self.circle.center, point).angle();
|
|
76
|
+
return _self.containsAngle(angle);
|
|
77
|
+
});
|
|
78
|
+
// Compute bounds and inlcude start end end point (they are definitely part of the bounds)
|
|
79
|
+
return Bounds.computeFromVertices(candidates.concat([this.getStartPoint(), this.getEndPoint()]));
|
|
80
|
+
}
|
|
81
|
+
//--- BEGIN --- Implement interface `IBounded`
|
|
82
|
+
/**
|
|
83
|
+
* Move the circle sector by the given amount.
|
|
84
|
+
*
|
|
85
|
+
* @method move
|
|
86
|
+
* @param {XYCoords} amount - The amount to move.
|
|
87
|
+
* @instance
|
|
88
|
+
* @memberof CircleSector
|
|
89
|
+
* @return {CircleSector} this for chaining
|
|
90
|
+
**/
|
|
91
|
+
move(amount) {
|
|
92
|
+
this.circle.move(amount);
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
44
95
|
/**
|
|
45
96
|
* Checks wether the given angle (must be inside 0 and PI*2) is contained inside this sector.
|
|
46
97
|
*
|
|
@@ -51,12 +102,22 @@ export class CircleSector {
|
|
|
51
102
|
* @return {boolean} True if (and only if) this sector contains the given angle.
|
|
52
103
|
*/
|
|
53
104
|
containsAngle(angle) {
|
|
54
|
-
|
|
55
|
-
|
|
105
|
+
var wrappedAngle = geomutils.mapAngleTo2PI(angle);
|
|
106
|
+
var wrappedStart = geomutils.mapAngleTo2PI(this.startAngle);
|
|
107
|
+
var wrappedEnd = geomutils.mapAngleTo2PI(this.endAngle);
|
|
108
|
+
// TODO: cleanup
|
|
109
|
+
// if (this.startAngle <= this.endAngle) {
|
|
110
|
+
// return angle >= this.startAngle && angle < this.endAngle;
|
|
111
|
+
// } else {
|
|
112
|
+
// // startAngle > endAngle
|
|
113
|
+
// return angle >= this.startAngle || angle < this.endAngle;
|
|
114
|
+
// }
|
|
115
|
+
if (wrappedStart <= wrappedEnd) {
|
|
116
|
+
return wrappedAngle >= wrappedStart && wrappedAngle < wrappedEnd;
|
|
56
117
|
}
|
|
57
118
|
else {
|
|
58
119
|
// startAngle > endAngle
|
|
59
|
-
return
|
|
120
|
+
return wrappedAngle >= wrappedStart || wrappedAngle < wrappedEnd;
|
|
60
121
|
}
|
|
61
122
|
}
|
|
62
123
|
/**
|
|
@@ -150,6 +211,50 @@ export class CircleSector {
|
|
|
150
211
|
}
|
|
151
212
|
return resultSector;
|
|
152
213
|
}
|
|
214
|
+
//--- BEGIN --- Implement interface `Intersectable`
|
|
215
|
+
/**
|
|
216
|
+
* Get the line intersections as vectors with this ellipse.
|
|
217
|
+
*
|
|
218
|
+
* @method lineIntersections
|
|
219
|
+
* @instance
|
|
220
|
+
* @param {VertTuple<Vector> ray - The line/ray to intersect this ellipse with.
|
|
221
|
+
* @param {boolean} inVectorBoundsOnly - (default=false) Set to true if only intersections within the vector bounds are of interest.
|
|
222
|
+
* @returns
|
|
223
|
+
*/
|
|
224
|
+
lineIntersections(ray, inVectorBoundsOnly = false) {
|
|
225
|
+
// First get all line intersections from underlying ellipse.
|
|
226
|
+
const ellipseIntersections = this.circle.lineIntersections(ray, inVectorBoundsOnly);
|
|
227
|
+
// Drop all intersection points that are not contained in the circle sectors bounds.
|
|
228
|
+
const tmpLine = new Line(this.circle.center, new Vertex());
|
|
229
|
+
return ellipseIntersections.filter((intersectionPoint) => {
|
|
230
|
+
tmpLine.b.set(intersectionPoint);
|
|
231
|
+
const lineAngle = tmpLine.angle();
|
|
232
|
+
return this.containsAngle(geomutils.wrapMinMax(lineAngle, 0, Math.PI * 2));
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get all line intersections of this polygon and their tangents along the shape.
|
|
237
|
+
*
|
|
238
|
+
* This method returns all intersection tangents (as vectors) with this shape. The returned array of vectors is in no specific order.
|
|
239
|
+
*
|
|
240
|
+
* @param line
|
|
241
|
+
* @param lineIntersectionTangents
|
|
242
|
+
* @returns
|
|
243
|
+
*/
|
|
244
|
+
lineIntersectionTangents(line, inVectorBoundsOnly = false) {
|
|
245
|
+
// Find the intersections of all lines plus their tangents inside the circle bounds
|
|
246
|
+
const interSectionPoints = this.lineIntersections(line, inVectorBoundsOnly);
|
|
247
|
+
return interSectionPoints.map((vert) => {
|
|
248
|
+
// Calculate angle
|
|
249
|
+
const lineFromCenter = new Line(this.circle.center, vert);
|
|
250
|
+
const angle = lineFromCenter.angle();
|
|
251
|
+
// console.log("angle", (angle / Math.PI) * 180.0);
|
|
252
|
+
// const angle = Math.random() * Math.PI * 2; // TODO
|
|
253
|
+
// Calculate tangent at angle
|
|
254
|
+
return this.circle.tangentAt(angle);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
//--- END --- Implement interface `Intersectable`
|
|
153
258
|
/**
|
|
154
259
|
* This function should invalidate any installed listeners and invalidate this object.
|
|
155
260
|
* After calling this function the object might not hold valid data any more and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircleSector.js","sourceRoot":"","sources":["../ts/CircleSector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CircleSector.js","sourceRoot":"","sources":["../ts/CircleSector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AAEJ,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,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