Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

125
Vistas
How to read triangles and vertices of the model from the STL format?

I need to get information about the vertices and triangles of the STL format model, please tell me how to extract this data in ThreeJS

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use the STLLoader class for this task. So you define an instance of the loader and use it to load a STL asset from a specific path. In the onLoad() callback, you get an instance of BufferGeometry representing the geometry data from the STL file.

const loader = new STLLoader();
loader.load( './models/stl/ascii/slotted_disk.stl', function ( geometry ) {

    const material = new THREE.MeshBasicMaterial();
    const mesh = new THREE.Mesh( geometry, material );

    scene.add( mesh );

} );

Keep in mind that the geometry is non-indexed. So the faces/triangles are defined by three consecutive vertices in the position buffer attribute.

Full example: https://threejs.org/examples/webgl_loader_stl

7 months 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 empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.