* Straight edges stay one edge after cuts (#1049) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Robustness goldens: cuts join straight edges along untouched walls (#1049) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fmt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Robustness goldens note: what each changed seed shows when replayed on both builds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec64564f21
commit
d019f2d5bf
7 files changed
+271
-41
No files matched your search
@@ -318,12 +318,13 @@ fn merge_collinear(shell: &mt::Shell, trace: &mut Trace) -> Option<mt::Shell> {
|
||||
es.push(e.clone());
|
||||
continue;
|
||||
};
|
||||
// The run's pieces become its joined edge, in this wire's direction.
|
||||
if done.insert(r)
|
||||
&& let Some((line, pos)) = joined.get(r)
|
||||
{
|
||||
// The run's pieces become its joined edge, in this wire's direction: once each
|
||||
// way, as a seam runs along its wire both ways.
|
||||
if let Some((line, pos)) = joined.get(r) {
|
||||
let forward = pos.get(&e.front().id()) < pos.get(&e.back().id());
|
||||
es.push(if forward { line.clone() } else { line.inverse() });
|
||||
if done.insert((r, forward)) {
|
||||
es.push(if forward { line.clone() } else { line.inverse() });
|
||||
}
|
||||
}
|
||||
}
|
||||
wires.push(mt::Wire::from(es));
|
||||
@@ -547,9 +548,9 @@ pub(crate) fn heal_traced(solid: Solid, size: f64, keep: &[Vec<Vec3>]) -> (Solid
|
||||
healed(solid, size, keep, true, false)
|
||||
}
|
||||
|
||||
/// [`heal_traced`] that only merges coplanar neighbouring faces, leaving every edge, curve and
|
||||
/// surface as it is: for results whose geometry is already exact (a prism boolean's), where
|
||||
/// joining edges would change more than the faces split in pieces.
|
||||
/// [`heal_traced`] that only merges coplanar neighbouring faces and joins the straight edges
|
||||
/// they leave split in line (#1049), leaving every curve and surface as it is: for results
|
||||
/// whose geometry is already exact (a prism boolean's).
|
||||
pub(crate) fn merge_faces_traced(solid: Solid, size: f64, keep: &[Vec<Vec3>]) -> (Solid, Option<HealMap>) {
|
||||
healed(solid, size, keep, true, true)
|
||||
}
|
||||
@@ -632,7 +633,9 @@ fn heal_shells(solid: &Solid, size: f64, keep: &[Vec<Vec3>], traced: bool, faces
|
||||
from = groups.iter().map(|g| g.iter().filter_map(|i| from.get(*i)).flatten().copied().collect()).collect();
|
||||
changed = true;
|
||||
}
|
||||
if !faces_only && let Some(m) = merge_collinear(&cur, &mut trace) {
|
||||
// Straight edges the merged pieces leave split at vertices nothing else uses join
|
||||
// into one, after any boolean (#1049): later features meet one edge, not the pieces.
|
||||
if let Some(m) = merge_collinear(&cur, &mut trace) {
|
||||
cur = m;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user