mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 04:18:28 +00:00
Simplify CurveGeometry
impl for Circle
This commit is contained in:
parent
b868e7d953
commit
b81c916ede
@ -94,19 +94,19 @@ pub trait CurveGeometry {
|
|||||||
) -> Vec<Point<1>>;
|
) -> Vec<Point<1>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CurveGeometry for (Point<3>, Circle) {
|
impl CurveGeometry for Circle {
|
||||||
fn clone_curve_geometry(&self) -> FloatingCurve {
|
fn clone_curve_geometry(&self) -> FloatingCurve {
|
||||||
Box::new(*self)
|
Box::new(*self)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn vector_from_local_point(&self, point: Point<1>) -> Vector<3> {
|
fn vector_from_local_point(&self, point: Point<1>) -> Vector<3> {
|
||||||
let (_, circle) = *self;
|
let circle = *self;
|
||||||
|
|
||||||
circle.vector_from_local_point(point)
|
circle.vector_from_local_point(point)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn project_vector(&self, vector: Vector<3>) -> Point<1> {
|
fn project_vector(&self, vector: Vector<3>) -> Point<1> {
|
||||||
let (_, circle) = *self;
|
let circle = *self;
|
||||||
|
|
||||||
circle.project_vector(vector)
|
circle.project_vector(vector)
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ impl CurveGeometry for (Point<3>, Circle) {
|
|||||||
boundary: [Point<1>; 2],
|
boundary: [Point<1>; 2],
|
||||||
tolerance: Tolerance,
|
tolerance: Tolerance,
|
||||||
) -> Vec<Point<1>> {
|
) -> Vec<Point<1>> {
|
||||||
let (_, circle) = self;
|
let circle = self;
|
||||||
|
|
||||||
CircleApproxParams::new(circle.radius(), tolerance)
|
CircleApproxParams::new(circle.radius(), tolerance)
|
||||||
.approx_circle(boundary)
|
.approx_circle(boundary)
|
||||||
|
@ -112,7 +112,7 @@ impl Sketch {
|
|||||||
Handle::new(Curve {
|
Handle::new(Curve {
|
||||||
geometry: AnchoredCurve {
|
geometry: AnchoredCurve {
|
||||||
origin,
|
origin,
|
||||||
floating: Box::new((origin, circle)),
|
floating: Box::new(circle),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user