Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda