Update group syntax

This commit is contained in:
Hanno Braun 2022-03-16 15:36:03 +01:00
parent f1e23508ae
commit 37402d5f4e
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ where
} }
pub trait Union { pub trait Union {
fn union<Other>(&self, other: &Other) -> crate::Group fn group<Other>(&self, other: &Other) -> crate::Group
where where
Other: Clone + Into<crate::Shape3d>; Other: Clone + Into<crate::Shape3d>;
} }
@ -80,7 +80,7 @@ impl<T> Union for T
where where
T: Clone + Into<crate::Shape3d>, T: Clone + Into<crate::Shape3d>,
{ {
fn union<Other>(&self, other: &Other) -> crate::Group fn group<Other>(&self, other: &Other) -> crate::Group
where where
Other: Clone + Into<crate::Shape3d>, Other: Clone + Into<crate::Shape3d>,
{ {

View File

@ -15,7 +15,7 @@ pub extern "C" fn model(_: &HashMap<String, String>) -> fj::Shape {
let cube_a = fj::Sketch::from_points(vertices).sweep(1.0); let cube_a = fj::Sketch::from_points(vertices).sweep(1.0);
let cube_b = cube_a.clone().translate([1.5, 0., 0.5]); let cube_b = cube_a.clone().translate([1.5, 0., 0.5]);
let disjoint_union = cube_a.union(&cube_b); let disjoint_union = cube_a.group(&cube_b);
disjoint_union.into() disjoint_union.into()
} }