Skip to content

Commit

Permalink
Relax method argument
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Dec 13, 2022
1 parent 1b198af commit f33ad6e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
5 changes: 4 additions & 1 deletion crates/fj-kernel/src/algorithms/intersect/curve_face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ mod tests {
let face = {
let mut face = PartialFace::default();
face.with_exterior_polygon_from_points(surface.clone(), exterior);
face.with_interior_polygon_from_points(surface, interior);
face.with_interior_polygon_from_points(
Partial::from_full_entry_point(surface),
interior,
);

face.build(&mut services.objects)
};
Expand Down
7 changes: 5 additions & 2 deletions crates/fj-kernel/src/algorithms/triangulate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mod tests {
builder::FaceBuilder,
insert::Insert,
objects::Face,
partial::{PartialFace, PartialObject},
partial::{Partial, PartialFace, PartialObject},
services::Services,
storage::Handle,
};
Expand Down Expand Up @@ -135,7 +135,10 @@ mod tests {
let surface = services.objects.surfaces.xy_plane();
let mut face = PartialFace::default();
face.with_exterior_polygon_from_points(surface.clone(), [a, b, c, d]);
face.with_interior_polygon_from_points(surface.clone(), [e, f, g, h]);
face.with_interior_polygon_from_points(
Partial::from_full_entry_point(surface.clone()),
[e, f, g, h],
);
let face = face
.build(&mut services.objects)
.insert(&mut services.objects);
Expand Down
9 changes: 3 additions & 6 deletions crates/fj-kernel/src/builder/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub trait FaceBuilder {
/// Update the [`PartialFace`] with an interior polygon
fn with_interior_polygon_from_points(
&mut self,
surface: Handle<Surface>,
surface: Partial<Surface>,
points: impl IntoIterator<Item = impl Into<Point<2>>>,
);
}
Expand All @@ -43,14 +43,11 @@ impl FaceBuilder for PartialFace {

fn with_interior_polygon_from_points(
&mut self,
surface: Handle<Surface>,
surface: Partial<Surface>,
points: impl IntoIterator<Item = impl Into<Point<2>>>,
) {
let mut cycle = PartialCycle::default();
cycle.with_poly_chain_from_points(
Partial::from_full_entry_point(surface),
points,
);
cycle.with_poly_chain_from_points(surface, points);
cycle.close_with_line_segment();

self.interiors = vec![Partial::from_partial(cycle)];
Expand Down
4 changes: 2 additions & 2 deletions crates/fj-kernel/src/validate/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ mod tests {
[[0., 0.], [3., 0.], [0., 3.]],
);
face.with_interior_polygon_from_points(
surface,
Partial::from_full_entry_point(surface),
[[1., 1.], [1., 2.], [2., 1.]],
);

Expand Down Expand Up @@ -166,7 +166,7 @@ mod tests {
[[0., 0.], [3., 0.], [0., 3.]],
);
face.with_interior_polygon_from_points(
surface,
Partial::from_full_entry_point(surface),
[[1., 1.], [1., 2.], [2., 1.]],
);
face.build(&mut services.objects)
Expand Down

0 comments on commit f33ad6e

Please sign in to comment.