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
340 downloads per month
Used in 3 crates
(2 directly)
580KB
3K
SLoC
svg_path_ops
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();
🖨️ Output Translate
Rotate
let translated_path = PathTransformer::new(cat_svg_path)
.rotate(90.0, 126.0, 140.0)
.translate(220.0, 0.0)
.to_string();
🖨️ Output Rotate
Skew
let translated_path = PathTransformer::new(cat_svg_path)
.skew_x(20.0)
.translate(180.0, 0.0)
.to_string();
🖨️ Output Skew
Scale
let translated_path = PathTransformer::new(cat_svg_path)
.scale(0.5, 0.5)
.translate(220.0, 60.0)
.to_string();
🖨️ Output Scale
📝 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