@plait/core 0.75.0-next.8 → 0.75.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/esm2022/interfaces/index.mjs +2 -1
- package/esm2022/interfaces/svg-arc-command.mjs +2 -0
- package/esm2022/utils/math.mjs +38 -28
- package/fesm2022/plait-core.mjs +38 -28
- package/fesm2022/plait-core.mjs.map +1 -1
- package/interfaces/index.d.ts +1 -0
- package/interfaces/svg-arc-command.d.ts +9 -0
- package/package.json +1 -1
- package/utils/math.d.ts +6 -21
package/interfaces/index.d.ts
CHANGED
package/package.json
CHANGED
package/utils/math.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Point } from '../interfaces';
|
|
1
|
+
import { Point, SVGArcCommand } from '../interfaces';
|
|
2
2
|
import { RectangleClient } from '../interfaces/rectangle-client';
|
|
3
3
|
export declare function distanceBetweenPointAndSegment(x: number, y: number, x1: number, y1: number, x2: number, y2: number): number;
|
|
4
4
|
export declare function getNearestPointBetweenPointAndSegment(point: Point, linePoints: [Point, Point]): Point;
|
|
5
|
-
export declare function distanceBetweenPointAndSegments(
|
|
5
|
+
export declare function distanceBetweenPointAndSegments(point: Point, points: Point[]): number;
|
|
6
6
|
export declare function getNearestPointBetweenPointAndSegments(point: Point, points: Point[], isClose?: Boolean): Point;
|
|
7
|
+
export declare function getNearestPointBetweenPointAndDiscreteSegments(point: Point, segments: [Point, Point][]): Point;
|
|
7
8
|
export declare function getNearestPointBetweenPointAndEllipse(point: Point, center: Point, rx: number, ry: number): Point;
|
|
8
9
|
export declare function rotate(x1: number, y1: number, x2: number, y2: number, angle: number): number[];
|
|
9
10
|
export declare function distanceBetweenPointAndPoint(x1: number, y1: number, x2: number, y2: number): number;
|
|
@@ -53,30 +54,14 @@ export declare function getPointBetween(x0: number, y0: number, x1: number, y1:
|
|
|
53
54
|
* 获取点到半椭圆弧段的最近点
|
|
54
55
|
* @param point 目标点
|
|
55
56
|
* @param startPoint 弧段起点
|
|
56
|
-
* @param
|
|
57
|
+
* @param arcCommand SVG 弧形命令参数
|
|
57
58
|
*/
|
|
58
59
|
/**
|
|
59
60
|
* 计算椭圆弧的中心点和实际半径
|
|
60
61
|
*/
|
|
61
|
-
export declare function getEllipseArcCenter(startPoint: Point,
|
|
62
|
-
rx: number;
|
|
63
|
-
ry: number;
|
|
64
|
-
xAxisRotation: number;
|
|
65
|
-
largeArcFlag: 0 | 1;
|
|
66
|
-
sweepFlag: 0 | 1;
|
|
67
|
-
endX: number;
|
|
68
|
-
endY: number;
|
|
69
|
-
}): {
|
|
62
|
+
export declare function getEllipseArcCenter(startPoint: Point, arcCommand: SVGArcCommand): {
|
|
70
63
|
center: Point;
|
|
71
64
|
rx: number;
|
|
72
65
|
ry: number;
|
|
73
66
|
};
|
|
74
|
-
export declare function getNearestPointBetweenPointAndArc(point: Point, startPoint: Point,
|
|
75
|
-
rx: number;
|
|
76
|
-
ry: number;
|
|
77
|
-
xAxisRotation: number;
|
|
78
|
-
largeArcFlag: 0 | 1;
|
|
79
|
-
sweepFlag: 0 | 1;
|
|
80
|
-
endX: number;
|
|
81
|
-
endY: number;
|
|
82
|
-
}): Point;
|
|
67
|
+
export declare function getNearestPointBetweenPointAndArc(point: Point, startPoint: Point, arcCommand: SVGArcCommand): Point;
|