// Copyright 2022 the Kurbo Authors // SPDX-License-Identifier: Apache-2.0 OR MIT //! A simple example to show an offset curve of a cubic Bézier segment. use kurbo::{offset::CubicOffset, CubicBez, Shape}; fn main() { println!(""); let c = CubicBez::new((100., 100.), (150., 75.), (300., 50.), (400., 200.)); println!( " ", c.to_path(1e-9).to_svg() ); for i in 1..=80 { let co = CubicOffset::new(c, i as f64 * 4.0); let path = kurbo::fit_to_bezpath_opt(&co, 1e-3); println!( " ", path.to_svg() ); } println!(""); }