mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-25 16:45:52 +00:00
Use convenient syntax in spacer model
This commit is contained in:
parent
222bb28771
commit
fea00dd52f
@ -1,5 +1,7 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
use fj::prelude::*;
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn model(args: &HashMap<String, String>) -> fj::Shape {
|
pub extern "C" fn model(args: &HashMap<String, String>) -> fj::Shape {
|
||||||
let outer = args
|
let outer = args
|
||||||
@ -22,10 +24,8 @@ pub extern "C" fn model(args: &HashMap<String, String>) -> fj::Shape {
|
|||||||
fj::Circle::from_radius(outer).with_color([0, 0, 255, 255]);
|
fj::Circle::from_radius(outer).with_color([0, 0, 255, 255]);
|
||||||
let inner_edge = fj::Circle::from_radius(inner);
|
let inner_edge = fj::Circle::from_radius(inner);
|
||||||
|
|
||||||
let footprint =
|
let footprint = outer_edge.difference(&inner_edge);
|
||||||
fj::Difference2d::from_objects(outer_edge.into(), inner_edge.into());
|
let spacer = footprint.sweep(height);
|
||||||
|
|
||||||
let spacer = fj::Sweep::from_shape_and_length(footprint.into(), height);
|
|
||||||
|
|
||||||
spacer.into()
|
spacer.into()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user