Merge pull request #2305 from hannobraun/validation

Update documentation of `AdjacentHalfEdgesNotConnected` validation check
This commit is contained in:
Hanno Braun 2024-03-28 13:05:34 +01:00 committed by GitHub
commit de0f75b4f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 4 deletions

View File

@ -1,9 +1,10 @@
use fj_math::Winding;
use crate::{
geometry::Geometry,
storage::Handle,
topology::{Cycle, Face},
validation::ValidationCheck,
validation::{ValidationCheck, ValidationConfig},
};
/// Interior [`Cycle`] of [`Face`] has invalid winding
@ -38,8 +39,8 @@ pub struct InteriorCycleHasInvalidWinding {
impl ValidationCheck<Face> for InteriorCycleHasInvalidWinding {
fn check(
object: &Face,
geometry: &crate::geometry::Geometry,
_: &crate::validation::ValidationConfig,
geometry: &Geometry,
_: &ValidationConfig,
) -> impl Iterator<Item = Self> {
object.region().interiors().iter().filter_map(|interior| {
let exterior = object.region().exterior();

View File

@ -7,7 +7,7 @@ use crate::{
validation::{validation_check::ValidationCheck, ValidationConfig},
};
/// Adjacent [`HalfEdge`]s in [`Cycle`] are not connected
/// # Adjacent [`HalfEdge`]s in [`Cycle`] are not connected
///
/// Each [`HalfEdge`] only references its start vertex. The end vertex is always
/// assumed to be the start vertex of the next [`HalfEdge`] in the cycle. This
@ -16,6 +16,25 @@ use crate::{
///
/// However, the *position* of that shared vertex is redundantly defined in both
/// [`HalfEdge`]s. This check verifies that both positions are the same.
///
/// ## Implementation Note
///
/// Having the vertex positions redundantly defined is not desirable, but
/// currently we lack the facilities to project a single definition (whether
/// local to a curve, local to a surface, or global in 3D space) into other
/// local contexts, where they are required for approximation/triangulation.
///
/// As of this writing, there is no issue for creating these facilities and
/// consolidating these redundant definitions, but the following issue tracks a
/// prerequisite of that:
///
/// <https://github.com/hannobraun/fornjot/issues/2118>
///
/// If there was a single definition for each vertex position, we wouldn't need
/// this validation check in its current form, but we would still need another
/// one that fills a similar gap. Namely, we would still need to check whether a
/// half-edge's start and end vertices are actually located on that half-edge's
/// curve.
#[derive(Clone, Debug, thiserror::Error)]
#[error(
"Adjacent `HalfEdge`s in `Cycle` are not connected\n\