mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-12 11:16:58 +00:00
Add HalfEdgeGeometry
At this point, it is only an empty placeholder.
This commit is contained in:
parent
795fe382a0
commit
987ddd7e50
@ -3,14 +3,15 @@ use std::collections::BTreeMap;
|
||||
use fj_math::Vector;
|
||||
|
||||
use crate::{
|
||||
objects::{Objects, Surface},
|
||||
objects::{HalfEdge, Objects, Surface},
|
||||
storage::{Handle, HandleWrapper},
|
||||
};
|
||||
|
||||
use super::{GlobalPath, SurfaceGeometry};
|
||||
use super::{GlobalPath, HalfEdgeGeometry, SurfaceGeometry};
|
||||
|
||||
/// Geometric data that is associated with topological objects
|
||||
pub struct Geometry {
|
||||
half_edge: BTreeMap<Handle<HalfEdge>, HalfEdgeGeometry>,
|
||||
surface: BTreeMap<HandleWrapper<Surface>, SurfaceGeometry>,
|
||||
|
||||
xy_plane: Handle<Surface>,
|
||||
@ -22,6 +23,7 @@ impl Geometry {
|
||||
/// Create a new instance of `Geometry`
|
||||
pub fn new(objects: &Objects) -> Self {
|
||||
let mut self_ = Self {
|
||||
half_edge: BTreeMap::new(),
|
||||
surface: BTreeMap::new(),
|
||||
|
||||
xy_plane: objects.surfaces.xy_plane(),
|
||||
@ -62,6 +64,21 @@ impl Geometry {
|
||||
self.surface.insert(surface.into(), geometry);
|
||||
}
|
||||
|
||||
/// # Access the geometry of the provided half-edge
|
||||
///
|
||||
/// ## Panics
|
||||
///
|
||||
/// Panics, if the geometry of the half-edge is not defined.
|
||||
pub fn of_half_edge(
|
||||
&self,
|
||||
half_edge: &Handle<HalfEdge>,
|
||||
) -> HalfEdgeGeometry {
|
||||
self.half_edge
|
||||
.get(half_edge)
|
||||
.copied()
|
||||
.expect("Expected geometry of half-edge to be defined")
|
||||
}
|
||||
|
||||
/// # Access the geometry of the provided surface
|
||||
///
|
||||
/// ## Panics
|
||||
|
3
crates/fj-core/src/geometry/half_edge.rs
Normal file
3
crates/fj-core/src/geometry/half_edge.rs
Normal file
@ -0,0 +1,3 @@
|
||||
/// The geometry of a half-edge
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct HalfEdgeGeometry {}
|
@ -2,12 +2,14 @@
|
||||
|
||||
mod boundary;
|
||||
mod geometry;
|
||||
mod half_edge;
|
||||
mod path;
|
||||
mod surface;
|
||||
|
||||
pub use self::{
|
||||
boundary::{CurveBoundary, CurveBoundaryElement},
|
||||
geometry::Geometry,
|
||||
half_edge::HalfEdgeGeometry,
|
||||
path::{GlobalPath, SurfacePath},
|
||||
surface::SurfaceGeometry,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user