mirror of https://github.com/hannobraun/Fornjot
Prepare for simplifying `SweepSketch`
`SweepSketch` has two internal code paths. All models have so far been using the more complicated one. This commit updates them to instead use the more simple one, in preparation of removing the more complicated one.
This commit is contained in:
parent
b78358dfd9
commit
125c21c7e2
|
@ -14,7 +14,7 @@ pub fn model(size: impl Into<Vector<3>>, core: &mut fj::core::Core) -> Solid {
|
||||||
let [x, y, z] = size.into().components;
|
let [x, y, z] = size.into().components;
|
||||||
|
|
||||||
let bottom_surface = core.layers.topology.surfaces.xy_plane();
|
let bottom_surface = core.layers.topology.surfaces.xy_plane();
|
||||||
let sweep_path = Vector::from([Scalar::ZERO, Scalar::ZERO, z]);
|
let sweep_path = Vector::from([Scalar::ZERO, Scalar::ZERO, -z]);
|
||||||
|
|
||||||
Sketch::empty(&core.layers.topology)
|
Sketch::empty(&core.layers.topology)
|
||||||
.add_regions(
|
.add_regions(
|
||||||
|
|
|
@ -18,7 +18,10 @@ pub fn model(radius: impl Into<Scalar>, core: &mut fj::core::Core) -> Solid {
|
||||||
cuboid.update_shell(
|
cuboid.update_shell(
|
||||||
cuboid.shells().only(),
|
cuboid.shells().only(),
|
||||||
|shell, core| {
|
|shell, core| {
|
||||||
let bottom_face = shell.faces().first();
|
let bottom_face = shell
|
||||||
|
.faces()
|
||||||
|
.nth(5)
|
||||||
|
.expect("Expected shell to have bottom face");
|
||||||
let offset = size / 2.;
|
let offset = size / 2.;
|
||||||
let depth = size / 2.;
|
let depth = size / 2.;
|
||||||
|
|
||||||
|
@ -32,11 +35,11 @@ pub fn model(radius: impl Into<Scalar>, core: &mut fj::core::Core) -> Solid {
|
||||||
core,
|
core,
|
||||||
);
|
);
|
||||||
|
|
||||||
let bottom_face = shell.faces().first();
|
let bottom_face = shell
|
||||||
let top_face = shell
|
|
||||||
.faces()
|
.faces()
|
||||||
.nth(5)
|
.nth(5)
|
||||||
.expect("Expected shell to have top face");
|
.expect("Expected shell to have bottom face");
|
||||||
|
let top_face = shell.faces().first();
|
||||||
|
|
||||||
[shell.add_through_hole(
|
[shell.add_through_hole(
|
||||||
[
|
[
|
||||||
|
|
|
@ -18,7 +18,7 @@ pub fn model(
|
||||||
core: &mut fj::core::Core,
|
core: &mut fj::core::Core,
|
||||||
) -> Solid {
|
) -> Solid {
|
||||||
let bottom_surface = core.layers.topology.surfaces.xy_plane();
|
let bottom_surface = core.layers.topology.surfaces.xy_plane();
|
||||||
let sweep_path = Vector::from([0., 0., height]);
|
let sweep_path = Vector::from([0., 0., -height]);
|
||||||
|
|
||||||
Sketch::empty(&core.layers.topology)
|
Sketch::empty(&core.layers.topology)
|
||||||
.add_regions(
|
.add_regions(
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub fn model(size: f64, split_pos: f64, core: &mut fj::core::Core) -> Solid {
|
||||||
let (shell, [face, _]) = shell.split_face(face, line, core);
|
let (shell, [face, _]) = shell.split_face(face, line, core);
|
||||||
|
|
||||||
[shell
|
[shell
|
||||||
.sweep_face_of_shell(face, [0., 0., -size / 2.], core)
|
.sweep_face_of_shell(face, [0., 0., size / 2.], core)
|
||||||
.shell]
|
.shell]
|
||||||
},
|
},
|
||||||
core,
|
core,
|
||||||
|
|
|
@ -41,7 +41,7 @@ pub fn model(
|
||||||
}
|
}
|
||||||
|
|
||||||
let bottom_surface = core.layers.topology.surfaces.xy_plane();
|
let bottom_surface = core.layers.topology.surfaces.xy_plane();
|
||||||
let sweep_path = Vector::from([0., 0., h]);
|
let sweep_path = Vector::from([0., 0., -h]);
|
||||||
|
|
||||||
Sketch::empty(&core.layers.topology)
|
Sketch::empty(&core.layers.topology)
|
||||||
.add_regions(
|
.add_regions(
|
||||||
|
|
Loading…
Reference in New Issue