Cleanup / fix clippy lints
This commit is contained in:
@@ -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,
|
||||||
|
@@ -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,
|
||||||
});
|
});
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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();
|
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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user