@visactor/vrender-core 0.20.0-alpha.0 → 0.20.0-alpha.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/cjs/allocator/matrix-allocate.d.ts +1 -1
- package/cjs/allocator/matrix-allocate.js +2 -4
- package/cjs/allocator/matrix-allocate.js.map +1 -1
- package/cjs/animate/animate.js +4 -2
- package/cjs/animate/animate.js.map +1 -1
- package/cjs/animate/custom-animate.d.ts +5 -16
- package/cjs/animate/custom-animate.js +9 -62
- package/cjs/animate/custom-animate.js.map +1 -1
- package/cjs/animate/group-fade.d.ts +16 -0
- package/cjs/animate/group-fade.js +66 -0
- package/cjs/animate/group-fade.js.map +1 -0
- package/cjs/animate/index.d.ts +1 -0
- package/cjs/animate/index.js +2 -1
- package/cjs/animate/index.js.map +1 -1
- package/cjs/canvas/util.d.ts +0 -1
- package/cjs/canvas/util.js +7 -17
- package/cjs/canvas/util.js.map +1 -1
- package/cjs/common/3d-interceptor.d.ts +3 -0
- package/cjs/common/3d-interceptor.js +51 -0
- package/cjs/common/3d-interceptor.js.map +1 -0
- package/cjs/common/bezier-utils.js +2 -1
- package/cjs/common/bounds-context.js +1 -2
- package/cjs/common/canvas-utils.d.ts +1 -1
- package/cjs/common/canvas-utils.js +15 -30
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/matrix.d.ts +11 -3
- package/cjs/common/matrix.js +97 -19
- package/cjs/common/matrix.js.map +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +23 -33
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/render-utils.js +2 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +16 -13
- package/cjs/common/sort.js.map +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.d.ts +0 -2
- package/cjs/common/text.js +4 -11
- package/cjs/common/text.js.map +1 -1
- package/cjs/common/utils.js +1 -1
- package/cjs/common/utils.js.map +1 -1
- package/cjs/core/application.js +1 -2
- package/cjs/core/camera.js +4 -4
- package/cjs/core/camera.js.map +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +0 -2
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.js +15 -9
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/graphic/builtin-symbol/utils.js +1 -5
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/config.js +1 -0
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -8
- package/cjs/graphic/graphic-service/graphic-service.js +17 -107
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/richtext/utils.js +12 -21
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +1 -1
- package/cjs/graphic/richtext.js +2 -2
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/text.js +1 -1
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +3 -3
- package/cjs/index.js.map +1 -1
- package/cjs/interface/graphic/group.d.ts +1 -1
- package/cjs/interface/graphic/group.js.map +1 -1
- package/cjs/interface/graphic/richText.d.ts +1 -0
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/picker/pick-interceptor.d.ts +1 -1
- package/cjs/picker/pick-interceptor.js +2 -42
- package/cjs/picker/pick-interceptor.js.map +1 -1
- package/cjs/picker/picker-service.js +4 -5
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/plugins/builtin-plugin/edit-module.d.ts +22 -0
- package/cjs/plugins/builtin-plugin/edit-module.js +94 -0
- package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -0
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.d.ts +2 -1
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +15 -7
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +76 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +338 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -0
- package/cjs/render/contributions/render/arc-render.js +1 -4
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +1 -1
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-3d-render.d.ts +10 -0
- package/cjs/render/contributions/render/base-3d-render.js +63 -0
- package/cjs/render/contributions/render/base-3d-render.js.map +1 -0
- package/cjs/render/contributions/render/base-render.js +5 -5
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +7 -51
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/group-render.js +4 -5
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/pyramid3d-render.d.ts +3 -5
- package/cjs/render/contributions/render/pyramid3d-render.js +4 -54
- package/cjs/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/cjs/render/contributions/render/rect3d-render.d.ts +3 -5
- package/cjs/render/contributions/render/rect3d-render.js +4 -53
- package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.js +9 -18
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/utils.js +2 -5
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/dist/index.es.js +1288 -978
- package/es/allocator/matrix-allocate.d.ts +1 -1
- package/es/allocator/matrix-allocate.js +3 -3
- package/es/allocator/matrix-allocate.js.map +1 -1
- package/es/animate/animate.js +4 -2
- package/es/animate/animate.js.map +1 -1
- package/es/animate/custom-animate.d.ts +5 -16
- package/es/animate/custom-animate.js +9 -58
- package/es/animate/custom-animate.js.map +1 -1
- package/es/animate/group-fade.d.ts +16 -0
- package/es/animate/group-fade.js +56 -0
- package/es/animate/group-fade.js.map +1 -0
- package/es/animate/index.d.ts +1 -0
- package/es/animate/index.js +2 -0
- package/es/animate/index.js.map +1 -1
- package/es/canvas/util.d.ts +0 -1
- package/es/canvas/util.js +7 -17
- package/es/canvas/util.js.map +1 -1
- package/es/common/3d-interceptor.d.ts +3 -0
- package/es/common/3d-interceptor.js +47 -0
- package/es/common/3d-interceptor.js.map +1 -0
- package/es/common/bezier-utils.js +2 -1
- package/es/common/bounds-context.js +1 -2
- package/es/common/canvas-utils.d.ts +1 -1
- package/es/common/canvas-utils.js +15 -30
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/matrix.d.ts +11 -3
- package/es/common/matrix.js +90 -17
- package/es/common/matrix.js.map +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +23 -33
- package/es/common/render-curve.js.map +1 -1
- package/es/common/render-utils.js +2 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +16 -13
- package/es/common/sort.js.map +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/store.js +1 -1
- package/es/common/text.d.ts +0 -2
- package/es/common/text.js +1 -7
- package/es/common/text.js.map +1 -1
- package/es/common/utils.js +1 -1
- package/es/common/utils.js.map +1 -1
- package/es/core/application.js +1 -2
- package/es/core/camera.js +6 -4
- package/es/core/camera.js.map +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +0 -2
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.js +15 -9
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +1 -1
- package/es/graphic/builtin-symbol/utils.js +1 -4
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/config.js +1 -0
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.d.ts +2 -8
- package/es/graphic/graphic-service/graphic-service.js +9 -97
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/richtext/utils.js +9 -20
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/richtext.d.ts +1 -1
- package/es/graphic/richtext.js +2 -2
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/text.js +2 -2
- package/es/graphic/text.js.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/es/interface/graphic/group.d.ts +1 -1
- package/es/interface/graphic/group.js.map +1 -1
- package/es/interface/graphic/richText.d.ts +1 -0
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/picker/pick-interceptor.d.ts +1 -1
- package/es/picker/pick-interceptor.js +4 -44
- package/es/picker/pick-interceptor.js.map +1 -1
- package/es/picker/picker-service.js +1 -1
- package/es/picker/picker-service.js.map +1 -1
- package/es/plugins/builtin-plugin/edit-module.d.ts +22 -0
- package/es/plugins/builtin-plugin/edit-module.js +86 -0
- package/es/plugins/builtin-plugin/edit-module.js.map +1 -0
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/react-attribute-plugin.d.ts +2 -1
- package/es/plugins/builtin-plugin/react-attribute-plugin.js +15 -7
- package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +76 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js +334 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -0
- package/es/render/contributions/render/arc-render.js +1 -4
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +1 -1
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-3d-render.d.ts +10 -0
- package/es/render/contributions/render/base-3d-render.js +57 -0
- package/es/render/contributions/render/base-3d-render.js.map +1 -0
- package/es/render/contributions/render/base-render.js +3 -1
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +7 -51
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/group-render.js +3 -1
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/pyramid3d-render.d.ts +3 -5
- package/es/render/contributions/render/pyramid3d-render.js +4 -56
- package/es/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/es/render/contributions/render/rect3d-render.d.ts +3 -5
- package/es/render/contributions/render/rect3d-render.js +4 -55
- package/es/render/contributions/render/rect3d-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.js +9 -18
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/utils.js +2 -5
- package/es/render/contributions/render/utils.js.map +1 -1
- package/package.json +4 -4
package/cjs/common/matrix.js
CHANGED
|
@@ -2,14 +2,104 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.transformMat4 = exports.
|
|
5
|
+
}), exports.transformMat4 = exports.ortho = exports.lookAt = exports.multiplyMat4Mat4 = exports.scaleMat4 = exports.multiplyMat4Mat3 = exports.mat3Tomat4 = exports.translate = exports.rotateZ = exports.rotateY = exports.rotateX = exports.identityMat4 = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils")
|
|
7
|
+
const vutils_1 = require("@visactor/vutils");
|
|
8
|
+
|
|
9
|
+
function identityMat4(out) {
|
|
10
|
+
return out[0] = 1, out[1] = 0, out[2] = 0, out[3] = 0, out[4] = 0, out[5] = 1, out[6] = 0,
|
|
11
|
+
out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = 0, out[13] = 0,
|
|
12
|
+
out[14] = 0, out[15] = 1, out;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function rotateX(out, a, rad) {
|
|
16
|
+
const s = Math.sin(rad), c = Math.cos(rad), a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
|
|
17
|
+
return a !== out && (out[0] = a[0], out[1] = a[1], out[2] = a[2], out[3] = a[3],
|
|
18
|
+
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[4] = a10 * c + a20 * s,
|
|
19
|
+
out[5] = a11 * c + a21 * s, out[6] = a12 * c + a22 * s, out[7] = a13 * c + a23 * s,
|
|
20
|
+
out[8] = a20 * c - a10 * s, out[9] = a21 * c - a11 * s, out[10] = a22 * c - a12 * s,
|
|
21
|
+
out[11] = a23 * c - a13 * s, out;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function rotateY(out, a, rad) {
|
|
25
|
+
const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
|
|
26
|
+
return a !== out && (out[4] = a[4], out[5] = a[5], out[6] = a[6], out[7] = a[7],
|
|
27
|
+
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c - a20 * s,
|
|
28
|
+
out[1] = a01 * c - a21 * s, out[2] = a02 * c - a22 * s, out[3] = a03 * c - a23 * s,
|
|
29
|
+
out[8] = a00 * s + a20 * c, out[9] = a01 * s + a21 * c, out[10] = a02 * s + a22 * c,
|
|
30
|
+
out[11] = a03 * s + a23 * c, out;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function rotateZ(out, a, rad) {
|
|
34
|
+
const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
|
|
35
|
+
return a !== out && (out[8] = a[8], out[9] = a[9], out[10] = a[10], out[11] = a[11],
|
|
36
|
+
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c + a10 * s,
|
|
37
|
+
out[1] = a01 * c + a11 * s, out[2] = a02 * c + a12 * s, out[3] = a03 * c + a13 * s,
|
|
38
|
+
out[4] = a10 * c - a00 * s, out[5] = a11 * c - a01 * s, out[6] = a12 * c - a02 * s,
|
|
39
|
+
out[7] = a13 * c - a03 * s, out;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function translate(out, a, v) {
|
|
43
|
+
const x = v[0], y = v[1], z = v[2];
|
|
44
|
+
let a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23;
|
|
45
|
+
return a === out ? (out[12] = a[0] * x + a[4] * y + a[8] * z + a[12], out[13] = a[1] * x + a[5] * y + a[9] * z + a[13],
|
|
46
|
+
out[14] = a[2] * x + a[6] * y + a[10] * z + a[14], out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]) : (a00 = a[0],
|
|
47
|
+
a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
|
|
48
|
+
a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], out[0] = a00, out[1] = a01, out[2] = a02,
|
|
49
|
+
out[3] = a03, out[4] = a10, out[5] = a11, out[6] = a12, out[7] = a13, out[8] = a20,
|
|
50
|
+
out[9] = a21, out[10] = a22, out[11] = a23, out[12] = a00 * x + a10 * y + a20 * z + a[12],
|
|
51
|
+
out[13] = a01 * x + a11 * y + a21 * z + a[13], out[14] = a02 * x + a12 * y + a22 * z + a[14],
|
|
52
|
+
out[15] = a03 * x + a13 * y + a23 * z + a[15]), out;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function mat3Tomat4(out, b) {
|
|
56
|
+
out[0] = b.a, out[1] = b.b, out[2] = 0, out[3] = 0, out[4] = b.c, out[5] = b.d,
|
|
57
|
+
out[6] = 0, out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = b.e,
|
|
58
|
+
out[13] = b.f, out[14] = 0, out[15] = 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function multiplyMat4Mat3(out, a, b) {
|
|
62
|
+
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
63
|
+
let b0 = b.a, b1 = b.b, b2 = 0, b3 = 0;
|
|
64
|
+
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
65
|
+
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
66
|
+
b0 = b.c, b1 = b.d, b2 = 0, b3 = 0, out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
67
|
+
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
68
|
+
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = 0, b1 = 0, b2 = 1, b3 = 0,
|
|
69
|
+
out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
70
|
+
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
71
|
+
b0 = b.e, b1 = b.f, b2 = 0, b3 = 1, out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
72
|
+
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
73
|
+
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function scaleMat4(out, a, v) {
|
|
77
|
+
const x = v[0], y = v[1], z = v[2];
|
|
78
|
+
return out[0] = a[0] * x, out[1] = a[1] * x, out[2] = a[2] * x, out[3] = a[3] * x,
|
|
79
|
+
out[4] = a[4] * y, out[5] = a[5] * y, out[6] = a[6] * y, out[7] = a[7] * y, out[8] = a[8] * z,
|
|
80
|
+
out[9] = a[9] * z, out[10] = a[10] * z, out[11] = a[11] * z, out[12] = a[12], out[13] = a[13],
|
|
81
|
+
out[14] = a[14], out[15] = a[15], out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function multiplyMat4Mat4(out, a, b) {
|
|
85
|
+
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
86
|
+
let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
|
|
87
|
+
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
88
|
+
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
89
|
+
b0 = b[4], b1 = b[5], b2 = b[6], b3 = b[7], out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
90
|
+
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
91
|
+
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = b[8], b1 = b[9], b2 = b[10],
|
|
92
|
+
b3 = b[11], out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
93
|
+
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
94
|
+
b0 = b[12], b1 = b[13], b2 = b[14], b3 = b[15], out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
95
|
+
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
96
|
+
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
97
|
+
}
|
|
8
98
|
|
|
9
99
|
function lookAt(out, eye, center, up) {
|
|
10
100
|
let x0, x1, x2, y0, y1, y2, z0, z1, z2, len;
|
|
11
101
|
const eyex = eye[0], eyey = eye[1], eyez = eye[2], upx = up[0], upy = up[1], upz = up[2], centerx = center[0], centery = center[1], centerz = center[2];
|
|
12
|
-
return Math.abs(eyex - centerx) < vutils_1.epsilon && Math.abs(eyey - centery) < vutils_1.epsilon && Math.abs(eyez - centerz) < vutils_1.epsilon ?
|
|
102
|
+
return Math.abs(eyex - centerx) < vutils_1.epsilon && Math.abs(eyey - centery) < vutils_1.epsilon && Math.abs(eyez - centerz) < vutils_1.epsilon ? identityMat4(out) : (z0 = eyex - centerx,
|
|
13
103
|
z1 = eyey - centery, z2 = eyez - centerz, len = 1 / Math.hypot(z0, z1, z2), z0 *= len,
|
|
14
104
|
z1 *= len, z2 *= len, x0 = upy * z2 - upz * z1, x1 = upz * z0 - upx * z2, x2 = upx * z1 - upy * z0,
|
|
15
105
|
len = Math.hypot(x0, x1, x2), len ? (len = 1 / len, x0 *= len, x1 *= len, x2 *= len) : (x0 = 0,
|
|
@@ -28,21 +118,6 @@ function ortho(out, left, right, bottom, top, near, far) {
|
|
|
28
118
|
out[13] = (top + bottom) * bt, out[14] = (far + near) * nf, out[15] = 1, out;
|
|
29
119
|
}
|
|
30
120
|
|
|
31
|
-
function multiply(out, a, b) {
|
|
32
|
-
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
33
|
-
let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
|
|
34
|
-
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
35
|
-
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
36
|
-
b0 = b[4], b1 = b[5], b2 = b[6], b3 = b[7], out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
37
|
-
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
38
|
-
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = b[8], b1 = b[9], b2 = b[10],
|
|
39
|
-
b3 = b[11], out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
40
|
-
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
41
|
-
b0 = b[12], b1 = b[13], b2 = b[14], b3 = b[15], out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
42
|
-
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
43
|
-
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
121
|
function transformMat4(out, a, m) {
|
|
47
122
|
const x = a[0], y = a[1], z = a[2];
|
|
48
123
|
let w = m[3] * x + m[7] * y + m[11] * z + m[15];
|
|
@@ -50,5 +125,8 @@ function transformMat4(out, a, m) {
|
|
|
50
125
|
out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w, out;
|
|
51
126
|
}
|
|
52
127
|
|
|
53
|
-
exports.
|
|
128
|
+
exports.identityMat4 = identityMat4, exports.rotateX = rotateX, exports.rotateY = rotateY,
|
|
129
|
+
exports.rotateZ = rotateZ, exports.translate = translate, exports.mat3Tomat4 = mat3Tomat4,
|
|
130
|
+
exports.multiplyMat4Mat3 = multiplyMat4Mat3, exports.scaleMat4 = scaleMat4, exports.multiplyMat4Mat4 = multiplyMat4Mat4,
|
|
131
|
+
exports.lookAt = lookAt, exports.ortho = ortho, exports.transformMat4 = transformMat4;
|
|
54
132
|
//# sourceMappingURL=matrix.js.map
|
package/cjs/common/matrix.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/matrix.ts"],"names":[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matrix.js","sourcesContent":["// import { abs, cos, epsilon, sin } from '@visactor/vutils';\n// import { IMatrix } from '../interface/matrix';\n// import { IBounds, IPoint } from '../interface/util';\n\nimport type { mat4, vec3 } from '@visactor/vutils';\nimport { epsilon } from '@visactor/vutils';\nimport { DefaultMat4Allocate } from '../allocator/matrix-allocate';\n\n// export type vec2 = [number, number] | Float32Array;\n// export type vec3 = [number, number, number] | Float32Array;\n// export type vec4 = [number, number, number, number] | Float32Array;\n// export type mat4 =\n// | [\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number,\n// number\n// ]\n// | Float32Array;\n\n// export class Matrix implements IMatrix {\n// /**\n// * scale x\n// */\n// a: number;\n// /**\n// * skew y\n// */\n// b: number;\n// /**\n// * skewx\n// */\n// c: number;\n// /**\n// * scale y\n// */\n// d: number;\n// /**\n// * translate x\n// */\n// e: number;\n// /**\n// * translate y\n// */\n// f: number;\n\n// // todo setScale需要sx,sy初始值为1\n// constructor(a?: number, b?: number, c?: number, d?: number, e?: number, f?: number) {\n// // 暂时不需要初始化\n// this.a = a ?? 1;\n// this.b = b ?? 0;\n// this.c = c ?? 0;\n// this.d = d ?? 1;\n// this.e = e ?? 0;\n// this.f = f ?? 0;\n// }\n\n// setValue(a: number, b: number, c: number, d: number, e: number, f: number) {\n// this.a = a;\n// this.b = b;\n// this.c = c;\n// this.d = d;\n// this.e = e;\n// this.f = f;\n// return this;\n// }\n\n// reset(): this {\n// this.a = 1;\n// this.b = 0;\n// this.c = 0;\n// this.d = 1;\n// this.e = 0;\n// this.f = 0;\n// return this;\n// }\n\n// /**\n// * 获取当前矩阵的逆矩阵\n// */\n// getInverse() {\n// const a = this.a;\n// const b = this.b;\n// const c = this.c;\n// const d = this.d;\n// const e = this.e;\n// const f = this.f;\n// const m = new Matrix();\n// const dt = a * d - b * c;\n\n// m.a = d / dt;\n// m.b = -b / dt;\n// m.c = -c / dt;\n// m.d = a / dt;\n// m.e = (c * f - d * e) / dt;\n// m.f = -(a * f - b * e) / dt;\n\n// return m;\n// }\n\n// rotate(rad: number) {\n// const c = Math.cos(rad);\n// const s = Math.sin(rad);\n// const m11 = this.a * c + this.c * s;\n// const m12 = this.b * c + this.d * s;\n// const m21 = this.a * -s + this.c * c;\n// const m22 = this.b * -s + this.d * c;\n// this.a = m11;\n// this.b = m12;\n// this.c = m21;\n// this.d = m22;\n// return this;\n// }\n\n// scale(sx: number, sy: number) {\n// this.a *= sx;\n// this.b *= sx;\n// this.c *= sy;\n// this.d *= sy;\n// return this;\n// }\n\n// setScale(sx: number, sy: number) {\n// this.b = (this.b / this.a) * sx;\n// this.c = (this.c / this.d) * sy;\n// this.a = sx;\n// this.d = sy;\n// return this;\n// }\n\n// transform(a: number, b: number, c: number, d: number, e: number, f: number) {\n// this.multiply(a, b, c, d, e, f);\n// return this;\n// }\n// translate(x: number, y: number) {\n// this.e += this.a * x + this.c * y;\n// this.f += this.b * x + this.d * y;\n// return this;\n// }\n// /**\n// * 矩阵相乘\n// * @param matrix\n// */\n// multiply(a2: number, b2: number, c2: number, d2: number, e2: number, f2: number) {\n// const a1 = this.a;\n// const b1 = this.b;\n// const c1 = this.c;\n// const d1 = this.d;\n// const e1 = this.e;\n// const f1 = this.f;\n\n// const m11 = a1 * a2 + c1 * b2;\n// const m12 = b1 * a2 + d1 * b2;\n// const m21 = a1 * c2 + c1 * d2;\n// const m22 = b1 * c2 + d1 * d2;\n// const dx = a1 * e2 + c1 * f2 + e1;\n// const dy = b1 * e2 + d1 * f2 + f1;\n\n// this.a = m11;\n// this.b = m12;\n// this.c = m21;\n// this.d = m22;\n// this.e = dx;\n// this.f = dy;\n// return this;\n// }\n// /**\n// * 插值计算\n// * @param m2\n// * @param t\n// */\n// interpolate(m2: Matrix, t: number) {\n// const m = new Matrix();\n\n// m.a = this.a + (m2.a - this.a) * t;\n// m.b = this.b + (m2.b - this.b) * t;\n// m.c = this.c + (m2.c - this.c) * t;\n// m.d = this.d + (m2.d - this.d) * t;\n// m.e = this.e + (m2.e - this.e) * t;\n// m.f = this.f + (m2.f - this.f) * t;\n\n// return m;\n// }\n\n// /**\n// * 将point转到当前矩阵的坐标空间中\n// * @param source\n// * @param target\n// */\n// transformPoint(source: IPoint, target: IPoint) {\n// const { a, b, c, d, e, f } = this;\n// const dt = a * d - b * c;\n\n// const nextA = d / dt;\n// const nextB = -b / dt;\n// const nextC = -c / dt;\n// const nextD = a / dt;\n// const nextE = (c * f - d * e) / dt;\n// const nextF = -(a * f - b * e) / dt;\n\n// const { x, y } = source;\n// target.x = x * nextA + y * nextC + nextE;\n// target.y = x * nextB + y * nextD + nextF;\n// }\n\n// // 只有translate\n// onlyTranslate(): boolean {\n// return this.a === 1 && this.b === 0 && this.c === 0 && this.d === 1;\n// }\n\n// clone(): Matrix {\n// return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);\n// }\n// }\n\n// /**\n// * 依据graphic的属性对bounds进行变换\n// * @param bounds\n// * @param x\n// * @param y\n// * @param scaleX\n// * @param scaleY\n// * @param angle\n// * @param rotateCenter\n// */\n// export function transformBounds(\n// bounds: IBounds,\n// x: number,\n// y: number,\n// scaleX: number,\n// scaleY: number,\n// angle: number,\n// rotateCenter?: [number, number]\n// ) {\n// if (abs(scaleX) <= epsilon || abs(scaleY) <= epsilon) {\n// return;\n// }\n\n// scaleX !== 1 && bounds.scaleX(scaleX);\n// scaleY !== 1 && bounds.scaleY(scaleY);\n\n// if (isFinite(angle) && Math.abs(angle) > epsilon) {\n// let rx = 0;\n// let ry = 0;\n// if (rotateCenter !== undefined) {\n// rx = rotateCenter[0];\n// ry = rotateCenter[1];\n// }\n// bounds.rotate(angle, rx, ry);\n// }\n\n// bounds.translate(x, y);\n// }\n// export function transformBoundsWithMatrix(bounds: IBounds, matrix: IMatrix): IBounds {\n// const { x1, y1, x2, y2 } = bounds;\n// // 如果没有旋转和缩放,那就直接translate\n// if (matrix.onlyTranslate()) {\n// bounds.translate(matrix.e, matrix.f);\n// return bounds;\n// }\n// bounds.x1 = matrix.a * x1 + matrix.c * y1 + matrix.e;\n// bounds.y1 = matrix.b * x1 + matrix.d * y1 + matrix.f;\n// bounds.x2 = matrix.a * x2 + matrix.c * y2 + matrix.e;\n// bounds.y2 = matrix.b * x2 + matrix.d * y2 + matrix.f;\n// bounds.clear();\n// bounds.add(x1, y1);\n// bounds.add(x2, y2);\n// return bounds;\n// }\n\n// export function normalTransform(\n// out: Matrix,\n// origin: Matrix,\n// x: number,\n// y: number,\n// scaleX: number,\n// scaleY: number,\n// angle: number,\n// rotateCenter?: vec2\n// ) {\n// const oa = origin.a;\n// const ob = origin.b;\n// const oc = origin.c;\n// const od = origin.d;\n// const oe = origin.e;\n// const of = origin.f;\n// const cosTheta = cos(angle);\n// const sinTheta = sin(angle);\n// let rotateCenterX: number;\n// let rotateCenterY: number;\n// if (rotateCenter) {\n// rotateCenterX = rotateCenter[0];\n// rotateCenterY = rotateCenter[1];\n// } else {\n// rotateCenterX = x;\n// rotateCenterY = y;\n// }\n// const offsetX = rotateCenterX - x;\n// const offsetY = rotateCenterY - y;\n\n// const a1 = oa * cosTheta + oc * sinTheta;\n// const b1 = ob * cosTheta + od * sinTheta;\n// const c1 = oc * cosTheta - oa * sinTheta;\n// const d1 = od * cosTheta - ob * sinTheta;\n// out.a = scaleX * a1;\n// out.b = scaleX * b1;\n// out.c = scaleY * c1;\n// out.d = scaleY * d1;\n\n// out.e = oe + oa * rotateCenterX + oc * rotateCenterY - a1 * offsetX - c1 * offsetY;\n// out.f = of + ob * rotateCenterX + od * rotateCenterY - b1 * offsetX - d1 * offsetY;\n// }\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function lookAt(out: mat4, eye: vec3, center: vec3, up: vec3) {\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let z0;\n let z1;\n let z2;\n let len;\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n\n if (Math.abs(eyex - centerx) < epsilon && Math.abs(eyey - centery) < epsilon && Math.abs(eyez - centerz) < epsilon) {\n return DefaultMat4Allocate.identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Generates a orthogonal projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function multiply(out: mat4, a: mat4, b: mat4) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15]; // Cache only the current line of the second matrix\n\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat4(out: vec3, a: vec3, m: mat4) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/common/matrix.ts"],"names":[],"mappings":";;;AAKA,6CAA2C;AA0B3C,SAAgB,YAAY,CAAC,GAAS;IACpC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,C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AAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACtD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACtD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACvD,OAAO,GAAG,CAAC;AACb,CAAC;AAVD,sCAUC","file":"matrix.js","sourcesContent":["// import { abs, cos, epsilon, sin } from '@visactor/vutils';\n// import { IMatrix } from '../interface/matrix';\n// import { IBounds, IPoint } from '../interface/util';\n\nimport type { IMatrix, mat4, vec3 } from '@visactor/vutils';\nimport { epsilon } from '@visactor/vutils';\n\n/**\n * 部分代码参考 https://github.com/toji/gl-matrix\n * Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function identityMat4(out: mat4) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateX(out: mat4, a: mat4, rad: number) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n // Perform axis-specific matrix multiplication\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateY(out: mat4, a: mat4, rad: number) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateZ(out: mat4, a: mat4, rad: number) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function translate(out: mat4, a: mat4, v: vec3) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n let a00;\n let a01;\n let a02;\n let a03;\n let a10;\n let a11;\n let a12;\n let a13;\n let a20;\n let a21;\n let a22;\n let a23;\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n}\n\nexport function mat3Tomat4(out: mat4, b: IMatrix) {\n out[0] = b.a;\n out[1] = b.b;\n out[2] = 0;\n out[3] = 0;\n out[4] = b.c;\n out[5] = b.d;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = b.e;\n out[13] = b.f;\n out[14] = 0;\n out[15] = 1;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function multiplyMat4Mat3(out: mat4, a: mat4, b: IMatrix) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15]; // Cache only the current line of the second matrix\n\n let b0 = b.a;\n let b1 = b.b;\n let b2 = 0;\n let b3 = 0;\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b.c;\n b1 = b.d;\n b2 = 0;\n b3 = 0;\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = 0;\n b1 = 0;\n b2 = 1;\n b3 = 0;\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b.e;\n b1 = b.f;\n b2 = 0;\n b3 = 1;\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\nexport function scaleMat4(out: mat4, a: mat4, v: vec3) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function multiplyMat4Mat4(out: mat4, a: mat4, b: mat4) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15]; // Cache only the current line of the second matrix\n\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n\n// 代码来自gl-matrix https://github.com/toji/gl-matrix\nexport function lookAt(out: mat4, eye: vec3, center: vec3, up: vec3) {\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let z0;\n let z1;\n let z2;\n let len;\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n\n if (Math.abs(eyex - centerx) < epsilon && Math.abs(eyey - centery) < epsilon && Math.abs(eyez - centerz) < epsilon) {\n return identityMat4(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Generates a orthogonal projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * 代码来自gl-matrix https://github.com/toji/gl-matrix\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat4(out: vec3, a: vec3, m: mat4) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n"]}
|
|
@@ -292,4 +292,4 @@ function bezierCurversToPath(bezierCurves) {
|
|
|
292
292
|
|
|
293
293
|
exports.pathToBezierCurves = pathToBezierCurves, exports.applyTransformOnBezierCurves = applyTransformOnBezierCurves,
|
|
294
294
|
exports.bezierCurversToPath = bezierCurversToPath;
|
|
295
|
-
//# sourceMappingURL=morphing-utils.js.map
|
|
295
|
+
//# sourceMappingURL=morphing-utils.js.map
|
package/cjs/common/path-svg.js
CHANGED
package/cjs/common/polygon.js
CHANGED
|
@@ -39,8 +39,8 @@ function getProportionPoint(point, segment, length, dx, dy) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
//# sourceMappingURL=polygon.js.map
|
|
43
42
|
Object.defineProperty(exports, "__esModule", {
|
|
44
43
|
value: !0
|
|
45
44
|
}), exports.drawRoundedPolygon = exports.drawPolygon = void 0, exports.drawPolygon = drawPolygon,
|
|
46
|
-
exports.drawRoundedPolygon = drawRoundedPolygon;
|
|
45
|
+
exports.drawRoundedPolygon = drawRoundedPolygon;
|
|
46
|
+
//# sourceMappingURL=polygon.js.map
|
package/cjs/common/rect-utils.js
CHANGED
|
@@ -6,9 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils"), enums_1 = require("./enums"), render_utils_1 = require("./render-utils");
|
|
8
8
|
|
|
9
|
-
function
|
|
9
|
+
function drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ) {
|
|
10
10
|
var _a;
|
|
11
|
-
|
|
11
|
+
let p0 = curve.p0, newDefined0 = defined0;
|
|
12
|
+
if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (p0 = lastCurve.p0),
|
|
13
|
+
curve.defined) defined0 || (path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ),
|
|
14
|
+
newDefined0 = !defined0); else {
|
|
15
|
+
const {originP1: originP1, originP2: originP2} = curve;
|
|
16
|
+
let validP;
|
|
17
|
+
if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1),
|
|
18
|
+
defined0) {
|
|
19
|
+
newDefined0 = !defined0;
|
|
20
|
+
const x = validP ? validP.x : curve.p0.x, y = validP ? validP.y : curve.p0.y;
|
|
21
|
+
path.moveTo(x + offsetX, y + offsetY, offsetZ);
|
|
22
|
+
} else validP && (newDefined0 = !defined0, path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ));
|
|
23
|
+
}
|
|
24
|
+
return newDefined0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
|
|
28
|
+
const {offsetX: offsetX = 0, offsetY: offsetY = 0, offsetZ: offsetZ = 0, mode: mode = "none", drawConnect: drawConnect = !1} = params || {};
|
|
12
29
|
if (drawConnect && "none" === mode) return;
|
|
13
30
|
if (!segPath) return;
|
|
14
31
|
let needMoveTo = !0;
|
|
@@ -17,23 +34,8 @@ function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
|
|
|
17
34
|
if (drawConnect) {
|
|
18
35
|
let lastCurve, defined0 = !0;
|
|
19
36
|
curves.forEach(((curve, i) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (curve.originP1 !== curve.originP2) {
|
|
23
|
-
if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (p0 = lastCurve.p0),
|
|
24
|
-
curve.defined) defined0 || (path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ),
|
|
25
|
-
defined0 = !defined0); else {
|
|
26
|
-
const {originP1: originP1, originP2: originP2} = curve;
|
|
27
|
-
let validP;
|
|
28
|
-
if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1),
|
|
29
|
-
defined0) {
|
|
30
|
-
defined0 = !defined0;
|
|
31
|
-
const x = validP ? validP.x : curve.p0.x, y = validP ? validP.y : curve.p0.y;
|
|
32
|
-
path.moveTo(x + offsetX, y + offsetY, offsetZ);
|
|
33
|
-
} else validP && (defined0 = !defined0, path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ));
|
|
34
|
-
}
|
|
35
|
-
lastCurve = curve;
|
|
36
|
-
} else lastCurve = curve;
|
|
37
|
+
curve.originP1 !== curve.originP2 ? (defined0 = drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ),
|
|
38
|
+
lastCurve = curve) : lastCurve = curve;
|
|
37
39
|
}));
|
|
38
40
|
} else curves.forEach((curve => {
|
|
39
41
|
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ),
|
|
@@ -50,23 +52,11 @@ function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
|
|
|
50
52
|
const curve = curves[i], curCurveLength = curve.getLength(direction), _p = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
|
|
51
53
|
if (drawedLengthUntilLast += curCurveLength, _p < 0) break;
|
|
52
54
|
if (drawConnect) {
|
|
53
|
-
let p0 = curve.p0;
|
|
54
55
|
if (curve.originP1 === curve.originP2) {
|
|
55
56
|
lastCurve = curve;
|
|
56
57
|
continue;
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
curve.defined) defined0 || (path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ),
|
|
60
|
-
defined0 = !defined0); else {
|
|
61
|
-
const {originP1: originP1, originP2: originP2} = curve;
|
|
62
|
-
let validP;
|
|
63
|
-
if (originP1 && !1 !== originP1.defined ? validP = p0 : originP1 && !1 !== originP2.defined && (validP = null !== (_a = curve.p3) && void 0 !== _a ? _a : curve.p1),
|
|
64
|
-
defined0) {
|
|
65
|
-
defined0 = !defined0;
|
|
66
|
-
const x = validP ? validP.x : curve.p0.x, y = validP ? validP.y : curve.p0.y;
|
|
67
|
-
path.moveTo(x + offsetX, y + offsetY, offsetZ);
|
|
68
|
-
} else validP && (defined0 = !defined0, path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ));
|
|
69
|
-
}
|
|
59
|
+
defined0 = drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ),
|
|
70
60
|
lastCurve = curve;
|
|
71
61
|
} else {
|
|
72
62
|
if (!curve.defined) {
|
|
@@ -109,4 +99,4 @@ function drawIncrementalAreaSegments(path, lastSeg, segments, params) {
|
|
|
109
99
|
|
|
110
100
|
exports.drawSegments = drawSegments, exports.drawIncrementalSegments = drawIncrementalSegments,
|
|
111
101
|
exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
|
|
112
|
-
//# sourceMappingURL=render-curve.js.map
|
|
102
|
+
//# sourceMappingURL=render-curve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/render-curve.ts"],"names":[],"mappings":";;;AACA,6CAAuC;AAUvC,mCAAoC;AACpC,iDAA6C;AAW7C,SAAgB,YAAY,CAC1B,IAAa,EACb,OAAmB,EACnB,OAAe,EACf,oBAA+C,EAC/C,MAQC;;IAED,MAAM,EACJ,OAAO,GAAG,CAAC,EACX,OAAO,GAAG,CAAC,EACX,OAAO,GAAG,CAAC,EACX,IAA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AAM,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;QAEpD,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACjB,IAAI,CAAC,CAAC,OAAO,KAAK,KAAK,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;gBAC1C,OAAO;aACR;YACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC3C,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,MAAA,CAAC,CAAC,EAAE,mCAAI,CAAC,CAAC,CAAC,EAAE,MAAA,CAAC,CAAC,EAAE,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC;SACvC;QACD,IAAI,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,EAAE,mCAAI,MAAM,CAAC,CAAC,EAAE,MAAA,MAAM,CAAC,EAAE,mCAAI,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AA3CD,kEA2CC","file":"render-curve.js","sourcesContent":["import type { IPoint, IPointLike } from '@visactor/vutils';\nimport { min } from '@visactor/vutils';\nimport type {\n IAreaSegment,\n IClipRangeByDimensionType,\n ICurve,\n IDirection,\n IPath2D,\n ISegment,\n ISegPath2D\n} from '../interface';\nimport { Direction } from './enums';\nimport { drawSegItem } from './render-utils';\n\n/**\n * 绘制连续的线段\n * 绘制长度为总长度percent的path,drawDirection为绘制的方向,也就是percent的方向\n * @param path\n * @param segPath\n * @param percent\n * @param drawDirection 绘制的方向,用于使用percent绘制\n * @param line 用于获取line相关属性\n */\nexport function drawSegments(\n path: IPath2D,\n segPath: ISegPath2D,\n percent: number,\n clipRangeByDimension: IClipRangeByDimensionType,\n params?: {\n offsetX?: number;\n offsetY?: number;\n offsetZ?: number;\n drawConnect?: boolean; // 是否是绘制connect区域的效果\n mode?: 'none' | 'connect' | 'zero';\n zeroX?: number;\n zeroY?: number;\n }\n) {\n const {\n offsetX = 0,\n offsetY = 0,\n offsetZ = 0,\n mode = 'none',\n drawConnect = false,\n zeroX = 0,\n zeroY = 0\n } = params || {};\n // none的connect不需要draw\n if (drawConnect && mode === 'none') {\n return;\n }\n if (!segPath) {\n return;\n }\n let needMoveTo: boolean = true;\n const { curves } = segPath;\n if (percent >= 1) {\n if (drawConnect) {\n // return;\n let defined0 = true;\n let lastCurve: ICurve<IPoint>;\n curves.forEach((curve, i) => {\n // step的逻辑\n let p0 = curve.p0;\n if (curve.originP1 === curve.originP2) {\n lastCurve = curve;\n return;\n }\n if (lastCurve && lastCurve.originP1 === lastCurve.originP2) {\n p0 = lastCurve.p0;\n }\n if (curve.defined) {\n // 非法变合法需要lineTo,合法变非法需要moveTo,初始非法需要moveTo\n if (!defined0) {\n path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ);\n defined0 = !defined0;\n }\n } else {\n // 找到合法的点\n const { originP1, originP2 } = curve;\n let validP: IPointLike;\n if (originP1 && originP1.defined !== false) {\n validP = p0;\n } else if (originP1 && originP2.defined !== false) {\n validP = curve.p3 ?? curve.p1;\n }\n // 合法/(初始)变非法,moveTo\n if (defined0) {\n defined0 = !defined0;\n const x = validP ? validP.x : curve.p0.x;\n const y = validP ? validP.y : curve.p0.y;\n path.moveTo(x + offsetX, y + offsetY, offsetZ);\n } else {\n // 非法变非法/合法,看情况要不要lineTo\n if (validP) {\n // 非法变合法,需要lineTo\n defined0 = !defined0;\n path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ);\n }\n }\n }\n\n lastCurve = curve;\n });\n } else {\n curves.forEach(curve => {\n // 跳过这个点\n if (!curve.defined) {\n needMoveTo = true;\n return;\n }\n if (needMoveTo) {\n path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ);\n }\n drawSegItem(path, curve, 1, params);\n needMoveTo = false;\n });\n }\n\n return;\n }\n if (percent <= 0) {\n return;\n }\n\n let direction: IDirection | undefined;\n\n if (clipRangeByDimension === 'x') {\n direction = Direction.ROW;\n } else if (clipRangeByDimension === 'y') {\n direction = Direction.COLUMN;\n } else if (clipRangeByDimension === 'auto') {\n direction = segPath.direction;\n }\n\n // 整个线段的总长度\n const totalLength = segPath.tryUpdateLength(direction);\n // 总需要绘制的长度\n const totalDrawLength = percent * totalLength;\n // 直到上次绘制的长度\n let drawedLengthUntilLast = 0;\n let defined0 = true;\n let lastCurve: ICurve<IPoint> = null;\n for (let i = 0, n = curves.length; i < n; i++) {\n const curve = curves[i];\n const curCurveLength = curve.getLength(direction);\n const _p = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;\n drawedLengthUntilLast += curCurveLength;\n if (_p < 0) {\n break;\n }\n\n if (drawConnect) {\n // step的逻辑\n let p0 = curve.p0;\n if (curve.originP1 === curve.originP2) {\n lastCurve = curve;\n continue;\n }\n if (lastCurve && lastCurve.originP1 === lastCurve.originP2) {\n p0 = lastCurve.p0;\n }\n if (curve.defined) {\n // 非法变合法需要lineTo,合法变非法需要moveTo,初始非法需要moveTo\n if (!defined0) {\n path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ);\n defined0 = !defined0;\n }\n } else {\n // 找到合法的点\n const { originP1, originP2 } = curve;\n let validP: IPointLike;\n if (originP1 && originP1.defined !== false) {\n validP = p0;\n } else if (originP1 && originP2.defined !== false) {\n validP = curve.p3 ?? curve.p1;\n }\n // 合法/(初始)变非法,moveTo\n if (defined0) {\n defined0 = !defined0;\n const x = validP ? validP.x : curve.p0.x;\n const y = validP ? validP.y : curve.p0.y;\n path.moveTo(x + offsetX, y + offsetY, offsetZ);\n } else {\n // 非法变非法/合法,看情况要不要lineTo\n if (validP) {\n // 非法变合法,需要lineTo\n defined0 = !defined0;\n path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ);\n }\n }\n }\n\n lastCurve = curve;\n } else {\n // 跳过这个点\n if (!curve.defined) {\n needMoveTo = true;\n continue;\n }\n if (needMoveTo) {\n path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ);\n }\n drawSegItem(path, curve, min(_p, 1), params);\n needMoveTo = false;\n }\n }\n}\n\nexport function drawIncrementalSegments(\n path: IPath2D,\n lastSeg: ISegment,\n segments: ISegment,\n params?: {\n offsetX?: number;\n offsetY?: number;\n }\n) {\n const { offsetX = 0, offsetY = 0 } = params || {};\n const startP = lastSeg ? lastSeg.points[lastSeg.points.length - 1] : segments.points[0];\n path.moveTo(startP.x + offsetX, startP.y + offsetY);\n segments.points.forEach(p => {\n if (p.defined === false) {\n path.moveTo(p.x + offsetX, p.y + offsetY);\n return;\n }\n path.lineTo(p.x + offsetX, p.y + offsetY);\n });\n}\n\nexport function drawIncrementalAreaSegments(\n path: IPath2D,\n lastSeg: IAreaSegment,\n segments: IAreaSegment,\n params?: {\n offsetX?: number;\n offsetY?: number;\n }\n) {\n const { offsetX = 0, offsetY = 0 } = params || {};\n const { points } = segments;\n // 分段\n const definedPointsList: IPointLike[][] = [];\n let lastIdx = 0;\n for (let i = 0; i < points.length; i++) {\n if (points[i].defined === false) {\n if (lastIdx + 1 !== i) {\n definedPointsList.slice(lastIdx, i);\n }\n lastIdx = i;\n }\n }\n definedPointsList.length === 0;\n definedPointsList.push(points);\n definedPointsList.forEach((points, i) => {\n const startP = lastSeg && i === 0 ? lastSeg.points[lastSeg.points.length - 1] : points[0];\n path.moveTo(startP.x + offsetX, startP.y + offsetY);\n // 绘制上层\n points.forEach(p => {\n if (p.defined === false) {\n path.moveTo(p.x + offsetX, p.y + offsetY);\n return;\n }\n path.lineTo(p.x + offsetX, p.y + offsetY);\n });\n // 绘制下层\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n path.lineTo(p.x1 ?? p.x, p.y1 ?? p.y);\n }\n path.lineTo(startP.x1 ?? startP.x, startP.y1 ?? startP.y);\n path.closePath();\n });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/common/render-curve.ts"],"names":[],"mappings":";;;AACA,6CAAuC;AAUvC,mCAAoC;AACpC,iDAA6C;AAE7C,SAAS,aAAa,CACpB,IAAa,EACb,KAAqB,EACrB,SAAyB,EACzB,QAAiB,EACjB,OAAe,EACf,OAAe,EACf,OAAe;;IAEf,IAAI,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IAClB,IAAI,WAAW,GAAG,QAAQ,CAAC;IAE3B,IAAI,SAAS,IAAI,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE;QAC1D,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC;KACnB;IACD,IAAI,KAAK,CAAC,OAAO,EAAE;QAEjB,IAAI,CAAC,QAAQ,EAAE;YACb,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC;YACrD,WAAW,GAAG,CAAC,QAAQ,CAAC;SACzB;KACF;SAAM;QAEL,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;QACrC,IAAI,MAAkB,CAAC;QACvB,IAAI,QAAQ,IAAI,QAAQ,CAAC,OAAO,KAAK,KAAK,EAAE;YAC1C,MAAM,GAAG,EAAE,CAAC;SACb;aAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,OAAO,KAAK,KAAK,EAAE;YACjD,MAAM,GAAG,MAAA,KAAK,CAAC,EAAE,mCAAI,KAAK,CAAC,EAAE,CAAC;SAC/B;QAED,IAAI,QAAQ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,EAAE;YAC3C,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,MAAA,CAAC,CAAC,EAAE,mCAAI,CAAC,CAAC,CAAC,EAAE,MAAA,CAAC,CAAC,EAAE,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC;SACvC;QACD,IAAI,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,EAAE,mCAAI,MAAM,CAAC,CAAC,EAAE,MAAA,MAAM,CAAC,EAAE,mCAAI,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AA3CD,kEA2CC","file":"render-curve.js","sourcesContent":["import type { IPoint, IPointLike } from '@visactor/vutils';\nimport { min } from '@visactor/vutils';\nimport type {\n IAreaSegment,\n IClipRangeByDimensionType,\n ICurve,\n IDirection,\n IPath2D,\n ISegment,\n ISegPath2D\n} from '../interface';\nimport { Direction } from './enums';\nimport { drawSegItem } from './render-utils';\n\nfunction drawEachCurve(\n path: IPath2D,\n curve: ICurve<IPoint>,\n lastCurve: ICurve<IPoint>,\n defined0: boolean,\n offsetX: number,\n offsetY: number,\n offsetZ: number\n) {\n let p0 = curve.p0;\n let newDefined0 = defined0;\n\n if (lastCurve && lastCurve.originP1 === lastCurve.originP2) {\n p0 = lastCurve.p0;\n }\n if (curve.defined) {\n // 非法变合法需要lineTo,合法变非法需要moveTo,初始非法需要moveTo\n if (!defined0) {\n path.lineTo(p0.x + offsetX, p0.y + offsetY, offsetZ);\n newDefined0 = !defined0;\n }\n } else {\n // 找到合法的点\n const { originP1, originP2 } = curve;\n let validP: IPointLike;\n if (originP1 && originP1.defined !== false) {\n validP = p0;\n } else if (originP1 && originP2.defined !== false) {\n validP = curve.p3 ?? curve.p1;\n }\n // 合法/(初始)变非法,moveTo\n if (defined0) {\n newDefined0 = !defined0;\n const x = validP ? validP.x : curve.p0.x;\n const y = validP ? validP.y : curve.p0.y;\n path.moveTo(x + offsetX, y + offsetY, offsetZ);\n } else {\n // 非法变非法/合法,看情况要不要lineTo\n if (validP) {\n // 非法变合法,需要lineTo\n newDefined0 = !defined0;\n path.lineTo(validP.x + offsetX, validP.y + offsetY, offsetZ);\n }\n }\n }\n\n return newDefined0;\n}\n\n/**\n * 绘制连续的线段\n * 绘制长度为总长度percent的path,drawDirection为绘制的方向,也就是percent的方向\n * @param path\n * @param segPath\n * @param percent\n * @param drawDirection 绘制的方向,用于使用percent绘制\n * @param line 用于获取line相关属性\n */\nexport function drawSegments(\n path: IPath2D,\n segPath: ISegPath2D,\n percent: number,\n clipRangeByDimension: IClipRangeByDimensionType,\n params?: {\n offsetX?: number;\n offsetY?: number;\n offsetZ?: number;\n drawConnect?: boolean; // 是否是绘制connect区域的效果\n mode?: 'none' | 'connect' | 'zero';\n zeroX?: number;\n zeroY?: number;\n }\n) {\n const { offsetX = 0, offsetY = 0, offsetZ = 0, mode = 'none', drawConnect = false } = params || {};\n // none的connect不需要draw\n if (drawConnect && mode === 'none') {\n return;\n }\n if (!segPath) {\n return;\n }\n let needMoveTo: boolean = true;\n const { curves } = segPath;\n if (percent >= 1) {\n if (drawConnect) {\n // return;\n let defined0 = true;\n let lastCurve: ICurve<IPoint>;\n curves.forEach((curve, i) => {\n // step的逻辑\n if (curve.originP1 === curve.originP2) {\n lastCurve = curve;\n return;\n }\n defined0 = drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ);\n\n lastCurve = curve;\n });\n } else {\n curves.forEach(curve => {\n // 跳过这个点\n if (!curve.defined) {\n needMoveTo = true;\n return;\n }\n if (needMoveTo) {\n path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ);\n }\n drawSegItem(path, curve, 1, params);\n needMoveTo = false;\n });\n }\n\n return;\n }\n if (percent <= 0) {\n return;\n }\n\n let direction: IDirection | undefined;\n\n if (clipRangeByDimension === 'x') {\n direction = Direction.ROW;\n } else if (clipRangeByDimension === 'y') {\n direction = Direction.COLUMN;\n } else if (clipRangeByDimension === 'auto') {\n direction = segPath.direction;\n }\n\n // 整个线段的总长度\n const totalLength = segPath.tryUpdateLength(direction);\n // 总需要绘制的长度\n const totalDrawLength = percent * totalLength;\n // 直到上次绘制的长度\n let drawedLengthUntilLast = 0;\n let defined0 = true;\n let lastCurve: ICurve<IPoint> = null;\n for (let i = 0, n = curves.length; i < n; i++) {\n const curve = curves[i];\n const curCurveLength = curve.getLength(direction);\n const _p = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;\n drawedLengthUntilLast += curCurveLength;\n if (_p < 0) {\n break;\n }\n\n if (drawConnect) {\n // step的逻辑\n if (curve.originP1 === curve.originP2) {\n lastCurve = curve;\n continue;\n }\n defined0 = drawEachCurve(path, curve, lastCurve, defined0, offsetX, offsetY, offsetZ);\n\n lastCurve = curve;\n } else {\n // 跳过这个点\n if (!curve.defined) {\n needMoveTo = true;\n continue;\n }\n if (needMoveTo) {\n path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ);\n }\n drawSegItem(path, curve, min(_p, 1), params);\n needMoveTo = false;\n }\n }\n}\n\nexport function drawIncrementalSegments(\n path: IPath2D,\n lastSeg: ISegment,\n segments: ISegment,\n params?: {\n offsetX?: number;\n offsetY?: number;\n }\n) {\n const { offsetX = 0, offsetY = 0 } = params || {};\n const startP = lastSeg ? lastSeg.points[lastSeg.points.length - 1] : segments.points[0];\n path.moveTo(startP.x + offsetX, startP.y + offsetY);\n segments.points.forEach(p => {\n if (p.defined === false) {\n path.moveTo(p.x + offsetX, p.y + offsetY);\n return;\n }\n path.lineTo(p.x + offsetX, p.y + offsetY);\n });\n}\n\nexport function drawIncrementalAreaSegments(\n path: IPath2D,\n lastSeg: IAreaSegment,\n segments: IAreaSegment,\n params?: {\n offsetX?: number;\n offsetY?: number;\n }\n) {\n const { offsetX = 0, offsetY = 0 } = params || {};\n const { points } = segments;\n // 分段\n const definedPointsList: IPointLike[][] = [];\n let lastIdx = 0;\n for (let i = 0; i < points.length; i++) {\n if (points[i].defined === false) {\n if (lastIdx + 1 !== i) {\n definedPointsList.slice(lastIdx, i);\n }\n lastIdx = i;\n }\n }\n definedPointsList.length === 0;\n definedPointsList.push(points);\n definedPointsList.forEach((points, i) => {\n const startP = lastSeg && i === 0 ? lastSeg.points[lastSeg.points.length - 1] : points[0];\n path.moveTo(startP.x + offsetX, startP.y + offsetY);\n // 绘制上层\n points.forEach(p => {\n if (p.defined === false) {\n path.moveTo(p.x + offsetX, p.y + offsetY);\n return;\n }\n path.lineTo(p.x + offsetX, p.y + offsetY);\n });\n // 绘制下层\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n path.lineTo(p.x1 ?? p.x, p.y1 ?? p.y);\n }\n path.lineTo(startP.x1 ?? startP.x, startP.y1 ?? startP.y);\n path.closePath();\n });\n}\n"]}
|
package/cjs/common/simplify.js
CHANGED
|
@@ -37,4 +37,4 @@ function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", {
|
|
38
38
|
value: !0
|
|
39
39
|
}), exports.flatten_simplify = void 0, exports.flatten_simplify = flatten_simplify;
|
|
40
|
-
//# sourceMappingURL=simplify.js.map
|
|
40
|
+
//# sourceMappingURL=simplify.js.map
|
package/cjs/common/sort.js
CHANGED
|
@@ -26,8 +26,18 @@ var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, gener
|
|
|
26
26
|
}));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
function
|
|
29
|
+
function parseChildMap(graphic, defaultZIndex, reverse) {
|
|
30
30
|
const childMap = {}, zIdxArray = [];
|
|
31
|
+
return graphic.forEachChildren((item => {
|
|
32
|
+
const {zIndex: zIndex = defaultZIndex} = item.attribute;
|
|
33
|
+
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [ item ], zIdxArray.push(zIndex));
|
|
34
|
+
}), reverse), zIdxArray.sort(((a, b) => reverse ? b - a : a - b)), {
|
|
35
|
+
childMap: childMap,
|
|
36
|
+
zIdxArray: zIdxArray
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
|
|
31
41
|
let needSort = !1;
|
|
32
42
|
if (sort3d) needSort = !0; else {
|
|
33
43
|
let lastZIndex;
|
|
@@ -39,13 +49,10 @@ function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
|
|
|
39
49
|
}), reverse);
|
|
40
50
|
}
|
|
41
51
|
if (needSort) {
|
|
42
|
-
graphic
|
|
43
|
-
const {zIndex: zIndex = defaultZIndex} = item.attribute;
|
|
44
|
-
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [ item ], zIdxArray.push(zIndex));
|
|
45
|
-
}), reverse), zIdxArray.sort(((a, b) => reverse ? b - a : a - b));
|
|
52
|
+
const {childMap: childMap, zIdxArray: zIdxArray} = parseChildMap(graphic, defaultZIndex, reverse);
|
|
46
53
|
let skip = !1;
|
|
47
54
|
for (let i = 0; i < zIdxArray.length && !skip; i++) {
|
|
48
|
-
const
|
|
55
|
+
const children = childMap[zIdxArray[i]];
|
|
49
56
|
sort3d && children.sort(((a, b) => {
|
|
50
57
|
var _a, _b;
|
|
51
58
|
return (reverse ? -1 : 1) * ((null !== (_a = b.attribute.z) && void 0 !== _a ? _a : 0) - (null !== (_b = a.attribute.z) && void 0 !== _b ? _b : 0));
|
|
@@ -65,7 +72,6 @@ function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
|
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
|
|
68
|
-
const childMap = {}, zIdxArray = [];
|
|
69
75
|
let needSort = !1;
|
|
70
76
|
graphic.forEachChildren(((item, i) => {
|
|
71
77
|
const {zIndex: zIndex = defaultZIndex} = item.attribute;
|
|
@@ -74,13 +80,10 @@ function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
|
|
|
74
80
|
}), reverse);
|
|
75
81
|
let result = null, next = !1;
|
|
76
82
|
if (needSort) {
|
|
77
|
-
graphic
|
|
78
|
-
const {zIndex: zIndex = defaultZIndex} = item.attribute;
|
|
79
|
-
childMap[zIndex] ? childMap[zIndex].push(item) : (childMap[zIndex] = [ item ], zIdxArray.push(zIndex));
|
|
80
|
-
}), reverse), zIdxArray.sort(((a, b) => reverse ? b - a : a - b));
|
|
83
|
+
const {childMap: childMap, zIdxArray: zIdxArray} = parseChildMap(graphic, defaultZIndex, reverse);
|
|
81
84
|
let skip = !1;
|
|
82
85
|
for (let i = 0; i < zIdxArray.length && !skip; i++) {
|
|
83
|
-
const
|
|
86
|
+
const children = childMap[zIdxArray[i]];
|
|
84
87
|
for (let i = 0; i < children.length; i++) {
|
|
85
88
|
if (next) {
|
|
86
89
|
skip = !0, result = children[i];
|
|
@@ -98,4 +101,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
98
101
|
value: !0
|
|
99
102
|
}), exports.findNextGraphic = exports.foreachAsync = exports.foreach = void 0, exports.foreach = foreach,
|
|
100
103
|
exports.foreachAsync = foreachAsync, exports.findNextGraphic = findNextGraphic;
|
|
101
|
-
//# sourceMappingURL=sort.js.map
|
|
104
|
+
//# sourceMappingURL=sort.js.map
|