ss-component-new 1.2.276 → 1.2.277
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/{OBJLoader-C0jZQFPa.cjs → OBJLoader-8gDmNV2i.cjs} +1 -1
- package/dist/{OBJLoader-64213hWB.js → OBJLoader-Ck9W3Ir7.js} +15 -15
- package/dist/{OrbitControls-BBZBmIbn.js → OrbitControls-BIGKrhyi.js} +1 -1
- package/dist/{OrbitControls-qylnhbze.cjs → OrbitControls-BWF5w18E.cjs} +1 -1
- package/dist/{PCDLoader-D3avKTU7.js → PCDLoader-CkJ5aJWh.js} +70 -70
- package/dist/{PCDLoader-Bm7UOglg.cjs → PCDLoader-D-K96lwY.cjs} +1 -1
- package/dist/{animationData-CaDzheJc.js → animationData-BlzkiZT-.js} +1 -1
- package/dist/animationData-Dzb7SwCQ.cjs +1 -0
- package/dist/{iconfont-DtHZpKxg.js → iconfont-BmIvNcSQ.js} +18 -18
- package/dist/{iconfont-BADQc-tq.cjs → iconfont-NOOcjYp4.cjs} +1 -1
- package/dist/{index-nuqLm_YA.js → index-B8qf9d05.js} +23 -24
- package/dist/{index-BW-0pCi3.cjs → index-BEpKwEv5.cjs} +1 -1
- package/dist/{index-CXs0ZsFx.js → index-BL0awa8-.js} +3 -3
- package/dist/{index-DBlUiXnM.js → index-BRv7sxzt.js} +2 -2
- package/dist/{index-D6gPxUru.cjs → index-BSg9JX4n.cjs} +1 -1
- package/dist/{index-BYpBA_KK.js → index-B_m93ELp.js} +1 -1
- package/dist/{index-Dwdoxmcq.js → index-BesW116i.js} +1 -1
- package/dist/{index-DZiK017P.js → index-Bgw0FBZB.js} +3 -3
- package/dist/{index-BcskLcv0.js → index-BnyJIP-o.js} +1 -1
- package/dist/{index-CToI_3R0.js → index-BtwkxysC.js} +1 -1
- package/dist/{index-DAEpPdX3.js → index-BvrZFscP.js} +2 -2
- package/dist/index-BwsCwOSF.cjs +1 -0
- package/dist/{index-Bp2ywlIX.cjs → index-C0xl75C8.cjs} +12 -12
- package/dist/{index-BvF_Eiw4.js → index-C10ZRirF.js} +2 -2
- package/dist/{index-KlIs_vtO.js → index-C5DS8J0U.js} +3783 -3708
- package/dist/index-CCkTluUl.cjs +1 -0
- package/dist/{index-CLz04045.cjs → index-CHj3wNcO.cjs} +1 -1
- package/dist/{index-BUT1ub8P.cjs → index-CIrfLsW0.cjs} +1 -1
- package/dist/{index-DyVbR2E1.js → index-CJ-zljKi.js} +7 -7
- package/dist/{index-DJuCQHW4.js → index-CLgNGdD3.js} +272 -272
- package/dist/index-CNctJ7sv.cjs +1 -0
- package/dist/{index-bvKP8j5i.js → index-CaRAY5Sl.js} +1 -1
- package/dist/{index-DTvmQ9sw.cjs → index-CeHymYlh.cjs} +1 -1
- package/dist/{index-C27lnw8n.cjs → index-CiboHnOj.cjs} +1 -1
- package/dist/{index-BeZemMv1.js → index-ClHoJzAi.js} +3 -3
- package/dist/{index-BL56OOVA.js → index-Cs8ZvUn4.js} +8 -9
- package/dist/{index-DfvOys4X.cjs → index-D0jGNd-H.cjs} +1 -1
- package/dist/{index-C2UeSG0O.cjs → index-D9i7wZaC.cjs} +1 -1
- package/dist/{index-CzIl5iPr.js → index-DCInp2vK.js} +3 -3
- package/dist/{index-Cl39jXmH.cjs → index-DG34ApJ9.cjs} +1 -1
- package/dist/{index-Ds_NrFJn.js → index-DODc5Qo5.js} +1 -1
- package/dist/{index-BGQ8tZy9.js → index-DRD-FSrJ.js} +1 -1
- package/dist/{index-DB-Y5yfM.cjs → index-Dc_JcSBf.cjs} +1 -1
- package/dist/index-DccSJl23.js +12217 -0
- package/dist/{index-Dh18rgrb.cjs → index-DmZWyQV_.cjs} +1 -1
- package/dist/{index-BguBP6jD.cjs → index-DnX96aeh.cjs} +1 -1
- package/dist/{index-BElSs6po.cjs → index-DqxlAcsy.cjs} +1 -1
- package/dist/{index-BSuyeTIF.cjs → index-DrOu72ul.cjs} +1 -1
- package/dist/{index-CnDyADxV.cjs → index-DtlOfXiz.cjs} +1 -1
- package/dist/{index-DFWmMuBR.js → index-HW4WbbBr.js} +1 -1
- package/dist/{index-DhcSe5pO.cjs → index-hORaVIHc.cjs} +1 -1
- package/dist/{index-B5bXHS1q.cjs → index-p-o31jQq.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-qTFnFcSL.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BxQbW2Qv.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CnmKC6YP.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-HTukJabf.js} +6 -6
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DhoqRtFv.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs} +285 -285
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B5W8KBo7.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js} +7385 -7343
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-BtE_L3Z8.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-BKGC817E.js} +3 -3
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DGMK0Ifn.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-DZ5eH9xZ.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-CtpftMHR.cjs → index.vue_vue_type_style_index_1_lang-DxybPHY4.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-vRD3eIQu.js → index.vue_vue_type_style_index_1_lang-zo3wkKNV.js} +4 -4
- package/dist/{main-BqGa__UE.cjs → main-DyEJZh6t.cjs} +1 -1
- package/dist/{main-ss9nNFMr.js → main-sgld64c-.js} +2 -2
- package/dist/{pointTrack-DQ1hLY5d.cjs → pointTrack-BkpbGc8n.cjs} +1 -1
- package/dist/{pointTrack-AMLI1vf8.js → pointTrack-CMyadDzE.js} +2 -2
- package/dist/{robotUtil-G36FSoFY.js → robotUtil-B2D7gGWk.js} +6 -6
- package/dist/{robotUtil-ChCSjU5C.cjs → robotUtil-oAoZqCam.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-DwwFHmc4.js → threeModel-COjVHVOm.js} +71 -71
- package/dist/{threeModel-BMvblQdw.cjs → threeModel-i6xyeVbw.cjs} +1 -1
- package/dist/{threePreview-CnJEE5N_.js → threePreview-Bf6eiws9.js} +33 -33
- package/dist/{threePreview-BC-QKuwq.cjs → threePreview-CsQVnCLb.cjs} +1 -1
- package/dist/{threeSceneView-CbJSvEfX.js → threeSceneView-DMRjj5p4.js} +89 -90
- package/dist/threeSceneView-DekFXELf.cjs +5 -0
- package/dist/{threeSceneViewForCPMPIP-CXbZ3zSA.cjs → threeSceneViewForCPMPIP-4-2S-WIR.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-BgZM8Vr2.js → threeSceneViewForCPMPIP-CmoLDO8W.js} +8 -8
- package/dist/{threeTrackPathView-CJSREHVs.cjs → threeTrackPathView-CTJoG96t.cjs} +1 -1
- package/dist/{threeTrackPathView-CroLNB4n.js → threeTrackPathView-DSXISfno.js} +23 -23
- package/dist/{threeViewerHost-CyrI9FeR.js → threeViewerHost-Dus5N92L.js} +2 -2
- package/dist/{threeViewerHost-CUgW4AvZ.cjs → threeViewerHost-UkmuBT5A.cjs} +2 -2
- package/dist/{urdfTree-D2-tY5M8.js → urdfTree-CG-0miYi.js} +1 -1
- package/dist/{urdfTree-Cw4rPe_3.cjs → urdfTree-CJHLz2pz.cjs} +1 -1
- package/dist/{workpieceTreePanel-RglxeGsj.js → workpieceTreePanel-BXOLb2w-.js} +37 -37
- package/dist/{workpieceTreePanel-D_9hpdVS.cjs → workpieceTreePanel-KNuWx06_.cjs} +1 -1
- package/package.json +1 -1
- package/dist/animationData-B-PqylKC.cjs +0 -1
- package/dist/dataUtil-BMZEDuJ3.js +0 -52
- package/dist/dataUtil-CthYESkP.cjs +0 -1
- package/dist/index-BM6iTDfN.cjs +0 -1
- package/dist/index-CNKx5V0b.js +0 -12215
- package/dist/index-D57m16IA.cjs +0 -1
- package/dist/index-Ddf_ua3r.cjs +0 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/dist/threeSceneView-CbWNHgUP.cjs +0 -5
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";const r=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs"),z=/^[og]\s*(.+)?/,B=/^mtllib /,U=/^usemtl /,S=/^usemap /,A=/\s+/,P=new r.Vector3,M=new r.Vector3,I=new r.Vector3,C=new r.Vector3,j=new r.Vector3,V=new r.Color;function D(){const L={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(s,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=s,this.object.fromDeclaration=e!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:s||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,i){const l=this._finalize(!1);l&&(l.inherited||l.groupCount<=0)&&this.materials.splice(l.index,1);const m={index:this.materials.length,name:t||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:l!==void 0?l.smooth:this.smooth,groupStart:l!==void 0?l.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(b){const a={index:typeof b=="number"?b:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return a.clone=this.clone.bind(a),a}};return this.materials.push(m),m},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),t&&this.materials.length>1)for(let l=this.materials.length-1;l>=0;l--)this.materials[l].groupCount<=0&&this.materials.splice(l,1);return t&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},n&&n.name&&typeof n.clone=="function"){const t=n.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(s,e){const n=parseInt(s,10);return(n>=0?n-1:n+e/3)*3},parseNormalIndex:function(s,e){const n=parseInt(s,10);return(n>=0?n-1:n+e/3)*3},parseUVIndex:function(s,e){const n=parseInt(s,10);return(n>=0?n-1:n+e/2)*2},addVertex:function(s,e,n){const t=this.vertices,i=this.object.geometry.vertices;i.push(t[s+0],t[s+1],t[s+2]),i.push(t[e+0],t[e+1],t[e+2]),i.push(t[n+0],t[n+1],t[n+2])},addVertexPoint:function(s){const e=this.vertices;this.object.geometry.vertices.push(e[s+0],e[s+1],e[s+2])},addVertexLine:function(s){const e=this.vertices;this.object.geometry.vertices.push(e[s+0],e[s+1],e[s+2])},addNormal:function(s,e,n){const t=this.normals,i=this.object.geometry.normals;i.push(t[s+0],t[s+1],t[s+2]),i.push(t[e+0],t[e+1],t[e+2]),i.push(t[n+0],t[n+1],t[n+2])},addFaceNormal:function(s,e,n){const t=this.vertices,i=this.object.geometry.normals;P.fromArray(t,s),M.fromArray(t,e),I.fromArray(t,n),j.subVectors(I,M),C.subVectors(P,M),j.cross(C),j.normalize(),i.push(j.x,j.y,j.z),i.push(j.x,j.y,j.z),i.push(j.x,j.y,j.z)},addColor:function(s,e,n){const t=this.colors,i=this.object.geometry.colors;t[s]!==void 0&&i.push(t[s+0],t[s+1],t[s+2]),t[e]!==void 0&&i.push(t[e+0],t[e+1],t[e+2]),t[n]!==void 0&&i.push(t[n+0],t[n+1],t[n+2])},addUV:function(s,e,n){const t=this.uvs,i=this.object.geometry.uvs;i.push(t[s+0],t[s+1]),i.push(t[e+0],t[e+1]),i.push(t[n+0],t[n+1])},addDefaultUV:function(){const s=this.object.geometry.uvs;s.push(0,0),s.push(0,0),s.push(0,0)},addUVLine:function(s){const e=this.uvs;this.object.geometry.uvs.push(e[s+0],e[s+1])},addFace:function(s,e,n,t,i,l,m,b,a){const u=this.vertices.length;let o=this.parseVertexIndex(s,u),c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(n,u);if(this.addVertex(o,c,f),this.addColor(o,c,f),m!==void 0&&m!==""){const p=this.normals.length;o=this.parseNormalIndex(m,p),c=this.parseNormalIndex(b,p),f=this.parseNormalIndex(a,p),this.addNormal(o,c,f)}else this.addFaceNormal(o,c,f);if(t!==void 0&&t!==""){const p=this.uvs.length;o=this.parseUVIndex(t,p),c=this.parseUVIndex(i,p),f=this.parseUVIndex(l,p),this.addUV(o,c,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(s){this.object.geometry.type="Points";const e=this.vertices.length;for(let n=0,t=s.length;n<t;n++){const i=this.parseVertexIndex(s[n],e);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(s,e){this.object.geometry.type="Line";const n=this.vertices.length,t=this.uvs.length;for(let i=0,l=s.length;i<l;i++)this.addVertexLine(this.parseVertexIndex(s[i],n));for(let i=0,l=e.length;i<l;i++)this.addUVLine(this.parseUVIndex(e[i],t))}};return L.startObject("",!1),L}class G extends r.Loader{constructor(s){super(s),this.materials=null}load(s,e,n,t){const i=this,l=new r.FileLoader(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(s,function(m){try{e(i.parse(m))}catch(b){t?t(b):console.error(b),i.manager.itemError(s)}},n,t)}setMaterials(s){return this.materials=s,this}parse(s){const e=new D;s.indexOf(`\r
|
|
2
2
|
`)!==-1&&(s=s.replace(/\r\n/g,`
|
|
3
3
|
`)),s.indexOf(`\\
|
|
4
4
|
`)!==-1&&(s=s.replace(/\\\n/g,""));const n=s.split(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const q = /^[og]\s*(.+)?/, W = /^mtllib /,
|
|
3
|
-
function
|
|
1
|
+
import { _ as N, a0 as R, C as H, o as J, F as T, J as P, aZ as w, ao as C, an as U, am as L, u as k, as as D, au as F, r as O, V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js";
|
|
2
|
+
const q = /^[og]\s*(.+)?/, W = /^mtllib /, Z = /^usemtl /, K = /^usemap /, S = /\s+/, B = new V(), z = new V(), E = new V(), G = new V(), j = new V(), _ = new H();
|
|
3
|
+
function Q() {
|
|
4
4
|
const I = {
|
|
5
5
|
objects: [],
|
|
6
6
|
object: {},
|
|
@@ -109,7 +109,7 @@ function X() {
|
|
|
109
109
|
},
|
|
110
110
|
addFaceNormal: function(s, e, n) {
|
|
111
111
|
const t = this.vertices, i = this.object.geometry.normals;
|
|
112
|
-
B.fromArray(t, s),
|
|
112
|
+
B.fromArray(t, s), z.fromArray(t, e), E.fromArray(t, n), j.subVectors(E, z), G.subVectors(B, z), j.cross(G), j.normalize(), i.push(j.x, j.y, j.z), i.push(j.x, j.y, j.z), i.push(j.x, j.y, j.z);
|
|
113
113
|
},
|
|
114
114
|
addColor: function(s, e, n) {
|
|
115
115
|
const t = this.colors, i = this.object.geometry.colors;
|
|
@@ -160,7 +160,7 @@ function X() {
|
|
|
160
160
|
};
|
|
161
161
|
return I.startObject("", !1), I;
|
|
162
162
|
}
|
|
163
|
-
class
|
|
163
|
+
class Y extends N {
|
|
164
164
|
/**
|
|
165
165
|
* Constructs a new OBJ loader.
|
|
166
166
|
*
|
|
@@ -204,7 +204,7 @@ class Z extends N {
|
|
|
204
204
|
* @return {Group} The parsed OBJ.
|
|
205
205
|
*/
|
|
206
206
|
parse(s) {
|
|
207
|
-
const e = new
|
|
207
|
+
const e = new Q();
|
|
208
208
|
s.indexOf(`\r
|
|
209
209
|
`) !== -1 && (s = s.replace(/\r\n/g, `
|
|
210
210
|
`)), s.indexOf(`\\
|
|
@@ -229,7 +229,7 @@ class Z extends N {
|
|
|
229
229
|
parseFloat(o[4]),
|
|
230
230
|
parseFloat(o[5]),
|
|
231
231
|
parseFloat(o[6]),
|
|
232
|
-
|
|
232
|
+
J
|
|
233
233
|
), e.colors.push(_.r, _.g, _.b)) : e.colors.push(void 0, void 0, void 0);
|
|
234
234
|
break;
|
|
235
235
|
case "vn":
|
|
@@ -288,11 +288,11 @@ class Z extends N {
|
|
|
288
288
|
} else if ((t = q.exec(r)) !== null) {
|
|
289
289
|
const o = (" " + t[0].slice(1).trim()).slice(1);
|
|
290
290
|
e.startObject(o);
|
|
291
|
-
} else if (
|
|
291
|
+
} else if (Z.test(r))
|
|
292
292
|
e.object.startMaterial(r.substring(7).trim(), e.materialLibraries);
|
|
293
293
|
else if (W.test(r))
|
|
294
294
|
e.materialLibraries.push(r.substring(7).trim());
|
|
295
|
-
else if (
|
|
295
|
+
else if (K.test(r))
|
|
296
296
|
console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
|
|
297
297
|
else if (h === "s") {
|
|
298
298
|
if (t = r.split(" "), t.length > 1) {
|
|
@@ -308,7 +308,7 @@ class Z extends N {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
e.finalize();
|
|
311
|
-
const i = new
|
|
311
|
+
const i = new T();
|
|
312
312
|
if (i.materialLibraries = [].concat(e.materialLibraries), !(e.objects.length === 1 && e.objects[0].geometry.vertices.length === 0) === !0)
|
|
313
313
|
for (let d = 0, g = e.objects.length; d < g; d++) {
|
|
314
314
|
const r = e.objects[d], h = r.geometry, o = r.materials, l = h.type === "Line", u = h.type === "Points";
|
|
@@ -329,7 +329,7 @@ class Z extends N {
|
|
|
329
329
|
U.prototype.copy.call(x, f), x.color.copy(f.color), x.map = f.map, f = x;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
f === void 0 && (l ? f = new C() : u ? f = new L({ size: 1, sizeAttenuation: !1 }) : f = new
|
|
332
|
+
f === void 0 && (l ? f = new C() : u ? f = new L({ size: 1, sizeAttenuation: !1 }) : f = new k(), f.name = y.name, f.flatShading = !y.smooth, f.vertexColors = m, e.materials[A] = f), p.push(f);
|
|
333
333
|
}
|
|
334
334
|
let b;
|
|
335
335
|
if (p.length > 1) {
|
|
@@ -337,20 +337,20 @@ class Z extends N {
|
|
|
337
337
|
const y = o[v];
|
|
338
338
|
c.addGroup(y.groupStart, y.groupCount, v);
|
|
339
339
|
}
|
|
340
|
-
l ? b = new
|
|
340
|
+
l ? b = new D(c, p) : u ? b = new F(c, p) : b = new O(c, p);
|
|
341
341
|
} else
|
|
342
|
-
l ? b = new
|
|
342
|
+
l ? b = new D(c, p[0]) : u ? b = new F(c, p[0]) : b = new O(c, p[0]);
|
|
343
343
|
b.name = r.name, i.add(b);
|
|
344
344
|
}
|
|
345
345
|
else if (e.vertices.length > 0) {
|
|
346
346
|
const d = new L({ size: 1, sizeAttenuation: !1 }), g = new P();
|
|
347
347
|
g.setAttribute("position", new w(e.vertices, 3)), e.colors.length > 0 && e.colors[0] !== void 0 && (g.setAttribute("color", new w(e.colors, 3)), d.vertexColors = !0);
|
|
348
|
-
const r = new
|
|
348
|
+
const r = new F(g, d);
|
|
349
349
|
i.add(r);
|
|
350
350
|
}
|
|
351
351
|
return i;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
export {
|
|
355
|
-
|
|
355
|
+
Y as O
|
|
356
356
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bb as S, V as p, M as u, bc as _, a6 as E, bd as P, a2 as c, be as w, w as O, y as R } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js";
|
|
2
2
|
const D = { type: "change" }, b = { type: "start" }, M = { type: "end" }, f = new w(), T = new O(), j = Math.cos(70 * R.DEG2RAD), n = new p(), r = 2 * Math.PI, o = {
|
|
3
3
|
NONE: -1,
|
|
4
4
|
ROTATE: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DhoqRtFv.cjs"),y={type:"change"},m={type:"start"},g={type:"end"},_=new s.Ray,b=new s.Plane,E=Math.cos(70*s.MathUtils.DEG2RAD),h=new s.Vector3,l=2*Math.PI,a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=1e-6;class P extends s.Controls{constructor(t,e=null){super(t,e),this.state=a.NONE,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new s.Vector3,this._lastQuaternion=new s.Quaternion,this._lastTargetPosition=new s.Vector3,this._quat=new s.Quaternion().setFromUnitVectors(t.up,new s.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new s.Spherical,this._sphericalDelta=new s.Spherical,this._scale=1,this._panOffset=new s.Vector3,this._rotateStart=new s.Vector2,this._rotateEnd=new s.Vector2,this._rotateDelta=new s.Vector2,this._panStart=new s.Vector2,this._panEnd=new s.Vector2,this._panDelta=new s.Vector2,this._dollyStart=new s.Vector2,this._dollyEnd=new s.Vector2,this._dollyDelta=new s.Vector2,this._dollyDirection=new s.Vector3,this._mouse=new s.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=D.bind(this),this._onPointerDown=T.bind(this),this._onPointerUp=M.bind(this),this._onContextMenu=L.bind(this),this._onMouseWheel=w.bind(this),this._onKeyDown=R.bind(this),this._onTouchStart=j.bind(this),this._onTouchMove=A.bind(this),this._onMouseDown=S.bind(this),this._onMouseMove=O.bind(this),this._interceptControlDown=C.bind(this),this._interceptControlUp=x.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(y),this.update(),this.state=a.NONE}update(t=null){const e=this.object.position;h.copy(e).sub(this.target),h.applyQuaternion(this._quat),this._spherical.setFromVector3(h),this.autoRotate&&this.state===a.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let o=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(o)&&isFinite(n)&&(o<-Math.PI?o+=l:o>Math.PI&&(o-=l),n<-Math.PI?n+=l:n>Math.PI&&(n-=l),o<=n?this._spherical.theta=Math.max(o,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(o+n)/2?Math.max(o,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const c=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=c!=this._spherical.radius}if(h.setFromSpherical(this._spherical),h.applyQuaternion(this._quatInverse),e.copy(this.target).add(h),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let c=null;if(this.object.isPerspectiveCamera){const p=h.length();c=this._clampDistance(p*this._scale);const d=p-c;this.object.position.addScaledVector(this._dollyDirection,d),this.object.updateMatrixWorld(),r=!!d}else if(this.object.isOrthographicCamera){const p=new s.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const d=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=d!==this.object.zoom;const f=new s.Vector3(this._mouse.x,this._mouse.y,0);f.unproject(this.object),this.object.position.sub(f).add(p),this.object.updateMatrixWorld(),c=h.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;c!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(c).add(this.object.position):(_.origin.copy(this.object.position),_.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(_.direction))<E?this.object.lookAt(this.target):(b.setFromNormalAndCoplanarPoint(this.object.up,this.target),_.intersectPlane(b,this.target))))}else if(this.object.isOrthographicCamera){const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),c!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>u||8*(1-this._lastQuaternion.dot(this.object.quaternion))>u||this._lastTargetPosition.distanceToSquared(this.target)>u?(this.dispatchEvent(y),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?l/60*this.autoRotateSpeed*t:l/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){h.setFromMatrixColumn(e,0),h.multiplyScalar(-t),this._panOffset.add(h)}_panUp(t,e){this.screenSpacePanning===!0?h.setFromMatrixColumn(e,1):(h.setFromMatrixColumn(e,0),h.crossVectors(this.object.up,h)),h.multiplyScalar(t),this._panOffset.add(h)}_pan(t,e){const o=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;h.copy(n).sub(this.target);let r=h.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/o.clientHeight,this.object.matrix),this._panUp(2*e*r/o.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/o.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/o.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const o=this.domElement.getBoundingClientRect(),n=t-o.left,r=e-o.top,c=o.width,p=o.height;this._mouse.x=n/c*2-1,this._mouse.y=-(r/p)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._rotateStart.set(o,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panStart.set(o,n)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),n=.5*(t.pageX+o.x),r=.5*(t.pageY+o.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panEnd.set(o,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const c=(t.pageX+e.x)*.5,p=(t.pageY+e.y)*.5;this._updateZoomParameters(c,p)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new s.Vector2,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,o={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:o.deltaY*=16;break;case 2:o.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(o.deltaY*=10),o}}function T(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function D(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function M(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(g),this.state=a.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function S(i){let t;switch(i.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=a.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function O(i){switch(this.state){case a.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case a.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case a.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function w(i){this.enabled===!1||this.enableZoom===!1||this.state!==a.NONE||(i.preventDefault(),this.dispatchEvent(m),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(g))}function R(i){this.enabled!==!1&&this._handleKeyDown(i)}function j(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case s.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=a.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=a.TOUCH_PAN;break;default:this.state=a.NONE}break;case 2:switch(this.touches.TWO){case s.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=a.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=a.TOUCH_DOLLY_ROTATE;break;default:this.state=a.NONE}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function A(i){switch(this._trackPointer(i),this.state){case a.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case a.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case a.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case a.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=a.NONE}}function L(i){this.enabled!==!1&&i.preventDefault()}function C(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function x(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}exports.OrbitControls=P;
|
|
1
|
+
"use strict";const s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs"),y={type:"change"},m={type:"start"},g={type:"end"},_=new s.Ray,b=new s.Plane,E=Math.cos(70*s.MathUtils.DEG2RAD),h=new s.Vector3,l=2*Math.PI,a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=1e-6;class P extends s.Controls{constructor(t,e=null){super(t,e),this.state=a.NONE,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new s.Vector3,this._lastQuaternion=new s.Quaternion,this._lastTargetPosition=new s.Vector3,this._quat=new s.Quaternion().setFromUnitVectors(t.up,new s.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new s.Spherical,this._sphericalDelta=new s.Spherical,this._scale=1,this._panOffset=new s.Vector3,this._rotateStart=new s.Vector2,this._rotateEnd=new s.Vector2,this._rotateDelta=new s.Vector2,this._panStart=new s.Vector2,this._panEnd=new s.Vector2,this._panDelta=new s.Vector2,this._dollyStart=new s.Vector2,this._dollyEnd=new s.Vector2,this._dollyDelta=new s.Vector2,this._dollyDirection=new s.Vector3,this._mouse=new s.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=D.bind(this),this._onPointerDown=T.bind(this),this._onPointerUp=M.bind(this),this._onContextMenu=L.bind(this),this._onMouseWheel=w.bind(this),this._onKeyDown=R.bind(this),this._onTouchStart=j.bind(this),this._onTouchMove=A.bind(this),this._onMouseDown=S.bind(this),this._onMouseMove=O.bind(this),this._interceptControlDown=C.bind(this),this._interceptControlUp=x.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(y),this.update(),this.state=a.NONE}update(t=null){const e=this.object.position;h.copy(e).sub(this.target),h.applyQuaternion(this._quat),this._spherical.setFromVector3(h),this.autoRotate&&this.state===a.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let o=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(o)&&isFinite(n)&&(o<-Math.PI?o+=l:o>Math.PI&&(o-=l),n<-Math.PI?n+=l:n>Math.PI&&(n-=l),o<=n?this._spherical.theta=Math.max(o,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(o+n)/2?Math.max(o,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const c=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=c!=this._spherical.radius}if(h.setFromSpherical(this._spherical),h.applyQuaternion(this._quatInverse),e.copy(this.target).add(h),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let c=null;if(this.object.isPerspectiveCamera){const p=h.length();c=this._clampDistance(p*this._scale);const d=p-c;this.object.position.addScaledVector(this._dollyDirection,d),this.object.updateMatrixWorld(),r=!!d}else if(this.object.isOrthographicCamera){const p=new s.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const d=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=d!==this.object.zoom;const f=new s.Vector3(this._mouse.x,this._mouse.y,0);f.unproject(this.object),this.object.position.sub(f).add(p),this.object.updateMatrixWorld(),c=h.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;c!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(c).add(this.object.position):(_.origin.copy(this.object.position),_.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(_.direction))<E?this.object.lookAt(this.target):(b.setFromNormalAndCoplanarPoint(this.object.up,this.target),_.intersectPlane(b,this.target))))}else if(this.object.isOrthographicCamera){const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),c!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>u||8*(1-this._lastQuaternion.dot(this.object.quaternion))>u||this._lastTargetPosition.distanceToSquared(this.target)>u?(this.dispatchEvent(y),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?l/60*this.autoRotateSpeed*t:l/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){h.setFromMatrixColumn(e,0),h.multiplyScalar(-t),this._panOffset.add(h)}_panUp(t,e){this.screenSpacePanning===!0?h.setFromMatrixColumn(e,1):(h.setFromMatrixColumn(e,0),h.crossVectors(this.object.up,h)),h.multiplyScalar(t),this._panOffset.add(h)}_pan(t,e){const o=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;h.copy(n).sub(this.target);let r=h.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/o.clientHeight,this.object.matrix),this._panUp(2*e*r/o.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/o.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/o.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const o=this.domElement.getBoundingClientRect(),n=t-o.left,r=e-o.top,c=o.width,p=o.height;this._mouse.x=n/c*2-1,this._mouse.y=-(r/p)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._rotateStart.set(o,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panStart.set(o,n)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),n=.5*(t.pageX+o.x),r=.5*(t.pageY+o.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panEnd.set(o,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const c=(t.pageX+e.x)*.5,p=(t.pageY+e.y)*.5;this._updateZoomParameters(c,p)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new s.Vector2,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,o={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:o.deltaY*=16;break;case 2:o.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(o.deltaY*=10),o}}function T(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function D(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function M(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(g),this.state=a.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function S(i){let t;switch(i.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=a.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function O(i){switch(this.state){case a.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case a.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case a.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function w(i){this.enabled===!1||this.enableZoom===!1||this.state!==a.NONE||(i.preventDefault(),this.dispatchEvent(m),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(g))}function R(i){this.enabled!==!1&&this._handleKeyDown(i)}function j(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case s.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=a.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=a.TOUCH_PAN;break;default:this.state=a.NONE}break;case 2:switch(this.touches.TWO){case s.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=a.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=a.TOUCH_DOLLY_ROTATE;break;default:this.state=a.NONE}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function A(i){switch(this._trackPointer(i),this.state){case a.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case a.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case a.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case a.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=a.NONE}}function L(i){this.enabled!==!1&&i.preventDefault()}function C(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function x(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}exports.OrbitControls=P;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as H, a0 as G, J as B, C as U, o as D, ab as P, V as q, aZ as L, $ as Z, aH as N, aj as j, aG as R, u as Y, a2 as W, a_ as J, a9 as X, b9 as $, am as K, au as Q } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js";
|
|
2
2
|
class se extends H {
|
|
3
3
|
/**
|
|
4
4
|
* Constructs a new STL loader.
|
|
@@ -18,8 +18,8 @@ class se extends H {
|
|
|
18
18
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
19
19
|
*/
|
|
20
20
|
load(s, d, F, e) {
|
|
21
|
-
const i = this,
|
|
22
|
-
|
|
21
|
+
const i = this, p = new G(this.manager);
|
|
22
|
+
p.setPath(this.path), p.setResponseType("arraybuffer"), p.setRequestHeader(this.requestHeader), p.setWithCredentials(this.withCredentials), p.load(s, function(u) {
|
|
23
23
|
try {
|
|
24
24
|
d(i.parse(u));
|
|
25
25
|
} catch (r) {
|
|
@@ -50,19 +50,19 @@ class se extends H {
|
|
|
50
50
|
}
|
|
51
51
|
function e(a) {
|
|
52
52
|
const n = new DataView(a), g = n.getUint32(80, !0);
|
|
53
|
-
let I, o, t, y = !1, h, c,
|
|
53
|
+
let I, o, t, y = !1, h, c, f, l, m;
|
|
54
54
|
for (let z = 0; z < 70; z++)
|
|
55
|
-
n.getUint32(z, !1) == 1129270351 && n.getUint8(z + 4) == 82 && n.getUint8(z + 5) == 61 && (y = !0, h = new Float32Array(g * 3 * 3), c = n.getUint8(z + 6) / 255,
|
|
55
|
+
n.getUint32(z, !1) == 1129270351 && n.getUint8(z + 4) == 82 && n.getUint8(z + 5) == 61 && (y = !0, h = new Float32Array(g * 3 * 3), c = n.getUint8(z + 6) / 255, f = n.getUint8(z + 7) / 255, l = n.getUint8(z + 8) / 255, m = n.getUint8(z + 9) / 255);
|
|
56
56
|
const b = 84, x = 12 * 4 + 2, _ = new B(), w = new Float32Array(g * 3 * 3), A = new Float32Array(g * 3 * 3), C = new U();
|
|
57
57
|
for (let z = 0; z < g; z++) {
|
|
58
|
-
const S = b + z * x,
|
|
58
|
+
const S = b + z * x, T = n.getFloat32(S, !0), v = n.getFloat32(S + 4, !0), V = n.getFloat32(S + 8, !0);
|
|
59
59
|
if (y) {
|
|
60
60
|
const O = n.getUint16(S + 48, !0);
|
|
61
|
-
(O & 32768) === 0 ? (I = (O & 31) / 31, o = (O >> 5 & 31) / 31, t = (O >> 10 & 31) / 31) : (I = c, o =
|
|
61
|
+
(O & 32768) === 0 ? (I = (O & 31) / 31, o = (O >> 5 & 31) / 31, t = (O >> 10 & 31) / 31) : (I = c, o = f, t = l);
|
|
62
62
|
}
|
|
63
63
|
for (let O = 1; O <= 3; O++) {
|
|
64
64
|
const M = S + O * 12, k = z * 3 * 3 + (O - 1) * 3;
|
|
65
|
-
w[k] = n.getFloat32(M, !0), w[k + 1] = n.getFloat32(M + 4, !0), w[k + 2] = n.getFloat32(M + 8, !0), A[k] =
|
|
65
|
+
w[k] = n.getFloat32(M, !0), w[k + 1] = n.getFloat32(M + 4, !0), w[k + 2] = n.getFloat32(M + 8, !0), A[k] = T, A[k + 1] = v, A[k + 2] = V, y && (C.setRGB(I, o, t, D), h[k] = C.r, h[k + 1] = C.g, h[k + 2] = C.b);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return _.setAttribute("position", new P(w, 3)), _.setAttribute("normal", new P(A, 3)), y && (_.setAttribute("color", new P(h, 3)), _.hasColors = !0, _.alpha = m), _;
|
|
@@ -70,7 +70,7 @@ class se extends H {
|
|
|
70
70
|
function i(a) {
|
|
71
71
|
const n = new B(), g = /solid([\s\S]*?)endsolid/g, I = /facet([\s\S]*?)endfacet/g, o = /solid\s(.+)/;
|
|
72
72
|
let t = 0;
|
|
73
|
-
const y = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source, h = new RegExp("vertex" + y + y + y, "g"), c = new RegExp("normal" + y + y + y, "g"),
|
|
73
|
+
const y = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source, h = new RegExp("vertex" + y + y + y, "g"), c = new RegExp("normal" + y + y + y, "g"), f = [], l = [], m = [], b = new q();
|
|
74
74
|
let x, _ = 0, w = 0, A = 0;
|
|
75
75
|
for (; (x = g.exec(a)) !== null; ) {
|
|
76
76
|
w = A;
|
|
@@ -81,15 +81,15 @@ class se extends H {
|
|
|
81
81
|
for (; (x = c.exec(O)) !== null; )
|
|
82
82
|
b.x = parseFloat(x[1]), b.y = parseFloat(x[2]), b.z = parseFloat(x[3]), V++;
|
|
83
83
|
for (; (x = h.exec(O)) !== null; )
|
|
84
|
-
|
|
84
|
+
f.push(parseFloat(x[1]), parseFloat(x[2]), parseFloat(x[3])), l.push(b.x, b.y, b.z), v++, A++;
|
|
85
85
|
V !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + t), v !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + t), t++;
|
|
86
86
|
}
|
|
87
|
-
const S = w,
|
|
88
|
-
n.userData.groupNames = m, n.addGroup(S,
|
|
87
|
+
const S = w, T = A - w;
|
|
88
|
+
n.userData.groupNames = m, n.addGroup(S, T, _), _++;
|
|
89
89
|
}
|
|
90
|
-
return n.setAttribute("position", new L(
|
|
90
|
+
return n.setAttribute("position", new L(f, 3)), n.setAttribute("normal", new L(l, 3)), n;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function p(a) {
|
|
93
93
|
return typeof a != "string" ? new TextDecoder().decode(a) : a;
|
|
94
94
|
}
|
|
95
95
|
function u(a) {
|
|
@@ -102,7 +102,7 @@ class se extends H {
|
|
|
102
102
|
return a;
|
|
103
103
|
}
|
|
104
104
|
const r = u(s);
|
|
105
|
-
return d(r) ? e(r) : i(
|
|
105
|
+
return d(r) ? e(r) : i(p(s));
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
class ne extends H {
|
|
@@ -119,10 +119,10 @@ class ne extends H {
|
|
|
119
119
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
120
120
|
*/
|
|
121
121
|
load(s, d, F, e) {
|
|
122
|
-
const i = this,
|
|
122
|
+
const i = this, p = this.path === "" ? Z.extractUrlBase(s) : this.path, u = new G(this.manager);
|
|
123
123
|
u.setPath(this.path), u.setRequestHeader(this.requestHeader), u.setWithCredentials(this.withCredentials), u.load(s, function(r) {
|
|
124
124
|
try {
|
|
125
|
-
d(i.parse(r,
|
|
125
|
+
d(i.parse(r, p));
|
|
126
126
|
} catch (a) {
|
|
127
127
|
e ? e(a) : console.error(a), i.manager.itemError(s);
|
|
128
128
|
}
|
|
@@ -148,7 +148,7 @@ class ne extends H {
|
|
|
148
148
|
const F = s.split(`
|
|
149
149
|
`);
|
|
150
150
|
let e = {};
|
|
151
|
-
const i = /\s+/,
|
|
151
|
+
const i = /\s+/, p = {};
|
|
152
152
|
for (let r = 0; r < F.length; r++) {
|
|
153
153
|
let a = F[r];
|
|
154
154
|
if (a = a.trim(), a.length === 0 || a.charAt(0) === "#")
|
|
@@ -158,7 +158,7 @@ class ne extends H {
|
|
|
158
158
|
g = g.toLowerCase();
|
|
159
159
|
let I = n >= 0 ? a.substring(n + 1) : "";
|
|
160
160
|
if (I = I.trim(), g === "newmtl")
|
|
161
|
-
e = { name: I },
|
|
161
|
+
e = { name: I }, p[I] = e;
|
|
162
162
|
else if (g === "ka" || g === "kd" || g === "ks" || g === "ke") {
|
|
163
163
|
const o = I.split(i, 3);
|
|
164
164
|
e[g] = [parseFloat(o[0]), parseFloat(o[1]), parseFloat(o[2])];
|
|
@@ -166,12 +166,12 @@ class ne extends H {
|
|
|
166
166
|
e[g] = I;
|
|
167
167
|
}
|
|
168
168
|
const u = new ee(this.resourcePath || d, this.materialOptions);
|
|
169
|
-
return u.setCrossOrigin(this.crossOrigin), u.setManager(this.manager), u.setMaterials(
|
|
169
|
+
return u.setCrossOrigin(this.crossOrigin), u.setManager(this.manager), u.setMaterials(p), u;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
class ee {
|
|
173
173
|
constructor(s = "", d = {}) {
|
|
174
|
-
this.baseUrl = s, this.options = d, this.materialsInfo = {}, this.materials = {}, this.materialsArray = [], this.nameLookup = {}, this.crossOrigin = "anonymous", this.side = this.options.side !== void 0 ? this.options.side : N, this.wrap = this.options.wrap !== void 0 ? this.options.wrap :
|
|
174
|
+
this.baseUrl = s, this.options = d, this.materialsInfo = {}, this.materials = {}, this.materialsArray = [], this.nameLookup = {}, this.crossOrigin = "anonymous", this.side = this.options.side !== void 0 ? this.options.side : N, this.wrap = this.options.wrap !== void 0 ? this.options.wrap : j;
|
|
175
175
|
}
|
|
176
176
|
setCrossOrigin(s) {
|
|
177
177
|
return this.crossOrigin = s, this;
|
|
@@ -188,9 +188,9 @@ class ee {
|
|
|
188
188
|
for (const F in s) {
|
|
189
189
|
const e = s[F], i = {};
|
|
190
190
|
d[F] = i;
|
|
191
|
-
for (const
|
|
192
|
-
let u = !0, r = e[
|
|
193
|
-
const a =
|
|
191
|
+
for (const p in e) {
|
|
192
|
+
let u = !0, r = e[p];
|
|
193
|
+
const a = p.toLowerCase();
|
|
194
194
|
switch (a) {
|
|
195
195
|
case "kd":
|
|
196
196
|
case "ka":
|
|
@@ -227,7 +227,7 @@ class ee {
|
|
|
227
227
|
function i(u, r) {
|
|
228
228
|
return typeof r != "string" || r === "" ? "" : /^https?:\/\//i.test(r) ? r : u + r;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function p(u, r) {
|
|
231
231
|
if (e[u]) return;
|
|
232
232
|
const a = d.getTextureParams(r, e), n = d.loadTexture(i(d.baseUrl, a.url));
|
|
233
233
|
n.repeat.copy(a.scale), n.offset.copy(a.offset), n.wrapS = d.wrap, n.wrapT = d.wrap, (u === "map" || u === "emissiveMap") && (n.colorSpace = D), e[u] = n;
|
|
@@ -248,26 +248,26 @@ class ee {
|
|
|
248
248
|
e.emissive = R.colorSpaceToWorking(new U().fromArray(r), D);
|
|
249
249
|
break;
|
|
250
250
|
case "map_kd":
|
|
251
|
-
|
|
251
|
+
p("map", r);
|
|
252
252
|
break;
|
|
253
253
|
case "map_ks":
|
|
254
|
-
|
|
254
|
+
p("specularMap", r);
|
|
255
255
|
break;
|
|
256
256
|
case "map_ke":
|
|
257
|
-
|
|
257
|
+
p("emissiveMap", r);
|
|
258
258
|
break;
|
|
259
259
|
case "norm":
|
|
260
|
-
|
|
260
|
+
p("normalMap", r);
|
|
261
261
|
break;
|
|
262
262
|
case "map_bump":
|
|
263
263
|
case "bump":
|
|
264
|
-
|
|
264
|
+
p("bumpMap", r);
|
|
265
265
|
break;
|
|
266
266
|
case "disp":
|
|
267
|
-
|
|
267
|
+
p("displacementMap", r);
|
|
268
268
|
break;
|
|
269
269
|
case "map_d":
|
|
270
|
-
|
|
270
|
+
p("alphaMap", r), e.transparent = !0;
|
|
271
271
|
break;
|
|
272
272
|
case "ns":
|
|
273
273
|
e.shininess = parseFloat(r);
|
|
@@ -280,7 +280,7 @@ class ee {
|
|
|
280
280
|
break;
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
return this.materials[s] = new
|
|
283
|
+
return this.materials[s] = new Y(e), this.materials[s];
|
|
284
284
|
}
|
|
285
285
|
getTextureParams(s, d) {
|
|
286
286
|
const F = {
|
|
@@ -291,9 +291,9 @@ class ee {
|
|
|
291
291
|
return i = e.indexOf("-bm"), i >= 0 && (d.bumpScale = parseFloat(e[i + 1]), e.splice(i, 2)), i = e.indexOf("-mm"), i >= 0 && (d.displacementBias = parseFloat(e[i + 1]), d.displacementScale = parseFloat(e[i + 2]), e.splice(i, 3)), i = e.indexOf("-s"), i >= 0 && (F.scale.set(parseFloat(e[i + 1]), parseFloat(e[i + 2])), e.splice(i, 4)), i = e.indexOf("-o"), i >= 0 && (F.offset.set(parseFloat(e[i + 1]), parseFloat(e[i + 2])), e.splice(i, 4)), F.url = e.join(" ").trim(), F;
|
|
292
292
|
}
|
|
293
293
|
loadTexture(s, d, F, e, i) {
|
|
294
|
-
const
|
|
295
|
-
let u =
|
|
296
|
-
u === null && (u = new X(
|
|
294
|
+
const p = this.manager !== void 0 ? this.manager : J;
|
|
295
|
+
let u = p.getHandler(s);
|
|
296
|
+
u === null && (u = new X(p)), u.setCrossOrigin && u.setCrossOrigin(this.crossOrigin);
|
|
297
297
|
const r = u.load(s, F, e, i);
|
|
298
298
|
return d !== void 0 && (r.mapping = d), r;
|
|
299
299
|
}
|
|
@@ -317,8 +317,8 @@ class ie extends H {
|
|
|
317
317
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
318
318
|
*/
|
|
319
319
|
load(s, d, F, e) {
|
|
320
|
-
const i = this,
|
|
321
|
-
|
|
320
|
+
const i = this, p = new G(i.manager);
|
|
321
|
+
p.setPath(i.path), p.setResponseType("arraybuffer"), p.setRequestHeader(i.requestHeader), p.setWithCredentials(i.withCredentials), p.load(s, function(u) {
|
|
322
322
|
try {
|
|
323
323
|
d(i.parse(u));
|
|
324
324
|
} catch (r) {
|
|
@@ -354,23 +354,23 @@ class ie extends H {
|
|
|
354
354
|
parse(s) {
|
|
355
355
|
function d(o, t) {
|
|
356
356
|
const y = o.length, h = new Uint8Array(t);
|
|
357
|
-
let c = 0,
|
|
357
|
+
let c = 0, f = 0, l, m, b;
|
|
358
358
|
do
|
|
359
359
|
if (l = o[c++], l < 32) {
|
|
360
|
-
if (l++,
|
|
360
|
+
if (l++, f + l > t) throw new Error("Output buffer is not large enough");
|
|
361
361
|
if (c + l > y) throw new Error("Invalid compressed data");
|
|
362
362
|
do
|
|
363
|
-
h[
|
|
363
|
+
h[f++] = o[c++];
|
|
364
364
|
while (--l);
|
|
365
365
|
} else {
|
|
366
|
-
if (m = l >> 5, b =
|
|
366
|
+
if (m = l >> 5, b = f - ((l & 31) << 8) - 1, c >= y) throw new Error("Invalid compressed data");
|
|
367
367
|
if (m === 7 && (m += o[c++], c >= y))
|
|
368
368
|
throw new Error("Invalid compressed data");
|
|
369
|
-
if (b -= o[c++],
|
|
369
|
+
if (b -= o[c++], f + m + 2 > t) throw new Error("Output buffer is not large enough");
|
|
370
370
|
if (b < 0) throw new Error("Invalid compressed data");
|
|
371
|
-
if (b >=
|
|
371
|
+
if (b >= f) throw new Error("Invalid compressed data");
|
|
372
372
|
do
|
|
373
|
-
h[
|
|
373
|
+
h[f++] = h[b++];
|
|
374
374
|
while (--m + 2);
|
|
375
375
|
}
|
|
376
376
|
while (c < y);
|
|
@@ -378,10 +378,10 @@ class ie extends H {
|
|
|
378
378
|
}
|
|
379
379
|
function F(o) {
|
|
380
380
|
const t = {}, y = new Uint8Array(o);
|
|
381
|
-
let h = "", c = "",
|
|
381
|
+
let h = "", c = "", f = 0, l = !1;
|
|
382
382
|
const m = y.length;
|
|
383
|
-
for (;
|
|
384
|
-
const w = String.fromCharCode(y[
|
|
383
|
+
for (; f < m && l === !1; ) {
|
|
384
|
+
const w = String.fromCharCode(y[f++]);
|
|
385
385
|
w === `
|
|
386
386
|
` || w === "\r" ? (c.trim().toLowerCase().startsWith("data") && (l = !0), c = "") : c += w, h += w;
|
|
387
387
|
}
|
|
@@ -403,11 +403,11 @@ class ie extends H {
|
|
|
403
403
|
t.data === "ascii" ? t.offset[t.fields[w]] = w : (t.offset[t.fields[w]] = _, _ += t.size[w] * t.count[w]);
|
|
404
404
|
return t.rowSize = _, t;
|
|
405
405
|
}
|
|
406
|
-
const e = F(s), i = [],
|
|
406
|
+
const e = F(s), i = [], p = [], u = [], r = [], a = [], n = new U();
|
|
407
407
|
if (e.data === "ascii") {
|
|
408
408
|
const o = e.offset, h = new TextDecoder().decode(s).slice(e.headerLen).split(`
|
|
409
409
|
`);
|
|
410
|
-
for (let c = 0,
|
|
410
|
+
for (let c = 0, f = h.length; c < f; c++) {
|
|
411
411
|
if (h[c] === "") continue;
|
|
412
412
|
const l = h[c].split(" ");
|
|
413
413
|
if (o.x !== void 0 && (i.push(parseFloat(l[o.x])), i.push(parseFloat(l[o.y])), i.push(parseFloat(l[o.z]))), o.rgb !== void 0) {
|
|
@@ -420,31 +420,31 @@ class ie extends H {
|
|
|
420
420
|
const w = (_ >> 16 & 255) / 255, A = (_ >> 8 & 255) / 255, C = (_ >> 0 & 255) / 255;
|
|
421
421
|
n.setRGB(w, A, C, D), u.push(n.r, n.g, n.b);
|
|
422
422
|
}
|
|
423
|
-
o.normal_x !== void 0 && (
|
|
423
|
+
o.normal_x !== void 0 && (p.push(parseFloat(l[o.normal_x])), p.push(parseFloat(l[o.normal_y])), p.push(parseFloat(l[o.normal_z]))), o.intensity !== void 0 && r.push(parseFloat(l[o.intensity])), o.label !== void 0 && a.push(parseInt(l[o.label]));
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
if (e.data === "binary_compressed") {
|
|
427
|
-
const o = new Uint32Array(s.slice(e.headerLen, e.headerLen + 8)), t = o[0], y = o[1], h = d(new Uint8Array(s, e.headerLen + 8, t), y), c = new DataView(h.buffer),
|
|
427
|
+
const o = new Uint32Array(s.slice(e.headerLen, e.headerLen + 8)), t = o[0], y = o[1], h = d(new Uint8Array(s, e.headerLen + 8, t), y), c = new DataView(h.buffer), f = e.offset;
|
|
428
428
|
for (let l = 0; l < e.points; l++) {
|
|
429
|
-
if (
|
|
429
|
+
if (f.x !== void 0) {
|
|
430
430
|
const m = e.fields.indexOf("x"), b = e.fields.indexOf("y"), x = e.fields.indexOf("z");
|
|
431
|
-
i.push(this._getDataView(c, e.points *
|
|
431
|
+
i.push(this._getDataView(c, e.points * f.x + e.size[m] * l, e.type[m], e.size[m])), i.push(this._getDataView(c, e.points * f.y + e.size[b] * l, e.type[b], e.size[b])), i.push(this._getDataView(c, e.points * f.z + e.size[x] * l, e.type[x], e.size[x]));
|
|
432
432
|
}
|
|
433
|
-
if (
|
|
434
|
-
const m = e.fields.indexOf("rgb"), b = c.getUint8(e.points *
|
|
433
|
+
if (f.rgb !== void 0) {
|
|
434
|
+
const m = e.fields.indexOf("rgb"), b = c.getUint8(e.points * f.rgb + e.size[m] * l + 2) / 255, x = c.getUint8(e.points * f.rgb + e.size[m] * l + 1) / 255, _ = c.getUint8(e.points * f.rgb + e.size[m] * l + 0) / 255;
|
|
435
435
|
n.setRGB(b, x, _, D), u.push(n.r, n.g, n.b);
|
|
436
436
|
}
|
|
437
|
-
if (
|
|
437
|
+
if (f.normal_x !== void 0) {
|
|
438
438
|
const m = e.fields.indexOf("normal_x"), b = e.fields.indexOf("normal_y"), x = e.fields.indexOf("normal_z");
|
|
439
|
-
|
|
439
|
+
p.push(this._getDataView(c, e.points * f.normal_x + e.size[m] * l, e.type[m], e.size[m])), p.push(this._getDataView(c, e.points * f.normal_y + e.size[b] * l, e.type[b], e.size[b])), p.push(this._getDataView(c, e.points * f.normal_z + e.size[x] * l, e.type[x], e.size[x]));
|
|
440
440
|
}
|
|
441
|
-
if (
|
|
441
|
+
if (f.intensity !== void 0) {
|
|
442
442
|
const m = e.fields.indexOf("intensity");
|
|
443
|
-
r.push(this._getDataView(c, e.points *
|
|
443
|
+
r.push(this._getDataView(c, e.points * f.intensity + e.size[m] * l, e.type[m], e.size[m]));
|
|
444
444
|
}
|
|
445
|
-
if (
|
|
445
|
+
if (f.label !== void 0) {
|
|
446
446
|
const m = e.fields.indexOf("label");
|
|
447
|
-
a.push(c.getInt32(e.points *
|
|
447
|
+
a.push(c.getInt32(e.points * f.label + e.size[m] * l, this.littleEndian));
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
}
|
|
@@ -452,16 +452,16 @@ class ie extends H {
|
|
|
452
452
|
const o = new DataView(s, e.headerLen), t = e.offset;
|
|
453
453
|
for (let y = 0, h = 0; y < e.points; y++, h += e.rowSize) {
|
|
454
454
|
if (t.x !== void 0) {
|
|
455
|
-
const c = e.fields.indexOf("x"),
|
|
456
|
-
i.push(this._getDataView(o, h + t.x, e.type[c], e.size[c])), i.push(this._getDataView(o, h + t.y, e.type[
|
|
455
|
+
const c = e.fields.indexOf("x"), f = e.fields.indexOf("y"), l = e.fields.indexOf("z");
|
|
456
|
+
i.push(this._getDataView(o, h + t.x, e.type[c], e.size[c])), i.push(this._getDataView(o, h + t.y, e.type[f], e.size[f])), i.push(this._getDataView(o, h + t.z, e.type[l], e.size[l]));
|
|
457
457
|
}
|
|
458
458
|
if (t.rgb !== void 0) {
|
|
459
|
-
const c = o.getUint8(h + t.rgb + 2) / 255,
|
|
460
|
-
n.setRGB(c,
|
|
459
|
+
const c = o.getUint8(h + t.rgb + 2) / 255, f = o.getUint8(h + t.rgb + 1) / 255, l = o.getUint8(h + t.rgb + 0) / 255;
|
|
460
|
+
n.setRGB(c, f, l, D), u.push(n.r, n.g, n.b);
|
|
461
461
|
}
|
|
462
462
|
if (t.normal_x !== void 0) {
|
|
463
|
-
const c = e.fields.indexOf("normal_x"),
|
|
464
|
-
|
|
463
|
+
const c = e.fields.indexOf("normal_x"), f = e.fields.indexOf("normal_y"), l = e.fields.indexOf("normal_z");
|
|
464
|
+
p.push(this._getDataView(o, h + t.normal_x, e.type[c], e.size[c])), p.push(this._getDataView(o, h + t.normal_y, e.type[f], e.size[f])), p.push(this._getDataView(o, h + t.normal_z, e.type[l], e.size[l]));
|
|
465
465
|
}
|
|
466
466
|
if (t.intensity !== void 0) {
|
|
467
467
|
const c = e.fields.indexOf("intensity");
|
|
@@ -471,9 +471,9 @@ class ie extends H {
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
const g = new B();
|
|
474
|
-
i.length > 0 && g.setAttribute("position", new L(i, 3)),
|
|
474
|
+
i.length > 0 && g.setAttribute("position", new L(i, 3)), p.length > 0 && g.setAttribute("normal", new L(p, 3)), u.length > 0 && g.setAttribute("color", new L(u, 3)), r.length > 0 && g.setAttribute("intensity", new L(r, 1)), a.length > 0 && g.setAttribute("label", new $(a, 1)), g.computeBoundingSphere();
|
|
475
475
|
const I = new K({ size: 5e-3 });
|
|
476
|
-
return u.length > 0 && (I.vertexColors = !0), new
|
|
476
|
+
return u.length > 0 && (I.vertexColors = !0), new Q(g, I);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
export {
|