mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-14 14:58:29 +00:00
Merge pull request #2299 from hannobraun/geometry
Provide `Handle<Surface>` to sweep code
This commit is contained in:
commit
8b21004c00
@ -50,7 +50,7 @@ impl AddHole for Shell {
|
|||||||
core,
|
core,
|
||||||
)
|
)
|
||||||
.sweep_region(
|
.sweep_region(
|
||||||
location.face.surface(),
|
location.face.surface().clone(),
|
||||||
None,
|
None,
|
||||||
path,
|
path,
|
||||||
&mut SweepCache::default(),
|
&mut SweepCache::default(),
|
||||||
@ -113,7 +113,7 @@ impl AddHole for Shell {
|
|||||||
core,
|
core,
|
||||||
)
|
)
|
||||||
.sweep_region(
|
.sweep_region(
|
||||||
entry_location.face.surface(),
|
entry_location.face.surface().clone(),
|
||||||
None,
|
None,
|
||||||
path,
|
path,
|
||||||
&mut SweepCache::default(),
|
&mut SweepCache::default(),
|
||||||
|
@ -2,11 +2,11 @@ use fj_interop::Color;
|
|||||||
use fj_math::Vector;
|
use fj_math::Vector;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
geometry::SurfaceGeometry,
|
|
||||||
operations::{
|
operations::{
|
||||||
build::BuildCycle, join::JoinCycle, sweep::half_edge::SweepHalfEdge,
|
build::BuildCycle, join::JoinCycle, sweep::half_edge::SweepHalfEdge,
|
||||||
},
|
},
|
||||||
topology::{Cycle, Face},
|
storage::Handle,
|
||||||
|
topology::{Cycle, Face, Surface},
|
||||||
Core,
|
Core,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ pub trait SweepCycle {
|
|||||||
/// operation is called in, and therefore falls outside of its scope.
|
/// operation is called in, and therefore falls outside of its scope.
|
||||||
fn sweep_cycle(
|
fn sweep_cycle(
|
||||||
&self,
|
&self,
|
||||||
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,
|
||||||
@ -49,7 +49,7 @@ pub trait SweepCycle {
|
|||||||
impl SweepCycle for Cycle {
|
impl SweepCycle for Cycle {
|
||||||
fn sweep_cycle(
|
fn sweep_cycle(
|
||||||
&self,
|
&self,
|
||||||
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,
|
||||||
@ -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(),
|
||||||
surface,
|
surface.clone(),
|
||||||
color,
|
color,
|
||||||
path,
|
path,
|
||||||
cache,
|
cache,
|
||||||
|
@ -50,7 +50,7 @@ impl SweepFace for Handle<Face> {
|
|||||||
let other_faces = bottom_face
|
let other_faces = bottom_face
|
||||||
.region()
|
.region()
|
||||||
.sweep_region(
|
.sweep_region(
|
||||||
bottom_face.surface(),
|
bottom_face.surface().clone(),
|
||||||
bottom_face.region().get_color(core),
|
bottom_face.region().get_color(core),
|
||||||
path,
|
path,
|
||||||
cache,
|
cache,
|
||||||
|
@ -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.
|
||||||
|
@ -2,7 +2,6 @@ use fj_interop::Color;
|
|||||||
use fj_math::Vector;
|
use fj_math::Vector;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
geometry::SurfaceGeometry,
|
|
||||||
operations::{
|
operations::{
|
||||||
insert::Insert, reverse::Reverse, transform::TransformObject,
|
insert::Insert, reverse::Reverse, transform::TransformObject,
|
||||||
},
|
},
|
||||||
@ -32,7 +31,7 @@ pub trait SweepRegion {
|
|||||||
/// operation's scope.
|
/// operation's scope.
|
||||||
fn sweep_region(
|
fn sweep_region(
|
||||||
&self,
|
&self,
|
||||||
surface: &Handle<Surface>,
|
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,
|
||||||
@ -43,7 +42,7 @@ pub trait SweepRegion {
|
|||||||
impl SweepRegion for Region {
|
impl SweepRegion for Region {
|
||||||
fn sweep_region(
|
fn sweep_region(
|
||||||
&self,
|
&self,
|
||||||
surface: &Handle<Surface>,
|
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,
|
||||||
@ -55,7 +54,7 @@ impl SweepRegion for Region {
|
|||||||
|
|
||||||
let top_exterior = sweep_cycle(
|
let top_exterior = sweep_cycle(
|
||||||
self.exterior(),
|
self.exterior(),
|
||||||
&core.layers.geometry.of_surface(surface),
|
surface.clone(),
|
||||||
color,
|
color,
|
||||||
&mut faces,
|
&mut faces,
|
||||||
path,
|
path,
|
||||||
@ -69,7 +68,7 @@ impl SweepRegion for Region {
|
|||||||
.map(|bottom_cycle| {
|
.map(|bottom_cycle| {
|
||||||
sweep_cycle(
|
sweep_cycle(
|
||||||
bottom_cycle,
|
bottom_cycle,
|
||||||
&core.layers.geometry.of_surface(surface),
|
surface.clone(),
|
||||||
color,
|
color,
|
||||||
&mut faces,
|
&mut faces,
|
||||||
path,
|
path,
|
||||||
@ -96,7 +95,7 @@ impl SweepRegion for Region {
|
|||||||
|
|
||||||
fn sweep_cycle(
|
fn sweep_cycle(
|
||||||
bottom_cycle: &Cycle,
|
bottom_cycle: &Cycle,
|
||||||
bottom_surface: &SurfaceGeometry,
|
bottom_surface: Handle<Surface>,
|
||||||
color: Option<Color>,
|
color: Option<Color>,
|
||||||
faces: &mut Vec<Face>,
|
faces: &mut Vec<Face>,
|
||||||
path: Vector<3>,
|
path: Vector<3>,
|
||||||
|
@ -66,7 +66,7 @@ impl SweepFaceOfShell for Shell {
|
|||||||
.derive_from(face.region().exterior(), core);
|
.derive_from(face.region().exterior(), core);
|
||||||
let region = Region::new(exterior, []);
|
let region = Region::new(exterior, []);
|
||||||
let swept_region = region.sweep_region(
|
let swept_region = region.sweep_region(
|
||||||
face.surface(),
|
face.surface().clone(),
|
||||||
face.region().get_color(core),
|
face.region().get_color(core),
|
||||||
path,
|
path,
|
||||||
&mut cache,
|
&mut cache,
|
||||||
|
Loading…
Reference in New Issue
Block a user