From bdc5a2a07f378581ba4a259e689e781bdd499c8e Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 13 Jan 2023 16:58:57 +0100 Subject: [PATCH] Fix `update_as_triangle_from_global_points` It never actually set the global positions. --- crates/fj-kernel/src/builder/cycle.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/builder/cycle.rs b/crates/fj-kernel/src/builder/cycle.rs index ca2ca9a37..10ce138b2 100644 --- a/crates/fj-kernel/src/builder/cycle.rs +++ b/crates/fj-kernel/src/builder/cycle.rs @@ -1,3 +1,4 @@ +use fj_interop::ext::ArrayExt; use fj_math::Point; use crate::{ @@ -183,10 +184,28 @@ impl CycleBuilder for PartialCycle { &mut self, points_global: [impl Into>; 3], ) -> [Partial; 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 } }