• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to read triangles and vertices of the model from the STL format?

Resolved: How to read triangles and vertices of the model from the STL format?

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

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

Answer:

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.
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

If you have better answer, please add a comment about this, thank you!

javascript stl-format three.js
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Vaadin 14.9 – Redirect on Session Destroy Event

26/03/2023

Resolved: How to separate multiple answers in one column, for multiple columns, by creating extra columns

26/03/2023

Resolved: How to set consistent decimal separators in R data frame?

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.