Skip to main content

Solid

Struct Solid 

Source
pub struct Solid {
    pub kind: SolidKind,
    pub front: Face,
    pub back: Face,
    pub rim: f64,
    pub material: String,
    pub name: String,
    pub poly: Option<Poly>,
}
Expand description

2 面で挟まれた立体(外径 rim の円柱の側面で閉じる)

Fields§

§kind: SolidKind§front: Face§back: Face§rim: f64§material: String

材料(鏡は “MIRROR”)

§name: String

表示用の名前(例: “L1 S2-S3 N-BK7”)

§poly: Option<Poly>

四角い開口の平面 2 枚で挟む立体(ビームスプリッターのキューブの半分の直角プリズムなど)は、 2 つの長方形の角を囲む凸多面体で描く(外径まで延ばした円板では形が違う)

Implementations§

Source§

impl Solid

Source

pub fn direction(&self) -> f64

前の面の局所 z で、後ろの面がある側の符号(+1 か -1)

Source

pub fn back_basis(&self) -> (V3, V3)

後ろの面の周の向きの基準(大域の x・y の単位ベクトル)。軸を前の面の軸と同じ側へ向け、前の面の x を後ろの面に 投げたものと軸 × x(前の面の座標系が左手系=展開で鏡映したものなら −軸 × x)。前の面の局所 x・y の角度 t の縁の点と、後ろの面のこの基準の角度 t の縁の点を側面で結ぶ (面どうしが軸のまわりに回っていても側面がねじれない。STEP の側面・3D の網・2D の断面で同じ)

Source

pub fn back_point(&self, c: f64, s: f64) -> V3

後ろの面の、Self::back_basis の向きの (c, s) の点(局所 x・y で c·bx + s·by)

Source

pub fn coaxial(&self) -> bool

2 面が同じ軸の上にあるか(軸が平行で、後ろの面の頂点が前の面の軸の上)

Source§

impl Solid

Source

pub fn key(&self) -> Vec<i64>

同じ位置・形の立体を見分ける鍵(前後の面を入れ替えても同じ)

Trait Implementations§

Source§

impl Clone for Solid

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Solid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Solid

§

impl !UnwindSafe for Solid

§

impl Freeze for Solid

§

impl Send for Solid

§

impl Sync for Solid

§

impl Unpin for Solid

§

impl UnsafeUnpin for Solid

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.