@wcardinal/wcardinal-ui 0.469.0 → 0.470.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.
- package/dist/types/wcardinal/ui/shape/e-shape-type.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/load/index.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/load/load-shape-sector.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/deserialize-sector.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/{e-shape-fan-triangulated-impl.d.ts → e-shape-sector-triangulated-impl.d.ts} +9 -9
- package/dist/types/wcardinal/ui/shape/variant/{e-shape-fan-triangulated.d.ts → e-shape-sector-triangulated.d.ts} +1 -1
- package/dist/types/wcardinal/ui/shape/variant/{e-shape-fan.d.ts → e-shape-sector.d.ts} +7 -7
- package/dist/types/wcardinal/ui/shape/variant/e-shape-semicircle.d.ts +4 -4
- package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated-impl.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/variant/hit-test-sector.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/index.d.ts +7 -7
- package/dist/types/wcardinal/ui/shape/variant/to-sector-angle-centric.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/to-sector-angle-eccentric.d.ts +5 -0
- package/dist/wcardinal/ui/shape/e-shape-type.js +1 -1
- package/dist/wcardinal/ui/shape/e-shape-type.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/index.js +1 -1
- package/dist/wcardinal/ui/shape/load/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-all.js +2 -2
- package/dist/wcardinal/ui/shape/load/load-shape-all.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/{load-shape-fan.js → load-shape-sector.js} +6 -6
- package/dist/wcardinal/ui/shape/load/load-shape-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{deserialize-fan.js → deserialize-sector.js} +4 -4
- package/dist/wcardinal/ui/shape/variant/deserialize-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{e-shape-fan-triangulated-impl.js → e-shape-sector-triangulated-impl.js} +103 -103
- package/dist/wcardinal/ui/shape/variant/e-shape-sector-triangulated-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{e-shape-fan-triangulated.js → e-shape-sector-triangulated.js} +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-sector-triangulated.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{e-shape-fan.js → e-shape-sector.js} +23 -23
- package/dist/wcardinal/ui/shape/variant/e-shape-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js +4 -4
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated-impl.js +44 -11
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/{hit-test-fan.js → hit-test-sector.js} +13 -13
- package/dist/wcardinal/ui/shape/variant/hit-test-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/hit-test-triangle-rounded.js +33 -2
- package/dist/wcardinal/ui/shape/variant/hit-test-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/index.js +7 -7
- package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-centric.js +11 -0
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-centric.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-eccentric.js +12 -0
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-eccentric.js.map +1 -0
- package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +227 -163
- package/dist/wcardinal-ui.js +227 -163
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/shape/load/load-shape-fan.d.ts +0 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-fan.d.ts +0 -4
- package/dist/types/wcardinal/ui/shape/variant/hit-test-fan.d.ts +0 -2
- package/dist/types/wcardinal/ui/shape/variant/to-fan-angle-centric.d.ts +0 -4
- package/dist/types/wcardinal/ui/shape/variant/to-fan-angle-eccentric.d.ts +0 -5
- package/dist/wcardinal/ui/shape/load/load-shape-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/hit-test-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-centric.js +0 -11
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-centric.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-eccentric.js +0 -12
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-eccentric.js.map +0 -1
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { EShapeDefaults } from "../e-shape-defaults";
|
|
6
6
|
import { EShapeStrokeSide } from "../e-shape-stroke-side";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { toSectorAngleCentric } from "./to-sector-angle-centric";
|
|
8
|
+
import { toSectorAngleEccentric } from "./to-sector-angle-eccentric";
|
|
9
9
|
/**
|
|
10
|
-
* Triangulates a
|
|
10
|
+
* Triangulates a sector whose arc is on the ellipse with the semi-axes (w, h) centered at the origin O.
|
|
11
11
|
* The vertices are computed in the frame where w and h are positive and flipped at the end.
|
|
12
12
|
*
|
|
13
13
|
* ## Points
|
|
14
14
|
*
|
|
15
|
-
* - O: the apex of the
|
|
15
|
+
* - O: the apex of the sector, the origin
|
|
16
16
|
* - A, B: the end points of the arc, (-w sin(ea), -h cos(ea)) and (+w sin(ea), -h cos(ea))
|
|
17
|
-
* - C: the point where the area of the
|
|
17
|
+
* - C: the point where the area of the sector becomes zero when the sector shrinks, (0, -h / (1 + sin(ca)))
|
|
18
18
|
* - P[k]: the points on the arc, k in [0, 2N] (P[0] = A, P[N] is the top, P[2N] = B)
|
|
19
|
-
* - Q[k]: the points on the medial axis of the
|
|
19
|
+
* - Q[k]: the points on the medial axis of the sector, which are on the normal of the arc at P[k]
|
|
20
20
|
* and equidistant from the arc and the straight sides (Q[0] = A, Q[N] = C, Q[2N] = B)
|
|
21
21
|
* - R[k]: the points P[k] shifted outward for the anti-aliasing
|
|
22
22
|
* - O': the point O shifted outward for the anti-aliasing
|
|
@@ -29,18 +29,18 @@ import { toFanAngleEccentric } from "./to-fan-angle-eccentric";
|
|
|
29
29
|
* where the outline is the arc and/or the straight sides depending on the stroke side.
|
|
30
30
|
*
|
|
31
31
|
* - ARC and BOTTOM (and NONE): the stroke is at the arc and the straight sides.
|
|
32
|
-
* The
|
|
32
|
+
* The sector is triangulated into the strip P[k], P[k + 1], Q[k + 1], Q[k] and
|
|
33
33
|
* the two polygons O', A', Q[0], ..., Q[N] and O', B', Q[2N], ..., Q[N] at the bottom.
|
|
34
34
|
* - ARC: the stroke is only at the arc.
|
|
35
|
-
* For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact
|
|
35
|
+
* For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact sector with the strip only.
|
|
36
36
|
* For the other ellipses, Q[k] are on the medial axis as ARC and BOTTOM, and the two polygons
|
|
37
37
|
* O, Q[0], ..., Q[N] and O, Q[2N], ..., Q[N] are added at the bottom without the stroke and the anti-aliasing.
|
|
38
38
|
* - BOTTOM: the stroke is only at the straight sides.
|
|
39
39
|
* It is the same as a polygon. Two triangle fans from C cover the area between the arc and the segments CA and CB,
|
|
40
40
|
* and two quads O', A', A, C and O', B', B, C cover the rest.
|
|
41
41
|
*/
|
|
42
|
-
var
|
|
43
|
-
function
|
|
42
|
+
var EShapeSectorTriangulatedImpl = /** @class */ (function () {
|
|
43
|
+
function EShapeSectorTriangulatedImpl(parent) {
|
|
44
44
|
this._id = 0;
|
|
45
45
|
this._parent = parent;
|
|
46
46
|
this._width = 0;
|
|
@@ -62,7 +62,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
62
62
|
this._nindices = 0;
|
|
63
63
|
this._boundary = [0, 0, 0, 0];
|
|
64
64
|
}
|
|
65
|
-
Object.defineProperty(
|
|
65
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "id", {
|
|
66
66
|
get: function () {
|
|
67
67
|
this.triangulate();
|
|
68
68
|
return this._id;
|
|
@@ -70,7 +70,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70
70
|
enumerable: false,
|
|
71
71
|
configurable: true
|
|
72
72
|
});
|
|
73
|
-
Object.defineProperty(
|
|
73
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "vertices", {
|
|
74
74
|
get: function () {
|
|
75
75
|
this.triangulate();
|
|
76
76
|
return this._vertices;
|
|
@@ -78,7 +78,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
78
78
|
enumerable: false,
|
|
79
79
|
configurable: true
|
|
80
80
|
});
|
|
81
|
-
Object.defineProperty(
|
|
81
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "nvertices", {
|
|
82
82
|
get: function () {
|
|
83
83
|
this.triangulate();
|
|
84
84
|
return this._nvertices;
|
|
@@ -86,7 +86,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
86
86
|
enumerable: false,
|
|
87
87
|
configurable: true
|
|
88
88
|
});
|
|
89
|
-
Object.defineProperty(
|
|
89
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "distances", {
|
|
90
90
|
get: function () {
|
|
91
91
|
this.triangulate();
|
|
92
92
|
return this._distances;
|
|
@@ -94,7 +94,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
94
94
|
enumerable: false,
|
|
95
95
|
configurable: true
|
|
96
96
|
});
|
|
97
|
-
Object.defineProperty(
|
|
97
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "lengths", {
|
|
98
98
|
get: function () {
|
|
99
99
|
this.triangulate();
|
|
100
100
|
return this._lengths;
|
|
@@ -102,7 +102,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
102
102
|
enumerable: false,
|
|
103
103
|
configurable: true
|
|
104
104
|
});
|
|
105
|
-
Object.defineProperty(
|
|
105
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "clippings", {
|
|
106
106
|
get: function () {
|
|
107
107
|
this.triangulate();
|
|
108
108
|
return this._clippings;
|
|
@@ -110,7 +110,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
110
110
|
enumerable: false,
|
|
111
111
|
configurable: true
|
|
112
112
|
});
|
|
113
|
-
Object.defineProperty(
|
|
113
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "uvs", {
|
|
114
114
|
get: function () {
|
|
115
115
|
this.triangulate();
|
|
116
116
|
return this._uvs;
|
|
@@ -118,7 +118,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
118
118
|
enumerable: false,
|
|
119
119
|
configurable: true
|
|
120
120
|
});
|
|
121
|
-
Object.defineProperty(
|
|
121
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "indices", {
|
|
122
122
|
get: function () {
|
|
123
123
|
this.triangulate();
|
|
124
124
|
return this._indices;
|
|
@@ -126,7 +126,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
126
126
|
enumerable: false,
|
|
127
127
|
configurable: true
|
|
128
128
|
});
|
|
129
|
-
Object.defineProperty(
|
|
129
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "nindices", {
|
|
130
130
|
get: function () {
|
|
131
131
|
this.triangulate();
|
|
132
132
|
return this._nindices;
|
|
@@ -134,7 +134,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
134
134
|
enumerable: false,
|
|
135
135
|
configurable: true
|
|
136
136
|
});
|
|
137
|
-
Object.defineProperty(
|
|
137
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "boundary", {
|
|
138
138
|
get: function () {
|
|
139
139
|
this.triangulate();
|
|
140
140
|
return this._boundary;
|
|
@@ -142,7 +142,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
142
142
|
enumerable: false,
|
|
143
143
|
configurable: true
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
EShapeSectorTriangulatedImpl.prototype.triangulate = function () {
|
|
146
146
|
var isNotInitialized = this._id === 0;
|
|
147
147
|
var parent = this._parent;
|
|
148
148
|
var size = parent.size;
|
|
@@ -180,7 +180,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
180
180
|
this.update(sizeX, sizeY, angle, strokeSideArc, strokeSideBottom);
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
|
|
183
|
+
EShapeSectorTriangulatedImpl.prototype.update = function (sx, sy, angle, ssa, ssb) {
|
|
184
184
|
// The number of the arc segments is 2n and the number of the points on the arc is m.
|
|
185
185
|
var n = EShapeDefaults.CIRCLE_SEGMENT_COUNT >> 2;
|
|
186
186
|
var m = 2 * n + 1;
|
|
@@ -196,8 +196,8 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
196
196
|
this.updateEmpty(ax, ay, nv, ni);
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
var ca =
|
|
200
|
-
var ea =
|
|
199
|
+
var ca = toSectorAngleCentric(angle);
|
|
200
|
+
var ea = toSectorAngleEccentric(ax, ay, ca);
|
|
201
201
|
var sea = Math.sin(ea);
|
|
202
202
|
var cea = Math.cos(ea);
|
|
203
203
|
var bx = ax * sea;
|
|
@@ -224,9 +224,9 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
/**
|
|
227
|
-
* Fills the empty
|
|
227
|
+
* Fills the empty sector, which has no vertices to draw.
|
|
228
228
|
*/
|
|
229
|
-
|
|
229
|
+
EShapeSectorTriangulatedImpl.prototype.updateEmpty = function (w, h, nv, ni) {
|
|
230
230
|
var boundary = this._boundary;
|
|
231
231
|
boundary[0] = -w;
|
|
232
232
|
boundary[1] = -h;
|
|
@@ -234,12 +234,12 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
234
234
|
boundary[3] = +h;
|
|
235
235
|
this.pad(0, 0, nv, ni, 0);
|
|
236
236
|
};
|
|
237
|
-
|
|
237
|
+
EShapeSectorTriangulatedImpl.prototype.updateArc = function (w, h, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, ssa, ssb, nv, ni) {
|
|
238
238
|
var m = 2 * n + 1;
|
|
239
239
|
// sided: the straight sides are the outline, which has the stroke and the anti-aliasing
|
|
240
240
|
// capped: the polygons are added at the bottom to cover the sector with the hard straight sides
|
|
241
241
|
// chained: Q is on the medial axis. Otherwise, Q is on the axis x = 0 (w <= h) or y = 0 (h < w)
|
|
242
|
-
// For a circle and a semi-ellipse, Q on the axis gives the exact
|
|
242
|
+
// For a circle and a semi-ellipse, Q on the axis gives the exact sector.
|
|
243
243
|
var sided = !ssa || ssb;
|
|
244
244
|
var isExact = Math.abs(w - h) <= 1e-9 * w || Math.PI * 0.5 <= ea;
|
|
245
245
|
var capped = !sided && !isExact;
|
|
@@ -262,7 +262,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
262
262
|
boundary[2] = +bx;
|
|
263
263
|
boundary[3] = 0;
|
|
264
264
|
var fd = 1 / dmax;
|
|
265
|
-
var fs = (
|
|
265
|
+
var fs = (EShapeSectorTriangulatedImpl.SCALE - 1) * dmax;
|
|
266
266
|
this.computeRimPoints(n, fs, st, ct, sided);
|
|
267
267
|
// Strip: 4 * (m - 1) vertices and 2 * 3 * (m - 1) indices
|
|
268
268
|
this.writeStrip(m, fd, fx, fy, gx, gy);
|
|
@@ -293,10 +293,10 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
293
293
|
* The points are symmetric with respect to the axis x = 0, so only the left half is computed
|
|
294
294
|
* and the right half is mirrored from it.
|
|
295
295
|
*/
|
|
296
|
-
|
|
296
|
+
EShapeSectorTriangulatedImpl.prototype.computeArcPoints = function (w, h, n, ea, sea, cea) {
|
|
297
297
|
var m = 2 * n + 1;
|
|
298
|
-
var px =
|
|
299
|
-
var py =
|
|
298
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
299
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
300
300
|
var da = ea / n;
|
|
301
301
|
var cda = Math.cos(da);
|
|
302
302
|
var sda = Math.sin(da);
|
|
@@ -326,14 +326,14 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
326
326
|
* The normal at P is Np = (-h x / w, -w y / h), whose magnitude is the speed of the arc.
|
|
327
327
|
* The lengths are the ones of the polyline, which is the actual outline, so that they are exact at clipping = 1.
|
|
328
328
|
*/
|
|
329
|
-
|
|
329
|
+
EShapeSectorTriangulatedImpl.prototype.computeArcNormals = function (w, h, n) {
|
|
330
330
|
var m = 2 * n + 1;
|
|
331
|
-
var px =
|
|
332
|
-
var py =
|
|
333
|
-
var nx =
|
|
334
|
-
var ny =
|
|
335
|
-
var speeds =
|
|
336
|
-
var ls =
|
|
331
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
332
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
333
|
+
var nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;
|
|
334
|
+
var ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;
|
|
335
|
+
var speeds = EShapeSectorTriangulatedImpl.WORK_SPEED;
|
|
336
|
+
var ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;
|
|
337
337
|
var hw = h / w;
|
|
338
338
|
var wh = w / h;
|
|
339
339
|
var l = 0;
|
|
@@ -370,16 +370,16 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
370
370
|
*
|
|
371
371
|
* Otherwise, the normal is extended until it reaches x = 0 if w <= h, otherwise y = 0.
|
|
372
372
|
*/
|
|
373
|
-
|
|
373
|
+
EShapeSectorTriangulatedImpl.prototype.computeMedialPoints = function (w, h, n, st, ct, chained) {
|
|
374
374
|
var m = 2 * n + 1;
|
|
375
|
-
var px =
|
|
376
|
-
var py =
|
|
377
|
-
var nx =
|
|
378
|
-
var ny =
|
|
379
|
-
var speeds =
|
|
380
|
-
var qx =
|
|
381
|
-
var qy =
|
|
382
|
-
var qd =
|
|
375
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
376
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
377
|
+
var nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;
|
|
378
|
+
var ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;
|
|
379
|
+
var speeds = EShapeSectorTriangulatedImpl.WORK_SPEED;
|
|
380
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
381
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
382
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
383
383
|
var u = w <= h ? w / h : h / w;
|
|
384
384
|
var dmax = 0;
|
|
385
385
|
for (var k = 0; k <= n; ++k) {
|
|
@@ -429,14 +429,14 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
429
429
|
* If the straight sides are the outline, the end points are shifted
|
|
430
430
|
* to the intersections of the shifted arc and the shifted straight sides.
|
|
431
431
|
*/
|
|
432
|
-
|
|
432
|
+
EShapeSectorTriangulatedImpl.prototype.computeRimPoints = function (n, fs, st, ct, sided) {
|
|
433
433
|
var m = 2 * n + 1;
|
|
434
|
-
var px =
|
|
435
|
-
var py =
|
|
436
|
-
var nx =
|
|
437
|
-
var ny =
|
|
438
|
-
var rx =
|
|
439
|
-
var ry =
|
|
434
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
435
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
436
|
+
var nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;
|
|
437
|
+
var ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;
|
|
438
|
+
var rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;
|
|
439
|
+
var ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;
|
|
440
440
|
for (var k = 0; k < m; ++k) {
|
|
441
441
|
var x = px[k] - fs * nx[k];
|
|
442
442
|
var y = py[k] - fs * ny[k];
|
|
@@ -461,16 +461,16 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
461
461
|
* Each quad owns its vertices. The length in a quad is the length at P[k] plus the projection
|
|
462
462
|
* to the chord P[k]P[k + 1], which is exact at clipping = 1 where the chord is the outline.
|
|
463
463
|
*/
|
|
464
|
-
|
|
465
|
-
var px =
|
|
466
|
-
var py =
|
|
467
|
-
var qx =
|
|
468
|
-
var qy =
|
|
469
|
-
var qd =
|
|
470
|
-
var ls =
|
|
471
|
-
var rx =
|
|
472
|
-
var ry =
|
|
473
|
-
var scale =
|
|
464
|
+
EShapeSectorTriangulatedImpl.prototype.writeStrip = function (m, fd, fx, fy, gx, gy) {
|
|
465
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
466
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
467
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
468
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
469
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
470
|
+
var ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;
|
|
471
|
+
var rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;
|
|
472
|
+
var ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;
|
|
473
|
+
var scale = EShapeSectorTriangulatedImpl.SCALE;
|
|
474
474
|
var indices = this._indices;
|
|
475
475
|
var iv = 0;
|
|
476
476
|
var ii = 0;
|
|
@@ -521,14 +521,14 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
521
521
|
* The clipping and the length are computed from the straight side:
|
|
522
522
|
* the outward unit normal is (sign * ct, st) and the length is oa + arc + (-st, sign * ct) . p.
|
|
523
523
|
*/
|
|
524
|
-
|
|
524
|
+
EShapeSectorTriangulatedImpl.prototype.writeSidePolygon = function (iv, ii, sign, n, w, oa, st, ct, fs, fd, fx, fy, gx, gy) {
|
|
525
525
|
var m = 2 * n + 1;
|
|
526
|
-
var qx =
|
|
527
|
-
var qy =
|
|
528
|
-
var qd =
|
|
529
|
-
var rx =
|
|
530
|
-
var ry =
|
|
531
|
-
var l0 = oa +
|
|
526
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
527
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
528
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
529
|
+
var rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;
|
|
530
|
+
var ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;
|
|
531
|
+
var l0 = oa + EShapeSectorTriangulatedImpl.WORK_ARC_L[m - 1];
|
|
532
532
|
var nx = sign * ct;
|
|
533
533
|
var ly = sign * ct;
|
|
534
534
|
var eps = 1e-9 * w;
|
|
@@ -569,12 +569,12 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
569
569
|
*
|
|
570
570
|
* The clipping of O is given by co, and the length of O is the one of the end point.
|
|
571
571
|
*/
|
|
572
|
-
|
|
572
|
+
EShapeSectorTriangulatedImpl.prototype.writeCapPolygon = function (iv, ii, sign, n, w, co, fd, fx, fy, gx, gy) {
|
|
573
573
|
var m = 2 * n + 1;
|
|
574
|
-
var qx =
|
|
575
|
-
var qy =
|
|
576
|
-
var qd =
|
|
577
|
-
var ls =
|
|
574
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
575
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
576
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
577
|
+
var ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;
|
|
578
578
|
var eps = 1e-9 * w;
|
|
579
579
|
var end = sign < 0 ? 0 : m - 1;
|
|
580
580
|
this.writeVertex(iv, 0, 0, ls[end], co, fd, fx, fy, gx, gy);
|
|
@@ -593,7 +593,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
593
593
|
/**
|
|
594
594
|
* The clipping is 1 - (the distance from the straight side) / d where d is the distance from C to OA (or OB).
|
|
595
595
|
*/
|
|
596
|
-
|
|
596
|
+
EShapeSectorTriangulatedImpl.prototype.updateBottom = function (w, h, n, ea, sea, cea, bx, by, st, ct, fx, fy, gx, gy, nv, ni) {
|
|
597
597
|
var boundary = this._boundary;
|
|
598
598
|
boundary[0] = -bx;
|
|
599
599
|
boundary[1] = -h;
|
|
@@ -601,11 +601,11 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
601
601
|
boundary[3] = 0;
|
|
602
602
|
var yc = h / (1 + st);
|
|
603
603
|
var fd = (1 + st) / (h * st);
|
|
604
|
-
var fs = (
|
|
604
|
+
var fs = (EShapeSectorTriangulatedImpl.SCALE - 1) / fd;
|
|
605
605
|
this.computeArcPoints(w, h, n, ea, sea, cea);
|
|
606
606
|
this.computeArcNormals(w, h, n);
|
|
607
607
|
// The length of O, which is the same as the one of writeSidePolygon: |OA| + the length of the arc
|
|
608
|
-
var l0 = Math.sqrt(bx * bx + by * by) +
|
|
608
|
+
var l0 = Math.sqrt(bx * bx + by * by) + EShapeSectorTriangulatedImpl.WORK_ARC_L[2 * n];
|
|
609
609
|
// Triangle fans from C to the arc: left (sign = -1) and right (sign = +1)
|
|
610
610
|
var iv = 0;
|
|
611
611
|
var ii = 0;
|
|
@@ -630,9 +630,9 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
630
630
|
* and the length is l0 + (-st, sign * ct) . p, which is the same as the one of writeSidePolygon
|
|
631
631
|
* so that the dashes of the straight sides do not depend on the stroke side.
|
|
632
632
|
*/
|
|
633
|
-
|
|
634
|
-
var px =
|
|
635
|
-
var py =
|
|
633
|
+
EShapeSectorTriangulatedImpl.prototype.writeBottomFan = function (iv, ii, sign, n, yc, l0, st, ct, fd, fx, fy, gx, gy) {
|
|
634
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
635
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
636
636
|
var nx = sign * ct;
|
|
637
637
|
var ly = sign * ct;
|
|
638
638
|
var count = 0;
|
|
@@ -649,7 +649,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
649
649
|
* O' is shifted outward by fs / st, and A' (B') is shifted outward by fs perpendicular to the straight side.
|
|
650
650
|
* Returns the number of the written vertices.
|
|
651
651
|
*/
|
|
652
|
-
|
|
652
|
+
EShapeSectorTriangulatedImpl.prototype.writeBottomQuad = function (iv, ii, sign, bx, by, yc, l0, fs, st, ct, fd, fx, fy, gx, gy) {
|
|
653
653
|
var nx = sign * ct;
|
|
654
654
|
var ly = sign * ct;
|
|
655
655
|
this.writeSideVertex(iv, 0, fs / st, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
|
|
@@ -667,7 +667,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
667
667
|
* The clipping is 1 + fd * (nx * x + ny * y), which is not less than the given floor,
|
|
668
668
|
* and the length is l0 + lx * x + ly * y.
|
|
669
669
|
*/
|
|
670
|
-
|
|
670
|
+
EShapeSectorTriangulatedImpl.prototype.writeSideVertex = function (vertex, x, y, floor, nx, ny, l0, lx, ly, fd, fx, fy, gx, gy) {
|
|
671
671
|
var clipping = Math.max(floor, 1 + fd * (nx * x + ny * y));
|
|
672
672
|
var length = l0 + lx * x + ly * y;
|
|
673
673
|
this.writeVertex(vertex, x, y, length, clipping, fd, fx, fy, gx, gy);
|
|
@@ -676,7 +676,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
676
676
|
* Writes the indices of a triangle fan from the first vertex.
|
|
677
677
|
* The number of the written indices is 3 * (count - 2).
|
|
678
678
|
*/
|
|
679
|
-
|
|
679
|
+
EShapeSectorTriangulatedImpl.prototype.writeFan = function (ii, iv, count) {
|
|
680
680
|
var indices = this._indices;
|
|
681
681
|
for (var i = 1; i < count - 1; ++i) {
|
|
682
682
|
indices[ii++] = iv;
|
|
@@ -695,7 +695,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
695
695
|
* @param gx - The sign of the X size, which flips the vertex
|
|
696
696
|
* @param gy - The sign of the Y size, which flips the vertex
|
|
697
697
|
*/
|
|
698
|
-
|
|
698
|
+
EShapeSectorTriangulatedImpl.prototype.writeVertex = function (vertex, x, y, length, clipping, fd, fx, fy, gx, gy) {
|
|
699
699
|
var vertex2 = vertex << 1;
|
|
700
700
|
this._vertices[vertex2] = gx * x;
|
|
701
701
|
this._vertices[vertex2 + 1] = gy * y;
|
|
@@ -709,7 +709,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
709
709
|
* Fills the unused tail with degenerated triangles and trims the arrays
|
|
710
710
|
* so that the buffers always hold exactly `nv` vertices and `ni` triangles.
|
|
711
711
|
*/
|
|
712
|
-
|
|
712
|
+
EShapeSectorTriangulatedImpl.prototype.pad = function (iv, ii, nv, ni, distance) {
|
|
713
713
|
for (var i = iv; i < nv; ++i) {
|
|
714
714
|
var vertex2 = i << 1;
|
|
715
715
|
this._vertices[vertex2] = 0;
|
|
@@ -731,28 +731,28 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
731
731
|
this._indices.length = ni * 3;
|
|
732
732
|
};
|
|
733
733
|
/** The ratio of the outer edge, where the clipping is 1, to the edge of the anti-aliasing */
|
|
734
|
-
|
|
734
|
+
EShapeSectorTriangulatedImpl.SCALE = 1.1;
|
|
735
735
|
// Work arrays shared by all the instances because they are used only in a single synchronous triangulation.
|
|
736
736
|
// All of them are indexed by k, which is in [0, 2N].
|
|
737
737
|
/** P: the points on the arc */
|
|
738
|
-
|
|
739
|
-
|
|
738
|
+
EShapeSectorTriangulatedImpl.WORK_ARC_X = [];
|
|
739
|
+
EShapeSectorTriangulatedImpl.WORK_ARC_Y = [];
|
|
740
740
|
/** The lengths of the polyline P[0], ..., P[k] */
|
|
741
|
-
|
|
741
|
+
EShapeSectorTriangulatedImpl.WORK_ARC_L = [];
|
|
742
742
|
/** The unit inward normals of the arc */
|
|
743
|
-
|
|
744
|
-
|
|
743
|
+
EShapeSectorTriangulatedImpl.WORK_NORMAL_X = [];
|
|
744
|
+
EShapeSectorTriangulatedImpl.WORK_NORMAL_Y = [];
|
|
745
745
|
/** The magnitudes of the tangents, that is, the speeds of the arc */
|
|
746
|
-
|
|
746
|
+
EShapeSectorTriangulatedImpl.WORK_SPEED = [];
|
|
747
747
|
/** Q: the points on the normals */
|
|
748
|
-
|
|
749
|
-
|
|
748
|
+
EShapeSectorTriangulatedImpl.WORK_MEDIAL_X = [];
|
|
749
|
+
EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y = [];
|
|
750
750
|
/** The distances from P to Q */
|
|
751
|
-
|
|
751
|
+
EShapeSectorTriangulatedImpl.WORK_MEDIAL_D = [];
|
|
752
752
|
/** R: the points on the arc shifted outward */
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
return
|
|
753
|
+
EShapeSectorTriangulatedImpl.WORK_RIM_X = [];
|
|
754
|
+
EShapeSectorTriangulatedImpl.WORK_RIM_Y = [];
|
|
755
|
+
return EShapeSectorTriangulatedImpl;
|
|
756
756
|
}());
|
|
757
|
-
export {
|
|
758
|
-
//# sourceMappingURL=e-shape-
|
|
757
|
+
export { EShapeSectorTriangulatedImpl };
|
|
758
|
+
//# sourceMappingURL=e-shape-sector-triangulated-impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e-shape-sector-triangulated-impl.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-sector-triangulated-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgC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C,GAAG,CAAC,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAhiCD,6FAA6F;IACnE,kCAAK,GAAG,GAAG,CAAC;IAEtC,4GAA4G;IAC5G,qDAAqD;IACrD,+BAA+B;IACL,uCAAU,GAAa,EAAE,CAAC;IAC1B,uCAAU,GAAa,EAAE,CAAC;IACpD,kDAAkD;IACxB,uCAAU,GAAa,EAAE,CAAC;IACpD,yCAAyC;IACf,0CAAa,GAAa,EAAE,CAAC;IAC7B,0CAAa,GAAa,EAAE,CAAC;IACvD,qEAAqE;IAC3C,uCAAU,GAAa,EAAE,CAAC;IACpD,mCAAmC;IACT,0CAAa,GAAa,EAAE,CAAC;IAC7B,0CAAa,GAAa,EAAE,CAAC;IACvD,gCAAgC;IACN,0CAAa,GAAa,EAAE,CAAC;IACvD,+CAA+C;IACrB,uCAAU,GAAa,EAAE,CAAC;IAC1B,uCAAU,GAAa,EAAE,CAAC;IA2gCrD,mCAAC;CAAA,AAliCD,IAkiCC;SAliCY,4BAA4B","sourcesContent":["/*\n * Copyright (C) 2019-2026 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { EShape } from \"../e-shape\";\nimport { EShapeBoundary } from \"../e-shape-boundary\";\nimport { EShapeDefaults } from \"../e-shape-defaults\";\nimport { EShapeStrokeSide } from \"../e-shape-stroke-side\";\nimport { EShapeSectorTriangulated } from \"./e-shape-sector-triangulated\";\nimport { toSectorAngleCentric } from \"./to-sector-angle-centric\";\nimport { toSectorAngleEccentric } from \"./to-sector-angle-eccentric\";\n\n/**\n * Triangulates a sector whose arc is on the ellipse with the semi-axes (w, h) centered at the origin O.\n * The vertices are computed in the frame where w and h are positive and flipped at the end.\n *\n * ## Points\n *\n * - O: the apex of the sector, the origin\n * - A, B: the end points of the arc, (-w sin(ea), -h cos(ea)) and (+w sin(ea), -h cos(ea))\n * - C: the point where the area of the sector becomes zero when the sector shrinks, (0, -h / (1 + sin(ca)))\n * - P[k]: the points on the arc, k in [0, 2N] (P[0] = A, P[N] is the top, P[2N] = B)\n * - Q[k]: the points on the medial axis of the sector, which are on the normal of the arc at P[k]\n * and equidistant from the arc and the straight sides (Q[0] = A, Q[N] = C, Q[2N] = B)\n * - R[k]: the points P[k] shifted outward for the anti-aliasing\n * - O': the point O shifted outward for the anti-aliasing\n *\n * ## Stroke sides\n *\n * The arc is stroked if any of the LEFT, TOP and RIGHT bits of the stroke side is set (ARC below),\n * and the straight sides are stroked if the BOTTOM bit is set.\n * The clipping of a vertex is 1 on the outline and decreases toward the inside by (the distance from the outline) * fd,\n * where the outline is the arc and/or the straight sides depending on the stroke side.\n *\n * - ARC and BOTTOM (and NONE): the stroke is at the arc and the straight sides.\n * The sector is triangulated into the strip P[k], P[k + 1], Q[k + 1], Q[k] and\n * the two polygons O', A', Q[0], ..., Q[N] and O', B', Q[2N], ..., Q[N] at the bottom.\n * - ARC: the stroke is only at the arc.\n * For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact sector with the strip only.\n * For the other ellipses, Q[k] are on the medial axis as ARC and BOTTOM, and the two polygons\n * O, Q[0], ..., Q[N] and O, Q[2N], ..., Q[N] are added at the bottom without the stroke and the anti-aliasing.\n * - BOTTOM: the stroke is only at the straight sides.\n * It is the same as a polygon. Two triangle fans from C cover the area between the arc and the segments CA and CB,\n * and two quads O', A', A, C and O', B', B, C cover the rest.\n */\nexport class EShapeSectorTriangulatedImpl implements EShapeSectorTriangulated {\n\t/** The ratio of the outer edge, where the clipping is 1, to the edge of the anti-aliasing */\n\tprotected static readonly SCALE = 1.1;\n\n\t// Work arrays shared by all the instances because they are used only in a single synchronous triangulation.\n\t// All of them are indexed by k, which is in [0, 2N].\n\t/** P: the points on the arc */\n\tprotected static readonly WORK_ARC_X: number[] = [];\n\tprotected static readonly WORK_ARC_Y: number[] = [];\n\t/** The lengths of the polyline P[0], ..., P[k] */\n\tprotected static readonly WORK_ARC_L: number[] = [];\n\t/** The unit inward normals of the arc */\n\tprotected static readonly WORK_NORMAL_X: number[] = [];\n\tprotected static readonly WORK_NORMAL_Y: number[] = [];\n\t/** The magnitudes of the tangents, that is, the speeds of the arc */\n\tprotected static readonly WORK_SPEED: number[] = [];\n\t/** Q: the points on the normals */\n\tprotected static readonly WORK_MEDIAL_X: number[] = [];\n\tprotected static readonly WORK_MEDIAL_Y: number[] = [];\n\t/** The distances from P to Q */\n\tprotected static readonly WORK_MEDIAL_D: number[] = [];\n\t/** R: the points on the arc shifted outward */\n\tprotected static readonly WORK_RIM_X: number[] = [];\n\tprotected static readonly WORK_RIM_Y: number[] = [];\n\n\tprotected _id: number;\n\tprotected _parent: EShape;\n\tprotected _width: number;\n\tprotected _height: number;\n\tprotected _strokeAlign: number;\n\tprotected _strokeWidth: number;\n\tprotected _strokeSideArc: boolean;\n\tprotected _strokeSideBottom: boolean;\n\tprotected _angle: number;\n\tprotected _sizeX: number;\n\tprotected _sizeY: number;\n\tprotected _vertices: number[];\n\tprotected _nvertices: number;\n\tprotected _distances: number[];\n\tprotected _lengths: number[];\n\tprotected _clippings: number[];\n\tprotected _uvs: number[];\n\tprotected _indices: number[];\n\tprotected _nindices: number;\n\tprotected _boundary: EShapeBoundary;\n\n\tconstructor(parent: EShape) {\n\t\tthis._id = 0;\n\t\tthis._parent = parent;\n\t\tthis._width = 0;\n\t\tthis._height = 0;\n\t\tthis._strokeAlign = 0;\n\t\tthis._strokeWidth = 0;\n\t\tthis._strokeSideArc = true;\n\t\tthis._strokeSideBottom = true;\n\t\tthis._angle = 0;\n\t\tthis._sizeX = 0;\n\t\tthis._sizeY = 0;\n\t\tthis._vertices = [];\n\t\tthis._nvertices = 0;\n\t\tthis._distances = [];\n\t\tthis._lengths = [];\n\t\tthis._clippings = [];\n\t\tthis._uvs = [];\n\t\tthis._indices = [];\n\t\tthis._nindices = 0;\n\t\tthis._boundary = [0, 0, 0, 0];\n\t}\n\n\tget id(): number {\n\t\tthis.triangulate();\n\t\treturn this._id;\n\t}\n\n\tget vertices(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._vertices;\n\t}\n\n\tget nvertices(): number {\n\t\tthis.triangulate();\n\t\treturn this._nvertices;\n\t}\n\n\tget distances(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._distances;\n\t}\n\n\tget lengths(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._lengths;\n\t}\n\n\tget clippings(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._clippings;\n\t}\n\n\tget uvs(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._uvs;\n\t}\n\n\tget indices(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._indices;\n\t}\n\n\tget nindices(): number {\n\t\tthis.triangulate();\n\t\treturn this._nindices;\n\t}\n\n\tget boundary(): EShapeBoundary {\n\t\tthis.triangulate();\n\t\treturn this._boundary;\n\t}\n\n\tprotected triangulate(): void {\n\t\tconst isNotInitialized = this._id === 0;\n\n\t\tconst parent = this._parent;\n\t\tconst size = parent.size;\n\t\tconst width = size.x;\n\t\tconst height = size.y;\n\t\tconst isRectChanged = this._width !== width || this._height !== height;\n\n\t\tconst stroke = parent.stroke;\n\t\tconst strokeAlign = stroke.align;\n\t\tconst strokeSideArc = (stroke.side & EShapeStrokeSide.NOT_BOTTOM) !== 0;\n\t\tconst strokeSideBottom = (stroke.side & EShapeStrokeSide.BOTTOM) !== 0;\n\t\tconst strokeWidth = stroke.enable && (strokeSideArc || strokeSideBottom) ? stroke.width : 0;\n\t\tconst isStrokeChanged =\n\t\t\tthis._strokeAlign !== strokeAlign || this._strokeWidth !== strokeWidth;\n\t\tconst isStrokeSideChanged =\n\t\t\tthis._strokeSideArc !== strokeSideArc || this._strokeSideBottom !== strokeSideBottom;\n\n\t\tconst angle = parent.angle;\n\t\tconst isAngleChanged = this._angle !== angle;\n\n\t\tlet isSizeChanged = false;\n\t\tlet sizeX = this._sizeX;\n\t\tlet sizeY = this._sizeY;\n\t\tif (isRectChanged || isStrokeChanged) {\n\t\t\tthis._width = width;\n\t\t\tthis._height = height;\n\t\t\tthis._strokeAlign = strokeAlign;\n\t\t\tthis._strokeWidth = strokeWidth;\n\n\t\t\tconst s = strokeAlign * strokeWidth;\n\t\t\tsizeX = width * 0.5 + (0 <= width ? +s : -s);\n\t\t\tsizeY = height * 0.5 + (0 <= height ? +s : -s);\n\t\t\tisSizeChanged = this._sizeX !== sizeX || this._sizeY !== sizeY;\n\t\t}\n\n\t\tif (isNotInitialized || isSizeChanged || isStrokeSideChanged || isAngleChanged) {\n\t\t\tthis._sizeX = sizeX;\n\t\t\tthis._sizeY = sizeY;\n\t\t\tthis._strokeSideArc = strokeSideArc;\n\t\t\tthis._strokeSideBottom = strokeSideBottom;\n\t\t\tthis._angle = angle;\n\t\t\tthis.update(sizeX, sizeY, angle, strokeSideArc, strokeSideBottom);\n\t\t}\n\t}\n\n\tprotected update(sx: number, sy: number, angle: number, ssa: boolean, ssb: boolean): void {\n\t\t// The number of the arc segments is 2n and the number of the points on the arc is m.\n\t\tconst n = EShapeDefaults.CIRCLE_SEGMENT_COUNT >> 2;\n\t\tconst m = 2 * n + 1;\n\t\tconst nv = 4 * (m - 1) + 2 * (n + 4);\n\t\tconst ni = 4 * n + 2 * (n + 2);\n\t\tthis._nvertices = nv;\n\t\tthis._nindices = ni;\n\t\tthis._id += 1;\n\n\t\t// The eccentric angle ea of A and B, and the sine and cosine of it\n\t\tconst ax = Math.abs(sx);\n\t\tconst ay = Math.abs(sy);\n\t\tif (ax <= 0 || ay <= 0) {\n\t\t\tthis.updateEmpty(ax, ay, nv, ni);\n\t\t\treturn;\n\t\t}\n\t\tconst ca = toSectorAngleCentric(angle);\n\t\tconst ea = toSectorAngleEccentric(ax, ay, ca);\n\t\tconst sea = Math.sin(ea);\n\t\tconst cea = Math.cos(ea);\n\t\tconst bx = ax * sea;\n\t\tconst by = ay * cea;\n\t\tconst bz = bx * bx + by * by;\n\t\tif (bx <= 0 || bz <= 0) {\n\t\t\tthis.updateEmpty(ax, ay, nv, ni);\n\t\t\treturn;\n\t\t}\n\n\t\t// The sine and cosine of the geometric half central angle\n\t\tconst oa = Math.sqrt(bz);\n\t\tconst st = bx / oa;\n\t\tconst ct = by / oa;\n\n\t\t// The factors of the UVs and the signs of the flipping\n\t\tconst fx = 1 / bx;\n\t\tconst fy = 1 / ay;\n\t\tconst gx = Math.sign(sx);\n\t\tconst gy = Math.sign(sy);\n\n\t\tif (!ssa && ssb) {\n\t\t\tthis.updateBottom(ax, ay, n, ea, sea, cea, bx, by, st, ct, fx, fy, gx, gy, nv, ni);\n\t\t} else {\n\t\t\tthis.updateArc(\n\t\t\t\tax,\n\t\t\t\tay,\n\t\t\t\tn,\n\t\t\t\tea,\n\t\t\t\tsea,\n\t\t\t\tcea,\n\t\t\t\tbx,\n\t\t\t\toa,\n\t\t\t\tst,\n\t\t\t\tct,\n\t\t\t\tfx,\n\t\t\t\tfy,\n\t\t\t\tgx,\n\t\t\t\tgy,\n\t\t\t\tssa,\n\t\t\t\tssb,\n\t\t\t\tnv,\n\t\t\t\tni\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Fills the empty sector, which has no vertices to draw.\n\t */\n\tprotected updateEmpty(w: number, h: number, nv: number, ni: number): void {\n\t\tconst boundary = this._boundary;\n\t\tboundary[0] = -w;\n\t\tboundary[1] = -h;\n\t\tboundary[2] = +w;\n\t\tboundary[3] = +h;\n\t\tthis.pad(0, 0, nv, ni, 0);\n\t}\n\n\tprotected updateArc(\n\t\tw: number,\n\t\th: number,\n\t\tn: number,\n\t\tea: number,\n\t\tsea: number,\n\t\tcea: number,\n\t\tbx: number,\n\t\toa: number,\n\t\tst: number,\n\t\tct: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number,\n\t\tssa: boolean,\n\t\tssb: boolean,\n\t\tnv: number,\n\t\tni: number\n\t): void {\n\t\tconst m = 2 * n + 1;\n\n\t\t// sided: the straight sides are the outline, which has the stroke and the anti-aliasing\n\t\t// capped: the polygons are added at the bottom to cover the sector with the hard straight sides\n\t\t// chained: Q is on the medial axis. Otherwise, Q is on the axis x = 0 (w <= h) or y = 0 (h < w)\n\t\t// For a circle and a semi-ellipse, Q on the axis gives the exact sector.\n\t\tconst sided = !ssa || ssb;\n\t\tconst isExact = Math.abs(w - h) <= 1e-9 * w || Math.PI * 0.5 <= ea;\n\t\tconst capped = !sided && !isExact;\n\t\tconst chained = sided || capped;\n\n\t\tthis.computeArcPoints(w, h, n, ea, sea, cea);\n\t\tthis.computeArcNormals(w, h, n);\n\t\tlet dmax = this.computeMedialPoints(w, h, n, st, ct, chained);\n\t\tif (capped) {\n\t\t\t// The distance field of the arc must cover O, which is the farthest point from the arc,\n\t\t\t// because the clipping in the polygons at the bottom is interpolated from the arc to O.\n\t\t\tdmax = Math.max(dmax, h <= w ? h : oa);\n\t\t}\n\t\tif (dmax <= 0) {\n\t\t\tthis.updateEmpty(w, h, nv, ni);\n\t\t\treturn;\n\t\t}\n\n\t\tconst boundary = this._boundary;\n\t\tboundary[0] = -bx;\n\t\tboundary[1] = -h;\n\t\tboundary[2] = +bx;\n\t\tboundary[3] = 0;\n\n\t\tconst fd = 1 / dmax;\n\t\tconst fs = (EShapeSectorTriangulatedImpl.SCALE - 1) * dmax;\n\t\tthis.computeRimPoints(n, fs, st, ct, sided);\n\n\t\t// Strip: 4 * (m - 1) vertices and 2 * 3 * (m - 1) indices\n\t\tthis.writeStrip(m, fd, fx, fy, gx, gy);\n\t\tlet iv = 4 * (m - 1);\n\t\tlet ii = 6 * (m - 1);\n\n\t\t// Polygons at the bottom: left (sign = -1) and right (sign = +1)\n\t\tif (sided) {\n\t\t\tfor (let sign = -1; sign <= 1; sign += 2) {\n\t\t\t\tconst count = this.writeSidePolygon(\n\t\t\t\t\tiv,\n\t\t\t\t\tii,\n\t\t\t\t\tsign,\n\t\t\t\t\tn,\n\t\t\t\t\tw,\n\t\t\t\t\toa,\n\t\t\t\t\tst,\n\t\t\t\t\tct,\n\t\t\t\t\tfs,\n\t\t\t\t\tfd,\n\t\t\t\t\tfx,\n\t\t\t\t\tfy,\n\t\t\t\t\tgx,\n\t\t\t\t\tgy\n\t\t\t\t);\n\t\t\t\tiv += count;\n\t\t\t\tii += 3 * (count - 2);\n\t\t\t}\n\t\t} else if (capped) {\n\t\t\tconst co = Math.max(0, 1 - (w >= h ? h : oa) * fd);\n\t\t\tfor (let sign = -1; sign <= 1; sign += 2) {\n\t\t\t\tconst count = this.writeCapPolygon(iv, ii, sign, n, w, co, fd, fx, fy, gx, gy);\n\t\t\t\tiv += count;\n\t\t\t\tii += 3 * (count - 2);\n\t\t\t}\n\t\t}\n\n\t\tthis.pad(iv, ii, nv, ni, fd);\n\t}\n\n\t/**\n\t * Computes P[k], the points on the arc, in the work arrays.\n\t *\n\t * The sine and cosine of the angle are updated by the rotation to avoid calling Math.sin and Math.cos in the loop.\n\t * The points are symmetric with respect to the axis x = 0, so only the left half is computed\n\t * and the right half is mirrored from it.\n\t */\n\tprotected computeArcPoints(\n\t\tw: number,\n\t\th: number,\n\t\tn: number,\n\t\tea: number,\n\t\tsea: number,\n\t\tcea: number\n\t): void {\n\t\tconst m = 2 * n + 1;\n\t\tconst px = EShapeSectorTriangulatedImpl.WORK_ARC_X;\n\t\tconst py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;\n\t\tconst da = ea / n;\n\t\tconst cda = Math.cos(da);\n\t\tconst sda = Math.sin(da);\n\t\tlet s = -sea;\n\t\tlet c = cea;\n\t\tfor (let k = 0; k <= n; ++k) {\n\t\t\t// Use the exact values at the center to prevent the accumulation of the errors.\n\t\t\tif (k === n) {\n\t\t\t\ts = 0;\n\t\t\t\tc = 1;\n\t\t\t}\n\t\t\tpx[k] = w * s;\n\t\t\tpy[k] = -h * c;\n\n\t\t\t// Rotate by da\n\t\t\tconst ns = s * cda + c * sda;\n\t\t\tc = c * cda - s * sda;\n\t\t\ts = ns;\n\t\t}\n\t\tfor (let k = 0; k < n; ++k) {\n\t\t\tpx[m - 1 - k] = -px[k];\n\t\t\tpy[m - 1 - k] = py[k];\n\t\t}\n\t}\n\n\t/**\n\t * Computes the unit inward normals of the arc, the speeds of the arc, and the lengths of the polyline at P[k].\n\t *\n\t * The normal at P is Np = (-h x / w, -w y / h), whose magnitude is the speed of the arc.\n\t * The lengths are the ones of the polyline, which is the actual outline, so that they are exact at clipping = 1.\n\t */\n\tprotected computeArcNormals(w: number, h: number, n: number): void {\n\t\tconst m = 2 * n + 1;\n\t\tconst px = EShapeSectorTriangulatedImpl.WORK_ARC_X;\n\t\tconst py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;\n\t\tconst nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;\n\t\tconst ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;\n\t\tconst speeds = EShapeSectorTriangulatedImpl.WORK_SPEED;\n\t\tconst ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;\n\t\tconst hw = h / w;\n\t\tconst wh = w / h;\n\t\tlet l = 0;\n\t\tfor (let k = 0; k <= n; ++k) {\n\t\t\tconst dx = -hw * px[k];\n\t\t\tconst dy = -wh * py[k];\n\t\t\tconst speed = Math.sqrt(dx * dx + dy * dy);\n\t\t\tnx[k] = dx / speed;\n\t\t\tny[k] = dy / speed;\n\t\t\tspeeds[k] = speed;\n\t\t\tif (0 < k) {\n\t\t\t\tconst ex = px[k] - px[k - 1];\n\t\t\t\tconst ey = py[k] - py[k - 1];\n\t\t\t\tl += Math.sqrt(ex * ex + ey * ey);\n\t\t\t}\n\t\t\tls[k] = l;\n\t\t}\n\t\tfor (let k = 0; k < n; ++k) {\n\t\t\tconst j = m - 1 - k;\n\t\t\tnx[j] = -nx[k];\n\t\t\tny[j] = ny[k];\n\t\t\tspeeds[j] = speeds[k];\n\t\t\tls[j] = 2 * ls[n] - ls[k];\n\t\t}\n\t}\n\n\t/**\n\t * Computes Q[k], the points on the normals, and their distances from P[k], and returns the maximum distance.\n\t *\n\t * If chained is true, Q is the point on the medial axis, that is, the point on the normal\n\t * whose distance to the arc is equal to the distance to the straight sides.\n\t * The distance delta is obtained from delta = -(n . P) - delta (n . normal) for the outward unit normals n of the sides.\n\t * The clamps keep Q on the same side of the axis x = 0 as P and before the center of curvature,\n\t * otherwise adjacent normals cross each other, which happens for tall ellipses.\n\t *\n\t * Otherwise, the normal is extended until it reaches x = 0 if w <= h, otherwise y = 0.\n\t */\n\tprotected computeMedialPoints(\n\t\tw: number,\n\t\th: number,\n\t\tn: number,\n\t\tst: number,\n\t\tct: number,\n\t\tchained: boolean\n\t): number {\n\t\tconst m = 2 * n + 1;\n\t\tconst px = EShapeSectorTriangulatedImpl.WORK_ARC_X;\n\t\tconst py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;\n\t\tconst nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;\n\t\tconst ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;\n\t\tconst speeds = EShapeSectorTriangulatedImpl.WORK_SPEED;\n\t\tconst qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;\n\t\tconst qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;\n\t\tconst qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;\n\t\tconst u = w <= h ? w / h : h / w;\n\t\tlet dmax = 0;\n\t\tfor (let k = 0; k <= n; ++k) {\n\t\t\tconst x = px[k];\n\t\t\tconst y = py[k];\n\t\t\tconst nnx = nx[k];\n\t\t\tconst nny = ny[k];\n\t\t\tconst speed = speeds[k];\n\n\t\t\tlet delta = Infinity;\n\t\t\tif (chained) {\n\t\t\t\tconst da = 1 + -ct * nnx + st * nny;\n\t\t\t\tif (1e-9 < da) {\n\t\t\t\t\tdelta = Math.min(delta, (ct * x - st * y) / da);\n\t\t\t\t}\n\t\t\t\tconst db = 1 + ct * nnx + st * nny;\n\t\t\t\tif (1e-9 < db) {\n\t\t\t\t\tdelta = Math.min(delta, (-ct * x - st * y) / db);\n\t\t\t\t}\n\t\t\t\tif (k !== n && 1e-12 < Math.abs(nnx)) {\n\t\t\t\t\tdelta = Math.min(delta, -x / nnx);\n\t\t\t\t}\n\t\t\t\tdelta = Math.max(0, Math.min(delta, (speed * speed * speed) / (w * h)));\n\t\t\t}\n\n\t\t\t// The distance between P and Q\n\t\t\tlet d: number;\n\t\t\tif (Number.isFinite(delta)) {\n\t\t\t\td = delta;\n\t\t\t} else {\n\t\t\t\td = u * speed;\n\t\t\t}\n\t\t\tqx[k] = x + d * nnx;\n\t\t\tqy[k] = y + d * nny;\n\t\t\tqd[k] = d;\n\t\t\tdmax = Math.max(dmax, d);\n\t\t}\n\t\tfor (let k = 0; k < n; ++k) {\n\t\t\tconst j = m - 1 - k;\n\t\t\tqx[j] = -qx[k];\n\t\t\tqy[j] = qy[k];\n\t\t\tqd[j] = qd[k];\n\t\t}\n\t\treturn dmax;\n\t}\n\n\t/**\n\t * Computes R[k], the points on the arc shifted outward by fs.\n\t * If the straight sides are the outline, the end points are shifted\n\t * to the intersections of the shifted arc and the shifted straight sides.\n\t */\n\tprotected computeRimPoints(\n\t\tn: number,\n\t\tfs: number,\n\t\tst: number,\n\t\tct: number,\n\t\tsided: boolean\n\t): void {\n\t\tconst m = 2 * n + 1;\n\t\tconst px = EShapeSectorTriangulatedImpl.WORK_ARC_X;\n\t\tconst py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;\n\t\tconst nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;\n\t\tconst ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;\n\t\tconst rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;\n\t\tconst ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;\n\t\tfor (let k = 0; k < m; ++k) {\n\t\t\tlet x = px[k] - fs * nx[k];\n\t\t\tlet y = py[k] - fs * ny[k];\n\t\t\tif (sided && (k === 0 || k === m - 1)) {\n\t\t\t\tconst sign = k === 0 ? -1 : +1;\n\n\t\t\t\t// The miter of the outward normal of the arc (n1) and that of the straight side (n2)\n\t\t\t\tconst n1x = -nx[k];\n\t\t\t\tconst n1y = -ny[k];\n\t\t\t\tconst n2x = sign * ct;\n\t\t\t\tconst n2y = st;\n\t\t\t\tconst miter = fs / Math.max(1 + n1x * n2x + n1y * n2y, 0.05);\n\t\t\t\tx = px[k] + miter * (n1x + n2x);\n\t\t\t\ty = py[k] + miter * (n1y + n2y);\n\t\t\t}\n\t\t\trx[k] = x;\n\t\t\try[k] = y;\n\t\t}\n\t}\n\n\t/**\n\t * Writes the strip P[k], P[k + 1], Q[k + 1], Q[k] with the vertices R[k], Q[k], R[k + 1] and Q[k + 1].\n\t *\n\t * Each quad owns its vertices. The length in a quad is the length at P[k] plus the projection\n\t * to the chord P[k]P[k + 1], which is exact at clipping = 1 where the chord is the outline.\n\t */\n\tprotected writeStrip(\n\t\tm: number,\n\t\tfd: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number\n\t): void {\n\t\tconst px = EShapeSectorTriangulatedImpl.WORK_ARC_X;\n\t\tconst py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;\n\t\tconst qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;\n\t\tconst qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;\n\t\tconst qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;\n\t\tconst ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;\n\t\tconst rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;\n\t\tconst ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;\n\t\tconst scale = EShapeSectorTriangulatedImpl.SCALE;\n\t\tconst indices = this._indices;\n\t\tlet iv = 0;\n\t\tlet ii = 0;\n\t\tfor (let k = 0; k < m - 1; ++k) {\n\t\t\tconst x0 = px[k];\n\t\t\tconst y0 = py[k];\n\t\t\tconst l0 = ls[k];\n\t\t\tconst dl = ls[k + 1] - l0;\n\t\t\tconst fl = 0 < dl ? 1 / dl : 0;\n\t\t\tconst ex = (px[k + 1] - x0) * fl;\n\t\t\tconst ey = (py[k + 1] - y0) * fl;\n\n\t\t\tconst r0x = rx[k];\n\t\t\tconst r0y = ry[k];\n\t\t\tconst q0x = qx[k];\n\t\t\tconst q0y = qy[k];\n\t\t\tconst r1x = rx[k + 1];\n\t\t\tconst r1y = ry[k + 1];\n\t\t\tconst q1x = qx[k + 1];\n\t\t\tconst q1y = qy[k + 1];\n\t\t\tconst lr0 = l0 + (r0x - x0) * ex + (r0y - y0) * ey;\n\t\t\tconst lq0 = l0 + (q0x - x0) * ex + (q0y - y0) * ey;\n\t\t\tconst lr1 = l0 + (r1x - x0) * ex + (r1y - y0) * ey;\n\t\t\tconst lq1 = l0 + (q1x - x0) * ex + (q1y - y0) * ey;\n\t\t\tconst cq0 = 1 - qd[k] * fd;\n\t\t\tconst cq1 = 1 - qd[k + 1] * fd;\n\t\t\tthis.writeVertex(iv, r0x, r0y, lr0, scale, fd, fx, fy, gx, gy);\n\t\t\tthis.writeVertex(iv + 1, q0x, q0y, lq0, cq0, fd, fx, fy, gx, gy);\n\t\t\tthis.writeVertex(iv + 2, r1x, r1y, lr1, scale, fd, fx, fy, gx, gy);\n\t\t\tthis.writeVertex(iv + 3, q1x, q1y, lq1, cq1, fd, fx, fy, gx, gy);\n\t\t\tindices[ii++] = iv;\n\t\t\tindices[ii++] = iv + 2;\n\t\t\tindices[ii++] = iv + 3;\n\t\t\tindices[ii++] = iv;\n\t\t\tindices[ii++] = iv + 3;\n\t\t\tindices[ii++] = iv + 1;\n\t\t\tiv += 4;\n\t\t}\n\t}\n\n\t/**\n\t * Writes the polygon O', R[end], Q[end], ..., Q[N] where the end is 0 for the left (sign = -1)\n\t * and 2N for the right (sign = +1). The straight side OA (or OB) is the outline of the polygon.\n\t * Returns the number of the written vertices.\n\t *\n\t * The chain of Q ends at the first point on the axis because the following points go back along the axis.\n\t * Q is not always on the medial axis where it is clamped,\n\t * so the clipping must not be less than the one of the arc.\n\t *\n\t * The clipping and the length are computed from the straight side:\n\t * the outward unit normal is (sign * ct, st) and the length is oa + arc + (-st, sign * ct) . p.\n\t */\n\tprotected writeSidePolygon(\n\t\tiv: number,\n\t\tii: number,\n\t\tsign: number,\n\t\tn: number,\n\t\tw: number,\n\t\toa: number,\n\t\tst: number,\n\t\tct: number,\n\t\tfs: number,\n\t\tfd: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number\n\t): number {\n\t\tconst m = 2 * n + 1;\n\t\tconst qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;\n\t\tconst qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;\n\t\tconst qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;\n\t\tconst rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;\n\t\tconst ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;\n\t\tconst l0 = oa + EShapeSectorTriangulatedImpl.WORK_ARC_L[m - 1];\n\t\tconst nx = sign * ct;\n\t\tconst ly = sign * ct;\n\t\tconst eps = 1e-9 * w;\n\t\tconst end = sign < 0 ? 0 : m - 1;\n\n\t\tlet count = 0;\n\t\tthis.writeSideVertex(\n\t\t\tiv + count++,\n\t\t\t0,\n\t\t\tfs / st,\n\t\t\t-Infinity,\n\t\t\tnx,\n\t\t\tst,\n\t\t\tl0,\n\t\t\t-st,\n\t\t\tly,\n\t\t\tfd,\n\t\t\tfx,\n\t\t\tfy,\n\t\t\tgx,\n\t\t\tgy\n\t\t);\n\t\tthis.writeSideVertex(\n\t\t\tiv + count++,\n\t\t\trx[end],\n\t\t\try[end],\n\t\t\t-Infinity,\n\t\t\tnx,\n\t\t\tst,\n\t\t\tl0,\n\t\t\t-st,\n\t\t\tly,\n\t\t\tfd,\n\t\t\tfx,\n\t\t\tfy,\n\t\t\tgx,\n\t\t\tgy\n\t\t);\n\t\tfor (let j = 0; j <= n; ++j) {\n\t\t\tconst k = sign < 0 ? j : m - 1 - j;\n\t\t\tconst floor = 1 - qd[k] * fd;\n\t\t\tconst isOnAxis = Math.abs(qx[k]) <= eps;\n\n\t\t\t// Where Q is clamped, the clipping of the side reaches the floor at T on the axis before Q.\n\t\t\t// Without T, the clipping on the axis is not linear and a dent appears at O.\n\t\t\tconst ty = -qd[k] / st;\n\t\t\tif (isOnAxis && qy[k] < ty - eps) {\n\t\t\t\tthis.writeSideVertex(\n\t\t\t\t\tiv + count++,\n\t\t\t\t\t0,\n\t\t\t\t\tty,\n\t\t\t\t\tfloor,\n\t\t\t\t\tnx,\n\t\t\t\t\tst,\n\t\t\t\t\tl0,\n\t\t\t\t\t-st,\n\t\t\t\t\tly,\n\t\t\t\t\tfd,\n\t\t\t\t\tfx,\n\t\t\t\t\tfy,\n\t\t\t\t\tgx,\n\t\t\t\t\tgy\n\t\t\t\t);\n\t\t\t\tthis.writeFan(ii, iv, count);\n\t\t\t\tthis.writeSideVertex(\n\t\t\t\t\tiv + count,\n\t\t\t\t\tqx[k],\n\t\t\t\t\tqy[k],\n\t\t\t\t\tfloor,\n\t\t\t\t\tnx,\n\t\t\t\t\tst,\n\t\t\t\t\tl0,\n\t\t\t\t\t-st,\n\t\t\t\t\tly,\n\t\t\t\t\tfd,\n\t\t\t\t\tfx,\n\t\t\t\t\tfy,\n\t\t\t\t\tgx,\n\t\t\t\t\tgy\n\t\t\t\t);\n\t\t\t\tconst indices = this._indices;\n\t\t\t\tconst i = ii + 3 * (count - 2);\n\t\t\t\tindices[i] = iv + count - 2;\n\t\t\t\tindices[i + 1] = iv + count;\n\t\t\t\tindices[i + 2] = iv + count - 1;\n\t\t\t\treturn count + 1;\n\t\t\t}\n\n\t\t\tthis.writeSideVertex(\n\t\t\t\tiv + count++,\n\t\t\t\tqx[k],\n\t\t\t\tqy[k],\n\t\t\t\tfloor,\n\t\t\t\tnx,\n\t\t\t\tst,\n\t\t\t\tl0,\n\t\t\t\t-st,\n\t\t\t\tly,\n\t\t\t\tfd,\n\t\t\t\tfx,\n\t\t\t\tfy,\n\t\t\t\tgx,\n\t\t\t\tgy\n\t\t\t);\n\t\t\tif (isOnAxis) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.writeFan(ii, iv, count);\n\t\treturn count;\n\t}\n\n\t/**\n\t * Writes the polygon O, Q[end], ..., Q[N] where the end is 0 for the left (sign = -1)\n\t * and 2N for the right (sign = +1). The straight sides are hard edges without the stroke.\n\t * Returns the number of the written vertices.\n\t *\n\t * The clipping of O is given by co, and the length of O is the one of the end point.\n\t */\n\tprotected writeCapPolygon(\n\t\tiv: number,\n\t\tii: number,\n\t\tsign: number,\n\t\tn: number,\n\t\tw: number,\n\t\tco: number,\n\t\tfd: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number\n\t): number {\n\t\tconst m = 2 * n + 1;\n\t\tconst qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;\n\t\tconst qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;\n\t\tconst qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;\n\t\tconst ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;\n\t\tconst eps = 1e-9 * w;\n\t\tconst end = sign < 0 ? 0 : m - 1;\n\n\t\tthis.writeVertex(iv, 0, 0, ls[end], co, fd, fx, fy, gx, gy);\n\t\tlet count = 1;\n\t\tfor (let j = 0; j <= n; ++j) {\n\t\t\tconst k = sign < 0 ? j : m - 1 - j;\n\t\t\tconst clipping = 1 - qd[k] * fd;\n\t\t\tthis.writeVertex(iv + count++, qx[k], qy[k], ls[k], clipping, fd, fx, fy, gx, gy);\n\t\t\tif (Math.abs(qx[k]) <= eps) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.writeFan(ii, iv, count);\n\t\treturn count;\n\t}\n\n\t/**\n\t * The clipping is 1 - (the distance from the straight side) / d where d is the distance from C to OA (or OB).\n\t */\n\tprotected updateBottom(\n\t\tw: number,\n\t\th: number,\n\t\tn: number,\n\t\tea: number,\n\t\tsea: number,\n\t\tcea: number,\n\t\tbx: number,\n\t\tby: number,\n\t\tst: number,\n\t\tct: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number,\n\t\tnv: number,\n\t\tni: number\n\t): void {\n\t\tconst boundary = this._boundary;\n\t\tboundary[0] = -bx;\n\t\tboundary[1] = -h;\n\t\tboundary[2] = +bx;\n\t\tboundary[3] = 0;\n\n\t\tconst yc = h / (1 + st);\n\t\tconst fd = (1 + st) / (h * st);\n\t\tconst fs = (EShapeSectorTriangulatedImpl.SCALE - 1) / fd;\n\n\t\tthis.computeArcPoints(w, h, n, ea, sea, cea);\n\t\tthis.computeArcNormals(w, h, n);\n\n\t\t// The length of O, which is the same as the one of writeSidePolygon: |OA| + the length of the arc\n\t\tconst l0 = Math.sqrt(bx * bx + by * by) + EShapeSectorTriangulatedImpl.WORK_ARC_L[2 * n];\n\n\t\t// Triangle fans from C to the arc: left (sign = -1) and right (sign = +1)\n\t\tlet iv = 0;\n\t\tlet ii = 0;\n\t\tfor (let sign = -1; sign <= 1; sign += 2) {\n\t\t\tconst count = this.writeBottomFan(iv, ii, sign, n, yc, l0, st, ct, fd, fx, fy, gx, gy);\n\t\t\tiv += count;\n\t\t\tii += 3 * (count - 2);\n\t\t}\n\n\t\t// Quads at the bottom: O', A', A, C and O', B', B, C\n\t\tfor (let sign = -1; sign <= 1; sign += 2) {\n\t\t\tconst count = this.writeBottomQuad(\n\t\t\t\tiv,\n\t\t\t\tii,\n\t\t\t\tsign,\n\t\t\t\tbx,\n\t\t\t\tby,\n\t\t\t\tyc,\n\t\t\t\tl0,\n\t\t\t\tfs,\n\t\t\t\tst,\n\t\t\t\tct,\n\t\t\t\tfd,\n\t\t\t\tfx,\n\t\t\t\tfy,\n\t\t\t\tgx,\n\t\t\t\tgy\n\t\t\t);\n\t\t\tiv += count;\n\t\t\tii += 3 * (count - 2);\n\t\t}\n\n\t\tthis.pad(iv, ii, nv, ni, fd);\n\t}\n\n\t/**\n\t * Writes the triangle fan from C to the arc of the left half (sign = -1) or the right half (sign = +1).\n\t * Returns the number of the written vertices.\n\t *\n\t * The clipping is 1 + fd * (n . p) where n is the outward unit normal of the straight side,\n\t * and the length is l0 + (-st, sign * ct) . p, which is the same as the one of writeSidePolygon\n\t * so that the dashes of the straight sides do not depend on the stroke side.\n\t */\n\tprotected writeBottomFan(\n\t\tiv: number,\n\t\tii: number,\n\t\tsign: number,\n\t\tn: number,\n\t\tyc: number,\n\t\tl0: number,\n\t\tst: number,\n\t\tct: number,\n\t\tfd: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number\n\t): number {\n\t\tconst px = EShapeSectorTriangulatedImpl.WORK_ARC_X;\n\t\tconst py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;\n\t\tconst nx = sign * ct;\n\t\tconst ly = sign * ct;\n\n\t\tlet count = 0;\n\t\tthis.writeSideVertex(iv + count++, 0, -yc, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);\n\t\tfor (let j = 0; j <= n; ++j) {\n\t\t\tconst k = sign < 0 ? j : n + j;\n\t\t\tthis.writeSideVertex(\n\t\t\t\tiv + count++,\n\t\t\t\tpx[k],\n\t\t\t\tpy[k],\n\t\t\t\t0,\n\t\t\t\tnx,\n\t\t\t\tst,\n\t\t\t\tl0,\n\t\t\t\t-st,\n\t\t\t\tly,\n\t\t\t\tfd,\n\t\t\t\tfx,\n\t\t\t\tfy,\n\t\t\t\tgx,\n\t\t\t\tgy\n\t\t\t);\n\t\t}\n\t\tthis.writeFan(ii, iv, count);\n\t\treturn count;\n\t}\n\n\t/**\n\t * Writes the quad O', A', A, C (sign = -1) or O', B', B, C (sign = +1) at the bottom.\n\t * O' is shifted outward by fs / st, and A' (B') is shifted outward by fs perpendicular to the straight side.\n\t * Returns the number of the written vertices.\n\t */\n\tprotected writeBottomQuad(\n\t\tiv: number,\n\t\tii: number,\n\t\tsign: number,\n\t\tbx: number,\n\t\tby: number,\n\t\tyc: number,\n\t\tl0: number,\n\t\tfs: number,\n\t\tst: number,\n\t\tct: number,\n\t\tfd: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number\n\t): number {\n\t\tconst nx = sign * ct;\n\t\tconst ly = sign * ct;\n\t\tthis.writeSideVertex(iv, 0, fs / st, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);\n\t\tthis.writeSideVertex(\n\t\t\tiv + 1,\n\t\t\tsign * (bx + fs * ct),\n\t\t\t-by + fs * st,\n\t\t\t0,\n\t\t\tnx,\n\t\t\tst,\n\t\t\tl0,\n\t\t\t-st,\n\t\t\tly,\n\t\t\tfd,\n\t\t\tfx,\n\t\t\tfy,\n\t\t\tgx,\n\t\t\tgy\n\t\t);\n\t\tthis.writeSideVertex(iv + 2, sign * bx, -by, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);\n\t\tthis.writeSideVertex(iv + 3, 0, -yc, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);\n\t\tthis.writeFan(ii, iv, 4);\n\t\treturn 4;\n\t}\n\n\t// ----------------------------------------------------------------------------------------\n\t// Writers\n\t// ----------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a vertex whose clipping and length are computed from the parameters of a straight side.\n\t * The clipping is 1 + fd * (nx * x + ny * y), which is not less than the given floor,\n\t * and the length is l0 + lx * x + ly * y.\n\t */\n\tprotected writeSideVertex(\n\t\tvertex: number,\n\t\tx: number,\n\t\ty: number,\n\t\tfloor: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tl0: number,\n\t\tlx: number,\n\t\tly: number,\n\t\tfd: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number\n\t): void {\n\t\tconst clipping = Math.max(floor, 1 + fd * (nx * x + ny * y));\n\t\tconst length = l0 + lx * x + ly * y;\n\t\tthis.writeVertex(vertex, x, y, length, clipping, fd, fx, fy, gx, gy);\n\t}\n\n\t/**\n\t * Writes the indices of a triangle fan from the first vertex.\n\t * The number of the written indices is 3 * (count - 2).\n\t */\n\tprotected writeFan(ii: number, iv: number, count: number): void {\n\t\tconst indices = this._indices;\n\t\tfor (let i = 1; i < count - 1; ++i) {\n\t\t\tindices[ii++] = iv;\n\t\t\tindices[ii++] = iv + i;\n\t\t\tindices[ii++] = iv + i + 1;\n\t\t}\n\t}\n\n\t/**\n\t * Writes a vertex.\n\t *\n\t * @param x - The X coordinate in the frame where the sizes are positive\n\t * @param y - The Y coordinate in the frame where the sizes are positive\n\t * @param fd - The inverse of the distance where the clipping decreases from 1 to 0\n\t * @param fx - The factor to convert x to the UV\n\t * @param fy - The factor to convert y to the UV\n\t * @param gx - The sign of the X size, which flips the vertex\n\t * @param gy - The sign of the Y size, which flips the vertex\n\t */\n\tprotected writeVertex(\n\t\tvertex: number,\n\t\tx: number,\n\t\ty: number,\n\t\tlength: number,\n\t\tclipping: number,\n\t\tfd: number,\n\t\tfx: number,\n\t\tfy: number,\n\t\tgx: number,\n\t\tgy: number\n\t): void {\n\t\tconst vertex2 = vertex << 1;\n\t\tthis._vertices[vertex2] = gx * x;\n\t\tthis._vertices[vertex2 + 1] = gy * y;\n\t\tthis._distances[vertex] = fd;\n\t\tthis._lengths[vertex] = length;\n\t\tthis._clippings[vertex] = clipping;\n\t\tthis._uvs[vertex2] = 0.5 * (x * fx + 1);\n\t\tthis._uvs[vertex2 + 1] = 1 + y * fy;\n\t}\n\n\t/**\n\t * Fills the unused tail with degenerated triangles and trims the arrays\n\t * so that the buffers always hold exactly `nv` vertices and `ni` triangles.\n\t */\n\tprotected pad(iv: number, ii: number, nv: number, ni: number, distance: number): void {\n\t\tfor (let i = iv; i < nv; ++i) {\n\t\t\tconst vertex2 = i << 1;\n\t\t\tthis._vertices[vertex2] = 0;\n\t\t\tthis._vertices[vertex2 + 1] = 0;\n\t\t\tthis._distances[i] = distance;\n\t\t\tthis._lengths[i] = 0;\n\t\t\tthis._clippings[i] = 0;\n\t\t\tthis._uvs[vertex2] = 0.5;\n\t\t\tthis._uvs[vertex2 + 1] = 0.5;\n\t\t}\n\t\tfor (let i = ii; i < ni * 3; ++i) {\n\t\t\tthis._indices[i] = 0;\n\t\t}\n\t\tthis._vertices.length = nv * 2;\n\t\tthis._distances.length = nv;\n\t\tthis._lengths.length = nv;\n\t\tthis._clippings.length = nv;\n\t\tthis._uvs.length = nv * 2;\n\t\tthis._indices.length = ni * 3;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e-shape-sector-triangulated.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-sector-triangulated.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019-2026 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapePolygonTriangulatedLike } from \"./e-shape-polygon-triangulated-like\";\n\nexport interface EShapeSectorTriangulated extends EShapePolygonTriangulatedLike {}\n"]}
|