#mechanism #simulation #optimization #rigid-body

four-bar

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

27 releases (17 stable)

7.0.4 Sep 23, 2024
7.0.1 Aug 20, 2024
7.0.0 May 30, 2024
6.1.0 Nov 29, 2023
0.1.0 Oct 28, 2021

#300 in Algorithms


Used in four-bar-ui

AGPL-3.0-or-later

155KB
3.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);

Features

  • Simulation: Calculate the trajectory of the coupler point (or any point) on the planar/spherical four-bar linkage.
    • FourBar struct defines a planar four-bar linkage.
    • MFourBar struct defines a planar four-bar linkage for motion generation (rigid body guidance) synthesis.
    • SFourBar struct defines a spherical four-bar linkage.
    • *NormFourBar structs are the normalized versions of the above linkages without the translation, rotation, and scaling.
  • Serialization: Serialize and deserialize four-bar linkages and their trajectories to/from a file via serde. (serde and csv feature)
  • Plotting: Visualize the four-bar linkage and the trajectory of the coupler point. (plot feature)
  • Synthesis: Find the dimensions of the four-bar linkage that will guide the coupler point through a desired trajectory. You can use the rayon feature to speed up the synthesis process. Also, the clap feature provides a CLI interface for the synthesis tool.
  • Atlas: A collection of four-bar linkages with known trajectories. It can be used to find the best match for a given trajectory, which is similar to the synthesis process but without the optimization part. (atlas feature)
  • GUI: A graphical user interface four-bar-ui is available at the repo with a web demo.

Citations

The synthesis technique is based on the paper by us:

  • Chang, Y., Chang, JL., Lee, JJ. (2024). Atlas-Based Path Synthesis of Planar Four-Bar Linkages Using Elliptical Fourier Descriptors. In: Okada, M. (eds) Advances in Mechanism and Machine Science. IFToMM WC 2023. Mechanisms and Machine Science, vol 149. Springer, Cham. https://doi.org/10.1007/978-3-031-45709-8_20
  • Chang, Y., Chang, JL. & Lee, JJ. Path Synthesis of Planar Four-bar Linkages for Closed and Open Curves Using Elliptical Fourier Descriptors. J Mech Sci Technol (2024). http://doi.org/10.1007/s12206-024-0436-y

Dependencies

~4.5–9MB
~170K SLoC