Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.1.77"
version = "0.1.78"
rust-version = "1.99.0"

[workspace.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use super::{ARGS, CUBE, OrcaRunner, golden, run_ares, stages};

#[path = "normal_support/brim.rs"]
mod brim;
#[path = "normal_support/painted_blocker.rs"]
mod painted_blocker;
#[path = "normal_support/support_volumes.rs"]
mod support_volumes;
#[path = "normal_support/tree_slot_cases.rs"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ fn grid_support_clips_outer_brim_on_belt_copies() {
);
}

#[test]
fn snug_support_clips_outer_brim_on_belt_copies() {
let mut settings = OUTER_BRIM.to_vec();
settings.push(("support_style", "snug"));
let input = fixture_on(ACROSS, Axis::X, "0", &settings);
belt_print::compare_project_with_native("belt-snug-support-with-outer-brim", input, |gcode| {
let support = extract_extrusions(gcode);
assert!(!support.base.is_empty() && !support.interface.is_empty());
let brim = Brim::observe_snug_contact(gcode);
assert!(brim.shortened, "Native clips the brim beside Snug support");
assert!(!brim.full_width, "Native omits the unclipped segment");
});
}

#[test]
fn prints_grid_support_without_outer_brim() {
let input = fixture_on(ACROSS, Axis::X, "0", &[]);
Expand All @@ -34,7 +48,14 @@ fn prints_outer_brim_without_grid_support() {
belt_print::compare_project_with_native(
"belt-outer-brim-without-grid-support",
input,
assert_unclipped_brim_without_support,
|gcode| {
assert_unclipped_brim_without_support(gcode);
let brim = Brim::observe_snug_contact(gcode);
assert!(
brim.full_width && !brim.shortened,
"without Snug support the brim segment is unclipped"
);
},
);
}

Expand Down Expand Up @@ -234,7 +255,7 @@ fn positive_motion<'a>(
delta > 0.0 && xyz
}

fn single_placement(settings: &[(&str, &str)]) -> Vec<u8> {
pub(super) fn single_placement(settings: &[(&str, &str)]) -> Vec<u8> {
let project = fixture_on(ACROSS, Axis::X, "0", settings);
belt_print::rewrite_project(&project, |name, bytes| {
let (entry, second) = match name {
Expand Down Expand Up @@ -292,6 +313,14 @@ struct Brim {

impl Brim {
fn observe(gcode: &str) -> Self {
Self::observe_contact(gcode, [49.229, 0.325, 100.567], 53.0, 52.18)
}

fn observe_snug_contact(gcode: &str) -> Self {
Self::observe_contact(gcode, [49.315, 0.325, 99.719], 68.688, 52.603)
}

fn observe_contact(gcode: &str, start: [f64; 3], full: f64, clipped: f64) -> Self {
let mut result = Self::default();
let (mut role, mut relative_e) = ("", false);
let mut xyz = [f64::NAN; 3];
Expand Down Expand Up @@ -321,13 +350,12 @@ impl Brim {
}
assert!(relative_e, "the fixture prints with relative E");
result.has_motion = true;
let start = [49.229, 0.325, 100.567];
let segment_ends_at = |x| {
let end = [x, start[1], start[2]];
(old == start && xyz == end) || (xyz == start && old == end)
};
result.full_width |= segment_ends_at(53.0);
result.shortened |= segment_ends_at(52.18);
result.full_width |= segment_ends_at(full);
result.shortened |= segment_ends_at(clipped);
}
result
}
Expand Down
Loading
Loading