-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathAffineShapes.js
143 lines (131 loc) · 3.74 KB
/
AffineShapes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* eslint-disable prefer-rest-params */
/**
* AffineShapes
*
* @copyright 2017-2019, Kevin Lindsey
* @module AffineShapes
* @deprecated use ShapeInfo
*/
import ShapeInfo from "./ShapeInfo.js";
/**
* Build shapes for intersection
*/
class AffineShapes {
/**
* arc
*
* @deprecated use ShapeInfo.arc
* @param {module:kld-intersections.Point2D} center
* @param {number} radiusX
* @param {number} radiusY
* @param {number} startRadians
* @param {number} endRadians
* @returns {module:kld-intersections.ShapeInfo}
*/
static arc(center, radiusX, radiusY, startRadians, endRadians) {
return ShapeInfo.arc(...arguments);
}
/**
* quadraticBezier
*
* @deprecated use ShapeInfo.quadraticBezier
* @param {module:kld-intersections.Point2D} p1
* @param {module:kld-intersections.Point2D} p2
* @param {module:kld-intersections.Point2D} p3
* @returns {module:kld-intersections.ShapeInfo}
*/
static quadraticBezier(p1, p2, p3) {
return ShapeInfo.quadraticBezier(...arguments);
}
/**
* cubicBezier
*
* @deprecated use ShapeInfo.cubicBezier
* @param {module:kld-intersections.Point2D} p1
* @param {module:kld-intersections.Point2D} p2
* @param {module:kld-intersections.Point2D} p3
* @param {module:kld-intersections.Point2D} p4
* @returns {module:kld-intersections.ShapeInfo}
*/
static cubicBezier(p1, p2, p3, p4) {
return ShapeInfo.cubicBezier(...arguments);
}
/**
* circle
*
* @deprecated use ShapeInfo.circle
* @param {module:kld-intersections.Point2D} center
* @param {number} radius
* @returns {module:kld-intersections.ShapeInfo}
*/
static circle(center, radius) {
return ShapeInfo.circle(...arguments);
}
/**
* ellipse
*
* @deprecated use ShapeInfo.ellipse
* @param {module:kld-intersections.Point2D} center
* @param {number} radiusX
* @param {number} radiusY
* @returns {module:kld-intersections.ShapeInfo}
*/
static ellipse(center, radiusX, radiusY) {
return ShapeInfo.ellipse(...arguments);
}
/**
* line
*
* @deprecated use ShapeInfo.line
* @param {module:kld-intersections.Point2D} p1
* @param {module:kld-intersections.Point2D} p2
* @returns {module:kld-intersections.ShapeInfo}
*/
static line(p1, p2) {
return ShapeInfo.line(...arguments);
}
/**
* path
*
* @deprecated use ShapeInfo.path
* @param {string} pathData
* @returns {module:kld-intersections.ShapeInfo}
*/
static path(pathData) {
return ShapeInfo.path(...arguments);
}
/**
* polygon
*
* @deprecated use ShapeInfo.polygon
* @param {Array<module:kld-intersections.Point2D>} points
* @returns {module:kld-intersections.ShapeInfo}
*/
static polygon(points) {
return ShapeInfo.polygon(...arguments);
}
/**
* polyline
*
* @deprecated use ShapeInfo.polyline
* @param {Array<module:kld-intersections.Point2D>} points
* @returns {module:kld-intersections.ShapeInfo}
*/
static polyline(points) {
return ShapeInfo.polyline(...arguments);
}
/**
* rectangle
*
* @deprecated use ShapeInfo.rectangle
* @param {module:kld-intersections.Point2D} topLeft
* @param {module:kld-intersections.Vector2D} size
* @param {number} [rx]
* @param {number} [ry]
* @returns {module:kld-intersections.ShapeInfo}
*/
static rectangle(topLeft, size, rx = 0, ry = 0) {
return ShapeInfo.rectangle(...arguments);
}
}
export default AffineShapes;