Skip to content

Commit

Permalink
remove extra changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jul 17, 2024
1 parent c75201e commit 129e692
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
7 changes: 2 additions & 5 deletions src/input/polyanya_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io::{self, BufRead, Read, Write};

use glam::Vec2;

use crate::{Layer, Mesh, MeshError, Polygon, Vertex};
use crate::{Mesh, MeshError, Polygon, Vertex};

/// A mesh read from a Polyanya file in the format `mesh 2`.
///
Expand Down Expand Up @@ -142,10 +142,7 @@ impl TryFrom<PolyanyaFile> for Mesh {
type Error = MeshError;

fn try_from(value: PolyanyaFile) -> Result<Self, Self::Error> {
Ok(Mesh {
layers: vec![Layer::new(value.vertices, value.polygons)?],
..Default::default()
})
Mesh::new(value.vertices, value.polygons)
}
}

Expand Down
7 changes: 2 additions & 5 deletions src/input/trimesh.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{Layer, Mesh, MeshError, Polygon, Vertex};
use crate::{Mesh, MeshError, Polygon, Vertex};
use glam::Vec2;
use std::cmp::Ordering;
use std::iter;
Expand Down Expand Up @@ -120,10 +120,7 @@ impl TryFrom<Trimesh> for Mesh {
.into_iter()
.map(|vertex| Vertex::new(vertex.coords, vertex.polygons))
.collect();
Ok(Mesh {
layers: vec![Layer::new(vertices, polygons)?],
..Default::default()
})
Self::new(vertices, polygons)
}
}

Expand Down
7 changes: 0 additions & 7 deletions tests/triangulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,6 @@ fn is_in_mesh_overlapping_simplified() {
for j in 0..(10 * resolution) {
let point = vec2(i as f32 / resolution as f32, j as f32 / resolution as f32);
assert_eq!(mesh.point_in_mesh(point), mesh_before.point_in_mesh(point));
match (mesh.point_in_mesh(point), mesh_before.point_in_mesh(point)) {
(true, true) => print!(" "),
(true, false) => print!("."),
(false, true) => print!("^"),
(false, false) => print!("#"),
}
}
println!("");
}
}

0 comments on commit 129e692

Please sign in to comment.