#2d-3d #algorithm #elliptical #fourier-descriptor

no-std efd

1D/2D/3D Elliptical Fourier Descriptor (EFD) implementation in Rust

86 releases (44 stable)

new 9.1.1 Apr 22, 2024
9.0.0 Mar 9, 2024
8.0.1 Feb 21, 2024
7.5.0 Feb 7, 2024
0.5.0 Jul 20, 2021

#29 in No standard library

Download history 138/week @ 2024-01-14 48/week @ 2024-01-21 83/week @ 2024-01-28 15/week @ 2024-02-04 474/week @ 2024-02-18 50/week @ 2024-02-25 101/week @ 2024-03-03 169/week @ 2024-03-10 10/week @ 2024-03-17 2/week @ 2024-03-24 24/week @ 2024-03-31 2/week @ 2024-04-07 176/week @ 2024-04-14

205 downloads per month
Used in 2 crates (via four-bar)

MIT license

73KB
1.5K SLoC

EFD Rust Library

dependency status documentation

Elliptical Fourier Descriptor (EFD) implementation in Rust. This crate implements 1D/2D/3D EFD and its related functions.

Keyword Alias:

  • Elliptical Fourier Analysis (EFA)
  • Elliptical Fourier Function (EFF)

Example of re-describing a new closed curve:

let curve = vec![
    [0., 0.],
    [1., 1.],
    [2., 2.],
    [3., 3.],
    [2., 2.],
    [1., 1.],
];
assert!(efd::util::valid_curve(&curve).is_some());
let described_curve = efd::Efd2::from_curve(curve, false).recon(20);

The harmonic number can be set with efd::Efd::from_curve_harmonic() method. The following figures show the reconstruction of a 2D closed curve with 1-8 harmonics.

1h 2h 3h 4h
5h 6h 7h 8h

Example Images

2D and 3D closed curve:

2d 3d

2D and 3D open curve:

2d 3d

Posed EFD combined a curve with a pose (unit vectors) to describe the orientation of each point.

2D open curve and its full reconstruction:

posed posed-full

Citations

Original

My Applications

  • 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

Dependencies

~4.5MB
~102K SLoC