mirror of
https://github.com/hannobraun/Fornjot
synced 2025-07-04 17:16:06 +00:00
Remove redundant code
This commit is contained in:
parent
a5d16b4e02
commit
78ee4aae2c
@ -1,16 +1,12 @@
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use fj_math::{Aabb, Point, Triangle};
|
||||
use fj_math::{Aabb, Triangle};
|
||||
|
||||
use crate::Color;
|
||||
|
||||
/// A triangle mesh
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct TriMesh {
|
||||
vertices: Vec<Point<3>>,
|
||||
indices: Vec<Index>,
|
||||
|
||||
indices_by_vertex: HashMap<Point<3>, Index>,
|
||||
triangles: Vec<MeshTriangle>,
|
||||
}
|
||||
|
||||
@ -28,17 +24,6 @@ impl TriMesh {
|
||||
) {
|
||||
let triangle = triangle.into();
|
||||
|
||||
for point in triangle.points {
|
||||
let index =
|
||||
*self.indices_by_vertex.entry(point).or_insert_with(|| {
|
||||
let index = self.vertices.len();
|
||||
self.vertices.push(point);
|
||||
index as u32
|
||||
});
|
||||
|
||||
self.indices.push(index);
|
||||
}
|
||||
|
||||
self.triangles.push(MeshTriangle {
|
||||
inner: triangle,
|
||||
color,
|
||||
|
Loading…
x
Reference in New Issue
Block a user