No panics in the boolean's final assembly (the web build aborts on any panic: the Plastic Enclosure sample panicked 8 times and crashed the browser's start page); face pushes check their result and fall back to the general offset (a boss standing on a plate joins again with off-axis cylinder seams); offset errors name the face they can't move; docs/robustness.md with the before and after rates; caught panics counted per design in the robustness runs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
ccde7a4837
commit
1bf377c14b
8 files changed
+182
-33
No files matched your search
@@ -26,10 +26,11 @@ impl<P, C, S> FacesClassification<P, C, S> {
|
||||
pub fn and_or_unknown(&self) -> [Shell<P, C, S>; 3] {
|
||||
let [mut and, mut or, mut unknown] = <[Shell<P, C, S>; 3]>::default();
|
||||
for face in &self.shell {
|
||||
match self.status.get(&face.id()).unwrap() {
|
||||
ShapesOpStatus::And => and.push(face.clone()),
|
||||
ShapesOpStatus::Or => or.push(face.clone()),
|
||||
ShapesOpStatus::Unknown => unknown.push(face.clone()),
|
||||
// SolveCraft: no panics (wasm can't catch them).
|
||||
match self.status.get(&face.id()) {
|
||||
Some(ShapesOpStatus::And) => and.push(face.clone()),
|
||||
Some(ShapesOpStatus::Or) => or.push(face.clone()),
|
||||
_ => unknown.push(face.clone()),
|
||||
}
|
||||
}
|
||||
[and, or, unknown]
|
||||
@@ -42,21 +43,19 @@ impl<P, C, S> FacesClassification<P, C, S> {
|
||||
let components = unknown.connected_components();
|
||||
for comp in components {
|
||||
let boundary = comp.extract_boundaries();
|
||||
if and_boundary
|
||||
.iter()
|
||||
.flatten()
|
||||
.any(|edge| edge.id() == boundary[0][0].id())
|
||||
{
|
||||
let Some(first) = boundary.first().and_then(|w| w.edge_iter().next()).map(|e| e.id()) else { continue };
|
||||
let set = if and_boundary.iter().flatten().any(|edge| edge.id() == first) {
|
||||
Some(ShapesOpStatus::And)
|
||||
} else if or_boundary.iter().flatten().any(|edge| edge.id() == first) {
|
||||
Some(ShapesOpStatus::Or)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
if let Some(st) = set {
|
||||
comp.iter().for_each(|face| {
|
||||
*self.status.get_mut(&face.id()).unwrap() = ShapesOpStatus::And;
|
||||
})
|
||||
} else if or_boundary
|
||||
.iter()
|
||||
.flatten()
|
||||
.any(|edge| edge.id() == boundary[0][0].id())
|
||||
{
|
||||
comp.iter().for_each(|face| {
|
||||
*self.status.get_mut(&face.id()).unwrap() = ShapesOpStatus::Or;
|
||||
if let Some(x) = self.status.get_mut(&face.id()) {
|
||||
*x = st;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user