mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 01:48:28 +00:00
Move HalfEdgeHasNoSibling
to ValidationError
This commit is contained in:
parent
7885e699ba
commit
f165c25faa
@ -29,9 +29,7 @@ impl Validate for Shell {
|
||||
.map(Into::into),
|
||||
);
|
||||
errors.extend(
|
||||
HalfEdgeHasNoSibling::check(self, geometry, config)
|
||||
.map(ShellValidationError::HalfEdgeHasNoSibling)
|
||||
.map(Into::into),
|
||||
HalfEdgeHasNoSibling::check(self, geometry, config).map(Into::into),
|
||||
);
|
||||
ShellValidationError::check_half_edge_coincidence(
|
||||
self, geometry, config, errors,
|
||||
@ -42,10 +40,6 @@ impl Validate for Shell {
|
||||
/// [`Shell`] validation failed
|
||||
#[derive(Clone, Debug, thiserror::Error)]
|
||||
pub enum ShellValidationError {
|
||||
/// [`Shell`] contains a half-edge that is not part of a pair
|
||||
#[error(transparent)]
|
||||
HalfEdgeHasNoSibling(HalfEdgeHasNoSibling),
|
||||
|
||||
/// [`Shell`] contains half-edges that are coincident, but aren't siblings
|
||||
#[error(
|
||||
"`Shell` contains `HalfEdge`s that are coincident but are not \
|
||||
@ -293,9 +287,7 @@ mod tests {
|
||||
assert_contains_err!(
|
||||
core,
|
||||
invalid,
|
||||
ValidationError::Shell(
|
||||
ShellValidationError::HalfEdgeHasNoSibling { .. }
|
||||
)
|
||||
ValidationError::HalfEdgeHasNoSibling { .. }
|
||||
);
|
||||
|
||||
Ok(())
|
||||
|
@ -6,7 +6,7 @@ use crate::validate::{
|
||||
|
||||
use super::checks::{
|
||||
AdjacentHalfEdgesNotConnected, CurveGeometryMismatch, FaceHasNoBoundary,
|
||||
InteriorCycleHasInvalidWinding,
|
||||
HalfEdgeHasNoSibling, InteriorCycleHasInvalidWinding,
|
||||
};
|
||||
|
||||
/// An error that can occur during a validation
|
||||
@ -24,6 +24,10 @@ pub enum ValidationError {
|
||||
#[error(transparent)]
|
||||
FaceHasNoBoundary(#[from] FaceHasNoBoundary),
|
||||
|
||||
/// Half-edge has no sibling
|
||||
#[error(transparent)]
|
||||
HalfEdgeHasNoSibling(#[from] HalfEdgeHasNoSibling),
|
||||
|
||||
/// Interior cycle has invalid winding
|
||||
#[error(transparent)]
|
||||
InteriorCycleHasInvalidWinding(#[from] InteriorCycleHasInvalidWinding),
|
||||
|
Loading…
Reference in New Issue
Block a user