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
impl WallRegionBoundary
Sourcepub fn area(&self, model: &Model) -> f64
pub fn area(&self, model: &Model) -> f64
面積 [mm²](ニューエルの公式による 3 次元面積。理想平面への投影を経由しない。 モジュールドキュメント参照)。節点が引けない場合は 0。
Sourcepub fn project(&self, coord: [f64; 3]) -> [f64; 2]
pub fn project(&self, coord: [f64; 3]) -> [f64; 2]
実座標 coord をこの境界の構面の局所座標 (s, z) へ射影する。
s は構面方向(WallRegionBoundary::plane_direction)に沿った
WallRegionBoundary::plane_origin からの距離、z はグローバル Z。
構面の局所座標は境界ごとに決まるため、射影は境界自身に持たせている
(origin と direction を呼び出し側が別々に渡す形だと、別の構面の
基準点と方向を取り違えても型では防げない)。WallRegionBoundary::contains
が受け取る点も、この関数で射影したものでなければならない。
Sourcepub fn contains(&self, model: &Model, p: [f64; 2]) -> bool
pub fn contains(&self, model: &Model, p: [f64; 2]) -> bool
局所座標 (s, z) の点 p がこの境界の内部にあるか(辺上は含まない厳密内包)。
p はこの境界と同じ構面(WallRegionBoundary::is_same_plane)上にあることを
前提とする(呼び出し側で確認すること。射影後の座標系が異なる構面どうしを
比較しても意味を持たない)。
Sourcepub fn is_same_plane(&self, origin: [f64; 2]) -> bool
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
impl Clone for WallRegionBoundary
Source§fn clone(&self) -> WallRegionBoundary
fn clone(&self) -> WallRegionBoundary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WallRegionBoundary
impl Debug for WallRegionBoundary
Source§impl PartialEq for WallRegionBoundary
impl PartialEq for WallRegionBoundary
Source§fn eq(&self, other: &WallRegionBoundary) -> bool
fn eq(&self, other: &WallRegionBoundary) -> bool
self and other values to be equal, and is used by ==.