Implement function to find inflection points of a Bezier curve (#712)

* Implement inflection function for bezier-rs

* Swapped to explicit inflection formula

Co-authored-by: Linda Zheng <ll2zheng@uwaterloo.ca>

* Address Rob's comments

* Fix axis align

Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>

* Address Keavon's comments

* Fix linting

Co-authored-by: Robert Nadal <Robnadal44@gmail.com>
Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Linda Zheng
2022-07-27 22:52:50 -04:00
committed by GitHub
co-authored by Linda Zheng Linda Zheng Robert Nadal Hannah Li Keavon Chambers
parent a5bb153dab
commit 06524bac8d
3 changed files with 56 additions and 0 deletions
@@ -156,4 +156,9 @@ impl WasmBezier {
let bbox_points: [Point; 2] = self.0.bounding_box().map(|p| Point { x: p.x, y: p.y });
to_js_value(bbox_points)
}
pub fn inflections(&self) -> JsValue {
let inflections = self.0.inflections();
to_js_value(inflections)
}
}