Skip to content

Commit

Permalink
fix triangle return
Browse files Browse the repository at this point in the history
  • Loading branch information
sowa705 committed Dec 8, 2024
1 parent 81a0c8c commit f73bd60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .idea/.idea.MeshSimplifier/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.1.0</Version>
<Version>0.1.1</Version>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>12</LangVersion>
<Authors>Łukasz Sowa</Authors>
Expand Down
2 changes: 1 addition & 1 deletion src/MeshSimplifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,7 @@ public Mesh ToMesh()
{
var mesh = new Mesh();
mesh.vertices = Vertices.ToArray();
mesh.triangles = this.triangles.Data.SelectMany(x=>(new int[] { x.v0, x.v1, x.v2 })).ToArray();
mesh.triangles = this.triangles.Data.Take(triangles.Length).SelectMany(x=>(new int[] { x.v0, x.v1, x.v2 })).ToArray();
mesh.textureCoordinates = [this.UV1.ToArray()];
mesh.colors = this.Colors.ToArray();
mesh.normals = this.Normals.ToArray();
Expand Down

0 comments on commit f73bd60

Please sign in to comment.