Return boundary from BuildHalfEdge::arc

This commit is contained in:
Hanno Braun 2024-06-28 18:16:05 +02:00
parent 9cddbb3c5f
commit eab0f0da5c
2 changed files with 5 additions and 3 deletions

View File

@ -59,7 +59,9 @@ pub trait BuildCycle {
[[a, b], [b, c], [c, d], [d, a]] [[a, b], [b, c], [c, d], [d, a]]
.into_iter() .into_iter()
.map(|[start, end]| { .map(|[start, end]| {
HalfEdge::arc(start, end, angle, surface.clone(), core) let (half_edge, _) =
HalfEdge::arc(start, end, angle, surface.clone(), core);
half_edge
}); });
Cycle::new(half_edges) Cycle::new(half_edges)

View File

@ -50,7 +50,7 @@ pub trait BuildHalfEdge {
angle_rad: impl Into<Scalar>, angle_rad: impl Into<Scalar>,
surface: Handle<Surface>, surface: Handle<Surface>,
core: &mut Core, core: &mut Core,
) -> Handle<HalfEdge> { ) -> (Handle<HalfEdge>, CurveBoundary<Point<1>>) {
let angle_rad = angle_rad.into(); let angle_rad = angle_rad.into();
if angle_rad <= -Scalar::TAU || angle_rad >= Scalar::TAU { if angle_rad <= -Scalar::TAU || angle_rad >= Scalar::TAU {
panic!("arc angle must be in the range (-2pi, 2pi) radians"); panic!("arc angle must be in the range (-2pi, 2pi) radians");
@ -76,7 +76,7 @@ pub trait BuildHalfEdge {
.geometry .geometry
.define_half_edge(half_edge.clone(), HalfEdgeGeom { boundary }); .define_half_edge(half_edge.clone(), HalfEdgeGeom { boundary });
half_edge (half_edge, boundary)
} }
/// Create a line segment /// Create a line segment