-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathShapes.js
157 lines (145 loc) · 3.79 KB
/
Shapes.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/* eslint-disable prefer-rest-params */
/**
* Shapes
*
* @copyright 2017, Kevin Lindsey
* @module Shapes
* @deprecated use ShapeInfo
*/
import ShapeInfo from "./ShapeInfo.js";
/**
* Build shapes for intersection
*/
class Shapes {
/**
* arc
*
* @deprecated use ShapeInfo.arc
* @param {number} centerX
* @param {number} centerY
* @param {number} radiusX
* @param {number} radiusY
* @param {number} startRadians
* @param {number} endRadians
* @returns {module:kld-intersections.ShapeInfo}
*/
static arc(centerX, centerY, radiusX, radiusY, startRadians, endRadians) {
return ShapeInfo.arc(...arguments);
}
/**
* quadraticBezier
*
* @deprecated use ShapeInfo.quadraticBezier
* @param {number} p1x
* @param {number} p1y
* @param {number} p2x
* @param {number} p2y
* @param {number} p3x
* @param {number} p3y
* @returns {module:kld-intersections.ShapeInfo}
*/
static quadraticBezier(p1x, p1y, p2x, p2y, p3x, p3y) {
return ShapeInfo.quadraticBezier(...arguments);
}
/**
* cubicBezier
*
* @deprecated use ShapeInfo.cubicBezier
* @param {number} p1x
* @param {number} p1y
* @param {number} p2x
* @param {number} p2y
* @param {number} p3x
* @param {number} p3y
* @param {number} p4x
* @param {number} p4y
* @returns {module:kld-intersections.ShapeInfo}
*/
static cubicBezier(p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y) {
return ShapeInfo.cubicBezier(...arguments);
}
/**
* circle
*
* @deprecated use ShapeInfo.circle
* @param {number} centerX
* @param {number} centerY
* @param {number} radius
* @returns {module:kld-intersections.ShapeInfo}
*/
static circle(centerX, centerY, radius) {
return ShapeInfo.circle(...arguments);
}
/**
* ellipse
*
* @deprecated use ShapeInfo.ellipse
* @param {number} centerX
* @param {number} centerY
* @param {number} radiusX
* @param {number} radiusY
* @returns {module:kld-intersections.ShapeInfo}
*/
static ellipse(centerX, centerY, radiusX, radiusY) {
return ShapeInfo.ellipse(...arguments);
}
/**
* line
*
* @deprecated use ShapeInfo.line
* @param {number} p1x
* @param {number} p1y
* @param {number} p2x
* @param {number} p2y
* @returns {module:kld-intersections.ShapeInfo}
*/
static line(p1x, p1y, p2x, p2y) {
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<number>} coords
* @returns {module:kld-intersections.ShapeInfo}
*/
static polygon(coords) {
return ShapeInfo.polygon(...arguments);
}
/**
* polyline
*
* @deprecated use ShapeInfo.polyline
* @param {Array<number>} coords
* @returns {module:kld-intersections.ShapeInfo}
*/
static polyline(coords) {
return ShapeInfo.polyline(...arguments);
}
/**
* rectangle
*
* @deprecated use ShapeInfo.rectangle
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
* @param {number} [rx]
* @param {number} [ry]
* @returns {module:kld-intersections.ShapeInfo}
*/
static rectangle(x, y, width, height, rx = 0, ry = 0) {
return ShapeInfo.rectangle(...arguments);
}
}
export default Shapes;