Skip to content

Commit

Permalink
Remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed May 24, 2022
1 parent 1ca9599 commit 5b7195a
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions crates/fj-kernel/src/topology/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,6 @@ impl Edge<3> {
Self { curve, vertices }
}

/// Construct an instance of `Edge`
///
/// # Implementation Note
///
/// This method accepts two `Handle<Vertex>`, and projects them onto the
/// curve, to create the local representation that is stored in `Edge`. This
/// could lead to incorrect results, as the caller could provide vertices
/// that don't actually lie on `curve`.
///
/// The good news is, that whole thing seems to be unnecessary. Or rather,
/// this whole method seems to be unnecessary. I reviewed all the call
/// sites, and in all cases, there seems to be a better way to construct the
/// `Edge`, without using this constructor.
///
/// Ideally, we'd just fix all those call sites and remove this method, to
/// completely avoid the potential for any bugs to occur here. Problem is,
/// some of those call sites can't be fixed easily, without building further
/// infrastructure. Here's one such piece of infrastructure, for which an
/// issue already exists:
/// <https://github.com/hannobraun/Fornjot/issues/399>
pub fn new_obsolete(
curve: Handle<Curve<3>>,
vertices: Option<[Handle<Vertex>; 2]>,
) -> Self {
let curve = LocalForm::canonical_only(curve);

let vertices = vertices.map(|vertices| {
vertices.map(|canonical| {
let local = curve
.canonical()
.get()
.point_to_curve_coords(canonical.get().point())
.local();
LocalForm::new(local, canonical)
})
});

Self { curve, vertices }
}

/// Build an edge using the [`EdgeBuilder`] API
pub fn builder(shape: &mut Shape) -> EdgeBuilder {
EdgeBuilder::new(shape)
Expand Down

0 comments on commit 5b7195a

Please sign in to comment.