mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-26 10:06:09 +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 fj_math::Vector;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
objects::{Objects, Surface},
|
objects::{HalfEdge, Objects, Surface},
|
||||||
storage::{Handle, HandleWrapper},
|
storage::{Handle, HandleWrapper},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{GlobalPath, SurfaceGeometry};
|
use super::{GlobalPath, HalfEdgeGeometry, SurfaceGeometry};
|
||||||
|
|
||||||
/// Geometric data that is associated with topological objects
|
/// Geometric data that is associated with topological objects
|
||||||
pub struct Geometry {
|
pub struct Geometry {
|
||||||
|
half_edge: BTreeMap<Handle<HalfEdge>, HalfEdgeGeometry>,
|
||||||
surface: BTreeMap<HandleWrapper<Surface>, SurfaceGeometry>,
|
surface: BTreeMap<HandleWrapper<Surface>, SurfaceGeometry>,
|
||||||
|
|
||||||
xy_plane: Handle<Surface>,
|
xy_plane: Handle<Surface>,
|
||||||
@ -22,6 +23,7 @@ impl Geometry {
|
|||||||
/// Create a new instance of `Geometry`
|
/// Create a new instance of `Geometry`
|
||||||
pub fn new(objects: &Objects) -> Self {
|
pub fn new(objects: &Objects) -> Self {
|
||||||
let mut self_ = Self {
|
let mut self_ = Self {
|
||||||
|
half_edge: BTreeMap::new(),
|
||||||
surface: BTreeMap::new(),
|
surface: BTreeMap::new(),
|
||||||
|
|
||||||
xy_plane: objects.surfaces.xy_plane(),
|
xy_plane: objects.surfaces.xy_plane(),
|
||||||
@ -62,6 +64,21 @@ impl Geometry {
|
|||||||
self.surface.insert(surface.into(), 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
|
/// # Access the geometry of the provided surface
|
||||||
///
|
///
|
||||||
/// ## Panics
|
/// ## 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 boundary;
|
||||||
mod geometry;
|
mod geometry;
|
||||||
|
mod half_edge;
|
||||||
mod path;
|
mod path;
|
||||||
mod surface;
|
mod surface;
|
||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
boundary::{CurveBoundary, CurveBoundaryElement},
|
boundary::{CurveBoundary, CurveBoundaryElement},
|
||||||
geometry::Geometry,
|
geometry::Geometry,
|
||||||
|
half_edge::HalfEdgeGeometry,
|
||||||
path::{GlobalPath, SurfacePath},
|
path::{GlobalPath, SurfacePath},
|
||||||
surface::SurfaceGeometry,
|
surface::SurfaceGeometry,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user