model: face splits along datum planes (#508)

A datum plane a split uses is in use, as one a partition cuts by.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-16 15:25:26 -04:00
1 parent e8e3fc647c
commit 6c79498005
3 files changed
+84 -3

No files matched your search

+12 -2
View File
@@ -85,7 +85,7 @@ pub use steps::{
};
pub use tie::Tie;
pub use units::UnitSystem;
pub use virtual_faces::{FaceMerge, Stitch};
pub use virtual_faces::{FaceMerge, FaceSplit, Stitch};
/// The largest node or element label. Nastran's GRID and element ids stop at 99 999 999 (eight
/// digits in a small field), the tightest of the three formats.
@@ -180,6 +180,9 @@ pub struct Model {
/// Stitches of imported surfaces, in the order they apply.
#[serde(skip_serializing_if = "Vec::is_empty")]
stitches: Vec<Stitch>,
/// Face splits along datum planes, in the order they apply (after the merges).
#[serde(skip_serializing_if = "Vec::is_empty")]
face_splits: Vec<FaceSplit>,
}
/// A [`Model`] as stored, before it is checked.
@@ -236,6 +239,8 @@ struct ModelData {
face_merges: Vec<FaceMerge>,
#[serde(default)]
stitches: Vec<Stitch>,
#[serde(default)]
face_splits: Vec<FaceSplit>,
}
impl TryFrom<ModelData> for Model {
@@ -331,6 +336,9 @@ impl TryFrom<ModelData> for Model {
for v in d.stitches {
m.add_stitch(v)?;
}
for v in d.face_splits {
m.add_face_split(v)?;
}
Ok(m)
}
}
@@ -465,6 +473,7 @@ impl Model {
mesh_plans: self.mesh_plans.clone(),
face_merges: self.face_merges.clone(),
stitches: self.stitches.clone(),
face_splits: self.face_splits.clone(),
}
}
@@ -515,7 +524,7 @@ impl Model {
}
/// Counts of each kind of definition, for summaries.
pub fn definition_counts(&self) -> [(&'static str, usize); 18] {
pub fn definition_counts(&self) -> [(&'static str, usize); 19] {
[
("sets", self.sets.len()),
("materials", self.materials.len()),
@@ -535,6 +544,7 @@ impl Model {
("seeds", self.seeds.len()),
("face_merges", self.face_merges.len()),
("stitches", self.stitches.len()),
("face_splits", self.face_splits.len()),
]
}
}