Bezier-rs: Implement miter-limit (#1096)

* Implement miter-limit approximation

* Refactor to use Join enum and address other comments

* Rustdocs improvements

* Tweaks

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Hannah Li
2023-03-27 22:58:35 -04:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 3733804d18
commit 97be83c404
15 changed files with 106 additions and 69 deletions
@@ -14,17 +14,17 @@ impl<ManipulatorGroupId: crate::Identifier> Subpath<ManipulatorGroupId> {
self.closed = new_closed;
}
/// Access a [ManipulatorGroup] from a [ManipulatorGroupId].
/// Access a [ManipulatorGroup] from a ManipulatorGroupId.
pub fn manipulator_from_id(&self, id: ManipulatorGroupId) -> Option<&ManipulatorGroup<ManipulatorGroupId>> {
self.manipulator_groups.iter().find(|manipulator_group| manipulator_group.id == id)
}
/// Access a mutable [ManipulatorGroup] from a [ManipulatorGroupId].
/// Access a mutable [ManipulatorGroup] from a ManipulatorGroupId.
pub fn manipulator_mut_from_id(&mut self, id: ManipulatorGroupId) -> Option<&mut ManipulatorGroup<ManipulatorGroupId>> {
self.manipulator_groups.iter_mut().find(|manipulator_group| manipulator_group.id == id)
}
/// Access the index of a [ManipulatorGroup] from a [ManipulatorGroupId].
/// Access the index of a [ManipulatorGroup] from a ManipulatorGroupId.
pub fn manipulator_index_from_id(&self, id: ManipulatorGroupId) -> Option<usize> {
self.manipulator_groups.iter().position(|manipulator_group| manipulator_group.id == id)
}