Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address coherence issues in sweep algorithm #742

Merged
merged 3 commits into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions crates/fj-kernel/src/algorithms/sweep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,20 @@ 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| {
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())
Expand Down