Cleanup / fix clippy lints
This commit is contained in:
@@ -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,
|
||||
|
@@ -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,
|
||||
});
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -106,3 +106,9 @@ impl MeshBuilder {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for MeshBuilder {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user