mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-04 19:15:57 +00:00
Tests: a split face without its record exports as the body has it, and the next operation joins it
export_keeps_faces_split_on_purpose took a box whose top Split Face cut in two, dropped the split record by hand (with_split_lines(None)) and expected the STEP file to have 6 faces: truck's export joined pieces on one surface, "as it does for pieces a boolean left". No operation makes such a body: the split record is only set (doc eval, Split Face), never dropped, and removing a Split Face rebuilds the part without the split. SMLib's booleans join pieces on one surface at their end (two touching boxes unite into 6 faces), and the local modifiers heal through boolean_record::healed, so no operation leaves incidental pieces either. The file now has what the body has (7 faces, the export merges nothing), and the heal every later operation applies joins the unrecorded pieces: 6 faces in the body and in its file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -632,9 +632,14 @@ mod tests {
|
||||
assert!(n > c.face_count());
|
||||
// The pieces stay apart; the cylinder's incidental seam pieces still join as before.
|
||||
assert_eq!(round_trip_faces(&cs), round_trip_faces(&c) + 1);
|
||||
// Without the record the export joins the top's pieces again (as it does for pieces a
|
||||
// boolean left).
|
||||
assert_eq!(round_trip_faces(&s.clone().with_split_lines(None)), 6);
|
||||
// Without the record (no operation drops it: only Split Face's own removal, which
|
||||
// rebuilds without the split) the pieces are incidental: the file has what the body
|
||||
// has, and the next operation joins them as it joins any pieces on one surface (SMLib's
|
||||
// booleans at their end, the local modifiers through the heal).
|
||||
let unrecorded = s.clone().with_split_lines(None);
|
||||
assert_eq!(round_trip_faces(&unrecorded), unrecorded.face_count());
|
||||
let joined = crate::boolean_record::healed(&unrecorded).unwrap();
|
||||
assert_eq!((joined.face_count(), round_trip_faces(&joined)), (6, 6));
|
||||
// A split after a split keeps both lines.
|
||||
let pl2 = Plane::new(Vec3::new(0.0, 12.0, 0.0), Vec3::X, Vec3::Z).unwrap();
|
||||
let tops: Vec<usize> =
|
||||
|
||||
Reference in New Issue
Block a user