Allow same syntax for patterns as mirror revolve (#7054)

* allow named axis for patterns

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* images

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Fix typo

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
This commit is contained in:
Jess Frazelle
2025-05-18 19:25:35 -07:00
committed by GitHub
parent bd01059a92
commit 658497da1d
12 changed files with 177 additions and 16 deletions

View File

@ -21,3 +21,41 @@ pub enum Axis3dOrEdgeReference {
/// Tagged edge.
Edge(EdgeReference),
}
/// A 2D axis or a raw point2d.
#[derive(Debug, Clone, PartialEq)]
pub enum Axis2dOrPoint2d {
/// 2D axis and origin.
Axis { direction: [TyF64; 2], origin: [TyF64; 2] },
/// Raw point2d.
Point([TyF64; 2]),
}
impl Axis2dOrPoint2d {
/// Convert to a 2D axis.
pub fn to_point2d(&self) -> [TyF64; 2] {
match self {
Axis2dOrPoint2d::Axis { direction, origin: _ } => direction.clone(),
Axis2dOrPoint2d::Point(point) => point.clone(),
}
}
}
/// A 3D axis or a raw point3d.
#[derive(Debug, Clone, PartialEq)]
pub enum Axis3dOrPoint3d {
/// 3D axis and origin.
Axis { direction: [TyF64; 3], origin: [TyF64; 3] },
/// Raw point3d.
Point([TyF64; 3]),
}
impl Axis3dOrPoint3d {
/// Convert to a 3D axis.
pub fn to_point3d(&self) -> [TyF64; 3] {
match self {
Axis3dOrPoint3d::Axis { direction, origin: _ } => direction.clone(),
Axis3dOrPoint3d::Point(point) => point.clone(),
}
}
}