New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/obj

Package Overview
Dependencies
Maintainers
0
Versions
336
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/obj - npm Package Compare versions

Comparing version 4.2.4 to 4.2.5

4

dist/dist.min.js

@@ -11,5 +11,5 @@ (function webpackUniversalModuleDefinition(root, factory) {

`)!==-1&&(o=o.replace(/\\\n/g,""));let r=o.split(`
`),t="",s="",n=0,l=[],c=typeof"".trimLeft=="function";for(let m=0,a=r.length;m<a;m++)if(t=r[m],t=c?t.trimLeft():t.trim(),n=t.length,n!==0&&(s=t.charAt(0),s!=="#"))if(s==="v"){let i=t.split(/\s+/);switch(i[0]){case"v":e.vertices.push(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])),i.length>=7&&e.colors.push(parseFloat(i[4]),parseFloat(i[5]),parseFloat(i[6]));break;case"vn":e.normals.push(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]));break;case"vt":e.uvs.push(parseFloat(i[1]),parseFloat(i[2]));break;default:}}else if(s==="f"){let h=t.substr(1).trim().split(/\s+/),p=[];for(let d=0,g=h.length;d<g;d++){let y=h[d];if(y.length>0){let x=y.split("/");p.push(x)}}let b=p[0];for(let d=1,g=p.length-1;d<g;d++){let y=p[d],x=p[d+1];e.addFace(b[0],y[0],x[0],b[1],y[1],x[1],b[2],y[2],x[2])}}else if(s==="l"){let i=t.substring(1).trim().split(" "),h,p=[];if(t.indexOf("/")===-1)h=i;else{h=[];for(let b=0,d=i.length;b<d;b++){let g=i[b].split("/");g[0]!==""&&h.push(g[0]),g[1]!==""&&p.push(g[1])}}e.addLineGeometry(h,p)}else if(s==="p"){let h=t.substr(1).trim().split(" ");e.addPointGeometry(h)}else if((l=Q.exec(t))!==null){let i=(" "+l[0].substr(1).trim()).substr(1);e.startObject(i)}else if(q.test(t))e.object.startMaterial(t.substring(7).trim(),e.materialLibraries);else if($.test(t))e.materialLibraries.push(t.substring(7).trim());else if(s==="s"){if(l=t.split(" "),l.length>1){let h=l[1].trim().toLowerCase();e.object.smooth=h!=="0"&&h!=="off"}else e.object.smooth=!0;let i=e.object.currentMaterial();i&&(i.smooth=e.object.smooth)}else{if(t==="\0")continue;throw new Error(`Unexpected line: "${t}"`)}e.finalize();let u=[],f=[];for(let m of e.objects){let{geometry:a}=m;if(a.vertices.length===0)continue;let i={header:{vertexCount:a.vertices.length/3},attributes:{}};switch(a.type){case"Points":i.mode=0;break;case"Line":i.mode=1;break;default:i.mode=4;break}i.attributes.POSITION={value:new Float32Array(a.vertices),size:3},a.normals.length>0&&(i.attributes.NORMAL={value:new Float32Array(a.normals),size:3}),a.colors.length>0&&(i.attributes.COLOR_0={value:new Float32Array(a.colors),size:3}),a.uvs.length>0&&(i.attributes.TEXCOORD_0={value:new Float32Array(a.uvs),size:2}),i.materials=[];for(let h of m.materials){let p={name:h.name,flatShading:!h.smooth};i.materials.push(p),f.push(p)}i.name=m.name,u.push(i)}return{meshes:u,materials:f}}function C(o,e={}){let r={};for(let s in e)s!=="value"&&(r[s]=JSON.stringify(e[s]));let t=[];for(let s in o){let n=o[s],l=H(s,n);t.push(l)}return{fields:t,metadata:r}}function H(o,e){let r={};for(let n in e)n!=="value"&&(r[n]=JSON.stringify(e[n]));let{type:t}=O(e.value);return e.size===1||e.size===void 0||(t={type:"fixed-size-list",listSize:e.size,children:[{name:"values",type:t}]}),{name:o,type:t,nullable:!1,metadata:r}}function M(o,e){let{meshes:r}=R(o),t=r.reduce((c,u)=>c+u.header.vertexCount,0),s=K(r,t),n={vertexCount:t,boundingBox:j(s)},l=C(s,{mode:4,boundingBox:n.boundingBox});return{loaderData:{header:{}},schema:l,header:n,mode:4,topology:"point-list",attributes:s}}function K(o,e){let r=new Float32Array(e*3),t,s,n,l=0;for(let u of o){let{POSITION:f,NORMAL:m,COLOR_0:a,TEXCOORD_0:i}=u.attributes;r.set(f.value,l*3),m&&(t=t||new Float32Array(e*3),t.set(m.value,l*3)),a&&(s=s||new Float32Array(e*3),s.set(a.value,l*3)),i&&(n=n||new Float32Array(e*2),n.set(i.value,l*2)),l+=f.value.length/3}let c={};return c.POSITION={value:r,size:3},t&&(c.NORMAL={value:t,size:3}),s&&(c.COLOR_0={value:s,size:3}),n&&(c.TEXCOORD_0={value:n,size:2}),c}var ee="4.2.3",S={dataType:null,batchType:null,name:"OBJ",id:"obj",module:"obj",version:ee,worker:!0,extensions:["obj"],mimeTypes:["text/plain"],testText:te,options:{obj:{}}};function te(o){return o[0]==="v"}var re=/\s+/;function B(o,e){let r=[],t={name:"placeholder"},s=o.split(`
`);for(let n of s){if(n=n.trim(),n.length===0||n.charAt(0)==="#")continue;let l=n.indexOf(" "),c=l>=0?n.substring(0,l):n;c=c.toLowerCase();let u=l>=0?n.substring(l+1):"";switch(u=u.trim(),c){case"newmtl":t={name:u},r.push(t);break;case"ka":t.ambientColor=F(u);break;case"kd":t.diffuseColor=F(u);break;case"map_kd":t.diffuseTextureUrl=u;break;case"ks":t.specularColor=F(u);break;case"map_ks":t.specularTextureUrl=u;break;case"ke":t.emissiveColor=F(u);break;case"map_ke":t.emissiveTextureUrl=u;break;case"ns":t.shininess=parseFloat(u);break;case"map_ns":break;case"ni":t.refraction=parseFloat(u);break;case"illum":t.illumination=parseFloat(u);break;default:break}}return r}function F(o,e){let r=o.split(re,3);return[parseFloat(r[0]),parseFloat(r[1]),parseFloat(r[2])]}var se="4.2.3",N={dataType:null,batchType:null,name:"MTL",id:"mtl",module:"mtl",version:se,worker:!0,extensions:["mtl"],mimeTypes:["text/plain"],testText:o=>o.includes("newmtl"),options:{mtl:{}}};var oe={...S,parse:async(o,e)=>M(new TextDecoder().decode(o),e),parseTextSync:(o,e)=>M(o,e)},ne={...N,parse:async(o,e)=>B(new TextDecoder().decode(o),e?.mtl),parseTextSync:(o,e)=>B(o,e?.mtl)};return Y(v);})();
`),t="",s="",n=0,l=[],c=typeof"".trimLeft=="function";for(let m=0,a=r.length;m<a;m++)if(t=r[m],t=c?t.trimLeft():t.trim(),n=t.length,n!==0&&(s=t.charAt(0),s!=="#"))if(s==="v"){let i=t.split(/\s+/);switch(i[0]){case"v":e.vertices.push(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])),i.length>=7&&e.colors.push(parseFloat(i[4]),parseFloat(i[5]),parseFloat(i[6]));break;case"vn":e.normals.push(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]));break;case"vt":e.uvs.push(parseFloat(i[1]),parseFloat(i[2]));break;default:}}else if(s==="f"){let h=t.substr(1).trim().split(/\s+/),p=[];for(let d=0,g=h.length;d<g;d++){let y=h[d];if(y.length>0){let x=y.split("/");p.push(x)}}let b=p[0];for(let d=1,g=p.length-1;d<g;d++){let y=p[d],x=p[d+1];e.addFace(b[0],y[0],x[0],b[1],y[1],x[1],b[2],y[2],x[2])}}else if(s==="l"){let i=t.substring(1).trim().split(" "),h,p=[];if(t.indexOf("/")===-1)h=i;else{h=[];for(let b=0,d=i.length;b<d;b++){let g=i[b].split("/");g[0]!==""&&h.push(g[0]),g[1]!==""&&p.push(g[1])}}e.addLineGeometry(h,p)}else if(s==="p"){let h=t.substr(1).trim().split(" ");e.addPointGeometry(h)}else if((l=Q.exec(t))!==null){let i=(" "+l[0].substr(1).trim()).substr(1);e.startObject(i)}else if(q.test(t))e.object.startMaterial(t.substring(7).trim(),e.materialLibraries);else if($.test(t))e.materialLibraries.push(t.substring(7).trim());else if(s==="s"){if(l=t.split(" "),l.length>1){let h=l[1].trim().toLowerCase();e.object.smooth=h!=="0"&&h!=="off"}else e.object.smooth=!0;let i=e.object.currentMaterial();i&&(i.smooth=e.object.smooth)}else{if(t==="\0")continue;throw new Error(`Unexpected line: "${t}"`)}e.finalize();let u=[],f=[];for(let m of e.objects){let{geometry:a}=m;if(a.vertices.length===0)continue;let i={header:{vertexCount:a.vertices.length/3},attributes:{}};switch(a.type){case"Points":i.mode=0;break;case"Line":i.mode=1;break;default:i.mode=4;break}i.attributes.POSITION={value:new Float32Array(a.vertices),size:3},a.normals.length>0&&(i.attributes.NORMAL={value:new Float32Array(a.normals),size:3}),a.colors.length>0&&(i.attributes.COLOR_0={value:new Float32Array(a.colors),size:3}),a.uvs.length>0&&(i.attributes.TEXCOORD_0={value:new Float32Array(a.uvs),size:2}),i.materials=[];for(let h of m.materials){let p={name:h.name,flatShading:!h.smooth};i.materials.push(p),f.push(p)}i.name=m.name,u.push(i)}return{meshes:u,materials:f}}function C(o,e={}){let r={};for(let s in e)s!=="value"&&(r[s]=JSON.stringify(e[s]));let t=[];for(let s in o){let n=o[s],l=H(s,n);t.push(l)}return{fields:t,metadata:r}}function H(o,e){let r={};for(let n in e)n!=="value"&&(r[n]=JSON.stringify(e[n]));let{type:t}=O(e.value);return e.size===1||e.size===void 0||(t={type:"fixed-size-list",listSize:e.size,children:[{name:"values",type:t}]}),{name:o,type:t,nullable:!1,metadata:r}}function M(o,e){let{meshes:r}=R(o),t=r.reduce((c,u)=>c+u.header.vertexCount,0),s=K(r,t),n={vertexCount:t,boundingBox:j(s)},l=C(s,{mode:4,boundingBox:n.boundingBox});return{loaderData:{header:{}},schema:l,header:n,mode:4,topology:"point-list",attributes:s}}function K(o,e){let r=new Float32Array(e*3),t,s,n,l=0;for(let u of o){let{POSITION:f,NORMAL:m,COLOR_0:a,TEXCOORD_0:i}=u.attributes;r.set(f.value,l*3),m&&(t=t||new Float32Array(e*3),t.set(m.value,l*3)),a&&(s=s||new Float32Array(e*3),s.set(a.value,l*3)),i&&(n=n||new Float32Array(e*2),n.set(i.value,l*2)),l+=f.value.length/3}let c={};return c.POSITION={value:r,size:3},t&&(c.NORMAL={value:t,size:3}),s&&(c.COLOR_0={value:s,size:3}),n&&(c.TEXCOORD_0={value:n,size:2}),c}var ee="4.2.4",S={dataType:null,batchType:null,name:"OBJ",id:"obj",module:"obj",version:ee,worker:!0,extensions:["obj"],mimeTypes:["text/plain"],testText:te,options:{obj:{}}};function te(o){return o[0]==="v"}var re=/\s+/;function B(o,e){let r=[],t={name:"placeholder"},s=o.split(`
`);for(let n of s){if(n=n.trim(),n.length===0||n.charAt(0)==="#")continue;let l=n.indexOf(" "),c=l>=0?n.substring(0,l):n;c=c.toLowerCase();let u=l>=0?n.substring(l+1):"";switch(u=u.trim(),c){case"newmtl":t={name:u},r.push(t);break;case"ka":t.ambientColor=F(u);break;case"kd":t.diffuseColor=F(u);break;case"map_kd":t.diffuseTextureUrl=u;break;case"ks":t.specularColor=F(u);break;case"map_ks":t.specularTextureUrl=u;break;case"ke":t.emissiveColor=F(u);break;case"map_ke":t.emissiveTextureUrl=u;break;case"ns":t.shininess=parseFloat(u);break;case"map_ns":break;case"ni":t.refraction=parseFloat(u);break;case"illum":t.illumination=parseFloat(u);break;default:break}}return r}function F(o,e){let r=o.split(re,3);return[parseFloat(r[0]),parseFloat(r[1]),parseFloat(r[2])]}var se="4.2.4",N={dataType:null,batchType:null,name:"MTL",id:"mtl",module:"mtl",version:se,worker:!0,extensions:["mtl"],mimeTypes:["text/plain"],testText:o=>o.includes("newmtl"),options:{mtl:{}}};var oe={...S,parse:async(o,e)=>M(new TextDecoder().decode(o),e),parseTextSync:(o,e)=>M(o,e)},ne={...N,parse:async(o,e)=>B(new TextDecoder().decode(o),e?.mtl),parseTextSync:(o,e)=>B(o,e?.mtl)};return Y(v);})();
return __exports__;
});
// __VERSION__ is injected by babel-plugin-version-inline
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const VERSION = typeof "4.2.3" !== 'undefined' ? "4.2.3" : 'latest';
const VERSION = typeof "4.2.4" !== 'undefined' ? "4.2.4" : 'latest';
/**

@@ -5,0 +5,0 @@ * Loader for the MTL material format

// __VERSION__ is injected by babel-plugin-version-inline
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const VERSION = typeof "4.2.3" !== 'undefined' ? "4.2.3" : 'latest';
const VERSION = typeof "4.2.4" !== 'undefined' ? "4.2.4" : 'latest';
/**

@@ -5,0 +5,0 @@ * Worker loader for the OBJ geometry format

@@ -744,3 +744,3 @@ "use strict";

// src/obj-loader.ts
var VERSION = true ? "4.2.3" : "latest";
var VERSION = true ? "4.2.4" : "latest";
var OBJLoader = {

@@ -835,3 +835,3 @@ dataType: null,

// src/mtl-loader.ts
var VERSION2 = true ? "4.2.3" : "latest";
var VERSION2 = true ? "4.2.4" : "latest";
var MTLLoader = {

@@ -838,0 +838,0 @@ dataType: null,

{
"name": "@loaders.gl/obj",
"version": "4.2.4",
"version": "4.2.5",
"description": "Framework-independent loader for the OBJ format",

@@ -45,4 +45,4 @@ "license": "MIT",

"dependencies": {
"@loaders.gl/loader-utils": "4.2.4",
"@loaders.gl/schema": "4.2.4"
"@loaders.gl/loader-utils": "4.2.5",
"@loaders.gl/schema": "4.2.5"
},

@@ -52,3 +52,3 @@ "peerDependencies": {

},
"gitHead": "68ce51cb8ef8ca55a9cc66801e0aff504e925bb9"
"gitHead": "9279ea41bf49a2fdf895520888301315f871bb10"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc