forked from 1b-agent/fieldcraft-upstream
mesh.cells: sweep the cells of a body together, conforming with no seeds (#288)
hex_mesh_swept_cells lays out one cross-section for several cells: every cell's walls (its cut faces included) are imprinted together, every cell's levels are levels of all, one interval assignment and one set of layers, and each region of each level interval is filled by the cell it lies in. Cells meet node for node across every cut, T-junctions included. mesh.cells sweeps the cells of each design body together first and meshes cell by cell only what does not sweep together (saying why); the reply gives every cell's volume, scaled Jacobian and edge ratio. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
c3a1712069
commit
755576de8a
6 files changed
+580
-136
No files matched your search
@@ -76,6 +76,16 @@ impl Design {
|
||||
pub fn body(&self, name: &str) -> Option<&Shape> {
|
||||
self.bodies.iter().find(|b| b.name == name)
|
||||
}
|
||||
|
||||
/// The body of the design as opened that `name` is, or that partitions cut it from
|
||||
/// (`Base` for `Base/a/b1`).
|
||||
pub fn source_of(&self, name: &str) -> Option<&str> {
|
||||
self.source
|
||||
.iter()
|
||||
.map(|b| b.name.as_str())
|
||||
.filter(|s| name == *s || name.strip_prefix(s).is_some_and(|rest| rest.starts_with('/')))
|
||||
.max_by_key(|s| s.len())
|
||||
}
|
||||
}
|
||||
|
||||
/// Open a design from its file bytes (a `.solidcraft` container or a JSON design) and rebuild it.
|
||||
|
||||
Reference in new issue
Block a user