mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-25 16:45:52 +00:00
Remove redundant block
This commit is contained in:
parent
a0d6814ef8
commit
386c10524c
@ -48,41 +48,38 @@ impl ToShape for fj::Difference2d {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
// Can't panic, as we just verified that both shapes have one face.
|
||||||
// Can't panic, as we just verified that both shapes have one face.
|
let [face_a, face_b] =
|
||||||
let [face_a, face_b] = [&mut a, &mut b]
|
[&mut a, &mut b].map(|shape| shape.faces().all().next().unwrap());
|
||||||
.map(|shape| shape.faces().all().next().unwrap());
|
|
||||||
|
|
||||||
let (cycles_a, cycles_b, surface_a, surface_b) =
|
let (cycles_a, cycles_b, surface_a, surface_b) =
|
||||||
match ((*face_a).clone(), (*face_b).clone()) {
|
match ((*face_a).clone(), (*face_b).clone()) {
|
||||||
(
|
(
|
||||||
Face::Face {
|
Face::Face {
|
||||||
cycles: a,
|
cycles: a,
|
||||||
surface: surface_a,
|
surface: surface_a,
|
||||||
},
|
},
|
||||||
Face::Face {
|
Face::Face {
|
||||||
cycles: b,
|
cycles: b,
|
||||||
surface: surface_b,
|
surface: surface_b,
|
||||||
},
|
},
|
||||||
) => (a, b, surface_a, surface_b),
|
) => (a, b, surface_a, surface_b),
|
||||||
_ => {
|
_ => {
|
||||||
// None of the 2D types still use triangle
|
// None of the 2D types still use triangle representation.
|
||||||
// representation.
|
unreachable!()
|
||||||
unreachable!()
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
surface_a == surface_b,
|
surface_a == surface_b,
|
||||||
"Trying to subtract sketches with different surfaces."
|
"Trying to subtract sketches with different surfaces."
|
||||||
);
|
);
|
||||||
let surface = surface_a;
|
let surface = surface_a;
|
||||||
|
|
||||||
let mut cycles = cycles_a;
|
let mut cycles = cycles_a;
|
||||||
cycles.extend(cycles_b);
|
cycles.extend(cycles_b);
|
||||||
|
|
||||||
shape.faces().add(Face::Face { cycles, surface });
|
shape.faces().add(Face::Face { cycles, surface });
|
||||||
};
|
|
||||||
|
|
||||||
shape
|
shape
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user