Skip to content

Commit

Permalink
Return bare face from BuildFace::triangle
Browse files Browse the repository at this point in the history
This gives the caller more flexibility on what to do with it.
  • Loading branch information
hannobraun committed Mar 23, 2023
1 parent 98160a2 commit 259c6a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/fj-kernel/src/operations/build/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub trait BuildFace {
points: [impl Into<Point<3>>; 3],
edges: [Option<Handle<GlobalEdge>>; 3],
objects: &mut Service<Objects>,
) -> (Handle<Face>, [Handle<GlobalEdge>; 3]) {
) -> (Face, [Handle<GlobalEdge>; 3]) {
let [a, b, c] = points.map(Into::into);

let surface = Surface::plane_from_points([a, b, c]).insert(objects);
Expand Down Expand Up @@ -46,7 +46,7 @@ pub trait BuildFace {
(cycle, global_edges)
};

let face = Face::new(surface, exterior, [], None).insert(objects);
let face = Face::new(surface, exterior, [], None);

(face, global_edges)
}
Expand Down
4 changes: 3 additions & 1 deletion crates/fj-kernel/src/operations/build/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use fj_math::Point;

use crate::{
objects::{Face, Objects, Shell},
operations::Insert,
services::Service,
};

Expand All @@ -25,7 +26,8 @@ pub trait BuildShell {
let (side_c, _) =
Face::triangle([b, c, d], [Some(bc), Some(dc), Some(bd)], objects);

let faces = [base, side_a, side_b, side_c];
let faces =
[base, side_a, side_b, side_c].map(|face| face.insert(objects));
Shell::new(faces)
}
}
Expand Down

0 comments on commit 259c6a7

Please sign in to comment.