-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2229 from hannobraun/validation
Start cleanup of validation infrastructure
- Loading branch information
Showing
17 changed files
with
214 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use fj_math::Scalar; | ||
|
||
/// Configuration required for the validation process | ||
#[derive(Debug, Clone, Copy)] | ||
pub struct ValidationConfig { | ||
/// The minimum distance between distinct objects | ||
/// | ||
/// Objects whose distance is less than the value defined in this field, are | ||
/// considered identical. | ||
pub distinct_min_distance: Scalar, | ||
|
||
/// The maximum distance between identical objects | ||
/// | ||
/// Objects that are considered identical might still have a distance | ||
/// between them, due to inaccuracies of the numerical representation. If | ||
/// that distance is less than the one defined in this field, can not be | ||
/// considered identical. | ||
pub identical_max_distance: Scalar, | ||
} | ||
|
||
impl Default for ValidationConfig { | ||
fn default() -> Self { | ||
Self { | ||
distinct_min_distance: Scalar::from_f64(5e-7), // 0.5 µm, | ||
|
||
// This value was chosen pretty arbitrarily. Seems small enough to | ||
// catch errors. If it turns out it's too small (because it produces | ||
// false positives due to floating-point accuracy issues), we can | ||
// adjust it. | ||
identical_max_distance: Scalar::from_f64(5e-14), | ||
} | ||
} | ||
} |
Oops, something went wrong.