Skip to main content

WallRegionBoundary

Struct WallRegionBoundary 

Source
pub struct WallRegionBoundary {
    pub plane_origin: [f64; 2],
    pub plane_direction: [f64; 2],
    pub boundary: Vec<NodeId>,
    pub edges: Vec<ElemId>,
}
Expand description

柱・梁が囲む鉛直構面内の閉領域(壁領域の境界)1 つ。

Fields§

§plane_origin: [f64; 2]

この境界が乗る構面(直線)の基準点(柱脚位置の XY 平面上)。

§plane_direction: [f64; 2]

構面の方向単位ベクトル(XY 平面上)。見出し角は [0, π) に正規化済み。

§boundary: Vec<NodeId>

境界の節点列(局所座標 (s, z) で反時計回り。始点は繰り返さない)。

§edges: Vec<ElemId>

境界をなす部材(boundary の辺と同順。辺 i は boundary[i]boundary[i+1])。

Implementations§

Source§

impl WallRegionBoundary

Source

pub fn area(&self, model: &Model) -> f64

面積 [mm²](ニューエルの公式による 3 次元面積。理想平面への投影を経由しない。 モジュールドキュメント参照)。節点が引けない場合は 0。

Source

pub fn project(&self, coord: [f64; 3]) -> [f64; 2]

実座標 coord をこの境界の構面の局所座標 (s, z) へ射影する。 s は構面方向(WallRegionBoundary::plane_direction)に沿った WallRegionBoundary::plane_origin からの距離、z はグローバル Z。

構面の局所座標は境界ごとに決まるため、射影は境界自身に持たせている (origindirection を呼び出し側が別々に渡す形だと、別の構面の 基準点と方向を取り違えても型では防げない)。WallRegionBoundary::contains が受け取る点も、この関数で射影したものでなければならない。

Source

pub fn contains(&self, model: &Model, p: [f64; 2]) -> bool

局所座標 (s, z) の点 p がこの境界の内部にあるか(辺上は含まない厳密内包)。 p はこの境界と同じ構面(WallRegionBoundary::is_same_plane)上にあることを 前提とする(呼び出し側で確認すること。射影後の座標系が異なる構面どうしを 比較しても意味を持たない)。

Source

pub fn is_same_plane(&self, origin: [f64; 2]) -> bool

与えた点 origin がこの境界と同じ構面(直線)上にあるか (crate::geom::MEMBER_AXIS_TOL_MM 以内の実距離。[super::floor:: RegionBoundary::is_same_level] の壁側版)。直線の方向ベクトルの数値的な 一致は求めない(同じ物理的な直線でも、由来する候補点の組が異なれば 正規化後の方向ベクトルが浮動小数点の誤差だけずれうるため。位置の実距離 のほうが頑健な同一性判定になる。wall_planes の候補統合と同じ判断)。

Trait Implementations§

Source§

impl Clone for WallRegionBoundary

Source§

fn clone(&self) -> WallRegionBoundary

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 WallRegionBoundary

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for WallRegionBoundary

Source§

fn eq(&self, other: &WallRegionBoundary) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for WallRegionBoundary

Auto Trait Implementations§

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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.