Skip to content

Commit

Permalink
Read vertex geometry in validation check
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jul 9, 2024
1 parent 22433ac commit be89c2e
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions crates/fj-core/src/validation/checks/curve_geometry_mismatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use itertools::Itertools;

use crate::{
geometry::Geometry,
queries::AllHalfEdgesWithSurface,
queries::{AllHalfEdgesWithSurface, CycleOfHalfEdge},
storage::Handle,
topology::{HalfEdge, Shell},
validation::{ValidationCheck, ValidationConfig},
Expand Down Expand Up @@ -130,8 +130,28 @@ impl ValidationCheck<Shell> for CurveGeometryMismatch {
// we have right now are circles, 3 would be enough to check
// for coincidence. But the first and last might be
// identical, so let's add an extra one.
let [a, d] =
geometry.of_half_edge(&half_edge_a).boundary.inner;
let [a, d] = [
geometry
.of_vertex(half_edge_a.start_vertex())
.unwrap()
.local_on(half_edge_a.curve())
.unwrap()
.position,
geometry
.of_vertex(
object
.find_cycle_of_half_edge(&half_edge_a)
.unwrap()
.half_edges()
.after(&half_edge_a)
.unwrap()
.start_vertex(),
)
.unwrap()
.local_on(half_edge_a.curve())
.unwrap()
.position,
];
let b = a + (d - a) * 1. / 3.;
let c = a + (d - a) * 2. / 3.;

Expand Down

0 comments on commit be89c2e

Please sign in to comment.