Provide Handle<Surface> to SweepHalfEdge

This commit is contained in:
Hanno Braun 2024-03-26 11:55:36 +01:00
parent 956c11322c
commit f5ac8608f6
2 changed files with 9 additions and 6 deletions

View File

@ -66,7 +66,7 @@ impl SweepCycle for Cycle {
let (side_face, top_edge) = bottom_half_edge.sweep_half_edge( let (side_face, top_edge) = bottom_half_edge.sweep_half_edge(
bottom_half_edge_next.start_vertex().clone(), bottom_half_edge_next.start_vertex().clone(),
&core.layers.geometry.of_surface(&surface), surface.clone(),
color, color,
path, path,
cache, cache,

View File

@ -2,7 +2,6 @@ use fj_interop::{ext::ArrayExt, Color};
use fj_math::{Point, Scalar, Vector}; use fj_math::{Point, Scalar, Vector};
use crate::{ use crate::{
geometry::SurfaceGeometry,
operations::{ operations::{
build::{BuildCycle, BuildHalfEdge}, build::{BuildCycle, BuildHalfEdge},
geometry::UpdateHalfEdgeGeometry, geometry::UpdateHalfEdgeGeometry,
@ -11,7 +10,7 @@ use crate::{
update::{UpdateCycle, UpdateHalfEdge}, update::{UpdateCycle, UpdateHalfEdge},
}, },
storage::Handle, storage::Handle,
topology::{Cycle, Face, HalfEdge, Region, Vertex}, topology::{Cycle, Face, HalfEdge, Region, Surface, Vertex},
Core, Core,
}; };
@ -39,7 +38,7 @@ pub trait SweepHalfEdge {
fn sweep_half_edge( fn sweep_half_edge(
&self, &self,
end_vertex: Handle<Vertex>, end_vertex: Handle<Vertex>,
surface: &SurfaceGeometry, surface: Handle<Surface>,
color: Option<Color>, color: Option<Color>,
path: impl Into<Vector<3>>, path: impl Into<Vector<3>>,
cache: &mut SweepCache, cache: &mut SweepCache,
@ -51,7 +50,7 @@ impl SweepHalfEdge for Handle<HalfEdge> {
fn sweep_half_edge( fn sweep_half_edge(
&self, &self,
end_vertex: Handle<Vertex>, end_vertex: Handle<Vertex>,
surface: &SurfaceGeometry, surface: Handle<Surface>,
color: Option<Color>, color: Option<Color>,
path: impl Into<Vector<3>>, path: impl Into<Vector<3>>,
cache: &mut SweepCache, cache: &mut SweepCache,
@ -60,7 +59,11 @@ impl SweepHalfEdge for Handle<HalfEdge> {
let path = path.into(); let path = path.into();
let geometry = core.layers.geometry.of_half_edge(self); let geometry = core.layers.geometry.of_half_edge(self);
let surface = geometry.path.sweep_surface_path(surface, path, core); let surface = geometry.path.sweep_surface_path(
&core.layers.geometry.of_surface(&surface),
path,
core,
);
// Next, we need to define the boundaries of the face. Let's start with // Next, we need to define the boundaries of the face. Let's start with
// the global vertices and edges. // the global vertices and edges.