mirror of https://github.com/hannobraun/Fornjot
Remove `PartialCurve::with_global_form`
This commit is contained in:
parent
8524c2f773
commit
651cd6bfa3
|
@ -42,8 +42,7 @@ impl TransformObject for PartialCurve {
|
|||
Ok(PartialCurve {
|
||||
path: self.path,
|
||||
surface,
|
||||
..Default::default()
|
||||
}
|
||||
.with_global_form(global_form))
|
||||
global_form,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,11 +68,9 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
|||
radius: impl Into<Scalar>,
|
||||
objects: &Objects,
|
||||
) -> Result<Self, ValidationError> {
|
||||
let curve = self
|
||||
.curve()
|
||||
.into_partial()
|
||||
.with_global_form(Some(self.extract_global_curve()))
|
||||
.update_as_circle_from_radius(radius);
|
||||
let mut curve = self.curve().into_partial();
|
||||
curve.global_form = Some(self.extract_global_curve());
|
||||
let curve = curve.update_as_circle_from_radius(radius);
|
||||
|
||||
let path = curve.path.expect("Expected path that was just created");
|
||||
|
||||
|
@ -143,9 +141,9 @@ impl HalfEdgeBuilder for PartialHalfEdge {
|
|||
|
||||
let curve = PartialCurve {
|
||||
surface: Some(surface),
|
||||
global_form: Some(self.extract_global_curve()),
|
||||
..Default::default()
|
||||
}
|
||||
.with_global_form(Some(self.extract_global_curve()))
|
||||
.update_as_line_from_points(points);
|
||||
|
||||
let [back, front] = {
|
||||
|
|
|
@ -9,10 +9,10 @@ use crate::{
|
|||
builder::{FaceBuilder, HalfEdgeBuilder},
|
||||
insert::Insert,
|
||||
objects::{
|
||||
Curve, Cycle, Face, FaceSet, HalfEdge, Objects, Shell, Surface,
|
||||
SurfaceVertex, Vertex,
|
||||
Cycle, Face, FaceSet, HalfEdge, Objects, Shell, Surface, SurfaceVertex,
|
||||
Vertex,
|
||||
},
|
||||
partial::HasPartial,
|
||||
partial::{HasPartial, PartialCurve},
|
||||
storage::Handle,
|
||||
};
|
||||
|
||||
|
@ -152,9 +152,16 @@ impl<'a> ShellBuilder<'a> {
|
|||
.with_surface(Some(surface.clone()))
|
||||
.with_global_form(Some(from.global_form().clone()));
|
||||
|
||||
let curve = Curve::partial().with_global_form(Some(
|
||||
side_up_prev.curve().global_form().clone(),
|
||||
));
|
||||
let curve = PartialCurve {
|
||||
global_form: Some(
|
||||
side_up_prev
|
||||
.curve()
|
||||
.global_form()
|
||||
.clone()
|
||||
.into(),
|
||||
),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
HalfEdge::partial()
|
||||
.with_curve(curve)
|
||||
|
|
|
@ -22,17 +22,6 @@ pub struct PartialCurve {
|
|||
}
|
||||
|
||||
impl PartialCurve {
|
||||
/// Provide a global form for the partial curve
|
||||
pub fn with_global_form(
|
||||
mut self,
|
||||
global_form: Option<impl Into<MaybePartial<GlobalCurve>>>,
|
||||
) -> Self {
|
||||
if let Some(global_form) = global_form {
|
||||
self.global_form = Some(global_form.into());
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Build a full [`Curve`] from the partial curve
|
||||
pub fn build(self, objects: &Objects) -> Result<Curve, ValidationError> {
|
||||
let path = self.path.expect("Can't build `Curve` without path");
|
||||
|
|
Loading…
Reference in New Issue