From e032ab1bc7d081aebb9c758e9532a728c9e6b7b3 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 30 Apr 2024 12:05:05 +0200 Subject: [PATCH 1/2] Refactor to prepare for follow-on change --- crates/fj-core/src/operations/build/shell.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/build/shell.rs b/crates/fj-core/src/operations/build/shell.rs index 9ab2fd54e..ccd1d0330 100644 --- a/crates/fj-core/src/operations/build/shell.rs +++ b/crates/fj-core/src/operations/build/shell.rs @@ -88,9 +88,11 @@ pub trait BuildShell { .zip_ext([[a, b], [b, c], [c, a]]) .zip_ext(curves_and_boundaries) .map(|((vertex, positions), (curve, boundary))| { + let boundary = boundary.reverse(); + let half_edge = HalfEdge::line_segment( positions, - Some(boundary.reverse()), + Some(boundary), surface.clone(), core, ); From b29d7312a91d9a4ef8e65120cb3ccd6479b8fbb0 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 29 Apr 2024 15:48:28 +0200 Subject: [PATCH 2/2] Set curve geometry in `BuildShell` method --- crates/fj-core/src/operations/build/shell.rs | 26 ++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/crates/fj-core/src/operations/build/shell.rs b/crates/fj-core/src/operations/build/shell.rs index ccd1d0330..7d4b955fd 100644 --- a/crates/fj-core/src/operations/build/shell.rs +++ b/crates/fj-core/src/operations/build/shell.rs @@ -4,10 +4,10 @@ use fj_interop::ext::ArrayExt; use fj_math::Point; use crate::{ - geometry::CurveBoundary, + geometry::{CurveBoundary, HalfEdgeGeom}, operations::{ build::{BuildFace, BuildHalfEdge, BuildSurface, Polygon}, - geometry::UpdateHalfEdgeGeometry, + geometry::{UpdateCurveGeometry, UpdateHalfEdgeGeometry}, insert::{Insert, IsInserted, IsInsertedNo, IsInsertedYes}, join::JoinCycle, reverse::ReverseCurveCoordinateSystems, @@ -90,21 +90,27 @@ pub trait BuildShell { .map(|((vertex, positions), (curve, boundary))| { let boundary = boundary.reverse(); - let half_edge = HalfEdge::line_segment( + let curve = curve.make_line_on_surface( positions, Some(boundary), surface.clone(), - core, + &mut core.layers.geometry, ); - half_edge + + HalfEdge::unjoined(core) .update_start_vertex(|_, _| vertex, core) - .update_curve(|_, _| curve, core) + .update_curve(|_, _| curve.clone(), core) .insert(core) .set_geometry( - *core - .layers - .geometry - .of_half_edge(&half_edge), + HalfEdgeGeom { + path: core + .layers + .geometry + .of_curve(&curve) + .local_on(&surface) + .path, + boundary, + }, &mut core.layers.geometry, ) })