stack3js 0.0.0-stage → 0.6.4
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/COMMAND.md +145 -0
- package/LICENSE +21 -0
- package/README.md +304 -2
- package/THIRD-PARTY-LICENSES.md +100 -0
- package/bin/stack3.mjs +5437 -0
- package/blender/import_stack.py +89 -0
- package/examples/future-tank.stack3.json +1 -0
- package/examples/traffic-cone-4view.png +0 -0
- package/meshing/blocks.py +82 -0
- package/meshing/branches.py +62 -0
- package/meshing/dexel.py +67 -0
- package/meshing/field_data.py +19 -0
- package/meshing/finish_blender.py +203 -0
- package/meshing/finishing.py +155 -0
- package/meshing/geometry.py +71 -0
- package/meshing/guided.py +150 -0
- package/meshing/implicit.py +178 -0
- package/meshing/intersection.py +33 -0
- package/meshing/material.py +115 -0
- package/meshing/mesh.py +103 -0
- package/meshing/network.py +136 -0
- package/meshing/regularization.py +213 -0
- package/meshing/sections.py +165 -0
- package/meshing/signed_distance.py +93 -0
- package/package.json +32 -4
- package/references/hard-surface/README.md +40 -0
- package/references/hard-surface/atlas/concrete-barrier-4view.png +0 -0
- package/references/hard-surface/atlas/preview.pipeline.yaml +14 -0
- package/references/hard-surface/case-studies/benchmark/README.md +22 -0
- package/references/hard-surface/case-studies/benchmark/lod-bevel.pipeline.yaml +258 -0
- package/references/hard-surface/finishing/exports.yaml +10 -0
- package/references/hard-surface/finishing/finish-lod.pipeline.yaml +33 -0
- package/references/hard-surface/finishing/inputs/stack/stack.json +1 -0
- package/references/hard-surface/finishing/inputs/stack/stack.png +0 -0
- package/references/hard-surface/finishing/regularize.pipeline.yaml +46 -0
- package/references/hard-surface/measured-depth/sdf/compare.pipeline.yaml +12 -0
- package/references/hard-surface/measured-depth/sdf/inputs/field.npy +0 -0
- package/references/hard-surface/measured-depth/sdf/inputs/stack/stack.json +1 -0
- package/references/hard-surface/measured-depth/sdf/inputs/stack/stack.png +0 -0
- package/references/hard-surface/measured-depth/sdf/inputs/truth.json +1 -0
- package/references/hard-surface/measured-depth/sdf/sdf.guide.json +3 -0
- package/references/hard-surface/measured-depth/triple-dexel/compare.pipeline.yaml +12 -0
- package/references/hard-surface/measured-depth/triple-dexel/dexel.guide.json +3 -0
- package/references/hard-surface/measured-depth/triple-dexel/inputs/fixture.json +22 -0
- package/references/hard-surface/measured-depth/triple-dexel/inputs/stack/stack.json +22 -0
- package/references/hard-surface/measured-depth/triple-dexel/inputs/stack/stack.png +0 -0
- package/references/hard-surface/measured-depth/triple-dexel/inputs/triple-dexel.npz +0 -0
- package/references/hard-surface/schema/pipeline-fragment.schema.json +5 -0
- package/references/hard-surface/schema/pipeline.schema.json +181 -0
- package/schema/pipeline-fragment.schema.json +5 -0
- package/schema/pipeline.schema.json +181 -0
- package/verification/assembly.py +96 -0
- package/verification/landmarks.py +53 -0
- package/verification/panels.py +137 -0
- package/verification/projections.py +135 -0
- package/verification/verify.py +108 -0
- package/viewer/dist/THIRD-PARTY-LICENSES.md +174 -0
- package/viewer/dist/assets/GLTFExporter-xdVCArY-.js +1 -0
- package/viewer/dist/assets/ant-mech-angled-leg-4view-BO2qt1_k.png +0 -0
- package/viewer/dist/assets/ant-mech-body-4view-D9xVPpbc.png +0 -0
- package/viewer/dist/assets/ant-mech-center-leg-4view-BcphjF_G.png +0 -0
- package/viewer/dist/assets/compare-B6DWTZS9.css +1 -0
- package/viewer/dist/assets/compare-Du4RoRQO.js +6 -0
- package/viewer/dist/assets/compare.worker-CgJq-znx.js +21 -0
- package/viewer/dist/assets/concrete-barrier-4view-7PsO3Ftq.png +0 -0
- package/viewer/dist/assets/emscripten-module-uFzwHH0Y.wasm +0 -0
- package/viewer/dist/assets/emscripten-module.browser-BcR5qphc.js +1 -0
- package/viewer/dist/assets/ffi-Boa1QuFa.js +1 -0
- package/viewer/dist/assets/fillet-rover-body-4-view-Chk8Mx4R.png +0 -0
- package/viewer/dist/assets/fillet-rover-wheel-4-view-B-F8flOC.png +0 -0
- package/viewer/dist/assets/hull-4view-BPPqJYUz.png +0 -0
- package/viewer/dist/assets/hull-base-color-4view-DrQmdT3h.png +0 -0
- package/viewer/dist/assets/hull-clay-4view-3Cu-4Hvr.png +0 -0
- package/viewer/dist/assets/hull-depth-4view-DCOdT5ev.png +0 -0
- package/viewer/dist/assets/hull-normal-4view-CvLaFITy.png +0 -0
- package/viewer/dist/assets/inspection-robot-body-4-view-CLMaHFYm.png +0 -0
- package/viewer/dist/assets/inspection-robot-wheel-4-view-27wRsxcs.png +0 -0
- package/viewer/dist/assets/plastic-barrier-4view-DQkTBW_i.png +0 -0
- package/viewer/dist/assets/presets-jXE0t1fU.js +1 -0
- package/viewer/dist/assets/preview-cache-BKV0EZl9.js +1 -0
- package/viewer/dist/assets/project-BzR9Ensg.css +1 -0
- package/viewer/dist/assets/project-DtHHhfo-.js +17 -0
- package/viewer/dist/assets/reconstruct.worker-ONc9GyFO.js +21 -0
- package/viewer/dist/assets/script-engine-Bs3azDYZ.js +6 -0
- package/viewer/dist/assets/style-CMUT8CmM.css +1 -0
- package/viewer/dist/assets/style-D6eZHs3D.js +4004 -0
- package/viewer/dist/assets/tank-hull-4view-B4sMMkP5.png +0 -0
- package/viewer/dist/assets/tank-track-4view-DAIiMTy3.png +0 -0
- package/viewer/dist/assets/tank-turret-4view-Cx0FuNFu.png +0 -0
- package/viewer/dist/assets/traffic-cone-4view-DG-TkITx.png +0 -0
- package/viewer/dist/assets/viewer-DIjS0No7.js +2 -0
- package/viewer/dist/assets/wet-floor-sign-4view-CWJDyeTX.png +0 -0
- package/viewer/dist/compare.html +47 -0
- package/viewer/dist/examples/traffic-cone-4view.png +0 -0
- package/viewer/dist/index.html +148 -0
- package/viewer/dist/playground/index.html +3342 -0
- package/viewer/dist/project.html +83 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GLTFExporter-xdVCArY-.js","./style-D6eZHs3D.js","./style-CMUT8CmM.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{T as zt,v as Pe,w as gt,x as Xt,y as se,F as Tt,z as D,E as xt,C as z,H as G,f as oe,J as qt,K as Wt,r as bt,M as he,V as I,U as $t,Q as wt,X as Yt,Y as Et,Z as Jt,_ as Qt,B as Se,$ as Zt,k as yt,i as en,j as tn,h as nn,L as Fe,g as Rt,m as De,n as sn,l as rn,a0 as on,a1 as ve,a2 as an,q as At,D as cn,a3 as te,P as ln,a4 as un,a5 as dn,a6 as fn,a7 as hn,a8 as pn,a9 as mn,aa as gn,G as _e,ab as Tn,b as xn,O as Lt,ac as bn,ad as wn,ae as En,d as yn,o as St,af as Rn,ag as rt,ah as it,ai as ot,aj as at,ak as ct,al as An,am as Ln,p as be,an as Sn,ao as vn,ap as _n,e as Mn,aq as Nn,A as Cn,ar as vt,as as We,W as In,at as On,au as kn,av as Pn,s as Fn,aw as _t,ax as Dn,ay as Hn,az as Gn}from"./style-D6eZHs3D.js";import{C as Un,O as jn,c as Bn,s as Kn,f as lt,a as Vn,_ as zn}from"./preview-cache-BKV0EZl9.js";import{m as Xn,s as Mt,q as Nt,c as Ct,i as qn,b as Wn}from"./presets-jXE0t1fU.js";function $n(o,e){if(!Number.isFinite(e)||e<=0||!Number.isFinite(e*o.size[2]))throw new Error("Spacing must be a positive, finite multiplier.");return e===1?o:{...o,spacing:o.spacing*e,size:[o.size[0],o.size[1],o.size[2]*e],pivot:[o.pivot[0],o.pivot[1],o.pivot[2]*e]}}function ut(o,e){if(e===zt)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===Pe||e===gt){let t=o.getIndex();if(t===null){const r=[],a=o.getAttribute("position");if(a!==void 0){for(let c=0;c<a.count;c++)r.push(c);o.setIndex(r),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const s=t.count-2,n=[];if(e===Pe)for(let r=1;r<=s;r++)n.push(t.getX(0)),n.push(t.getX(r)),n.push(t.getX(r+1));else for(let r=0;r<s;r++)r%2===0?(n.push(t.getX(r)),n.push(t.getX(r+1)),n.push(t.getX(r+2))):(n.push(t.getX(r+2)),n.push(t.getX(r+1)),n.push(t.getX(r)));n.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=o.clone();return i.setIndex(n),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class Yn extends Xt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new ts(t)}),this.register(function(t){return new ns(t)}),this.register(function(t){return new ds(t)}),this.register(function(t){return new fs(t)}),this.register(function(t){return new hs(t)}),this.register(function(t){return new rs(t)}),this.register(function(t){return new is(t)}),this.register(function(t){return new os(t)}),this.register(function(t){return new as(t)}),this.register(function(t){return new es(t)}),this.register(function(t){return new cs(t)}),this.register(function(t){return new ss(t)}),this.register(function(t){return new us(t)}),this.register(function(t){return new ls(t)}),this.register(function(t){return new Qn(t)}),this.register(function(t){return new ps(t)}),this.register(function(t){return new ms(t)})}load(e,t,s,n){const i=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const l=se.extractUrlBase(e);r=se.resolveURL(l,this.path)}else r=se.extractUrlBase(e);this.manager.itemStart(e);const a=function(l){n?n(l):console.error(l),i.manager.itemError(e),i.manager.itemEnd(e)},c=new Tt(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(l){try{i.parse(l,r,function(u){t(u),i.manager.itemEnd(e)},a)}catch(u){a(u)}},s,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){let i;const r={},a={},c=new TextDecoder;if(typeof e=="string")i=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===It){try{r[T.KHR_BINARY_GLTF]=new gs(e)}catch(d){n&&n(d);return}i=JSON.parse(r[T.KHR_BINARY_GLTF].content)}else i=JSON.parse(c.decode(e));else i=e;if(i.asset===void 0||i.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new Ms(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const d=this.pluginCallbacks[u](l);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[d.name]=d,r[d.name]=!0}if(i.extensionsUsed)for(let u=0;u<i.extensionsUsed.length;++u){const d=i.extensionsUsed[u],f=i.extensionsRequired||[];switch(d){case T.KHR_MATERIALS_UNLIT:r[d]=new Zn;break;case T.KHR_DRACO_MESH_COMPRESSION:r[d]=new Ts(i,this.dracoLoader);break;case T.KHR_TEXTURE_TRANSFORM:r[d]=new xs;break;case T.KHR_MESH_QUANTIZATION:r[d]=new bs;break;default:f.indexOf(d)>=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(r),l.setPlugins(a),l.parse(s,n)}parseAsync(e,t){const s=this;return new Promise(function(n,i){s.parse(e,t,n,i)})}}function Jn(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const T={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Qn{constructor(e){this.parser=e,this.name=T.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s<n;s++){const i=t[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let n=t.cache.get(s);if(n)return n;const i=t.json,c=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let l;const u=new z(16777215);c.color!==void 0&&u.setRGB(c.color[0],c.color[1],c.color[2],G);const d=c.range!==void 0?c.range:0;switch(c.type){case"directional":l=new bt(u),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new Wt(u),l.distance=d;break;case"spot":l=new qt(u),l.distance=d,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),F(l,c),c.intensity!==void 0&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),n=Promise.resolve(l),t.cache.add(s,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,i=s.json.nodes[e],a=(i.extensions&&i.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(c){return s._getNodeRef(t.cache,a,c)})}}class Zn{constructor(){this.name=T.KHR_MATERIALS_UNLIT}getMaterialType(){return te}extendParams(e,t,s){const n=[];e.color=new z(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const r=i.baseColorFactor;e.color.setRGB(r[0],r[1],r[2],G),e.opacity=r[3]}i.baseColorTexture!==void 0&&n.push(s.assignTexture(e,"map",i.baseColorTexture,oe))}return Promise.all(n)}}class es{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}}class ts{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],r=n.extensions[this.name];if(r.clearcoatFactor!==void 0&&(t.clearcoat=r.clearcoatFactor),r.clearcoatTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(i.push(s.assignTexture(t,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new xt(a,a)}return Promise.all(i)}}class ns{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_DISPERSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}}class ss{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],r=n.extensions[this.name];return r.iridescenceFactor!==void 0&&(t.iridescence=r.iridescenceFactor),r.iridescenceTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceMap",r.iridescenceTexture)),r.iridescenceIor!==void 0&&(t.iridescenceIOR=r.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),r.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),r.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),r.iridescenceThicknessTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(i)}}class rs{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_SHEEN}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new z(0,0,0),t.sheenRoughness=0,t.sheen=1;const r=n.extensions[this.name];if(r.sheenColorFactor!==void 0){const a=r.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],G)}return r.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&i.push(s.assignTexture(t,"sheenColorMap",r.sheenColorTexture,oe)),r.sheenRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(i)}}class is{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],r=n.extensions[this.name];return r.transmissionFactor!==void 0&&(t.transmission=r.transmissionFactor),r.transmissionTexture!==void 0&&i.push(s.assignTexture(t,"transmissionMap",r.transmissionTexture)),Promise.all(i)}}class os{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_VOLUME}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],r=n.extensions[this.name];t.thickness=r.thicknessFactor!==void 0?r.thicknessFactor:0,r.thicknessTexture!==void 0&&i.push(s.assignTexture(t,"thicknessMap",r.thicknessTexture)),t.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return t.attenuationColor=new z().setRGB(a[0],a[1],a[2],G),Promise.all(i)}}class as{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_IOR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}}class cs{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_SPECULAR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],r=n.extensions[this.name];t.specularIntensity=r.specularFactor!==void 0?r.specularFactor:1,r.specularTexture!==void 0&&i.push(s.assignTexture(t,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return t.specularColor=new z().setRGB(a[0],a[1],a[2],G),r.specularColorTexture!==void 0&&i.push(s.assignTexture(t,"specularColorMap",r.specularColorTexture,oe)),Promise.all(i)}}class ls{constructor(e){this.parser=e,this.name=T.EXT_MATERIALS_BUMP}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],r=n.extensions[this.name];return t.bumpScale=r.bumpFactor!==void 0?r.bumpFactor:1,r.bumpTexture!==void 0&&i.push(s.assignTexture(t,"bumpMap",r.bumpTexture)),Promise.all(i)}}class us{constructor(e){this.parser=e,this.name=T.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:D}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],r=n.extensions[this.name];return r.anisotropyStrength!==void 0&&(t.anisotropy=r.anisotropyStrength),r.anisotropyRotation!==void 0&&(t.anisotropyRotation=r.anisotropyRotation),r.anisotropyTexture!==void 0&&i.push(s.assignTexture(t,"anisotropyMap",r.anisotropyTexture)),Promise.all(i)}}class ds{constructor(e){this.parser=e,this.name=T.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,n=s.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const i=n.extensions[this.name],r=t.options.ktx2Loader;if(!r){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,r)}}class fs{constructor(e){this.parser=e,this.name=T.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const r=i.extensions[t],a=n.images[r.source];let c=s.textureLoader;if(a.uri){const l=s.options.manager.getHandler(a.uri);l!==null&&(c=l)}return s.loadTextureImage(e,r.source,c)}}class hs{constructor(e){this.parser=e,this.name=T.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const r=i.extensions[t],a=n.images[r.source];let c=s.textureLoader;if(a.uri){const l=s.options.manager.getHandler(a.uri);l!==null&&(c=l)}return s.loadTextureImage(e,r.source,c)}}class ps{constructor(e){this.name=T.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const n=s.extensions[this.name],i=this.parser.getDependency("buffer",n.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(a){const c=n.byteOffset||0,l=n.byteLength||0,u=n.count,d=n.byteStride,f=new Uint8Array(a,c,l);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(u,d,f,n.mode,n.filter).then(function(p){return p.buffer}):r.ready.then(function(){const p=new ArrayBuffer(u*d);return r.decodeGltfBuffer(new Uint8Array(p),u,d,f,n.mode,n.filter),p})})}else return null}}class ms{constructor(e){this.name=T.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const n=t.meshes[s.mesh];for(const l of n.primitives)if(l.mode!==N.TRIANGLES&&l.mode!==N.TRIANGLE_STRIP&&l.mode!==N.TRIANGLE_FAN&&l.mode!==void 0)return null;const r=s.extensions[this.name].attributes,a=[],c={};for(const l in r)a.push(this.parser.getDependency("accessor",r[l]).then(u=>(c[l]=u,c[l])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(l=>{const u=l.pop(),d=u.isGroup?u.children:[u],f=l[0].count,p=[];for(const g of d){const b=new he,m=new I,x=new wt,y=new I(1,1,1),E=new $t(g.geometry,g.material,f);for(let w=0;w<f;w++)c.TRANSLATION&&m.fromBufferAttribute(c.TRANSLATION,w),c.ROTATION&&x.fromBufferAttribute(c.ROTATION,w),c.SCALE&&y.fromBufferAttribute(c.SCALE,w),E.setMatrixAt(w,b.compose(m,x,y));for(const w in c)if(w==="_COLOR_0"){const M=c[w];E.instanceColor=new Yt(M.array,M.itemSize,M.normalized)}else w!=="TRANSLATION"&&w!=="ROTATION"&&w!=="SCALE"&&g.geometry.setAttribute(w,c[w]);Et.prototype.copy.call(E,g),this.parser.assignFinalMaterial(E),p.push(E)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const It="glTF",ee=12,dt={JSON:1313821514,BIN:5130562};class gs{constructor(e){this.name=T.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,ee),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==It)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-ee,i=new DataView(e,ee);let r=0;for(;r<n;){const a=i.getUint32(r,!0);r+=4;const c=i.getUint32(r,!0);if(r+=4,c===dt.JSON){const l=new Uint8Array(e,ee+r,a);this.content=s.decode(l)}else if(c===dt.BIN){const l=ee+r;this.body=e.slice(l,l+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Ts{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=T.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,r=e.extensions[this.name].attributes,a={},c={},l={};for(const u in r){const d=He[u]||u.toLowerCase();a[d]=r[u]}for(const u in e.attributes){const d=He[u]||u.toLowerCase();if(r[u]!==void 0){const f=s.accessors[e.attributes[u]],p=Q[f.componentType];l[d]=p.name,c[d]=f.normalized===!0}}return t.getDependency("bufferView",i).then(function(u){return new Promise(function(d,f){n.decodeDracoFile(u,function(p){for(const g in p.attributes){const b=p.attributes[g],m=c[g];m!==void 0&&(b.normalized=m)}d(p)},a,l,G,f)})})}}class xs{constructor(){this.name=T.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class bs{constructor(){this.name=T.KHR_MESH_QUANTIZATION}}class Ot extends Ln{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let r=0;r!==n;r++)t[r]=s[i+r];return t}interpolate_(e,t,s,n){const i=this.resultBuffer,r=this.sampleValues,a=this.valueSize,c=a*2,l=a*3,u=n-t,d=(s-t)/u,f=d*d,p=f*d,g=e*l,b=g-l,m=-2*p+3*f,x=p-f,y=1-m,E=x-f+d;for(let w=0;w!==a;w++){const M=r[b+w+a],j=r[b+w+c]*u,k=r[g+w+a],Z=r[g+w]*u;i[w]=y*M+E*j+m*k+x*Z}return i}}const ws=new wt;class Es extends Ot{interpolate_(e,t,s,n){const i=super.interpolate_(e,t,s,n);return ws.fromArray(i).normalize().toArray(i),i}}const N={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Q={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ft={9728:Rt,9729:Fe,9984:nn,9985:tn,9986:en,9987:yt},ht={33071:rn,33648:sn,10497:De},Me={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},He={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},B={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ys={CUBICSPLINE:void 0,LINEAR:St,STEP:yn},Ne={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Rs(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new At({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:An})),o.DefaultMaterial}function V(o,e,t){for(const s in t.extensions)o[s]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function F(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function As(o,e,t){let s=!1,n=!1,i=!1;for(let l=0,u=e.length;l<u;l++){const d=e[l];if(d.POSITION!==void 0&&(s=!0),d.NORMAL!==void 0&&(n=!0),d.COLOR_0!==void 0&&(i=!0),s&&n&&i)break}if(!s&&!n&&!i)return Promise.resolve(o);const r=[],a=[],c=[];for(let l=0,u=e.length;l<u;l++){const d=e[l];if(s){const f=d.POSITION!==void 0?t.getDependency("accessor",d.POSITION):o.attributes.position;r.push(f)}if(n){const f=d.NORMAL!==void 0?t.getDependency("accessor",d.NORMAL):o.attributes.normal;a.push(f)}if(i){const f=d.COLOR_0!==void 0?t.getDependency("accessor",d.COLOR_0):o.attributes.color;c.push(f)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(c)]).then(function(l){const u=l[0],d=l[1],f=l[2];return s&&(o.morphAttributes.position=u),n&&(o.morphAttributes.normal=d),i&&(o.morphAttributes.color=f),o.morphTargetsRelative=!0,o})}function Ls(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,s=e.weights.length;t<s;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let s=0,n=t.length;s<n;s++)o.morphTargetDictionary[t[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Ss(o){let e;const t=o.extensions&&o.extensions[T.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Ce(t.attributes):e=o.indices+":"+Ce(o.attributes)+":"+o.mode,o.targets!==void 0)for(let s=0,n=o.targets.length;s<n;s++)e+=":"+Ce(o.targets[s]);return e}function Ce(o){let e="";const t=Object.keys(o).sort();for(let s=0,n=t.length;s<n;s++)e+=t[s]+":"+o[t[s]]+";";return e}function Ge(o){switch(o){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function vs(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":o.search(/\.ktx2($|\?)/i)>0||o.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const _s=new he;class Ms{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Jn,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,n=-1,i=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(a)===!0;const c=a.match(/Version\/(\d+)/);n=s&&c?parseInt(c[1],10):-1,i=a.indexOf("Firefox")>-1,r=i?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&n<17||i&&r<98?this.textureLoader=new Jt(this.options.manager):this.textureLoader=new Qt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Tt(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(r){const a={scene:r[0][n.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:n.asset,parser:s,userData:{}};return V(i,a,n),F(a,n),Promise.all(s._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){for(const c of a.scenes)c.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let n=0,i=t.length;n<i;n++){const r=t[n].joints;for(let a=0,c=r.length;a<c;a++)e[r[a]].isBone=!0}for(let n=0,i=e.length;n<i;n++){const r=e[n];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(s[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const n=s.clone(),i=(r,a)=>{const c=this.associations.get(r);c!=null&&this.associations.set(a,c);for(const[l,u]of r.children.entries())i(u,a.children[l])};return i(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const n=e(t[s]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let n=0;n<t.length;n++){const i=e(t[n]);i&&s.push(i)}return s}getDependency(e,t){const s=e+":"+t;let n=this.cache.get(s);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(i){return i.loadNode&&i.loadNode(t)});break;case"mesh":n=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(s,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(i,r){return s.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[T.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(i,r){s.load(se.resolveURL(t.uri,n.path),i,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(s){const n=t.byteLength||0,i=t.byteOffset||0;return s.slice(i,i+n)})}loadAccessor(e){const t=this,s=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const r=Me[n.type],a=Q[n.componentType],c=n.normalized===!0,l=new a(n.count*r);return Promise.resolve(new Se(l,r,c))}const i=[];return n.bufferView!==void 0?i.push(this.getDependency("bufferView",n.bufferView)):i.push(null),n.sparse!==void 0&&(i.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(i).then(function(r){const a=r[0],c=Me[n.type],l=Q[n.componentType],u=l.BYTES_PER_ELEMENT,d=u*c,f=n.byteOffset||0,p=n.bufferView!==void 0?s.bufferViews[n.bufferView].byteStride:void 0,g=n.normalized===!0;let b,m;if(p&&p!==d){const x=Math.floor(f/p),y="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+x+":"+n.count;let E=t.cache.get(y);E||(b=new l(a,x*p,n.count*p/u),E=new Zt(b,p/u),t.cache.add(y,E)),m=new Rn(E,c,f%p/u,g)}else a===null?b=new l(n.count*c):b=new l(a,f,n.count*c),m=new Se(b,c,g);if(n.sparse!==void 0){const x=Me.SCALAR,y=Q[n.sparse.indices.componentType],E=n.sparse.indices.byteOffset||0,w=n.sparse.values.byteOffset||0,M=new y(r[1],E,n.sparse.count*x),j=new l(r[2],w,n.sparse.count*c);a!==null&&(m=new Se(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let k=0,Z=M.length;k<Z;k++){const W=M[k];if(m.setX(W,j[k*c]),c>=2&&m.setY(W,j[k*c+1]),c>=3&&m.setZ(W,j[k*c+2]),c>=4&&m.setW(W,j[k*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=g}return m})}loadTexture(e){const t=this.json,s=this.options,i=t.textures[e].source,r=t.images[i];let a=this.textureLoader;if(r.uri){const c=s.manager.getHandler(r.uri);c!==null&&(a=c)}return this.loadTextureImage(e,i,a)}loadTextureImage(e,t,s){const n=this,i=this.json,r=i.textures[e],a=i.images[t],c=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,s).then(function(u){u.flipY=!1,u.name=r.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const f=(i.samplers||{})[r.sampler]||{};return u.magFilter=ft[f.magFilter]||Fe,u.minFilter=ft[f.minFilter]||yt,u.wrapS=ht[f.wrapS]||De,u.wrapT=ht[f.wrapT]||De,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Rt&&u.minFilter!==Fe,n.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){const s=this,n=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const r=n.images[e],a=self.URL||self.webkitURL;let c=r.uri||"",l=!1;if(r.bufferView!==void 0)c=s.getDependency("bufferView",r.bufferView).then(function(d){l=!0;const f=new Blob([d],{type:r.mimeType});return c=a.createObjectURL(f),c});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(c).then(function(d){return new Promise(function(f,p){let g=f;t.isImageBitmapLoader===!0&&(g=function(b){const m=new rt(b);m.needsUpdate=!0,f(m)}),t.load(se.resolveURL(d,i.path),g,void 0,p)})}).then(function(d){return l===!0&&a.revokeObjectURL(c),F(d,r),d.userData.mimeType=r.mimeType||vs(r.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),d});return this.sourceCache[e]=u,u}assignTexture(e,t,s,n){const i=this;return this.getDependency("texture",s.index).then(function(r){if(!r)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(r=r.clone(),r.channel=s.texCoord),i.extensions[T.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[T.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=i.associations.get(r);r=i.extensions[T.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),i.associations.set(r,c)}}return n!==void 0&&(r.colorSpace=n),e[t]=r,r})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const n=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,r=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new on,ve.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,c.sizeAttenuation=!1,this.cache.add(a,c)),s=c}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new an,ve.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,this.cache.add(a,c)),s=c}if(n||i||r){let a="ClonedMaterial:"+s.uuid+":";n&&(a+="derivative-tangents:"),i&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=s.clone(),i&&(c.vertexColors=!0),r&&(c.flatShading=!0),n&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(s))),s=c}e.material=s}getMaterialType(){return At}loadMaterial(e){const t=this,s=this.json,n=this.extensions,i=s.materials[e];let r;const a={},c=i.extensions||{},l=[];if(c[T.KHR_MATERIALS_UNLIT]){const d=n[T.KHR_MATERIALS_UNLIT];r=d.getMaterialType(),l.push(d.extendParams(a,i,t))}else{const d=i.pbrMetallicRoughness||{};if(a.color=new z(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],G),a.opacity=f[3]}d.baseColorTexture!==void 0&&l.push(t.assignTexture(a,"map",d.baseColorTexture,oe)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),r=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}i.doubleSided===!0&&(a.side=cn);const u=i.alphaMode||Ne.OPAQUE;if(u===Ne.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===Ne.MASK&&(a.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&r!==te&&(l.push(t.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new xt(1,1),i.normalTexture.scale!==void 0)){const d=i.normalTexture.scale;a.normalScale.set(d,d)}if(i.occlusionTexture!==void 0&&r!==te&&(l.push(t.assignTexture(a,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&r!==te){const d=i.emissiveFactor;a.emissive=new z().setRGB(d[0],d[1],d[2],G)}return i.emissiveTexture!==void 0&&r!==te&&l.push(t.assignTexture(a,"emissiveMap",i.emissiveTexture,oe)),Promise.all(l).then(function(){const d=new r(a);return i.name&&(d.name=i.name),F(d,i),t.associations.set(d,{materials:e}),i.extensions&&V(n,d,i),d})}createUniqueName(e){const t=ln.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,n=this.primitiveCache;function i(a){return s[T.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return pt(c,a,t)})}const r=[];for(let a=0,c=e.length;a<c;a++){const l=e[a],u=Ss(l),d=n[u];if(d)r.push(d.promise);else{let f;l.extensions&&l.extensions[T.KHR_DRACO_MESH_COMPRESSION]?f=i(l):f=pt(new un,l,t),n[u]={primitive:l,promise:f},r.push(f)}}return Promise.all(r)}loadMesh(e){const t=this,s=this.json,n=this.extensions,i=s.meshes[e],r=i.primitives,a=[];for(let c=0,l=r.length;c<l;c++){const u=r[c].material===void 0?Rs(this.cache):this.getDependency("material",r[c].material);a.push(u)}return a.push(t.loadGeometries(r)),Promise.all(a).then(function(c){const l=c.slice(0,c.length-1),u=c[c.length-1],d=[];for(let p=0,g=u.length;p<g;p++){const b=u[p],m=r[p];let x;const y=l[p];if(m.mode===N.TRIANGLES||m.mode===N.TRIANGLE_STRIP||m.mode===N.TRIANGLE_FAN||m.mode===void 0)x=i.isSkinnedMesh===!0?new dn(b,y):new fn(b,y),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),m.mode===N.TRIANGLE_STRIP?x.geometry=ut(x.geometry,gt):m.mode===N.TRIANGLE_FAN&&(x.geometry=ut(x.geometry,Pe));else if(m.mode===N.LINES)x=new hn(b,y);else if(m.mode===N.LINE_STRIP)x=new pn(b,y);else if(m.mode===N.LINE_LOOP)x=new mn(b,y);else if(m.mode===N.POINTS)x=new gn(b,y);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(x.geometry.morphAttributes).length>0&&Ls(x,i),x.name=t.createUniqueName(i.name||"mesh_"+e),F(x,i),m.extensions&&V(n,x,m),t.assignFinalMaterial(x),d.push(x)}for(let p=0,g=d.length;p<g;p++)t.associations.set(d[p],{meshes:e,primitives:p});if(d.length===1)return i.extensions&&V(n,d[0],i),d[0];const f=new _e;i.extensions&&V(n,f,i),t.associations.set(f,{meshes:e});for(let p=0,g=d.length;p<g;p++)f.add(d[p]);return f})}loadCamera(e){let t;const s=this.json.cameras[e],n=s[s.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?t=new Tn(xn.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):s.type==="orthographic"&&(t=new Lt(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),F(t,s),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],s=[];for(let n=0,i=t.joints.length;n<i;n++)s.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(n){const i=n.pop(),r=n,a=[],c=[];for(let l=0,u=r.length;l<u;l++){const d=r[l];if(d){a.push(d);const f=new he;i!==null&&f.fromArray(i.array,l*16),c.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new bn(a,c)})}loadAnimation(e){const t=this.json,s=this,n=t.animations[e],i=n.name?n.name:"animation_"+e,r=[],a=[],c=[],l=[],u=[];for(let d=0,f=n.channels.length;d<f;d++){const p=n.channels[d],g=n.samplers[p.sampler],b=p.target,m=b.node,x=n.parameters!==void 0?n.parameters[g.input]:g.input,y=n.parameters!==void 0?n.parameters[g.output]:g.output;b.node!==void 0&&(r.push(this.getDependency("node",m)),a.push(this.getDependency("accessor",x)),c.push(this.getDependency("accessor",y)),l.push(g),u.push(b))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(c),Promise.all(l),Promise.all(u)]).then(function(d){const f=d[0],p=d[1],g=d[2],b=d[3],m=d[4],x=[];for(let E=0,w=f.length;E<w;E++){const M=f[E],j=p[E],k=g[E],Z=b[E],W=m[E];if(M===void 0)continue;M.updateMatrix&&M.updateMatrix();const Ae=s._createAnimationTracks(M,j,k,Z,W);if(Ae)for(let Le=0;Le<Ae.length;Le++)x.push(Ae[Le])}const y=new wn(i,void 0,x);return F(y,n),y})}createNodeMesh(e){const t=this.json,s=this,n=t.nodes[e];return n.mesh===void 0?null:s.getDependency("mesh",n.mesh).then(function(i){const r=s._getNodeRef(s.meshCache,n.mesh,i);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let c=0,l=n.weights.length;c<l;c++)a.morphTargetInfluences[c]=n.weights[c]}),r})}loadNode(e){const t=this.json,s=this,n=t.nodes[e],i=s._loadNodeShallow(e),r=[],a=n.children||[];for(let l=0,u=a.length;l<u;l++)r.push(s.getDependency("node",a[l]));const c=n.skin===void 0?Promise.resolve(null):s.getDependency("skin",n.skin);return Promise.all([i,Promise.all(r),c]).then(function(l){const u=l[0],d=l[1],f=l[2];f!==null&&u.traverse(function(p){p.isSkinnedMesh&&p.bind(f,_s)});for(let p=0,g=d.length;p<g;p++)u.add(d[p]);return u})}_loadNodeShallow(e){const t=this.json,s=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const i=t.nodes[e],r=i.name?n.createUniqueName(i.name):"",a=[],c=n._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return c&&a.push(c),i.camera!==void 0&&a.push(n.getDependency("camera",i.camera).then(function(l){return n._getNodeRef(n.cameraCache,i.camera,l)})),n._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){a.push(l)}),this.nodeCache[e]=Promise.all(a).then(function(l){let u;if(i.isBone===!0?u=new En:l.length>1?u=new _e:l.length===1?u=l[0]:u=new Et,u!==l[0])for(let d=0,f=l.length;d<f;d++)u.add(l[d]);if(i.name&&(u.userData.name=i.name,u.name=r),F(u,i),i.extensions&&V(s,u,i),i.matrix!==void 0){const d=new he;d.fromArray(i.matrix),u.applyMatrix4(d)}else i.translation!==void 0&&u.position.fromArray(i.translation),i.rotation!==void 0&&u.quaternion.fromArray(i.rotation),i.scale!==void 0&&u.scale.fromArray(i.scale);if(!n.associations.has(u))n.associations.set(u,{});else if(i.mesh!==void 0&&n.meshCache.refs[i.mesh]>1){const d=n.associations.get(u);n.associations.set(u,{...d})}return n.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],n=this,i=new _e;s.name&&(i.name=n.createUniqueName(s.name)),F(i,s),s.extensions&&V(t,i,s);const r=s.nodes||[],a=[];for(let c=0,l=r.length;c<l;c++)a.push(n.getDependency("node",r[c]));return Promise.all(a).then(function(c){for(let u=0,d=c.length;u<d;u++)i.add(c[u]);const l=u=>{const d=new Map;for(const[f,p]of n.associations)(f instanceof ve||f instanceof rt)&&d.set(f,p);return u.traverse(f=>{const p=n.associations.get(f);p!=null&&d.set(f,p)}),d};return n.associations=l(i),i})}_createAnimationTracks(e,t,s,n,i){const r=[],a=e.name?e.name:e.uuid,c=[];B[i.path]===B.weights?e.traverse(function(f){f.morphTargetInfluences&&c.push(f.name?f.name:f.uuid)}):c.push(a);let l;switch(B[i.path]){case B.weights:l=ot;break;case B.rotation:l=at;break;case B.translation:case B.scale:l=it;break;default:s.itemSize===1?l=ot:l=it;break}const u=n.interpolation!==void 0?ys[n.interpolation]:St,d=this._getArrayFromAccessor(s);for(let f=0,p=c.length;f<p;f++){const g=new l(c[f]+"."+B[i.path],t.array,d,u);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),r.push(g)}return r}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=Ge(t.constructor),n=new Float32Array(t.length);for(let i=0,r=t.length;i<r;i++)n[i]=t[i]*s;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(s){const n=this instanceof at?Es:Ot;return new n(this.times,this.values,this.getValueSize()/3,s)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Ns(o,e,t){const s=e.attributes,n=new be;if(s.POSITION!==void 0){const a=t.json.accessors[s.POSITION],c=a.min,l=a.max;if(c!==void 0&&l!==void 0){if(n.set(new I(c[0],c[1],c[2]),new I(l[0],l[1],l[2])),a.normalized){const u=Ge(Q[a.componentType]);n.min.multiplyScalar(u),n.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=e.targets;if(i!==void 0){const a=new I,c=new I;for(let l=0,u=i.length;l<u;l++){const d=i[l];if(d.POSITION!==void 0){const f=t.json.accessors[d.POSITION],p=f.min,g=f.max;if(p!==void 0&&g!==void 0){if(c.setX(Math.max(Math.abs(p[0]),Math.abs(g[0]))),c.setY(Math.max(Math.abs(p[1]),Math.abs(g[1]))),c.setZ(Math.max(Math.abs(p[2]),Math.abs(g[2]))),f.normalized){const b=Ge(Q[f.componentType]);c.multiplyScalar(b)}a.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}o.boundingBox=n;const r=new Sn;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,o.boundingSphere=r}function pt(o,e,t){const s=e.attributes,n=[];function i(r,a){return t.getDependency("accessor",r).then(function(c){o.setAttribute(a,c)})}for(const r in s){const a=He[r]||r.toLowerCase();a in o.attributes||n.push(i(s[r],a))}if(e.indices!==void 0&&!o.index){const r=t.getDependency("accessor",e.indices).then(function(a){o.setIndex(a)});n.push(r)}return ct.workingColorSpace!==G&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ct.workingColorSpace}" not supported.`),F(o,e),Ns(o,e,t),Promise.all(n).then(function(){return e.targets!==void 0?As(o,e.targets,t):o})}async function Cs(o,e=!1,t){const s=new Uint8Array(await o.slice(0,33).arrayBuffer());t===void 0?vn(s):_n(s,t);const n=await createImageBitmap(o,{colorSpaceConversion:e?"none":"default"});try{const i=new OffscreenCanvas(n.width,n.height),r=i.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("Could not decode the PNG.");r.drawImage(n,0,0);const a=r.getImageData(0,0,i.width,i.height);return{width:i.width,height:i.height,data:new Uint8Array(a.data.buffer)}}finally{n.close()}}function h(o){const e=document.getElementById(o);if(!e)throw new Error("Missing viewer control "+o);return e}const X=h("viewport"),L=h("status"),kt=h("previewLabel"),q=h("export"),Ue=h("pixelArt"),je=h("smoothEdges"),$e=new Un,Pt=h("cpuPreview"),ne=h("gpuPreview"),pe=h("materialLighting"),me=h("supersampling"),K=o=>o.getAttribute("aria-pressed")==="true";let P,$="gpu";X.append($e.canvas);const ae=new Mn,H=new Nn(16,32,4478570,2569798);ae.add(H);const Ft=new bt(16777215,1.5);Ft.position.set(2,3,2);ae.add(new Cn(16777215,.85),Ft);const A=new Lt(-1,1,1,-1,.01,300);A.position.set(2.7,1.8,2.5);const O=new jn(A,X);O.target.y=.4;O.enableDamping=!0;O.minZoom=.15;O.maxZoom=12;let Be=1.1;function we(){const{clientWidth:o,clientHeight:e}=X;if(!o||!e)return;P?.setPixelRatio(Math.min(devicePixelRatio,2)*(K(me)?2:1)),P?.setSize(o,e,!1);const t=o/e;A.left=-Be*Math.max(1,t),A.right=-A.left,A.top=Be*Math.max(1,1/t),A.bottom=-A.top,A.updateProjectionMatrix()}function Ee(o){if(o==="gpu"&&!P)try{P=new In({antialias:!0}),P.setClearColor(1186083),P.domElement.addEventListener("webglcontextlost",e=>{e.preventDefault(),ne.disabled=!0,Ee("cpu")}),P.domElement.addEventListener("webglcontextrestored",()=>{ne.disabled=!1}),X.append(P.domElement)}catch{ne.disabled=!0,h("cacheNotice").textContent="WebGL unavailable. Using CPU.",o="cpu"}$=o,$e.canvas.hidden=$!=="cpu",P&&(P.domElement.hidden=$!=="gpu"),Pt.setAttribute("aria-pressed",String($==="cpu")),ne.setAttribute("aria-pressed",String($==="gpu")),Y=0,de=0,re=performance.now(),we()}Pt.addEventListener("click",()=>Ee("cpu"));ne.addEventListener("click",()=>Ee("gpu"));new ResizeObserver(we).observe(X);let Y=0,re=performance.now(),de=0,mt=re;const Is=h("performance");function Dt(o){requestAnimationFrame(Dt),O.update(Math.min(.1,(o-mt)/1e3)),mt=o;const e=performance.now();if($==="gpu"?P?.render(ae,A):$e.render(v,A,K(me),H.visible,H.position.y,K(pe)),de+=performance.now()-e,Y++,o-re>=500){const t=o-re;Is.value=`${Math.round(Y*1e3/t)} FPS · ${(t/Y).toFixed(1)} ms/frame · ${(de/Y).toFixed(1)} ms render CPU`,Y=0,de=0,re=o}}let v=null,R=null,_=[],C=[],ie,ce=null,le=null;const Ke={};let Ve="atlas",J="stack",ue=null,Ht,ge=!0,S=0;const Gt=["targetMesh","targetStack","meshMethod","textureProjection","contourHub","qualityPreset","layers","resolution","threshold","profile","height","pivot","resetReconstruction"].map(o=>h(o)),ze=h("persistentCache"),Te=h("spacing"),Os=h("squash"),ks=h("previewScale");let Ut=3;function Ye(){if(!v)return;const o=new be().setFromObject(v),e=o.getCenter(new I),t=o.getSize(new I),s=Math.max(t.x,t.y,t.z,.01),n=s*2.65;Be=s*.86,Ut=n,O.target.copy(e),A.position.copy(e).addScaledVector(new I(1.35,.95,1).normalize(),n),A.near=Math.max(1e-4,s/200),A.far=Math.max(300,n*50),we(),Je(),Qe()}function Je(){if(!v)return;const o=new be().setFromObject(v),e=o.getSize(new I);H.scale.setScalar(Math.max(e.x,e.y,e.z,.01)),H.position.y=o.min.y-H.scale.x*.002}function Qe(){const o=new Dn().setFromVector3(A.position.clone().sub(O.target));o.phi=Math.acos(Math.min(.9999,Os.valueAsNumber)),o.radius=Ut,A.zoom=ks.valueAsNumber,A.updateProjectionMatrix(),A.position.copy(O.target).add(new I().setFromSpherical(o)),O.update()}function jt(o,e){v&&(ae.remove(v),We(v)),v=o,ae.add(o),e?Ye():Je(),X.dataset.ready="true"}function Ze(){const o=R?.target==="stack"&&v!==null;Ue.disabled=!o,je.disabled=!o,o&&On(v,Ue.getAttribute("aria-pressed")==="true",je.getAttribute("aria-pressed")==="true")}function ye(){Te.disabled=R?.target!=="stack",R?.target==="stack"&&v&&(v.scale.y=Te.valueAsNumber,Je())}for(const o of[Ue,je])o.addEventListener("click",()=>{o.setAttribute("aria-pressed",String(o.getAttribute("aria-pressed")!=="true")),Ze()});h("showGrid").addEventListener("click",o=>{H.visible=!H.visible,o.currentTarget.setAttribute("aria-pressed",String(H.visible))});for(const o of[pe,me,ze])o.addEventListener("click",()=>{o.setAttribute("aria-pressed",String(!K(o))),o===pe&&R&&v&&_t(v,K(o)),o===me&&we()});function Re(o,e,t){const s=h(o),n=h(o+"Value");s.addEventListener("input",()=>{n.value=e(s.valueAsNumber),t()})}Re("spacing",o=>o.toFixed(2)+"×",ye);Re("squash",o=>o.toFixed(2),Qe);Re("previewScale",o=>o.toFixed(2)+"×",Qe);Re("rotationSpeed",o=>o+"°/s",()=>{const o=h("rotationSpeed").valueAsNumber;O.autoRotate=o>0,O.autoRotateSpeed=o/6});function et(){clearTimeout(Ht)}function Xe(o,e){h(o).replaceChildren(...e.map(s=>{const n=document.createElement("li");return n.textContent=s,n}))}function tt(o,e,t=!1,s){R=o,ie=s,C=s?qn(s,_):[];const n=C.length?Ct(C):Fn(R);R.target==="stack"&&(n.scale.y=Te.valueAsNumber),K(pe)&&_t(n,!0),jt(n,ge),ge=!1,ye(),Ze(),kt.textContent=R.target==="mesh"?"Mesh preview":"Sprite stack preview",q.disabled=t;const i=new be().setFromObject(n).getSize(new I),r=(C.length?[i.x,i.z,i.y]:R.size).map(c=>c.toFixed(2)).join(" × "),a=R.target==="mesh"?`${(R.indices.length/3).toLocaleString()} triangles`:`${R.layers} slices`;L.value=`${r} units · ${C.length?C.length+" parts · ":""}${a} · ${e}`,X.dataset.partCount=String(C.length||1)}function Ie(o,e,t=!1){tt(o.result,t?e+" · Building full resolution…":e,t,o.parts),Xe("mappedViews",o.inspection.views.map(s=>`${s.direction} ${s.width}×${s.height}`)),Xe("warnings",o.inspection.warnings)}function U(o=125){et();const e=++S;q.disabled=!0;let t;if(Ve==="atlas"&&_.length)t={parts:_.map(({atlas:u,layout:d,size:f})=>({atlas:u,layout:d,size:f}))};else if(Ve==="atlas"){if(!ce){L.value="Load a PNG atlas.";return}const u=h("layout").value;try{kn(u)}catch(d){L.value=d.message;return}t={atlas:ce,layout:u}}else{const u=Number(h("viewCount").value),d=vt.slice(0,u),f=d.filter(p=>!Ke[p]);if(f.length){L.value="Add views: "+f.join(", ");return}t={files:Object.fromEntries(d.map(p=>[p,Ke[p]]))}}for(const u of Gt)u.disabled=!1;for(const u of["height","pivot","layout","profile"])h(u).disabled="parts"in t;const s=h("meshMethod").value,n=J==="mesh"&&s==="contour",i=n&&h("contourHub").checked;h("meshOptions").hidden=J!=="mesh",h("resolutionName").textContent=i?"Hub segments":"Texture resolution";const r=h("resolution").valueAsNumber;if(h("resolutionValue").value=i?String(r):st(r),h("hubOption").hidden=!n,n){for(const u of["qualityPreset","layers","profile"])h(u).disabled=!0;h("resolution").disabled=!i}const a=u=>h(u).valueAsNumber,c={textureProjection:J==="mesh"?h("textureProjection").value:void 0,meshMethod:n?s:void 0,contourHub:i||void 0,layers:a("layers"),resolution:a("resolution"),threshold:a("threshold"),height:a("height"),pivot:h("pivot").value,profile:"parts"in t?"silhouette":h("profile").value};L.value="Reconstructing…";const l=J;Ht=setTimeout(async()=>{try{await Ps(e,t,l,c)}catch(u){e===S&&(L.value=u.message)}},o)}async function Ps(o,e,t,s){const n=await Kn(e);if(o!==S)return;const i=K(ze),r=JSON.stringify([n,t,s]),a=await lt(r,i);if(o!==S)return;if(a){Ie(a.value,a.origin);return}let c=s.meshMethod!=="contour"&&(s.layers>45||s.resolution>96)?{...s,layers:Math.min(45,s.layers),resolution:Math.min(96,s.resolution)}:void 0;const l=JSON.stringify([n,t,c]);if(c){const f=await lt(l,i);if(o!==S)return;f&&(Ie(f.value,f.origin,!0),c=void 0)}const u=ue??=new Worker(new URL(""+new URL("reconstruct.worker-ONc9GyFO.js",import.meta.url).href,import.meta.url),{type:"module"}),d=qe;u.onmessage=({data:f})=>{if(!(ue!==u||f.id!==o||o!==S)){if("error"in f){L.value=f.error;return}d===qe&&Vn(f.preview?l:r,f,K(ze)),Ie(f,"Built from source · "+Math.round(f.elapsed)+" ms",f.preview)}},u.onerror=()=>{ue===u&&(u.terminate(),ue=null,o===S&&(L.value="Could not start the reconstruction worker."))},u.postMessage({id:o,sourceKey:n,source:e,target:t,settings:s,preview:c})}let qe=0;h("clearCache").addEventListener("click",async()=>{qe++;const o=h("cacheNotice");try{await Bn(),o.textContent="Cache cleared."}catch{o.textContent="Could not clear the disk cache."}});function nt(o,e=!0){Ve=o,h("atlasFields").hidden=o!=="atlas",h("separateFields").hidden=o!=="files",h("modeAtlas").setAttribute("aria-pressed",String(o==="atlas")),h("modeFiles").setAttribute("aria-pressed",String(o==="files")),e&&U(0)}function xe(o,e,t=[]){ce=o,_=t,Bt(),ge=!0;const s=h("sourceImage");le&&URL.revokeObjectURL(le),le=URL.createObjectURL(o),s.src=le,s.hidden=!1,e&&(h("layout").value=e),nt("atlas")}function Bt(){const o=h("assemblyEditor");o.hidden=!_.length;const e=_.reduce((t,s)=>t+s.mounts.length,0);h("assemblySummary").textContent=`${_.length} atlases · ${e} parts`,h("partMounts").replaceChildren(..._.flatMap((t,s)=>t.mounts.map(n=>Fs(n,s))))}function Fs(o,e){const t=document.createElement("fieldset"),s=document.createElement("legend");s.textContent=o.name;const n=document.createElement("div");for(const[r,a]of["X","Depth","Height","Scale"].entries()){const c=document.createElement("label"),l=document.createElement("input");l.type="number",l.step=".05",l.min=r===3?".05":"-20",l.max="20",l.value=(r===3?o.scale??1:o.position[r]).toFixed(3),c.append(a,l),l.addEventListener("change",()=>{if(!(!Number.isFinite(l.valueAsNumber)||l.validity.rangeUnderflow||l.validity.rangeOverflow)&&(r===3?o.scale=l.valueAsNumber:o.position[r]=l.valueAsNumber,R&&ie&&ie.length===_.length)){const u=!q.disabled;tt(R,"Assembly placement updated",!u,ie)}}),n.append(c)}const i=document.createElement("button");return i.type="button",i.textContent="Remove part",i.disabled=_.reduce((r,a)=>r+a.mounts.length,0)===1,i.addEventListener("click",()=>{const r=_[e];r.mounts=r.mounts.filter(a=>a!==o),r.mounts.length||_.splice(e,1),h("samplePreset").value="",Bt(),U(0)}),t.append(s,n,i),t}const fe=h("partFiles");h("addParts").addEventListener("click",()=>fe.click());fe.addEventListener("change",()=>{const o=Array.from(fe.files??[]);if(fe.value="",!o.length)return;if(o.some(s=>!/\.png$/i.test(s.name))){L.value="Choose four-view PNGs.";return}const e=_.length?_:ce?[{atlas:ce,layout:h("layout").value,name:"Base",mounts:[{name:"Base",position:[0,0,0]}]}]:[];if(e.length+o.length>12){L.value="An assembly supports up to 12 atlases.";return}const t=[...e,...o.map((s,n)=>({atlas:s,name:s.name,layout:"top,left,front,rear",mounts:[{name:s.name,position:[.7*(e.length+n),0,0],scale:e.length+n?.6:1}]}))];h("samplePreset").value="",xe(t[0].atlas,t[0].layout,t)});for(const[o,e]of vt.entries()){const t=document.createElement("div"),s=document.createElement("label");s.htmlFor="view-"+e,s.textContent=e;const n=document.createElement("input");n.id=s.htmlFor,n.type="file",n.accept="image/png,.png",n.addEventListener("change",()=>{n.files?.[0]&&(Ke[e]=n.files[0]),ge=!0,U(0)}),t.append(s,n),t.dataset.direction=e,t.hidden=o>=4,h("viewFiles").append(t)}h("viewCount").addEventListener("change",o=>{const e=o.currentTarget;for(const[t,s]of Array.from(h("viewFiles").children).entries())s.hidden=t>=Number(e.value);U(0)});h("modeAtlas").addEventListener("click",()=>nt("atlas"));h("modeFiles").addEventListener("click",()=>nt("files"));h("atlas").addEventListener("change",o=>{const e=o.currentTarget.files?.[0];e&&(h("samplePreset").value="",h("profile").value="silhouette",xe(e))});h("samplePreset").addEventListener("change",async o=>{const e=++S,t=o.currentTarget.value;if(t){et(),q.disabled=!0,L.value="Loading sample…";try{const s="top,left,front,rear",n=async r=>{const a=await fetch(r);if(!a.ok)throw new Error("Could not load the sample atlas.");return a.blob()},i=Xn[t];if(i){const r=await Promise.all(i.map(async a=>({...a,mounts:structuredClone(a.mounts),atlas:await n(a.url),layout:s})));e===S&&(h("profile").value="silhouette",xe(r[0].atlas,s,r))}else{const r=await n(Mt[t]);e===S&&(h("profile").value=t==="cone"?"round-base":"silhouette",xe(r,s))}}catch(s){e===S&&(L.value=s.message)}}});h("resetCamera").addEventListener("click",Ye);for(const[o,e]of[["targetMesh","mesh"],["targetStack","stack"]])h(o).addEventListener("click",()=>{J!==e&&(J=e,h("targetMesh").setAttribute("aria-pressed",String(e==="mesh")),h("targetStack").setAttribute("aria-pressed",String(e==="stack")),q.textContent=e==="mesh"?"Export GLB":"Export stack",U(0))});for(const[o,e]of[["layers","layerValue"],["resolution","resolutionValue"],["threshold","thresholdValue"]]){const t=h(o);t.addEventListener("input",()=>{!t.validity.valid||!Number.isFinite(t.valueAsNumber)||(h(e).value=o==="resolution"?st(t.valueAsNumber):t.value,o!=="threshold"&&(h("qualityPreset").value=""),U())})}for(const o of["height","pivot","layout","profile","meshMethod","textureProjection","contourHub"])h(o).addEventListener("change",()=>U(0));function st(o){return`${o} px · ${(o/Nt.balanced.resolution).toFixed(2)}×`}function Kt(o){const{layers:e,resolution:t}=Nt[o];h("layers").value=h("layerValue").value=String(e),h("resolution").value=String(t),h("resolutionValue").value=st(t)}h("qualityPreset").addEventListener("change",o=>{const e=o.currentTarget.value;e&&(Kt(e),U(0))});h("resetReconstruction").addEventListener("click",()=>{h("meshMethod").value="marching-cubes",h("textureProjection").value="auto",h("contourHub").checked=!1,h("qualityPreset").value="standard",h("profile").value=h("samplePreset").value==="cone"?"round-base":"silhouette",Kt("standard");for(const[o,e]of[["height","1"],["pivot","ground"],["threshold","238"],["thresholdValue","238"],["spacing","1"],["squash",".75"],["previewScale","1"],["rotationSpeed","0"]])h(o).value=e;for(const[o,e]of[["spacingValue","1.00×"],["squashValue","0.75"],["previewScaleValue","1.00×"],["rotationSpeedValue","0°/s"]])h(o).value=e;O.autoRotate=!1,ye(),Ye(),U(0)});function Oe(o,e,t){const s=URL.createObjectURL(new Blob([new Uint8Array(o)],{type:t})),n=document.createElement("a");n.href=s,n.download=e,n.click(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}q.addEventListener("click",async()=>{if(R)try{if(R.target==="stack"){const o=C.length?Wn(C):R;Oe(Hn($n(o,Te.valueAsNumber)),"stack3-stack.zip","application/zip")}else if(C.length){const o=Ct(C);try{const{GLTFExporter:e}=await zn(async()=>{const{GLTFExporter:s}=await import("./GLTFExporter-xdVCArY-.js");return{GLTFExporter:s}},__vite__mapDeps([0,1,2]),import.meta.url),t=await new e().parseAsync(o,{binary:!0});if(!(t instanceof ArrayBuffer))throw new Error("Could not export assembly as GLB.");Oe(new Uint8Array(t),"stack3-assembly.glb","model/gltf-binary")}finally{We(o)}}else Oe(Gn(R),"stack3.glb","model/gltf-binary")}catch(o){L.value=o.message}});h("openGlb").addEventListener("click",()=>h("glb").click());h("glb").addEventListener("change",async o=>{const e=o.currentTarget,t=e.files?.[0];if(e.value="",!t)return;et();const s=++S;R=null,C=[],ie=void 0,ye(),Ze(),q.disabled=!0;try{const n=await t.arrayBuffer(),i=new DataView(n);if(n.byteLength<20||i.getUint32(0,!0)!==1179937895||i.getUint32(12,!0)>n.byteLength-20)throw new Error("Expected a GLB file.");const r=JSON.parse(new TextDecoder().decode(new Uint8Array(n,20,i.getUint32(12,!0))));if([...r.images??[],...r.buffers??[]].some(c=>c.uri&&!c.uri.startsWith("data:")))throw new Error("Open a GLB with embedded textures and buffers.");const a=await new Yn().parseAsync(n,"");if(s!==S){We(a.scene);return}jt(a.scene,!0),kt.textContent="GLB preview",L.value=t.name+" · Opened",Xe("warnings",[])}catch(n){s===S&&(L.value=n.message)}});async function Ds(o){const e=++S;L.value="Opening stack…";try{const t=new URL(`__stack3/${o}/`,location.href),[s,n]=await Promise.all([fetch(new URL("stack.json",t)),fetch(new URL("stack.png",t))]);if(!s.ok||!n.ok)throw new Error("Could not open this CLI stack bundle.");const i=await s.json(),r=await Cs(await n.blob(),!1,i);if(e!==S)return;tt(Pn(i,r),"Opened stack bundle");for(const a of Gt)a.disabled=!0}catch(t){e===S&&(L.value=t.message)}}const Vt=new URLSearchParams(location.search),ke=Vt.get("stack");Ee("gpu");requestAnimationFrame(Dt);if(ke&&/^[a-f0-9-]{36}$/.test(ke))Ds(ke);else{const o=Vt.get("preset");if(o&&Object.hasOwn(Mt,o)){const e=h("samplePreset");e.value=o,e.dispatchEvent(new Event("change"))}}
|
|
Binary file
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<link rel="icon" href="data:,">
|
|
7
|
+
<title>stack3.js · 4-view comparison</title>
|
|
8
|
+
<script type="module" crossorigin src="./assets/compare-Du4RoRQO.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="./assets/style-D6eZHs3D.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/presets-jXE0t1fU.js">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./assets/style-CMUT8CmM.css">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./assets/compare-B6DWTZS9.css">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<header class="topbar">
|
|
16
|
+
<h1>4-view comparison</h1>
|
|
17
|
+
<nav class="toolbar" aria-label="Viewer">
|
|
18
|
+
<a id="back" class="button" href="./index.html">Asset viewer</a>
|
|
19
|
+
</nav>
|
|
20
|
+
</header>
|
|
21
|
+
<main class="comparison">
|
|
22
|
+
<div class="compare-controls">
|
|
23
|
+
<div>
|
|
24
|
+
<label for="part">Atlas source</label>
|
|
25
|
+
<select id="part"></select>
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<label for="atlas">4-view PNG</label>
|
|
29
|
+
<input id="atlas" type="file" accept="image/png,.png">
|
|
30
|
+
</div>
|
|
31
|
+
<div><label for="yaw">Orbit <output id="yaw-value">45°</output></label><input id="yaw" type="range" min="-180" max="180" value="45"></div>
|
|
32
|
+
<div><label for="pitch">Elevation <output id="pitch-value">24°</output></label><input id="pitch" type="range" min="-10" max="90" value="24"></div>
|
|
33
|
+
<div><label for="zoom">Zoom <output id="zoom-value">1×</output></label><input id="zoom" type="range" min="0.75" max="3" step="0.05" value="1"></div>
|
|
34
|
+
<div><label for="layers">Layers <output id="layers-value">128</output></label><input id="layers" type="number" min="8" step="1" value="128" disabled></div>
|
|
35
|
+
<div><label for="spacing">Spacing <output id="spacing-value">1.00×</output></label><input id="spacing" type="range" min="0.50" max="2.50" step="0.05" value="1" disabled></div>
|
|
36
|
+
<div><label for="explode">Explode <output id="explode-value">0%</output></label><input id="explode" type="range" min="0" max="100" step="1" value="0" disabled></div>
|
|
37
|
+
<div class="compare-actions">
|
|
38
|
+
<button id="clay" type="button" aria-pressed="false" title="Show mesh geometry without textures">Clay</button>
|
|
39
|
+
<button id="reset" type="button">Reset camera</button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<output id="comparison-status" role="status" aria-live="polite">Choose a PNG in TOP, LEFT, FRONT, REAR order.</output>
|
|
43
|
+
<ul id="comparison-warnings" aria-label="Atlas alignment warnings"></ul>
|
|
44
|
+
<div class="compare-results" aria-label="Reconstruction thumbnails"></div>
|
|
45
|
+
</main>
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<link rel="icon" href="data:,">
|
|
7
|
+
<title>stack3.js · Asset Viewer</title>
|
|
8
|
+
<script type="module" crossorigin src="./assets/viewer-DIjS0No7.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="./assets/style-D6eZHs3D.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/preview-cache-BKV0EZl9.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/presets-jXE0t1fU.js">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./assets/style-CMUT8CmM.css">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<header class="topbar">
|
|
16
|
+
<h1>stack3<span>.js</span></h1>
|
|
17
|
+
<div class="toolbar">
|
|
18
|
+
<a class="button" href="./compare.html">4-view comparison</a>
|
|
19
|
+
<a class="button" href="./project.html">Scene editor</a>
|
|
20
|
+
<a class="button" href="./project.html?playground=1">Playground</a>
|
|
21
|
+
<a class="button" href="./playground/index.html">Demo yard</a>
|
|
22
|
+
<button id="openGlb" type="button">Open GLB</button><input id="glb" type="file" accept=".glb" hidden>
|
|
23
|
+
<button id="export" class="primary" type="button" disabled>Export stack</button>
|
|
24
|
+
</div>
|
|
25
|
+
</header>
|
|
26
|
+
<main>
|
|
27
|
+
<aside aria-label="Asset settings">
|
|
28
|
+
<section>
|
|
29
|
+
<h2>Source</h2>
|
|
30
|
+
<label for="samplePreset">Sample asset</label>
|
|
31
|
+
<select id="samplePreset">
|
|
32
|
+
<option value="">Choose a sample</option>
|
|
33
|
+
<option value="cone">Traffic Cone</option>
|
|
34
|
+
<option value="rover">Cargo Rover</option>
|
|
35
|
+
<option value="inspection">Inspection Robot</option>
|
|
36
|
+
<option value="ant">Ant Mech</option>
|
|
37
|
+
<option value="tank">Armored Miniature</option>
|
|
38
|
+
<option value="sign">Wet-Floor Sign</option>
|
|
39
|
+
<option value="barrier">Plastic Barrier</option>
|
|
40
|
+
<option value="concrete">Concrete Barrier</option>
|
|
41
|
+
</select>
|
|
42
|
+
<div class="segmented" role="group" aria-label="Input mode">
|
|
43
|
+
<button id="modeAtlas" type="button" aria-pressed="true">Atlas</button>
|
|
44
|
+
<button id="modeFiles" type="button" aria-pressed="false">Individual views</button>
|
|
45
|
+
</div>
|
|
46
|
+
<div id="atlasFields">
|
|
47
|
+
<label for="atlas">PNG atlas</label>
|
|
48
|
+
<input id="atlas" type="file" accept="image/png,.png">
|
|
49
|
+
<label for="layout">Directions in reading order</label>
|
|
50
|
+
<input id="layout" type="text" value="top,left,front,rear" spellcheck="false">
|
|
51
|
+
<img id="sourceImage" alt="Source atlas" hidden>
|
|
52
|
+
<div class="toolbar"><button id="addParts" type="button">Add part atlases</button></div>
|
|
53
|
+
<input id="partFiles" type="file" accept="image/png,.png" multiple hidden>
|
|
54
|
+
<details id="assemblyEditor" hidden open>
|
|
55
|
+
<summary id="assemblySummary">Assembly parts</summary>
|
|
56
|
+
<div id="partMounts"></div>
|
|
57
|
+
</details>
|
|
58
|
+
</div>
|
|
59
|
+
<div id="separateFields" hidden>
|
|
60
|
+
<label for="viewCount">View set</label>
|
|
61
|
+
<select id="viewCount"><option value="4">Four views</option><option value="6">Six views</option></select>
|
|
62
|
+
<div id="viewFiles"></div>
|
|
63
|
+
</div>
|
|
64
|
+
<ul id="mappedViews" aria-label="Mapped view sizes"></ul>
|
|
65
|
+
</section>
|
|
66
|
+
<section>
|
|
67
|
+
<h2>Reconstruction</h2>
|
|
68
|
+
<div class="segmented" role="group" aria-label="Asset type">
|
|
69
|
+
<button id="targetStack" type="button" aria-pressed="true">Sprite stack</button>
|
|
70
|
+
<button id="targetMesh" type="button" aria-pressed="false">3D mesh</button>
|
|
71
|
+
</div>
|
|
72
|
+
<div id="meshOptions" hidden>
|
|
73
|
+
<label for="meshMethod">Mesh method</label>
|
|
74
|
+
<select id="meshMethod"><option value="marching-cubes">Marching Cubes</option><option value="contour">Contour extrusion</option></select>
|
|
75
|
+
<label for="textureProjection">Texture projection</label>
|
|
76
|
+
<select id="textureProjection"><option value="auto">Automatic (multi-view)</option><option value="top-contour">Upper contour from TOP</option></select>
|
|
77
|
+
<label id="hubOption" hidden><input id="contourHub" type="checkbox"> Centered round hub</label>
|
|
78
|
+
</div>
|
|
79
|
+
<label for="qualityPreset">Quality preset</label>
|
|
80
|
+
<select id="qualityPreset">
|
|
81
|
+
<option value="">Custom</option>
|
|
82
|
+
<option value="draft">Draft · 24 layers</option>
|
|
83
|
+
<option value="standard" selected>Standard · 128 layers</option>
|
|
84
|
+
<option value="balanced">Balanced · 48 layers</option>
|
|
85
|
+
<option value="detail">Detail · 90 layers</option>
|
|
86
|
+
</select>
|
|
87
|
+
<label for="layers">Layers <output id="layerValue">128</output></label>
|
|
88
|
+
<input id="layers" type="number" min="8" step="1" value="128">
|
|
89
|
+
<label for="resolution"><span id="resolutionName">Texture resolution</span> <output id="resolutionValue">96 px · 1.00×</output></label>
|
|
90
|
+
<input id="resolution" type="number" min="16" step="1" value="96">
|
|
91
|
+
<label for="threshold">Background threshold <output id="thresholdValue">238</output></label>
|
|
92
|
+
<input id="threshold" type="range" min="180" max="255" value="238">
|
|
93
|
+
<label for="profile">Cross-section</label>
|
|
94
|
+
<select id="profile">
|
|
95
|
+
<option value="silhouette">From silhouettes</option>
|
|
96
|
+
<option value="round">Round</option>
|
|
97
|
+
<option value="round-base">Round above square base</option>
|
|
98
|
+
</select>
|
|
99
|
+
<div class="split">
|
|
100
|
+
<div><label for="height">Asset height</label><input id="height" type="number" min=".01" step=".1" value="1"></div>
|
|
101
|
+
<div><label for="pivot">Pivot</label><select id="pivot"><option value="ground">Ground</option><option value="center">Center</option></select></div>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="toolbar">
|
|
104
|
+
<button id="persistentCache" type="button" aria-pressed="true">Disk cache</button>
|
|
105
|
+
<button id="clearCache" type="button">Clear cache</button>
|
|
106
|
+
<button id="resetReconstruction" type="button">Defaults</button>
|
|
107
|
+
</div>
|
|
108
|
+
<output id="cacheNotice" role="status"></output>
|
|
109
|
+
</section>
|
|
110
|
+
<section>
|
|
111
|
+
<h2>Presentation</h2>
|
|
112
|
+
<label for="spacing">Spacing <output id="spacingValue">1.00×</output></label>
|
|
113
|
+
<input id="spacing" type="range" min=".50" max="2.50" step=".05" value="1" disabled>
|
|
114
|
+
<label for="squash">Squash <output id="squashValue">0.75</output></label>
|
|
115
|
+
<input id="squash" type="range" min=".45" max="1" step=".01" value=".75">
|
|
116
|
+
<label for="previewScale">Scale <output id="previewScaleValue">1.00×</output></label>
|
|
117
|
+
<input id="previewScale" type="range" min=".5" max="2" step=".05" value="1">
|
|
118
|
+
<label for="rotationSpeed">Auto-rotate speed <output id="rotationSpeedValue">0°/s</output></label>
|
|
119
|
+
<input id="rotationSpeed" type="range" min="0" max="135" step="1" value="0">
|
|
120
|
+
</section>
|
|
121
|
+
</aside>
|
|
122
|
+
<section class="viewer" aria-label="Model preview">
|
|
123
|
+
<div class="viewer-toolbar">
|
|
124
|
+
<span id="previewLabel">Sprite stack preview</span>
|
|
125
|
+
<div class="toolbar">
|
|
126
|
+
<div class="toolbar" role="group" aria-label="Preview renderer">
|
|
127
|
+
<button id="cpuPreview" type="button" aria-pressed="false">CPU</button>
|
|
128
|
+
<button id="gpuPreview" type="button" aria-pressed="true">GPU</button>
|
|
129
|
+
</div>
|
|
130
|
+
<button id="materialLighting" type="button" aria-pressed="false">Material lighting</button>
|
|
131
|
+
<button id="supersampling" type="button" aria-pressed="false">Supersampling 2×</button>
|
|
132
|
+
<button id="pixelArt" type="button" aria-pressed="false" disabled>Pixel art</button>
|
|
133
|
+
<button id="smoothEdges" type="button" aria-pressed="true" disabled>Smooth edges</button>
|
|
134
|
+
<button id="showGrid" type="button" aria-pressed="true">Grid</button>
|
|
135
|
+
<button id="resetCamera" type="button">Reset camera</button>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div id="viewport"></div>
|
|
139
|
+
<div class="viewer-status">
|
|
140
|
+
<output id="status" aria-live="polite">Load a PNG atlas or individual views.</output>
|
|
141
|
+
<output id="performance">— FPS</output>
|
|
142
|
+
<span>Drag to orbit · Scroll to zoom</span>
|
|
143
|
+
</div>
|
|
144
|
+
<ul id="warnings" aria-label="Input warnings"></ul>
|
|
145
|
+
</section>
|
|
146
|
+
</main>
|
|
147
|
+
</body>
|
|
148
|
+
</html>
|