diff --git a/unity/Editor/Importer/StlMeshParser.cs b/unity/Editor/Importer/StlMeshParser.cs index 207218dc03..3a2b157d9c 100644 --- a/unity/Editor/Importer/StlMeshParser.cs +++ b/unity/Editor/Importer/StlMeshParser.cs @@ -60,11 +60,13 @@ public static Mesh ParseBinary(byte[] stlFileContents, Vector3 scale) { reader.ReadBytes(_headerLength); var numTriangles = reader.ReadUInt32(); var numVertices = numTriangles * _verticesPerTriangle; + /* if (numVertices > _unityLimitNumVerticesPerMesh) { throw new IndexOutOfRangeException( "The mesh exceeds the number of vertices per mesh allowed by Unity. " + $"({numVertices} > {_unityLimitNumVerticesPerMesh})"); } + */ var triangleIndices = new List(capacity: (int)numVertices); var vertices = new List(capacity: (int)numVertices); var normals = new List(capacity: (int)numVertices); @@ -80,6 +82,7 @@ public static Mesh ParseBinary(byte[] stlFileContents, Vector3 scale) { } var mesh = new Mesh(); + mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; mesh.vertices = vertices.ToArray(); mesh.normals = normals.ToArray(); mesh.triangles = triangleIndices.ToArray();