mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 04:18:28 +00:00
Add CurveGeom
This commit is contained in:
parent
6b065639d2
commit
b94f3e46dd
36
crates/fj-core/src/geometry/curve.rs
Normal file
36
crates/fj-core/src/geometry/curve.rs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
use crate::{storage::Handle, topology::Surface};
|
||||||
|
|
||||||
|
use super::SurfacePath;
|
||||||
|
|
||||||
|
/// The geometric definition of a curve
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct CurveGeom {
|
||||||
|
/// # The redundant local definitions of the curve geometry
|
||||||
|
///
|
||||||
|
/// ## Implementation Note
|
||||||
|
///
|
||||||
|
/// Having multiple redundant definitions is undesirable. However, we can't
|
||||||
|
/// just use one global definition in 3D, as we need the local 2D
|
||||||
|
/// definitions to approximate and triangulate curves, and we currently
|
||||||
|
/// don't have the tools to project a global definition into a local
|
||||||
|
/// context.
|
||||||
|
///
|
||||||
|
/// Eventually, it should be possible to define the geometry of a curve
|
||||||
|
/// once, either locally or globally, and then convert that single
|
||||||
|
/// definition into (other) local contexts, as needed. There currently is no
|
||||||
|
/// issue to track that specifically, but there is the following issue,
|
||||||
|
/// which is a prerequisite for making the required tooling practical:
|
||||||
|
///
|
||||||
|
/// <https://github.com/hannobraun/fornjot/issues/2118>
|
||||||
|
pub definitions: Vec<LocalCurveGeom>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The geometric definition of a curve in 2D surface coordinates
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct LocalCurveGeom {
|
||||||
|
/// The path that defines the curve on its surface
|
||||||
|
pub path: SurfacePath,
|
||||||
|
|
||||||
|
/// The surface that the curve is defined on
|
||||||
|
pub surface: Handle<Surface>,
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
//! Types that are tied to objects, but aren't objects themselves
|
//! Types that are tied to objects, but aren't objects themselves
|
||||||
|
|
||||||
mod boundary;
|
mod boundary;
|
||||||
|
mod curve;
|
||||||
mod geometry;
|
mod geometry;
|
||||||
mod half_edge;
|
mod half_edge;
|
||||||
mod path;
|
mod path;
|
||||||
@ -8,6 +9,7 @@ mod surface;
|
|||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
boundary::{CurveBoundary, CurveBoundaryElement},
|
boundary::{CurveBoundary, CurveBoundaryElement},
|
||||||
|
curve::{CurveGeom, LocalCurveGeom},
|
||||||
geometry::Geometry,
|
geometry::Geometry,
|
||||||
half_edge::HalfEdgeGeom,
|
half_edge::HalfEdgeGeom,
|
||||||
path::{GlobalPath, SurfacePath},
|
path::{GlobalPath, SurfacePath},
|
||||||
|
Loading…
Reference in New Issue
Block a user