pub enum AxisGroupKind {
Parallel {
origin: [f64; 2],
angle_deg: f64,
},
Other,
}Expand description
通り芯グループの幾何。
Variants§
Parallel
平行芯。原点 origin と芯線の方向角 angle_deg(度、グローバル X 軸から
反時計回り)を持ち、各通りは原点からの符号付き離れ(Axis::distance)で
位置が決まる。芯線の方向は (cos θ, sin θ)、離れを測る向きは
それを 90° 回した (−sin θ, cos θ)(AxisGroupKind::offset_dir)。
Other
平行芯以外(円弧芯・放射芯・作図芯)。幾何は保持せず、所属節点の
まとまりとしてのみ扱う。この種のグループの通りは Axis::distance が
None になる。
Implementations§
Source§impl AxisGroupKind
impl AxisGroupKind
Sourcepub fn offset_dir(&self) -> Option<[f64; 2]>
pub fn offset_dir(&self) -> Option<[f64; 2]>
離れを測る向きの単位ベクトル (−sin θ, cos θ)。Other は None。
Sourcepub fn distance_of(&self, x: f64, y: f64) -> Option<f64>
pub fn distance_of(&self, x: f64, y: f64) -> Option<f64>
平面上の点 (x, y) の、このグループにおける符号付き離れ。Other は None。
Sourcepub fn plan_dir(&self) -> Option<AxisPlanDir>
pub fn plan_dir(&self) -> Option<AxisPlanDir>
このグループが表す平面上の位置の向き(AxisPlanDir)。
離れを測る向きがグローバル軸に沿っていない斜めのグループ、および
Other は None。
Trait Implementations§
Source§impl Clone for AxisGroupKind
impl Clone for AxisGroupKind
Source§fn clone(&self) -> AxisGroupKind
fn clone(&self) -> AxisGroupKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AxisGroupKind
Source§impl Debug for AxisGroupKind
impl Debug for AxisGroupKind
Source§impl<'de> Deserialize<'de> for AxisGroupKind
impl<'de> Deserialize<'de> for AxisGroupKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AxisGroupKind
impl PartialEq for AxisGroupKind
Source§fn eq(&self, other: &AxisGroupKind) -> bool
fn eq(&self, other: &AxisGroupKind) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AxisGroupKind
impl Serialize for AxisGroupKind
impl StructuralPartialEq for AxisGroupKind
Auto Trait Implementations§
impl Freeze for AxisGroupKind
impl RefUnwindSafe for AxisGroupKind
impl Send for AxisGroupKind
impl Sync for AxisGroupKind
impl Unpin for AxisGroupKind
impl UnsafeUnpin for AxisGroupKind
impl UnwindSafe for AxisGroupKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more