5 releases (breaking)

0.8.0 Nov 2, 2024
0.7.0 Oct 16, 2024
0.5.0 Feb 13, 2023
0.4.0 Dec 4, 2022
0.2.0 Oct 25, 2022

#607 in Graphics APIs

Download history 97/week @ 2024-08-17 93/week @ 2024-08-24 121/week @ 2024-08-31 95/week @ 2024-09-07 92/week @ 2024-09-14 96/week @ 2024-09-21 48/week @ 2024-09-28 8/week @ 2024-10-05 176/week @ 2024-10-12 109/week @ 2024-10-19 52/week @ 2024-10-26 241/week @ 2024-11-02 77/week @ 2024-11-09 89/week @ 2024-11-16 56/week @ 2024-11-23 107/week @ 2024-11-30

340 downloads per month
Used in 3 crates (2 directly)

MIT license

580KB
3K SLoC

svg_path_ops

Crates.io Documentation License

This crate includes utility functions to work with svg paths. Works on types from svgtypes crate.

This package exposes functions to manipulate svg paths with simplification purposes. Also a path transformer fully compatible with svgpath is provided.

📦 Cargo.toml

[dependencies]
svg_path_ops = "0.6"

🔧 Example

Translate

let translated_path = PathTransformer::new(cat_svg_path)
    .translate(230.0, 0.0)
    .to_string();

full example

🖨️ Output Translate

translate

Rotate

let translated_path = PathTransformer::new(cat_svg_path)
    .rotate(90.0, 126.0, 140.0)
    .translate(220.0, 0.0)
    .to_string();

full example

🖨️ Output Rotate

translate

Skew

let translated_path = PathTransformer::new(cat_svg_path)
    .skew_x(20.0)
    .translate(180.0, 0.0)
    .to_string();

full example

🖨️ Output Skew

translate

Scale

let translated_path = PathTransformer::new(cat_svg_path)
    .scale(0.5, 0.5)
    .translate(220.0, 60.0)
    .to_string();

full example

🖨️ Output Scale

translate

📝 License

Licensed under MIT License (LICENSE).

🚧 Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

Dependencies

~1MB
~26K SLoC