Avoid use of BuildHalfEdge::circle

This commit is contained in:
Hanno Braun 2024-06-05 20:44:15 +02:00
parent a88b054754
commit 02c96f76c6

View File

@ -4,15 +4,15 @@ use fj_math::{Point, Scalar, Vector};
use crate::{
storage::Handle,
topology::{Cycle, Face, HalfEdge, Region, Shell},
topology::{Cycle, Face, Region, Shell},
Core,
};
use super::{
build::{BuildCycle, BuildHalfEdge, BuildRegion},
build::{BuildCycle, BuildRegion},
join::JoinCycle,
sweep::{SweepCache, SweepRegion},
update::{UpdateCycle, UpdateFace, UpdateRegion, UpdateShell},
update::{UpdateFace, UpdateRegion, UpdateShell},
};
/// Add a hole to a [`Shell`]
@ -82,7 +82,7 @@ impl AddHole for Shell {
) -> Self {
let radius = radius.into();
let entry = HalfEdge::circle(
let entry = Cycle::circle(
entry_location.position,
radius,
entry_location.face.surface().clone(),
@ -104,10 +104,7 @@ impl AddHole for Shell {
};
let swept_region = Region::empty(core)
.update_exterior(
|_, core| Cycle::empty().add_half_edges([entry.clone()], core),
core,
)
.update_exterior(|_, _| entry.clone(), core)
.sweep_region(
entry_location.face.surface().clone(),
None,
@ -129,19 +126,7 @@ impl AddHole for Shell {
entry_location.face,
|face, core| {
[face.update_region(
|region, core| {
region.add_interiors(
[Cycle::empty().add_joined_edges(
[(
entry.clone(),
*core.layers.geometry.of_half_edge(&entry),
)],
entry_location.face.surface().clone(),
core,
)],
core,
)
},
|region, core| region.add_interiors([entry], core),
core,
)]
},