use svgpath::Command;
let s = "
M 10,30
A 20,20 0,0,1 50,30
A 20,20 0,0,1 90,30
Q 90,60 50,90
Q 10,60 10,30
Z";
let p = svgpath::parse(s)?;
let mut sp = p.simplify();
let rect = svgpath::Rect::new(50.0, 50.0, 700.0, 700.0);
let mut sp = sp.fit(&rect, true, true);
let center = sp.bbox().center();
let m = svgpath::Matrix::new()
.translate(center.x, center.y)
.rotate(35.0)
.translate(-center.x, -center.y);
let mut sp = sp.transform(&m);
println!("{sp}");
for cmd in sp.commands() {
match cmd {
Command::Move{x, y} => println!("move {x} {y}"),
Command::Line{x, y} => println!("line {x} {y}"),
Command::Cubic{x1, y1, x2, y2, x, y} => println!("cubic {x1} {y1} {x2} {y2} {x} {y}"),
Command::Close => println!("close"),
_ => {},
}
}