From fea00dd52f503f43a24ad0b4bb9174f08b910238 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 17 Mar 2022 13:50:25 +0100 Subject: [PATCH] Use convenient syntax in spacer model --- models/spacer/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/spacer/src/lib.rs b/models/spacer/src/lib.rs index 46cdf27f1..16af20e4a 100644 --- a/models/spacer/src/lib.rs +++ b/models/spacer/src/lib.rs @@ -1,5 +1,7 @@ use std::collections::HashMap; +use fj::prelude::*; + #[no_mangle] pub extern "C" fn model(args: &HashMap) -> fj::Shape { let outer = args @@ -22,10 +24,8 @@ pub extern "C" fn model(args: &HashMap) -> fj::Shape { fj::Circle::from_radius(outer).with_color([0, 0, 255, 255]); let inner_edge = fj::Circle::from_radius(inner); - let footprint = - fj::Difference2d::from_objects(outer_edge.into(), inner_edge.into()); - - let spacer = fj::Sweep::from_shape_and_length(footprint.into(), height); + let footprint = outer_edge.difference(&inner_edge); + let spacer = footprint.sweep(height); spacer.into() }