@threepipe/plugin-svg-renderer 0.3.0 → 0.4.0-r172.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/CHANGELOG.md +6 -0
- package/dist/dependencies.txt +2 -2
- package/dist/index.js +34 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -34
- package/dist/index.mjs.map +1 -1
- package/docs/classes/BasicSVGRenderer.html +6 -6
- package/docs/classes/BasicSVGRendererPlugin.html +35 -35
- package/docs/classes/DrawPass.html +5 -5
- package/docs/classes/FillPass.html +9 -9
- package/docs/classes/SVGDrawHandler.html +5 -5
- package/docs/classes/SVGDrawInfo.html +3 -3
- package/docs/classes/SVGMesh.html +25 -25
- package/docs/classes/SVGRenderInfo.html +5 -5
- package/docs/classes/SVGRenderer.html +8 -8
- package/docs/classes/ThreeSVGRendererPlugin.html +54 -54
- package/docs/classes/Viewmap.html +15 -15
- package/docs/classes/ViewmapBuildInfo.html +6 -6
- package/docs/interfaces/FillPassOptions.html +7 -7
- package/docs/interfaces/SVGDrawOptions.html +2 -2
- package/docs/interfaces/SVGMeshOptions.html +2 -2
- package/docs/interfaces/SVGTexture.html +3 -3
- package/docs/interfaces/ViewmapOptions.html +5 -5
- package/package.json +5 -2
- package/src/three-svg-renderer/core/viewmap/operations/assignPolygons.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @threepipe/plugin-svg-renderer v0.
|
|
3
|
+
* @threepipe/plugin-svg-renderer v0.4.0-r172.1
|
|
4
4
|
* Copyright 2022-2026 repalash <palash@shaders.app>
|
|
5
5
|
* GPLV3 License
|
|
6
6
|
* See ./dependencies.txt for any bundled third-party dependencies and licenses.
|
|
@@ -715,7 +715,7 @@ var SVGRenderer$1 = class {
|
|
|
715
715
|
// ../../node_modules/ts-browser-helpers/dist/bundle.esm.js
|
|
716
716
|
/**
|
|
717
717
|
* @license
|
|
718
|
-
* ts-browser-helpers v0.
|
|
718
|
+
* ts-browser-helpers v0.24.0
|
|
719
719
|
* Copyright 2022-2026 repalash <palash@shaders.app>
|
|
720
720
|
* MIT License
|
|
721
721
|
* See ./dependencies.txt for bundled third-party dependencies and licenses.
|
|
@@ -734,22 +734,22 @@ var SVGRenderer$1 = class {
|
|
|
734
734
|
* See the License for the specific language governing permissions and
|
|
735
735
|
* limitations under the License.
|
|
736
736
|
*/
|
|
737
|
-
var
|
|
738
|
-
constructor(e =
|
|
737
|
+
var k$1 = class k {
|
|
738
|
+
constructor(e = k.DECAY_MILLISECONDS) {
|
|
739
739
|
this.velocity = 0, this.naturalFrequency = 0, this.setDecayTime(e);
|
|
740
740
|
}
|
|
741
741
|
setDecayTime(e) {
|
|
742
|
-
this.naturalFrequency = 1 / Math.max(
|
|
742
|
+
this.naturalFrequency = 1 / Math.max(k.MIN_DECAY_MILLISECONDS, e);
|
|
743
743
|
}
|
|
744
744
|
update(e, t, n, r) {
|
|
745
745
|
const o = 2e-4 * this.naturalFrequency;
|
|
746
746
|
if (e == null || r === 0 || e === t && this.velocity === 0) return t;
|
|
747
747
|
if (n < 0) return e;
|
|
748
|
-
const s = e - t, a = this.velocity + this.naturalFrequency * s, l = s + n * a, d = Math.exp(-this.naturalFrequency * n), c = (a - this.naturalFrequency * l) * d,
|
|
749
|
-
return Math.abs(c) < o * Math.abs(r) &&
|
|
748
|
+
const s = e - t, a = this.velocity + this.naturalFrequency * s, l = s + n * a, d = Math.exp(-this.naturalFrequency * n), c = (a - this.naturalFrequency * l) * d, u = -this.naturalFrequency * (c + a * d);
|
|
749
|
+
return Math.abs(c) < o * Math.abs(r) && u * s >= 0 ? (this.velocity = 0, t) : (this.velocity = c, t + l * d);
|
|
750
750
|
}
|
|
751
751
|
};
|
|
752
|
-
|
|
752
|
+
k$1.SETTLING_TIME = 1e4, k$1.MIN_DECAY_MILLISECONDS = .001, k$1.DECAY_MILLISECONDS = 50;
|
|
753
753
|
function re(i, e) {
|
|
754
754
|
let t;
|
|
755
755
|
do
|
|
@@ -777,24 +777,24 @@ function R(i, e) {
|
|
|
777
777
|
var O = {
|
|
778
778
|
priority: 1 / 0,
|
|
779
779
|
type: "Object",
|
|
780
|
-
serialize: (i, e) => R(i, ([t, n]) => [t,
|
|
781
|
-
deserialize: (i, e, t) => Object.assign(e || {}, R(i, ([n, r]) => [n,
|
|
780
|
+
serialize: (i, e) => R(i, ([t, n]) => [t, x$4.Serialize(n, e, !1)]),
|
|
781
|
+
deserialize: (i, e, t) => Object.assign(e || {}, R(i, ([n, r]) => [n, x$4.Deserialize(r, e == null ? void 0 : e[n], t, !1)])),
|
|
782
782
|
isType: (i) => (i.constructor || Object) === Object
|
|
783
783
|
};
|
|
784
|
-
var
|
|
784
|
+
var f = class f {
|
|
785
785
|
static GetSerializer(e) {
|
|
786
|
-
return
|
|
786
|
+
return f.Serializers.find((t) => t.isType(e));
|
|
787
787
|
}
|
|
788
788
|
static RegisterSerializer(...e) {
|
|
789
789
|
for (const t of e) {
|
|
790
|
-
const n = t.priority ?? 1e10, r = se(
|
|
791
|
-
r >= 0 ?
|
|
790
|
+
const n = t.priority ?? 1e10, r = se(f.Serializers, (o) => o.priority !== void 0 && o.priority < n);
|
|
791
|
+
r >= 0 ? f.Serializers.splice(r + 1, 0, t) : f.Serializers.push(t);
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
static UnregisterSerializer(...e) {
|
|
795
795
|
for (const t of e) {
|
|
796
|
-
const n =
|
|
797
|
-
n >= 0 &&
|
|
796
|
+
const n = f.Serializers.indexOf(t);
|
|
797
|
+
n >= 0 && f.Serializers.splice(n, 1);
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
/**
|
|
@@ -806,7 +806,7 @@ var u = class u {
|
|
|
806
806
|
static Serialize(e, t, n = !1) {
|
|
807
807
|
if (typeof e == "function") return;
|
|
808
808
|
if (!n) {
|
|
809
|
-
const s =
|
|
809
|
+
const s = f.GetSerializer(e);
|
|
810
810
|
if (s) return s.serialize(e, t);
|
|
811
811
|
if (typeof e.toJSON == "function") {
|
|
812
812
|
const a = e.toJSON(t, !0);
|
|
@@ -816,8 +816,8 @@ var u = class u {
|
|
|
816
816
|
let r = e.constructor ?? Object;
|
|
817
817
|
const o = {};
|
|
818
818
|
for (; r && r !== Object;) {
|
|
819
|
-
const s =
|
|
820
|
-
for (const [a, l] of s) o[a] =
|
|
819
|
+
const s = f.TypeMap.get(r) ?? [];
|
|
820
|
+
for (const [a, l] of s) o[a] = f.Serialize(e[l], t, !1);
|
|
821
821
|
r = Object.getPrototypeOf(r);
|
|
822
822
|
}
|
|
823
823
|
return e.serializableClassId && (o.serializableClassId = e.serializableClassId), o;
|
|
@@ -852,14 +852,14 @@ var u = class u {
|
|
|
852
852
|
}
|
|
853
853
|
if (e && typeof e == "object") {
|
|
854
854
|
const s = (a) => {
|
|
855
|
-
const l =
|
|
855
|
+
const l = f.SerializableClasses.get(a);
|
|
856
856
|
l && (l.DataInConstructor ? t = new l(e) : t = new l());
|
|
857
857
|
};
|
|
858
858
|
e.serializableClassId && (!t || t.serializableClassId !== e.serializableClassId) && s(e.serializableClassId), e.type && (!t || t.type !== e.type) && s(e.type), !Array.isArray(t) && Array.isArray(e) ? t = [] : typeof t != "object" && (e.constructor || Object) === Object && (t = {});
|
|
859
859
|
}
|
|
860
860
|
if (typeof t == "function") return console.error("Serialization: Cannot deserialize into a function", t, e), t;
|
|
861
861
|
if (!r) {
|
|
862
|
-
const s =
|
|
862
|
+
const s = f.GetSerializer(e);
|
|
863
863
|
if (s && s !== O) return s.deserialize(e, t, n);
|
|
864
864
|
}
|
|
865
865
|
if (!e || t === void 0 || t === null || typeof t != "object") return e;
|
|
@@ -867,9 +867,9 @@ var u = class u {
|
|
|
867
867
|
let o = t.constructor ?? Object;
|
|
868
868
|
if (o === Object) return O.deserialize(e, t, n);
|
|
869
869
|
for (; o && o !== Object;) {
|
|
870
|
-
const s =
|
|
870
|
+
const s = f.TypeMap.get(o) ?? [];
|
|
871
871
|
for (const [a, l] of s) {
|
|
872
|
-
const d = t[l], c =
|
|
872
|
+
const d = t[l], c = f.Deserialize(e[a], d, n, !1);
|
|
873
873
|
c !== d && P(t, l, c, !0);
|
|
874
874
|
}
|
|
875
875
|
o = Object.getPrototypeOf(o);
|
|
@@ -877,17 +877,17 @@ var u = class u {
|
|
|
877
877
|
return t;
|
|
878
878
|
}
|
|
879
879
|
};
|
|
880
|
-
|
|
880
|
+
f.TypeMap = /* @__PURE__ */ new WeakMap(), f.SerializableClasses = /* @__PURE__ */ new Map(), f.Serializers = [
|
|
881
881
|
{
|
|
882
882
|
priority: 0,
|
|
883
883
|
type: "Array",
|
|
884
884
|
isType: (e) => Array.isArray(e),
|
|
885
|
-
serialize: (e, t) => e.map((n) =>
|
|
885
|
+
serialize: (e, t) => e.map((n) => f.Serialize(n, t, !1)),
|
|
886
886
|
deserialize: (e, t, n) => {
|
|
887
887
|
const r = e.length;
|
|
888
888
|
Array.isArray(t) || (t = []);
|
|
889
889
|
for (let o = 0; o < r; o++) {
|
|
890
|
-
const s = e[o], a = t.length > o ?
|
|
890
|
+
const s = e[o], a = t.length > o ? f.Deserialize(s, t[o], n, !1) : f.Deserialize(s, void 0, n, !1);
|
|
891
891
|
t.length <= o ? t.push(a) : t[o] = a;
|
|
892
892
|
}
|
|
893
893
|
return t;
|
|
@@ -916,13 +916,13 @@ u.TypeMap = /* @__PURE__ */ new WeakMap(), u.SerializableClasses = /* @__PURE__
|
|
|
916
916
|
},
|
|
917
917
|
O
|
|
918
918
|
];
|
|
919
|
-
var
|
|
920
|
-
var
|
|
919
|
+
var x$4 = f;
|
|
920
|
+
var _ = class _ {
|
|
921
921
|
static callFunction(e, t, n = []) {
|
|
922
922
|
if (!t) return e(...n);
|
|
923
923
|
if (e.name && t[e.name] === e) return e.call(t, ...n);
|
|
924
|
-
|
|
925
|
-
const r =
|
|
924
|
+
_.methodMap.has(t) || _.methodMap.set(t, /* @__PURE__ */ new WeakMap());
|
|
925
|
+
const r = _.methodMap.get(t);
|
|
926
926
|
if (!r.has(e)) {
|
|
927
927
|
let o = t;
|
|
928
928
|
for (; o;) {
|
|
@@ -935,8 +935,8 @@ var k$1 = class k {
|
|
|
935
935
|
return r.get(e) ? e.call(t, ...n) : e(...n);
|
|
936
936
|
}
|
|
937
937
|
};
|
|
938
|
-
|
|
939
|
-
var
|
|
938
|
+
_.methodMap = /* @__PURE__ */ new WeakMap();
|
|
939
|
+
var T = _;
|
|
940
940
|
function I(i, e = "param") {
|
|
941
941
|
if (!i) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
|
|
942
942
|
return (t, n, r) => {
|
|
@@ -960,7 +960,7 @@ function I(i, e = "param") {
|
|
|
960
960
|
oldValue: a,
|
|
961
961
|
target: this
|
|
962
962
|
}] : [];
|
|
963
|
-
typeof i == "string" ? (d = this[i]) == null || d.call(this, ...l) : typeof i == "function" &&
|
|
963
|
+
typeof i == "string" ? (d = this[i]) == null || d.call(this, ...l) : typeof i == "function" && T.callFunction(i, this, l);
|
|
964
964
|
}
|
|
965
965
|
};
|
|
966
966
|
if (r) return U(r, "value") && delete r.value, U(r, "writable") && delete r.writable, U(r, "initializer") && delete r.initializer, Object.assign(r, o);
|
|
@@ -4318,7 +4318,7 @@ function assignPolygons(viewmap, options, info = new AssignPolygonInfo()) {
|
|
|
4318
4318
|
if (intersections.length > 0) {
|
|
4319
4319
|
const intersection = intersections[0];
|
|
4320
4320
|
const faceIndex = intersection.faceIndex;
|
|
4321
|
-
if (faceIndex !== void 0) {
|
|
4321
|
+
if (faceIndex !== void 0 && faceIndex !== null) {
|
|
4322
4322
|
const intersectionMesh = intersection.object;
|
|
4323
4323
|
polygon.mesh = svgMeshesMap.get(intersectionMesh);
|
|
4324
4324
|
if (polygon.mesh) {
|