mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 10:58:28 +00:00
Refactor to prepare for follow-on change
This commit is contained in:
parent
43b924ed69
commit
187a943e18
@ -28,7 +28,9 @@ impl Validate for Shell {
|
|||||||
CurveGeometryMismatch::check(self, geometry, config)
|
CurveGeometryMismatch::check(self, geometry, config)
|
||||||
.map(Into::into),
|
.map(Into::into),
|
||||||
);
|
);
|
||||||
ShellValidationError::check_half_edge_pairs(self, geometry, errors);
|
errors.extend(ShellValidationError::check_half_edge_pairs(
|
||||||
|
self, geometry,
|
||||||
|
));
|
||||||
ShellValidationError::check_half_edge_coincidence(
|
ShellValidationError::check_half_edge_coincidence(
|
||||||
self, geometry, config, errors,
|
self, geometry, config, errors,
|
||||||
);
|
);
|
||||||
@ -75,8 +77,7 @@ impl ShellValidationError {
|
|||||||
fn check_half_edge_pairs<'r>(
|
fn check_half_edge_pairs<'r>(
|
||||||
shell: &'r Shell,
|
shell: &'r Shell,
|
||||||
geometry: &'r Geometry,
|
geometry: &'r Geometry,
|
||||||
errors: &'r mut Vec<ValidationError>,
|
) -> impl Iterator<Item = ValidationError> + 'r {
|
||||||
) {
|
|
||||||
let mut unmatched_half_edges = BTreeMap::new();
|
let mut unmatched_half_edges = BTreeMap::new();
|
||||||
|
|
||||||
for face in shell.faces() {
|
for face in shell.faces() {
|
||||||
@ -113,12 +114,13 @@ impl ShellValidationError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
errors.extend(unmatched_half_edges.into_values().cloned().map(
|
unmatched_half_edges
|
||||||
|half_edge| {
|
.into_values()
|
||||||
|
.cloned()
|
||||||
|
.map(|half_edge| {
|
||||||
Self::HalfEdgeHasNoSibling(HalfEdgeHasNoSibling { half_edge })
|
Self::HalfEdgeHasNoSibling(HalfEdgeHasNoSibling { half_edge })
|
||||||
.into()
|
.into()
|
||||||
},
|
})
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check that non-sibling half-edges are not coincident
|
/// Check that non-sibling half-edges are not coincident
|
||||||
|
Loading…
Reference in New Issue
Block a user