mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Prevent defining geometry for 2D space
This commit is contained in:
parent
87d7de90b3
commit
6383778ea4
@ -14,6 +14,8 @@ pub struct Geometry {
|
||||
half_edge: BTreeMap<Handle<HalfEdge>, HalfEdgeGeom>,
|
||||
surface: BTreeMap<Handle<Surface>, SurfaceGeom>,
|
||||
|
||||
space_2d: Handle<Surface>,
|
||||
|
||||
xy_plane: Handle<Surface>,
|
||||
xz_plane: Handle<Surface>,
|
||||
yz_plane: Handle<Surface>,
|
||||
@ -26,6 +28,8 @@ impl Geometry {
|
||||
half_edge: BTreeMap::new(),
|
||||
surface: BTreeMap::new(),
|
||||
|
||||
space_2d: topology.surfaces.space_2d(),
|
||||
|
||||
xy_plane: topology.surfaces.xy_plane(),
|
||||
xz_plane: topology.surfaces.xz_plane(),
|
||||
yz_plane: topology.surfaces.yz_plane(),
|
||||
@ -69,6 +73,10 @@ impl Geometry {
|
||||
surface: Handle<Surface>,
|
||||
geometry: SurfaceGeom,
|
||||
) {
|
||||
if surface == self.space_2d {
|
||||
panic!("Attempting to define geometry for 2D space");
|
||||
}
|
||||
|
||||
if self.surface.contains_key(&surface)
|
||||
&& (surface == self.xy_plane
|
||||
|| surface == self.xz_plane
|
||||
|
Loading…
Reference in New Issue
Block a user