How can I create a Mesh in Unity from a .stl file

Hello,
How can I create a Mesh in Unity from a .stl file where I have for each triangle the 3 vertex position (xyz) and the normal vector? Thank you

Unity does not have native support for .stl files. You can either write your own reader, get one from the asset store or If you dont need to do it at runtime then just convert the file to fbx, Blender is good for this :wink:

If you can parse the .stl file, you can build the Mesh dynamically. Check out the docs, specifically the “Building a mesh from scratch” example.

1 Like

Searching on the forums can sometimes bear fruit: STL-file and vertex normals - Unity Engine - Unity Discussions

1 Like

Just to note it could be really scary importing raw .stl files. Not that you can’t, but its most likely that doing so will result in an unacceptable performance environment. However if the linked tool has poly reduction controls then you’ll have more control over it and might be able to get more realistic polycounts.