mirror of https://github.com/hannobraun/Fornjot
Remove redundant validation check
We already check that all half-edges are connected by identical surface vertices. Checking the surface on top of that is redundant.
This commit is contained in:
parent
7671353c50
commit
2dd2c916eb
|
@ -24,20 +24,14 @@ impl Cycle {
|
|||
pub fn new(half_edges: impl IntoIterator<Item = Handle<HalfEdge>>) -> Self {
|
||||
let half_edges = half_edges.into_iter().collect::<Vec<_>>();
|
||||
|
||||
let surface = match half_edges.first() {
|
||||
Some(half_edge) => half_edge.surface().clone(),
|
||||
None => panic!("Cycle must contain at least one half-edge"),
|
||||
};
|
||||
|
||||
// Verify, that the curves of all edges are defined in the correct
|
||||
// surface.
|
||||
for edge in &half_edges {
|
||||
assert_eq!(
|
||||
surface.id(),
|
||||
edge.curve().surface().id(),
|
||||
"Edges in cycle not defined in same surface"
|
||||
);
|
||||
}
|
||||
// This is not a validation check, and thus not part of the validation
|
||||
// infrastructure. The property being checked here is inherent to the
|
||||
// validity of a `Cycle`, as methods of `Cycle` might assume that there
|
||||
// is at least one edge.
|
||||
assert!(
|
||||
!half_edges.is_empty(),
|
||||
"Cycle must contain at least one half-edge"
|
||||
);
|
||||
|
||||
if half_edges.len() != 1 {
|
||||
// Verify that all edges connect.
|
||||
|
|
Loading…
Reference in New Issue