Cleanup / fix clippy lints

This commit is contained in:
Connor Slade
2024-08-07 20:24:14 -04:00
parent 2e818d4f4f
commit 34cde7c569
5 changed files with 11 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ pub struct SliceResult<'a, Layer> {
pub slice_config: &'a SliceConfig,
}
#[derive(Debug)]
pub struct Run {
pub length: u64,
pub value: u8,

View File

@@ -109,13 +109,13 @@ impl SlicePreviewPipeline {
})
.collect::<Vec<_>>();
let vertex_buffer = device.create_buffer_init(&BufferInitDescriptor {
label: Some("Platform Vertex Buffer"),
label: None,
contents: bytemuck::cast_slice(&vert),
usage: BufferUsages::VERTEX | BufferUsages::COPY_DST,
});
let index_buffer = device.create_buffer_init(&BufferInitDescriptor {
label: Some("Platform Index Buffer"),
label: None,
contents: bytemuck::cast_slice(&[0, 1, 2]),
usage: BufferUsages::INDEX | BufferUsages::COPY_DST,
});

View File

@@ -10,8 +10,6 @@ struct Context {
struct VertexOutput {
@builtin(position)
position: vec4<f32>,
@location(1)
normal: vec3<f32>,
};
@vertex
@@ -21,7 +19,6 @@ fn vert(
) -> VertexOutput {
var out: VertexOutput;
out.position = position;
out.normal = normal;
return out;
}

View File

@@ -106,3 +106,9 @@ impl MeshBuilder {
}
}
}
impl Default for MeshBuilder {
fn default() -> Self {
Self::new()
}
}

View File

@@ -55,11 +55,9 @@ impl<'a> LineSupportGenerator<'a> {
let mut out = MeshBuilder::new();
for [origin, _normal] in overhangs {
let bottom = origin.xy().to_homogeneous();
out.add_vertical_cylinder(bottom, origin.z, self.config.support_radius, 10);
out.add_vertical_cylinder(bottom, origin.z, self.config.support_radius, 15);
}
out.save_stl("debug.stl").unwrap();
out.build()
}
@@ -109,7 +107,7 @@ impl<'a> LineSupportGenerator<'a> {
let normals = mesh.normals();
for (face, normal) in normals.iter().enumerate() {
let normal = mesh.transform_normal(&normal);
let normal = mesh.transform_normal(normal);
if normal.z >= self.config.max_origin_normal_z {
continue;
}