Skip to content

Commit

Permalink
Remove unused function argument
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 28, 2022
1 parent 19724a3 commit 758fbe9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 32 deletions.
5 changes: 1 addition & 4 deletions crates/fj-kernel/src/algorithms/approx/faces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ mod tests {
use crate::{
geometry,
objects::{Face, Surface},
shape::Shape,
};

use super::{CycleApprox, FaceApprox, Tolerance};
Expand All @@ -95,8 +94,6 @@ mod tests {

let tolerance = Tolerance::from_scalar(Scalar::ONE)?;

let mut shape = Shape::new();

let a = Point::from([0., 0.]);
let b = Point::from([3., 0.]);
let c = Point::from([3., 3.]);
Expand All @@ -107,7 +104,7 @@ mod tests {
let g = Point::from([2., 2.]);
let h = Point::from([1., 2.]);

let face = Face::builder(Surface::xy_plane(), &mut shape)
let face = Face::builder(Surface::xy_plane())
.with_exterior_polygon([a, b, c, d])
.with_interior_polygon([e, f, g, h])
.build();
Expand Down
8 changes: 2 additions & 6 deletions crates/fj-kernel/src/algorithms/sweep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ mod tests {
algorithms::Tolerance,
iter::ObjectIters,
objects::{Face, Surface},
shape::Shape,
};

#[test]
Expand Down Expand Up @@ -362,9 +361,7 @@ mod tests {
) -> anyhow::Result<()> {
let tolerance = Tolerance::from_scalar(Scalar::ONE)?;

let mut shape = Shape::new();

let sketch = Face::builder(Surface::xy_plane(), &mut shape)
let sketch = Face::builder(Surface::xy_plane())
.with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]])
.build();

Expand All @@ -376,11 +373,10 @@ mod tests {
.map(|vertex| vertex.into())
.collect();

let mut shape = Shape::new();
let faces = expected_surfaces.into_iter().map(|surface| {
let surface = Surface::plane_from_points(surface);

Face::builder(surface, &mut shape)
Face::builder(surface)
.with_exterior_polygon(expected_vertices.clone())
.build()
});
Expand Down
9 changes: 2 additions & 7 deletions crates/fj-kernel/src/algorithms/triangulation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,16 @@ mod tests {
use crate::{
algorithms::Tolerance,
objects::{Face, Surface},
shape::Shape,
};

#[test]
fn simple() -> anyhow::Result<()> {
let mut shape = Shape::new();

let a = [0., 0.];
let b = [2., 0.];
let c = [2., 2.];
let d = [0., 1.];

let face = Face::builder(Surface::xy_plane(), &mut shape)
let face = Face::builder(Surface::xy_plane())
.with_exterior_polygon([a, b, c, d])
.build();

Expand All @@ -122,8 +119,6 @@ mod tests {

#[test]
fn simple_hole() -> anyhow::Result<()> {
let mut shape = Shape::new();

let a = [0., 0.];
let b = [4., 0.];
let c = [4., 4.];
Expand All @@ -134,7 +129,7 @@ mod tests {
let g = [3., 3.];
let h = [1., 2.];

let face = Face::builder(Surface::xy_plane(), &mut shape)
let face = Face::builder(Surface::xy_plane())
.with_exterior_polygon([a, b, c, d])
.with_interior_polygon([e, f, g, h])
.build();
Expand Down
8 changes: 2 additions & 6 deletions crates/fj-kernel/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,7 @@ impl<T> Iterator for Iter<T> {

#[cfg(test)]
mod tests {
use crate::{
objects::{Curve, Cycle, Edge, Face, Surface, Vertex},
shape::Shape,
};
use crate::objects::{Curve, Cycle, Edge, Face, Surface, Vertex};

use super::ObjectIters as _;

Expand Down Expand Up @@ -488,8 +485,7 @@ mod tests {

#[test]
fn face() {
let mut shape = Shape::new();
let face = Face::builder(Surface::xy_plane(), &mut shape)
let face = Face::builder(Surface::xy_plane())
.with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]])
.build();

Expand Down
7 changes: 2 additions & 5 deletions crates/fj-kernel/src/objects/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ use std::hash::{Hash, Hasher};
use fj_interop::mesh::Color;
use fj_math::Triangle;

use crate::{
builder::FaceBuilder,
shape::{LocalForm, Shape},
};
use crate::{builder::FaceBuilder, shape::LocalForm};

use super::{Cycle, Surface};

Expand Down Expand Up @@ -57,7 +54,7 @@ impl Face {
})
}
/// Build a face using the [`FaceBuilder`] API
pub fn builder(surface: Surface, _shape: &mut Shape) -> FaceBuilder {
pub fn builder(surface: Surface) -> FaceBuilder {
FaceBuilder::new(surface)
}

Expand Down
5 changes: 1 addition & 4 deletions crates/fj-operations/src/sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use fj_interop::debug::DebugInfo;
use fj_kernel::{
algorithms::Tolerance,
objects::{Face, Surface},
shape::Shape,
validation::{validate, Validated, ValidationConfig, ValidationError},
};
use fj_math::{Aabb, Point};
Expand All @@ -16,12 +15,10 @@ impl ToShape for fj::Sketch {
_: Tolerance,
_: &mut DebugInfo,
) -> Result<Validated<Vec<Face>>, ValidationError> {
let mut tmp = Shape::new();

let surface = Surface::xy_plane();
let points = self.to_points().into_iter().map(Point::from);

let sketch = Face::builder(surface, &mut tmp)
let sketch = Face::builder(surface)
.with_exterior_polygon(points)
.with_color(self.color())
.build();
Expand Down

0 comments on commit 758fbe9

Please sign in to comment.