From 129e6923e888bd5414f447d9b85faace27e88fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 17 Jul 2024 23:44:28 +0200 Subject: [PATCH] remove extra changes --- src/input/polyanya_file.rs | 7 ++----- src/input/trimesh.rs | 7 ++----- tests/triangulation.rs | 7 ------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/input/polyanya_file.rs b/src/input/polyanya_file.rs index 8602a64..a2e608d 100644 --- a/src/input/polyanya_file.rs +++ b/src/input/polyanya_file.rs @@ -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`. /// @@ -142,10 +142,7 @@ impl TryFrom for Mesh { type Error = MeshError; fn try_from(value: PolyanyaFile) -> Result { - Ok(Mesh { - layers: vec![Layer::new(value.vertices, value.polygons)?], - ..Default::default() - }) + Mesh::new(value.vertices, value.polygons) } } diff --git a/src/input/trimesh.rs b/src/input/trimesh.rs index 01804d1..93f864f 100644 --- a/src/input/trimesh.rs +++ b/src/input/trimesh.rs @@ -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; @@ -120,10 +120,7 @@ impl TryFrom 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) } } diff --git a/tests/triangulation.rs b/tests/triangulation.rs index 9edd86c..bab5087 100644 --- a/tests/triangulation.rs +++ b/tests/triangulation.rs @@ -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!(""); } }