mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-08 03:48:27 +00:00
Implement Clone
for FloatingCurve
This commit is contained in:
parent
af589bde5e
commit
63775d1789
@ -60,9 +60,7 @@ impl AnchoredCurve {
|
||||
pub fn translate(&self, offset: impl Into<Vector<3>>) -> Self {
|
||||
Self {
|
||||
origin: self.origin + offset,
|
||||
floating: FloatingCurve {
|
||||
inner: self.floating.inner.clone_curve_geometry(),
|
||||
},
|
||||
floating: self.floating.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,9 +77,7 @@ impl Clone for AnchoredCurve {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
origin: self.origin,
|
||||
floating: FloatingCurve {
|
||||
inner: self.floating.inner.clone_curve_geometry(),
|
||||
},
|
||||
floating: self.floating.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -97,6 +93,14 @@ impl FloatingCurve {
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for FloatingCurve {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
inner: self.inner.clone_curve_geometry(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait CurveGeometry {
|
||||
fn clone_curve_geometry(&self) -> Box<dyn CurveGeometry>;
|
||||
fn vector_from_local_point(&self, point: Point<1>) -> Vector<3>;
|
||||
|
@ -39,9 +39,7 @@ impl SweptCurve {
|
||||
let v = {
|
||||
let v = AnchoredCurve {
|
||||
origin: self.u.point_from_local(u),
|
||||
floating: FloatingCurve {
|
||||
inner: self.v.inner.clone_curve_geometry(),
|
||||
},
|
||||
floating: self.v.clone(),
|
||||
};
|
||||
|
||||
v.project_point(point)
|
||||
@ -62,9 +60,7 @@ impl SweptCurve {
|
||||
pub fn translate(&self, offset: impl Into<Vector<3>>) -> Self {
|
||||
Self {
|
||||
u: self.u.translate(offset),
|
||||
v: FloatingCurve {
|
||||
inner: self.v.inner.clone_curve_geometry(),
|
||||
},
|
||||
v: self.v.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,9 +88,7 @@ fn build_connecting_faces(
|
||||
let curve = Curve {
|
||||
geometry: AnchoredCurve {
|
||||
origin: a.point,
|
||||
floating: FloatingCurve {
|
||||
inner: connecting_curve.inner.clone_curve_geometry(),
|
||||
},
|
||||
floating: connecting_curve.clone(),
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user