Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
Unable to parse STL file in Azure Blob Storage with Three.js

I am trying to use the @azure/storage-blob package to download a STL file blob for use in Three.JS as follows:

const downloadResponse = await containerClient.getBlobClient('models/Large Knob.STL').download();
const downloaded = (
  await streamToBuffer(downloadResponse.readableStreamBody)
).toString(); 
const loader = new STLLoader();
const obj = loader.parse(downloaded);

and I load it in a mesh like this:

const mesh = new Mesh(model, material);
scene.add(mesh);
const renderer = new WebGLRenderer();
renderer.render(scene, camera);

I get the following stack trace:

three.module.js?ffb8:5319 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'center')
    at Sphere.copy (webpack-internal:///./node_modules/three/build/three.module.js:5759:28)
    at Frustum.intersectsObject (webpack-internal:///./node_modules/three/build/three.module.js:12767:13)
    at projectObject (webpack-internal:///./node_modules/three/build/three.module.js:27383:45)
    at projectObject (webpack-internal:///./node_modules/three/build/three.module.js:27428:4)
    at WebGLRenderer.render (webpack-internal:///./node_modules/three/build/three.module.js:27212:3)
    at _callee$ (webpack-internal:///./pages/index.tsx:130:30)
    at tryCatch (webpack-internal:///./node_modules/next/dist/compiled/regenerator-runtime/runtime.js:45:40)
    at Generator.invoke [as _invoke] (webpack-internal:///./node_modules/next/dist/compiled/regenerator-runtime/runtime.js:274:22)
    at Generator.prototype.<computed> [as next] (webpack-internal:///./node_modules/next/dist/compiled/regenerator-runtime/runtime.js:97:21)
    at asyncGeneratorStep (webpack-internal:///./pages/index.tsx:35:28)
    at _next (webpack-internal:///./pages/index.tsx:53:17)
    at eval (webpack-internal:///./pages/index.tsx:58:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///./pages/index.tsx:50:16)
    at createScene (webpack-internal:///./pages/index.tsx:89:25)
    at Home (webpack-internal:///./pages/index.tsx:209:9)
    at renderWithHooks (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:14985:18)

I am able to successfully load and view the mesh if I use loader.load(<filepath, but as my file is hosted in Azure blob storage, I don't think this is a viable option. Any advice would be greatly appreciated

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I am not sure what STLLoader supports, but if you are running on NodeJS, BlobClient also has downloadToFile() and downloadToBuffer() methods that might be more convenient. Please check the documentation site for more information:

https://docs.microsoft.com/en-us/javascript/api/@azure/storage-blob/blobclient?view=azure-node-latest#@azure-storage-blob-blobclient-downloadtofile

https://docs.microsoft.com/en-us/javascript/api/@azure/storage-blob/blobclient?view=azure-node-latest#@azure-storage-blob-blobclient-downloadtobuffer-1

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda