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 ThreeJSAnswer:
You can use theSTLLoader
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.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!