Skip to content

Commit

Permalink
Improve UI and spherical example.
Browse files Browse the repository at this point in the history
  • Loading branch information
KmolYuan committed Nov 29, 2023
1 parent fefa975 commit 1b3cd54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions four-bar-ui/src/app/proj/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use four_bar::{

const JOINT_COLOR: Color32 = Color32::from_rgb(93, 69, 56);
const LINK_COLOR: Color32 = Color32::from_rgb(165, 151, 132);
const CURVE_NAME: &[&str] = &["Driver Curve", "Follower Curve", "Coupler Curve"];

fn pick_color(i: usize) -> Color32 {
use four_bar::plot::{Color as _, Palette as _, Palette99};
Expand Down Expand Up @@ -121,10 +122,7 @@ impl ProjPlot<efd::D2> for FourBar {
}
}
}
for (i, name) in ["Driver joint", "Follower joint", "Coupler joint"]
.into_iter()
.enumerate()
{
for (i, name) in CURVE_NAME.iter().enumerate() {
let iter = curves.iter().map(|c| c[i]).collect::<Vec<_>>();
let line = egui_plot::Line::new(iter)
.name(name)
Expand Down Expand Up @@ -165,10 +163,7 @@ impl ProjPlot<efd::D3> for SFourBar {
}
}
}
for (i, name) in ["Driver joint", "Follower joint", "Coupler joint"]
.into_iter()
.enumerate()
{
for (i, name) in CURVE_NAME.iter().enumerate() {
let color = pick_color(i);
let iter = curves.iter().map(|c| c[i]);
draw_sline(ui, oz, iter, |s| s.name(name).width(3.).color(color));
Expand Down
2 changes: 1 addition & 1 deletion four-bar/src/fb/fb3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl SFourBar {
g: 0.5235987755982988,
stat: Stat::C1B1,
};
Self::new(UnNorm::new(), norm)
Self::new(UnNorm::from_radius(90.), norm)
}

/// Take the sphere part without the linkage length.
Expand Down

0 comments on commit 1b3cd54

Please sign in to comment.