Skip to content

Commit

Permalink
Add new-style curve geometry to Geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 13, 2024
1 parent b6146df commit 99582c6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions crates/fj-core/src/geometry/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ use crate::{
};

use super::{
vertex::LocalVertexGeom, CurveGeom, LocalCurveGeom, Path, SurfaceGeom,
VertexGeom,
vertex::LocalVertexGeom, CurveGeom, CurveGeom2, LocalCurveGeom, Path,
SurfaceGeom, VertexGeom,
};

/// Geometric data that is associated with topological objects
pub struct Geometry {
curve: BTreeMap<Handle<Curve>, CurveGeom>,
curve2: BTreeMap<Handle<Curve>, CurveGeom2>,
surface: BTreeMap<Handle<Surface>, SurfaceGeom>,
vertex: BTreeMap<Handle<Vertex>, VertexGeom>,

Expand All @@ -30,6 +31,7 @@ impl Geometry {
pub fn new(topology: &Topology) -> Self {
let mut self_ = Self {
curve: BTreeMap::new(),
curve2: BTreeMap::new(),
surface: BTreeMap::new(),
vertex: BTreeMap::new(),

Expand Down Expand Up @@ -116,6 +118,18 @@ impl Geometry {
self.curve.get(curve)
}

/// # Access the geometry of the provided curve
///
/// ## Implementation Note
///
/// There currently is an ongoing transition to a new geometry system. This
/// method returns the new-style geometry. Its name is temporary, while the
/// method returning the old-style geometry is still taking up the more
/// concise name.
pub fn of_curve_2(&self, curve: &Handle<Curve>) -> Option<&CurveGeom2> {
self.curve2.get(curve)
}

/// # Access the geometry of the provided surface
///
/// ## Panics
Expand Down

0 comments on commit 99582c6

Please sign in to comment.