Skip to content

Commit

Permalink
Consolidate redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 12, 2024
1 parent 754fcbb commit f60e50c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/fj-core/src/geometry/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ impl SurfaceGeom {
.map(|point_circle| {
circle.point_from_circle_coords([point_circle])
})
.map(|point_global| point_global + self.v * point_surface.v)
}
Path::Line(line) => {
// We don't need to approximate a line. So instead of creating a
// line segment to represent the line at this point, we just
// need this single point.
let point = line.origin()
+ line.direction() * point_surface.u
+ self.v * point_surface.v;
let point = line.origin() + line.direction() * point_surface.u;

[point, point]
}
};

let [a, b] =
[a, b].map(|point_global| point_global + self.v * point_surface.v);

let c = a + (b - a) / 2.;
let triangle = Triangle::from([a, b, c]);

Expand Down

0 comments on commit f60e50c

Please sign in to comment.