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, pub slice_config: &'a SliceConfig,
} }
#[derive(Debug)]
pub struct Run { pub struct Run {
pub length: u64, pub length: u64,
pub value: u8, pub value: u8,

View File

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

View File

@@ -10,8 +10,6 @@ struct Context {
struct VertexOutput { struct VertexOutput {
@builtin(position) @builtin(position)
position: vec4<f32>, position: vec4<f32>,
@location(1)
normal: vec3<f32>,
}; };
@vertex @vertex
@@ -21,7 +19,6 @@ fn vert(
) -> VertexOutput { ) -> VertexOutput {
var out: VertexOutput; var out: VertexOutput;
out.position = position; out.position = position;
out.normal = normal;
return out; 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(); let mut out = MeshBuilder::new();
for [origin, _normal] in overhangs { for [origin, _normal] in overhangs {
let bottom = origin.xy().to_homogeneous(); 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() out.build()
} }
@@ -109,7 +107,7 @@ impl<'a> LineSupportGenerator<'a> {
let normals = mesh.normals(); let normals = mesh.normals();
for (face, normal) in normals.iter().enumerate() { 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 { if normal.z >= self.config.max_origin_normal_z {
continue; continue;
} }