mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-11 21:38:31 +00:00
Simplify make_line_on_surface
This commit is contained in:
parent
acc0c00d48
commit
c267df6cff
@ -87,6 +87,8 @@ pub trait BuildHalfEdge {
|
||||
surface: Handle<Surface>,
|
||||
core: &mut Core,
|
||||
) -> Handle<HalfEdge> {
|
||||
let boundary = boundary.unwrap_or_default();
|
||||
|
||||
let half_edge = HalfEdge::unjoined(core).insert(core);
|
||||
|
||||
half_edge.curve().clone().make_line_on_surface(
|
||||
@ -96,12 +98,9 @@ pub trait BuildHalfEdge {
|
||||
&mut core.layers.geometry,
|
||||
);
|
||||
|
||||
core.layers.geometry.define_half_edge(
|
||||
half_edge.clone(),
|
||||
HalfEdgeGeom {
|
||||
boundary: boundary.unwrap_or_default(),
|
||||
},
|
||||
);
|
||||
core.layers
|
||||
.geometry
|
||||
.define_half_edge(half_edge.clone(), HalfEdgeGeom { boundary });
|
||||
|
||||
half_edge
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ pub trait BuildShell {
|
||||
|
||||
let curve = curve.make_line_on_surface(
|
||||
positions,
|
||||
Some(boundary),
|
||||
boundary,
|
||||
surface.clone(),
|
||||
&mut core.layers.geometry,
|
||||
);
|
||||
|
@ -35,7 +35,7 @@ pub trait UpdateCurveGeometry {
|
||||
fn make_line_on_surface(
|
||||
self,
|
||||
points_surface: [impl Into<Point<2>>; 2],
|
||||
points_curve: Option<CurveBoundary<Point<1>>>,
|
||||
points_curve: CurveBoundary<Point<1>>,
|
||||
surface: Handle<Surface>,
|
||||
geometry: &mut Layer<Geometry>,
|
||||
) -> Self;
|
||||
@ -71,11 +71,10 @@ impl UpdateCurveGeometry for Handle<Curve> {
|
||||
fn make_line_on_surface(
|
||||
self,
|
||||
points_surface: [impl Into<Point<2>>; 2],
|
||||
points_curve: Option<CurveBoundary<Point<1>>>,
|
||||
points_curve: CurveBoundary<Point<1>>,
|
||||
surface: Handle<Surface>,
|
||||
geometry: &mut Layer<Geometry>,
|
||||
) -> Self {
|
||||
let points_curve = points_curve.unwrap_or_default();
|
||||
let path = SurfacePath::line_from_points_with_coords(
|
||||
points_curve.inner.zip_ext(points_surface),
|
||||
);
|
||||
|
@ -133,7 +133,7 @@ impl SweepHalfEdge for Handle<HalfEdge> {
|
||||
.unwrap_or_else(|| Curve::new().insert(core))
|
||||
.make_line_on_surface(
|
||||
[start, end],
|
||||
Some(boundary),
|
||||
boundary,
|
||||
surface.clone(),
|
||||
&mut core.layers.geometry,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user