Prepare to support other curves besides lines

This commit is contained in:
Hanno Braun 2025-04-07 13:00:02 +02:00
parent e42a283475
commit 9f09428c66
4 changed files with 22 additions and 5 deletions

View File

@ -0,0 +1,3 @@
pub trait CurveGeometry {}
impl CurveGeometry for () {}

View File

@ -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,
};

View File

@ -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(()),
}
} }
} }

View File

@ -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(()),
}
} }
} }