mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-27 10:29:28 +00:00
Merge pull request #2338 from hannobraun/geometry
Set curve geometry in `BuildShell::from_vertices_and_indices`
This commit is contained in:
commit
b5bcd2cf99
@ -4,10 +4,10 @@ use fj_interop::ext::ArrayExt;
|
|||||||
use fj_math::Point;
|
use fj_math::Point;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
geometry::CurveBoundary,
|
geometry::{CurveBoundary, HalfEdgeGeom},
|
||||||
operations::{
|
operations::{
|
||||||
build::{BuildFace, BuildHalfEdge, BuildSurface, Polygon},
|
build::{BuildFace, BuildHalfEdge, BuildSurface, Polygon},
|
||||||
geometry::UpdateHalfEdgeGeometry,
|
geometry::{UpdateCurveGeometry, UpdateHalfEdgeGeometry},
|
||||||
insert::{Insert, IsInserted, IsInsertedNo, IsInsertedYes},
|
insert::{Insert, IsInserted, IsInsertedNo, IsInsertedYes},
|
||||||
join::JoinCycle,
|
join::JoinCycle,
|
||||||
reverse::ReverseCurveCoordinateSystems,
|
reverse::ReverseCurveCoordinateSystems,
|
||||||
@ -88,21 +88,29 @@ pub trait BuildShell {
|
|||||||
.zip_ext([[a, b], [b, c], [c, a]])
|
.zip_ext([[a, b], [b, c], [c, a]])
|
||||||
.zip_ext(curves_and_boundaries)
|
.zip_ext(curves_and_boundaries)
|
||||||
.map(|((vertex, positions), (curve, boundary))| {
|
.map(|((vertex, positions), (curve, boundary))| {
|
||||||
let half_edge = HalfEdge::line_segment(
|
let boundary = boundary.reverse();
|
||||||
|
|
||||||
|
let curve = curve.make_line_on_surface(
|
||||||
positions,
|
positions,
|
||||||
Some(boundary.reverse()),
|
Some(boundary),
|
||||||
surface.clone(),
|
surface.clone(),
|
||||||
core,
|
&mut core.layers.geometry,
|
||||||
);
|
);
|
||||||
half_edge
|
|
||||||
|
HalfEdge::unjoined(core)
|
||||||
.update_start_vertex(|_, _| vertex, core)
|
.update_start_vertex(|_, _| vertex, core)
|
||||||
.update_curve(|_, _| curve, core)
|
.update_curve(|_, _| curve.clone(), core)
|
||||||
.insert(core)
|
.insert(core)
|
||||||
.set_geometry(
|
.set_geometry(
|
||||||
*core
|
HalfEdgeGeom {
|
||||||
.layers
|
path: core
|
||||||
.geometry
|
.layers
|
||||||
.of_half_edge(&half_edge),
|
.geometry
|
||||||
|
.of_curve(&curve)
|
||||||
|
.local_on(&surface)
|
||||||
|
.path,
|
||||||
|
boundary,
|
||||||
|
},
|
||||||
&mut core.layers.geometry,
|
&mut core.layers.geometry,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user