Skip to content

Commit 6be9e51

Browse files
committed
Fix some rebase issues
1 parent 0dd22bf commit 6be9e51

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

crates/viewer/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl GameApp for ViewerApp {
4747
// Model sourced from:
4848
// https://nist.gov/ctl/smart-connected-systems-division/smart-connected-manufacturing-systems-group/mbe-pmi-0
4949
// let keycap = Shape::read_step("crates/viewer/models/nist_ftc_06.step").unwrap();
50-
let keycap = examples::gizmo::shape();
50+
let keycap = examples::flywheel::shape();
5151

5252
let mesh = keycap.mesh();
5353
let cad_mesh = CadMesh::from_mesh(&mesh, graphics_device.device());

examples/src/bowl.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use glam::dvec3;
22
use opencascade::{
3-
primitives::{self, Direction, Solid},
3+
primitives::{Direction, Shape, Solid},
44
workplane::Workplane,
55
};
66

7-
pub fn main() {
7+
pub fn shape() -> Shape {
88
let bot_rad: f64 = 30.0;
99
let top_rad: f64 = 40.0;
1010
let height: f64 = 30.0;
@@ -14,16 +14,16 @@ pub fn main() {
1414

1515
// inner ( shell does not exist yest)
1616
let inner = bowly_shape(bot_rad - thickness, top_rad - thickness, height, thickness);
17-
(loft, _) = loft.subtract_shape(&inner);
17+
loft = loft.subtract(&inner).into();
1818

1919
// rouind out the top
2020
let top_side = loft.faces().farthest(Direction::PosZ).edges();
2121
loft.fillet_edges(thickness / 2.0, top_side);
2222

23-
loft.write_stl("bowl.stl").unwrap();
23+
loft
2424
}
2525

26-
fn bowly_shape(bot_rad: f64, top_rad: f64, height: f64, offset: f64) -> primitives::Shape {
26+
fn bowly_shape(bot_rad: f64, top_rad: f64, height: f64, offset: f64) -> Shape {
2727
let bottom = Workplane::xy().circle(0.0, 0.0, bot_rad);
2828
let mut top = Workplane::xy().circle(0.0, 0.0, top_rad);
2929
top.translate(dvec3(0.0, 0.0, height));

examples/src/flywheel.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use glam::dvec3;
22
use opencascade::{angle::Angle, primitives::Shape, workplane::Workplane};
33

4-
pub fn main() {
4+
pub fn shape() -> Shape {
55
let outer: f64 = 30.0;
66
let height: f64 = 8.0;
77
let thickness: f64 = 8.0;
@@ -10,22 +10,22 @@ pub fn main() {
1010

1111
let ring = rim(outer, thickness, height);
1212
let sp = spokes(outer - thickness / 2.0, thickness / 2.0, spoke_count);
13-
let (mut fly, smooth) = ring.union_shape(&sp);
14-
fly.fillet_edges(1.0, smooth);
13+
let mut fly = ring.union(&sp);
14+
fly.fillet_new_edges(1.0);
1515

1616
let the_hub = hub(hub_outer, thickness);
17-
let (mut fly, hub_con) = fly.union_shape(&the_hub);
18-
fly.fillet_edges(1.0, hub_con);
17+
let mut fly = fly.union(&the_hub);
18+
fly.fillet_new_edges(1.0);
1919

20-
fly.write_stl("flywheel.stl").unwrap();
20+
fly.into()
2121
}
2222

2323
fn rim(outer: f64, thickness: f64, height: f64) -> Shape {
2424
let outer_wire = Workplane::xy().circle(0.0, 0.0, outer);
2525
let mut ring = outer_wire.to_face().extrude(dvec3(0.0, 0.0, height)).to_shape();
2626
let inner_wire = Workplane::xy().circle(0.0, 0.0, outer - thickness / 2.0);
2727
let inner_ring = inner_wire.to_face().extrude(dvec3(0.0, 0.0, height)).to_shape();
28-
(ring, _) = ring.subtract_shape(&inner_ring);
28+
ring = ring.subtract(&inner_ring).into();
2929
ring.chamfer(0.1);
3030
ring
3131
}
@@ -51,7 +51,7 @@ fn spokes(length: f64, thickness: f64, count: usize) -> Shape {
5151
let mut first_s = spoke(length, thickness, 0.0);
5252
for i in 1..count {
5353
let s = spoke(length, thickness, incr * i as f64);
54-
(first_s, _) = first_s.union_shape(&s);
54+
first_s = first_s.union(&s).into();
5555
}
5656
first_s
5757
}

examples/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
pub mod bowl;
12
pub mod box_shape;
23
pub mod chamfer;
4+
pub mod flywheel;
35
pub mod gizmo;
46
pub mod high_level_bottle;
57
pub mod keyboard_case;

0 commit comments

Comments
 (0)