4 releases (breaking)

new 0.7.0 Oct 16, 2024
0.5.0 Feb 13, 2023
0.4.0 Dec 4, 2022
0.2.0 Oct 25, 2022

#452 in Graphics APIs

Download history 13/week @ 2024-07-03 46/week @ 2024-07-10 63/week @ 2024-07-17 128/week @ 2024-07-24 71/week @ 2024-07-31 35/week @ 2024-08-07 62/week @ 2024-08-14 102/week @ 2024-08-21 108/week @ 2024-08-28 113/week @ 2024-09-04 79/week @ 2024-09-11 109/week @ 2024-09-18 66/week @ 2024-09-25 26/week @ 2024-10-02 8/week @ 2024-10-09 215/week @ 2024-10-16

324 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