From 2c228a6a76df6d5f0c8c700b68d3d4ef6fd395ca Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 19 Mar 2025 20:45:07 +0100 Subject: [PATCH] Simplify `Mesh` --- crates/fj-interop/src/mesh.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/fj-interop/src/mesh.rs b/crates/fj-interop/src/mesh.rs index 65eefc1b7..bef8457a1 100644 --- a/crates/fj-interop/src/mesh.rs +++ b/crates/fj-interop/src/mesh.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, hash::Hash}; +use std::collections::HashMap; use fj_math::{Aabb, Point}; @@ -14,17 +14,14 @@ pub struct Mesh { triangles: Vec, } -impl Mesh -where - V: Copy + Eq + Hash, -{ +impl Mesh> { /// Construct a new instance of `Mesh` pub fn new() -> Self { Self::default() } /// Add a vertex to the mesh - pub fn push_vertex(&mut self, vertex: V) { + pub fn push_vertex(&mut self, vertex: Point<3>) { let index = *self.indices_by_vertex.entry(vertex).or_insert_with(|| { let index = self.vertices.len(); @@ -56,7 +53,7 @@ where } /// Access the vertices of the mesh - pub fn vertices(&self) -> impl Iterator + '_ { + pub fn vertices(&self) -> impl Iterator> + '_ { self.vertices.iter().copied() }