Skip to content

Commit

Permalink
Fix update_as_triangle_from_global_points
Browse files Browse the repository at this point in the history
It never actually set the global positions.
  • Loading branch information
hannobraun committed Jan 13, 2023
1 parent 26861fd commit bdc5a2a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion crates/fj-kernel/src/builder/cycle.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use fj_interop::ext::ArrayExt;
use fj_math::Point;

use crate::{
Expand Down Expand Up @@ -183,10 +184,28 @@ impl CycleBuilder for PartialCycle {
&mut self,
points_global: [impl Into<Point<3>>; 3],
) -> [Partial<HalfEdge>; 3] {
let points_global = points_global.map(Into::into);

let points_surface = self
.surface
.write()
.update_as_plane_from_points(points_global);
self.update_as_polygon_from_points(points_surface)

let half_edges = self.update_as_polygon_from_points(points_surface);

for (mut half_edge, point) in half_edges.clone().zip_ext(points_global)
{
half_edge
.write()
.back_mut()
.write()
.surface_form
.write()
.global_form
.write()
.position = Some(point);
}

half_edges
}
}

0 comments on commit bdc5a2a

Please sign in to comment.