web3dlink 2.1.4 → 2.1.5
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/web3dlink.js +101 -2
- package/dist/web3dlink.js.map +1 -1
- package/package.json +1 -1
package/dist/web3dlink.js
CHANGED
|
@@ -2720,7 +2720,7 @@ function outline(e) {
|
|
|
2720
2720
|
min: 0
|
|
2721
2721
|
})), t.push(...validateOptionalNumber({
|
|
2722
2722
|
normalized: n.config,
|
|
2723
|
-
field: "
|
|
2723
|
+
field: "meshOpacity",
|
|
2724
2724
|
value: n.config.meshOpacity,
|
|
2725
2725
|
defaultValue: .02,
|
|
2726
2726
|
min: 0,
|
|
@@ -2743,6 +2743,102 @@ function removeAllOutline(e) {
|
|
|
2743
2743
|
normalized: { ...e }
|
|
2744
2744
|
};
|
|
2745
2745
|
}
|
|
2746
|
+
var SLICE_MODE_LIST = [
|
|
2747
|
+
"None",
|
|
2748
|
+
"Color",
|
|
2749
|
+
"Texture",
|
|
2750
|
+
"Material"
|
|
2751
|
+
];
|
|
2752
|
+
function validateBooleanField(e, t, n, r, i) {
|
|
2753
|
+
if (r == null) {
|
|
2754
|
+
t[n] = i;
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
if (typeof r != "boolean") {
|
|
2758
|
+
e.push(`[${n}]必须是布尔类型`);
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
t[n] = r;
|
|
2762
|
+
}
|
|
2763
|
+
function openSlice(e = {}) {
|
|
2764
|
+
let t = [], n = { ...e };
|
|
2765
|
+
return t.push(...validateRequiredString({
|
|
2766
|
+
normalized: n,
|
|
2767
|
+
field: "id",
|
|
2768
|
+
value: e.id
|
|
2769
|
+
})), t.push(...verifyEnumerationValue({
|
|
2770
|
+
normalized: n,
|
|
2771
|
+
field: "mode",
|
|
2772
|
+
value: e.mode,
|
|
2773
|
+
defaultValue: "None",
|
|
2774
|
+
type: "string",
|
|
2775
|
+
list: SLICE_MODE_LIST
|
|
2776
|
+
})), t.push(...validateOptionalColor({
|
|
2777
|
+
normalized: n,
|
|
2778
|
+
field: "color",
|
|
2779
|
+
value: e.color,
|
|
2780
|
+
defaultValue: "#FFFFFF00"
|
|
2781
|
+
})), t.push(...validateOptionalString({
|
|
2782
|
+
normalized: n,
|
|
2783
|
+
field: "texturePath",
|
|
2784
|
+
value: e.texturePath,
|
|
2785
|
+
defaultValue: ""
|
|
2786
|
+
})), t.push(...validateOptionalString({
|
|
2787
|
+
normalized: n,
|
|
2788
|
+
field: "materialName",
|
|
2789
|
+
value: e.materialName,
|
|
2790
|
+
defaultValue: ""
|
|
2791
|
+
})), t.push(...validateOptionalArray({
|
|
2792
|
+
normalized: n,
|
|
2793
|
+
field: "uvOffset",
|
|
2794
|
+
value: e.uvOffset,
|
|
2795
|
+
length: 2,
|
|
2796
|
+
defaultValue: [0, 0]
|
|
2797
|
+
})), t.push(...validateOptionalArray({
|
|
2798
|
+
normalized: n,
|
|
2799
|
+
field: "uvScale",
|
|
2800
|
+
value: e.uvScale,
|
|
2801
|
+
length: 2,
|
|
2802
|
+
defaultValue: [1, 1]
|
|
2803
|
+
})), validateBooleanField(t, n, "isWorldUV", e.isWorldUV, !1), t.push(...validateOptionalArray({
|
|
2804
|
+
normalized: n,
|
|
2805
|
+
field: "direction",
|
|
2806
|
+
value: e.direction,
|
|
2807
|
+
length: 3,
|
|
2808
|
+
defaultValue: [
|
|
2809
|
+
0,
|
|
2810
|
+
0,
|
|
2811
|
+
-1
|
|
2812
|
+
]
|
|
2813
|
+
})), validateBooleanField(t, n, "isWorldDirection", e.isWorldDirection, !1), t.push(...validateOptionalNumber({
|
|
2814
|
+
normalized: n,
|
|
2815
|
+
field: "ratio",
|
|
2816
|
+
value: e.ratio,
|
|
2817
|
+
defaultValue: .5,
|
|
2818
|
+
min: 0,
|
|
2819
|
+
max: 1
|
|
2820
|
+
})), {
|
|
2821
|
+
errors: t,
|
|
2822
|
+
normalized: n
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
function closeSlice(e = {}) {
|
|
2826
|
+
let t = [], n = { ...e };
|
|
2827
|
+
return t.push(...validateRequiredString({
|
|
2828
|
+
normalized: n,
|
|
2829
|
+
field: "id",
|
|
2830
|
+
value: e.id
|
|
2831
|
+
})), {
|
|
2832
|
+
errors: t,
|
|
2833
|
+
normalized: n
|
|
2834
|
+
};
|
|
2835
|
+
}
|
|
2836
|
+
function closeAllSlice(e = {}) {
|
|
2837
|
+
return {
|
|
2838
|
+
errors: [],
|
|
2839
|
+
normalized: { ...e }
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2746
2842
|
//#endregion
|
|
2747
2843
|
//#region ../api/sceneModel/sceneModelApi.js
|
|
2748
2844
|
var validator$5 = {
|
|
@@ -2760,7 +2856,10 @@ var validator$5 = {
|
|
|
2760
2856
|
setOpacity,
|
|
2761
2857
|
outline,
|
|
2762
2858
|
removeOutline,
|
|
2763
|
-
removeAllOutline
|
|
2859
|
+
removeAllOutline,
|
|
2860
|
+
openSlice,
|
|
2861
|
+
closeSlice,
|
|
2862
|
+
closeAllSlice
|
|
2764
2863
|
}, SceneModelAPI = class {
|
|
2765
2864
|
constructor(e) {
|
|
2766
2865
|
this.commandManager = e;
|