mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-11 13:28:28 +00:00
Prepare to support other curves besides lines
This commit is contained in:
parent
e42a283475
commit
9f09428c66
3
experiments/2025-03-18/src/geometry/curve.rs
Normal file
3
experiments/2025-03-18/src/geometry/curve.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
pub trait CurveGeometry {}
|
||||||
|
|
||||||
|
impl CurveGeometry for () {}
|
@ -1,5 +1,9 @@
|
|||||||
|
mod curve;
|
||||||
mod sketch;
|
mod sketch;
|
||||||
mod surface;
|
mod surface;
|
||||||
mod tri_mesh;
|
mod tri_mesh;
|
||||||
|
|
||||||
pub use self::{sketch::Sketch, surface::SurfaceGeometry, tri_mesh::ToTriMesh};
|
pub use self::{
|
||||||
|
curve::CurveGeometry, sketch::Sketch, surface::SurfaceGeometry,
|
||||||
|
tri_mesh::ToTriMesh,
|
||||||
|
};
|
||||||
|
@ -22,8 +22,12 @@ impl TranslateExt for Curve {
|
|||||||
// 3D space, which means we have to do the actual translation here.
|
// 3D space, which means we have to do the actual translation here.
|
||||||
// We'll see how it shakes out.
|
// We'll see how it shakes out.
|
||||||
|
|
||||||
let Curve {} = self;
|
let Curve { geometry } = self;
|
||||||
Curve {}
|
let _ = geometry;
|
||||||
|
|
||||||
|
Curve {
|
||||||
|
geometry: Box::new(()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
|
use crate::geometry::CurveGeometry;
|
||||||
|
|
||||||
use super::vertex::Vertex;
|
use super::vertex::Vertex;
|
||||||
|
|
||||||
pub struct Curve {}
|
pub struct Curve {
|
||||||
|
pub geometry: Box<dyn CurveGeometry>,
|
||||||
|
}
|
||||||
|
|
||||||
impl Curve {
|
impl Curve {
|
||||||
pub fn line_from_vertices(_: [&Vertex; 2]) -> Self {
|
pub fn line_from_vertices(_: [&Vertex; 2]) -> Self {
|
||||||
Curve {}
|
Self {
|
||||||
|
geometry: Box::new(()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user