softbox 4.0.0 → 4.1.0
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/README.md +6 -0
- package/dist/{ThreePathTracingService-Bv1CmdCK.cjs → ThreePathTracingService-CexSoU8l.cjs} +1 -1
- package/dist/{ThreePathTracingService-CRv4tDno.js → ThreePathTracingService-DTwEWxOo.js} +1 -1
- package/dist/{index-1KtcaoH6.js → index-CklTozD_.js} +1322 -1280
- package/dist/index-Ha8qaqKC.cjs +11 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/simple-viewer.cjs +1 -1
- package/dist/simple-viewer.es.js +1 -1
- package/package.json +1 -1
- package/dist/index-C4Chx9Wl.cjs +0 -11
package/README.md
CHANGED
|
@@ -193,6 +193,12 @@ const options: SimpleViewerOptions = {
|
|
|
193
193
|
backgroundColor: '#f0f0f7',
|
|
194
194
|
staticScene: false, // stop the render loop when nothing moves
|
|
195
195
|
|
|
196
|
+
// Unit your model is authored in: meters (default) | centimeters | millimeters
|
|
197
|
+
// | feet | inches. Non-meter models are rescaled on load to the viewer's
|
|
198
|
+
// 1-unit-=-1-meter convention (the real-scale floor, shadows and framing
|
|
199
|
+
// depend on it) without touching the model's own transform.
|
|
200
|
+
units: 'meters',
|
|
201
|
+
|
|
196
202
|
camera: { position: [60, 60, 60], fov: 45, autoFitToObject: true },
|
|
197
203
|
|
|
198
204
|
// The procedural studio environment lights the scene by default (zero network
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("three"),T=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("three"),T=require("./index-Ha8qaqKC.cjs");function $e(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const A=$e(l);function je(s){switch(s){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function Ye(s){switch(s){case 1:return l.RedFormat;case 2:return l.RGFormat;case 3:return l.RGBAFormat;case 4:return l.RGBAFormat}}function de(s){switch(s){case 1:return l.RedIntegerFormat;case 2:return l.RGIntegerFormat;case 3:return l.RGBAIntegerFormat;case 4:return l.RGBAIntegerFormat}}class Oe extends l.DataTexture{constructor(){super(),this.minFilter=l.NearestFilter,this.magFilter=l.NearestFilter,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,r=e.itemSize,i=e.count;if(t!==null){if(r*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*r/t}const o=e.itemSize,a=e.count,c=e.normalized,h=e.array.constructor,d=h.BYTES_PER_ELEMENT;let m=this._forcedType,f=o;if(m===null)switch(h){case Float32Array:m=l.FloatType;break;case Uint8Array:case Uint16Array:case Uint32Array:m=l.UnsignedIntType;break;case Int8Array:case Int16Array:case Int32Array:m=l.IntType;break}let n,x,p,v,u=je(o);switch(m){case l.FloatType:p=1,x=Ye(o),c&&d===1?(v=h,u+="8",h===Uint8Array?n=l.UnsignedByteType:(n=l.ByteType,u+="_SNORM")):(v=Float32Array,u+="32F",n=l.FloatType);break;case l.IntType:u+=d*8+"I",p=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,x=de(o),d===1?(v=Int8Array,n=l.ByteType):d===2?(v=Int16Array,n=l.ShortType):(v=Int32Array,n=l.IntType);break;case l.UnsignedIntType:u+=d*8+"UI",p=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,x=de(o),d===1?(v=Uint8Array,n=l.UnsignedByteType):d===2?(v=Uint16Array,n=l.UnsignedShortType):(v=Uint32Array,n=l.UnsignedIntType);break}f===3&&(x===l.RGBAFormat||x===l.RGBAIntegerFormat)&&(f=4);const g=Math.ceil(Math.sqrt(a))||1,y=f*g*g,b=new v(y),w=e.normalized;e.normalized=!1;for(let R=0;R<a;R++){const _=f*R;b[_]=e.getX(R)/p,o>=2&&(b[_+1]=e.getY(R)/p),o>=3&&(b[_+2]=e.getZ(R)/p,f===4&&(b[_+3]=1)),o>=4&&(b[_+3]=e.getW(R)/p)}e.normalized=w,this.internalFormat=u,this.format=x,this.type=n,this.image.width=g,this.image.height=g,this.image.data=b,this.needsUpdate=!0,this.dispose(),e.itemSize=r,e.count=i}}class Be extends Oe{constructor(){super(),this._forcedType=l.UnsignedIntType}}class Ne extends Oe{constructor(){super(),this._forcedType=l.FloatType}}class Xe{constructor(){this.index=new Be,this.position=new Ne,this.bvhBounds=new l.DataTexture,this.bvhContents=new l.DataTexture,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(Ke(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const r=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==r.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=T.getIndexArray(T.getVertexCount(t));this._cachedIndexAttr=new l.BufferAttribute(i,1,!1)}Qe(t,r,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:r,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),r&&r.dispose(),i&&i.dispose()}}function Qe(s,e,t){const r=t.array,i=s.index?s.index.array:null;for(let o=0,a=e.length;o<a;o++){const c=3*o,h=3*e[o];for(let d=0;d<3;d++)r[c+d]=i?i[h+d]:h+d}}function Ke(s,e,t){const r=s._roots;if(r.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=r[0],o=new Uint16Array(i),a=new Uint32Array(i),c=new Float32Array(i),h=i.byteLength/T.BYTES_PER_NODE,d=2*Math.ceil(Math.sqrt(h/2)),m=new Float32Array(4*d*d),f=Math.ceil(Math.sqrt(h)),n=new Uint32Array(2*f*f);for(let x=0;x<h;x++){const p=x*T.BYTES_PER_NODE/4,v=p*2,u=T.BOUNDING_DATA_INDEX(p);for(let g=0;g<3;g++)m[8*x+0+g]=c[u+0+g],m[8*x+4+g]=c[u+3+g];if(T.IS_LEAF(v,o)){const g=T.COUNT(v,o),y=T.OFFSET(p,a),b=T.LEAFNODE_MASK_32|g;n[x*2+0]=b,n[x*2+1]=y}else{const g=a[p+6],y=T.SPLIT_AXIS(p,a);n[x*2+0]=y,n[x*2+1]=g}}e.image.data=m,e.image.width=d,e.image.height=d,e.format=l.RGBAFormat,e.type=l.FloatType,e.internalFormat="RGBA32F",e.minFilter=l.NearestFilter,e.magFilter=l.NearestFilter,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=n,t.image.width=f,t.image.height=f,t.format=l.RGIntegerFormat,t.type=l.UnsignedIntType,t.internalFormat="RG32UI",t.minFilter=l.NearestFilter,t.magFilter=l.NearestFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const Ze=`
|
|
2
2
|
|
|
3
3
|
// A stack of uint32 indices can can store the indices for
|
|
4
4
|
// a perfectly balanced tree with a depth up to 31. Lower stack
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as H from "three";
|
|
2
2
|
import { UnsignedIntType as re, DataTexture as M, NearestFilter as T, IntType as Te, FloatType as R, UnsignedByteType as _e, UnsignedShortType as Mt, ByteType as Be, ShortType as At, RGBAFormat as I, RGBAIntegerFormat as Me, RGIntegerFormat as ut, RedIntegerFormat as Ft, RGFormat as ht, RedFormat as me, BufferAttribute as P, BufferGeometry as $, Matrix4 as O, Matrix3 as Ct, Vector3 as C, Vector4 as J, MeshBasicMaterial as Dt, Mesh as ft, OrthographicCamera as Pt, Float32BufferAttribute as He, ShaderMaterial as pe, NoBlending as ie, WebGLRenderTarget as ae, Vector2 as j, PerspectiveCamera as dt, DataUtils as k, HalfFloatType as D, LinearFilter as F, RepeatWrapping as z, ClampToEdgeWrapping as N, Source as Et, Quaternion as kt, DataArrayTexture as Ot, DoubleSide as zt, BackSide as Nt, FrontSide as Bt, WebGLArrayRenderTarget as Ht, Color as se, NoToneMapping as Wt, NormalBlending as mt, EquirectangularReflectionMapping as pt, Spherical as Lt, LinearMipMapLinearFilter as Ut, Clock as Vt, Scene as Gt, AdditiveBlending as qt } from "three";
|
|
3
|
-
import { g as $t, a as jt, B as We, I as Yt, C as Xt, O as Qt, S as Kt, b as Zt, L as Jt, c as er, M as tr, T as rr, D as ar, R as S, d as W, E as L, h as Le } from "./index-
|
|
3
|
+
import { g as $t, a as jt, B as We, I as Yt, C as Xt, O as Qt, S as Kt, b as Zt, L as Jt, c as er, M as tr, T as rr, D as ar, R as S, d as W, E as L, h as Le } from "./index-CklTozD_.js";
|
|
4
4
|
function ir(s) {
|
|
5
5
|
switch (s) {
|
|
6
6
|
case 1:
|