mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-07 19:38:29 +00:00
Merge pull request #2309 from hannobraun/planes
Prevent accidental re-definition of basis plane geometry
This commit is contained in:
commit
b158c3feb6
@ -69,6 +69,14 @@ impl Geometry {
|
||||
surface: Handle<Surface>,
|
||||
geometry: SurfaceGeom,
|
||||
) {
|
||||
if self.surface.contains_key(&surface)
|
||||
&& (surface == self.xy_plane
|
||||
|| surface == self.xz_plane
|
||||
|| surface == self.yz_plane)
|
||||
{
|
||||
panic!("Attempting to redefine basis plane.");
|
||||
}
|
||||
|
||||
self.surface.insert(surface, geometry);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,12 @@ impl Layer<Geometry> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Define the geometry of the provided surface
|
||||
/// # Define the geometry of the provided surface
|
||||
///
|
||||
/// ## Panics
|
||||
///
|
||||
/// Panics, if the surface is a special pre-defined plane, like the basis
|
||||
/// planes (xy-, xz-, or yz-plane).
|
||||
pub fn define_surface(
|
||||
&mut self,
|
||||
surface: Handle<Surface>,
|
||||
|
Loading…
Reference in New Issue
Block a user