diff --git a/fj/src/lib.rs b/fj/src/lib.rs index 7a04c27a7..03fef9087 100644 --- a/fj/src/lib.rs +++ b/fj/src/lib.rs @@ -16,8 +16,7 @@ mod syntax; pub mod prelude { pub use crate::syntax::{ - Difference as _, Rotate as _, Sketch as _, Sweep as _, Translate as _, - Union as _, + Rotate as _, Sketch as _, Sweep as _, Translate as _, Union as _, }; } diff --git a/fj/src/shape_3d.rs b/fj/src/shape_3d.rs index b974890b1..9c167973c 100644 --- a/fj/src/shape_3d.rs +++ b/fj/src/shape_3d.rs @@ -4,9 +4,6 @@ use crate::{Shape, Shape2d}; #[derive(Clone, Debug)] #[repr(C)] pub enum Shape3d { - /// The difference of two 3-dimensional shapes - Difference(Box), - /// A sweep of 2-dimensional shape along the z-axis Sweep(Sweep), @@ -23,37 +20,6 @@ impl From for Shape { } } -/// The difference of two 3-dimensional shapes -/// -/// # Limitations -/// -/// This operation is not supported right now. Using it in a model, will result -/// in the host application crashing. -/// -/// See issue: -/// https://github.com/hannobraun/Fornjot/issues/43 -#[derive(Clone, Debug)] -#[repr(C)] -pub struct Difference { - /// The first of the shapes - pub a: Shape3d, - - /// The second of the shapes - pub b: Shape3d, -} - -impl From for Shape { - fn from(shape: Difference) -> Self { - Self::Shape3d(Shape3d::Difference(Box::new(shape))) - } -} - -impl From for Shape3d { - fn from(shape: Difference) -> Self { - Self::Difference(Box::new(shape)) - } -} - /// A transformed 3-dimensional shape /// /// # Limitations diff --git a/fj/src/syntax.rs b/fj/src/syntax.rs index 124d1302f..31e57d8a5 100644 --- a/fj/src/syntax.rs +++ b/fj/src/syntax.rs @@ -34,27 +34,6 @@ where } } -pub trait Difference { - fn difference(&self, other: &Other) -> crate::Difference - where - Other: Clone + Into; -} - -impl Difference for T -where - T: Clone + Into, -{ - fn difference(&self, other: &Other) -> crate::Difference - where - Other: Clone + Into, - { - let a = self.clone().into(); - let b = other.clone().into(); - - crate::Difference { a, b } - } -} - pub trait Sweep { fn sweep(&self, length: f64) -> crate::Sweep; } diff --git a/src/kernel/shapes/difference_3d.rs b/src/kernel/shapes/difference_3d.rs deleted file mode 100644 index 92496f37c..000000000 --- a/src/kernel/shapes/difference_3d.rs +++ /dev/null @@ -1,24 +0,0 @@ -use crate::{ - debug::DebugInfo, - kernel::topology::{edges::Edges, faces::Faces, vertices::Vertices, Shape}, - math::{Aabb, Scalar}, -}; - -use super::ToShape; - -impl ToShape for fj::Difference { - fn to_shape(&self, _: Scalar, _: &mut DebugInfo) -> Shape { - Shape { - vertices: Vertices(Vec::new()), - edges: Edges { cycles: Vec::new() }, - faces: Faces(Vec::new()), - } - } - - fn bounding_volume(&self) -> Aabb<3> { - // This is a conservative estimate of the bounding box: It's never going - // to be bigger than the bounding box of the original shape that another - // is being subtracted from. - self.a.bounding_volume() - } -} diff --git a/src/kernel/shapes/mod.rs b/src/kernel/shapes/mod.rs index 67c1e8b02..a3ef73a72 100644 --- a/src/kernel/shapes/mod.rs +++ b/src/kernel/shapes/mod.rs @@ -1,6 +1,5 @@ pub mod circle; pub mod difference_2d; -pub mod difference_3d; pub mod sketch; pub mod sweep; pub mod transform; @@ -54,7 +53,6 @@ macro_rules! dispatch { $( fn $method(&self, $($arg_name: $arg_ty,)*) -> $ret { match self { - Self::Difference(shape) => shape.$method($($arg_name,)*), Self::Sweep(shape) => shape.$method($($arg_name,)*), Self::Transform(shape) => shape.$method($($arg_name,)*), Self::Union(shape) => shape.$method($($arg_name,)*),