From 051d68ff77179ab790fa386176ae7c1e52750761 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 29 Jun 2022 14:14:01 +0200 Subject: [PATCH 1/3] Simplify handling of local curves in sweep How it was done previously was wrong. The way it's done now is still wrong (I added a comment about that), but at least it's simpler, and allows me to make some changes to the curve reversal stuff. --- crates/fj-kernel/src/algorithms/sweep.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index 4ffee264f8..dce7c268a8 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -124,7 +124,16 @@ fn reverse_local_coordinates_in_cycle(cycles: &CyclesInFace) -> CyclesInFace { .iter() .map(|edge| { let curve = LocalForm::new( - edge.local().curve.local().reverse(), + // This is wrong. We have reversed the direction of the + // surface, thereby modifying its coordinate system. So we + // can't just use the local form of the curve, which is + // expressed in surface coordinates, as-is. + // + // This is a coherence issue, but since coherence validation + // is not complete, and the whole local form stuff is still + // a work in progress, this doesn't lead to any observable + // bugs. + *edge.local().curve.local(), edge.local().curve.canonical(), ); let vertices = edge.local().vertices.clone().map(|vertex| { From 3ac9b55c147042ca2b3a9560c8fbd4faa22ecbb5 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 29 Jun 2022 13:47:06 +0200 Subject: [PATCH 2/3] Fix coherence issue in sweep algorithm --- crates/fj-kernel/src/algorithms/sweep.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index dce7c268a8..763775e8b3 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -137,7 +137,7 @@ fn reverse_local_coordinates_in_cycle(cycles: &CyclesInFace) -> CyclesInFace { edge.local().curve.canonical(), ); let vertices = edge.local().vertices.clone().map(|vertex| { - let local = -(*vertex.local()); + let local = *vertex.local(); LocalForm::new(local, vertex.canonical()) }); let local = Edge { curve, vertices }; From 481dc1c4d1e91f412e2720652c84b31f153c1404 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 29 Jun 2022 14:00:00 +0200 Subject: [PATCH 3/3] Refactor --- crates/fj-kernel/src/algorithms/sweep.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index 763775e8b3..0645b2a85f 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -137,8 +137,7 @@ fn reverse_local_coordinates_in_cycle(cycles: &CyclesInFace) -> CyclesInFace { edge.local().curve.canonical(), ); let vertices = edge.local().vertices.clone().map(|vertex| { - let local = *vertex.local(); - LocalForm::new(local, vertex.canonical()) + LocalForm::new(*vertex.local(), vertex.canonical()) }); let local = Edge { curve, vertices }; LocalForm::new(local, edge.canonical())