#mechanism #optimization #simulation

four-bar

Four🍀bar library provides simulation and synthesis function for four-bar linkages

22 releases (6 major breaking)

6.1.0 Nov 29, 2023
5.1.0 Sep 20, 2023
5.0.0 Jul 28, 2023
4.0.0 Apr 13, 2023
0.1.0 Oct 28, 2021

#500 in Algorithms

Download history 11/week @ 2024-02-19 17/week @ 2024-02-26 10/week @ 2024-03-11 139/week @ 2024-04-01

149 downloads per month
Used in four-bar-ui

AGPL-3.0-or-later

110KB
2.5K SLoC

Four🍀bar

documentation

Four-bar is a simulator and a synthesizing tool for four-bar linkage mechanism.

use four_bar::FourBar;

// Get the trajectory of the coupler point
let path = FourBar::example().curve(360);

The synthesis function let you synthesize a four-bar mechanism by fitting target curve.

use four_bar::{mh, syn};

let func = syn::FbSyn::from_curve(curve, syn::Mode::Closed).res(res);
let s = mh::Solver::build(mh::Rga::default(), func)
    .task(|ctx| ctx.gen == gen)
    .pop_num(pop)
    .solve()
    .unwrap();

lib.rs:

Four🍀bar is a simulator, a synthesizing tool for four-bar linkage mechanism.

https://en.wikipedia.org/wiki/Four-bar_linkage

use four_bar::FourBar;

// Get the trajectory of the coupler point
let path = FourBar::example().curve(360);

Dependencies

~6–9MB
~180K SLoC