Remove unused function argument

This commit is contained in:
Hanno Braun 2022-06-28 18:50:38 +02:00
parent 19724a3010
commit 758fbe9308
6 changed files with 10 additions and 32 deletions

View File

@ -84,7 +84,6 @@ mod tests {
use crate::{ use crate::{
geometry, geometry,
objects::{Face, Surface}, objects::{Face, Surface},
shape::Shape,
}; };
use super::{CycleApprox, FaceApprox, Tolerance}; use super::{CycleApprox, FaceApprox, Tolerance};
@ -95,8 +94,6 @@ mod tests {
let tolerance = Tolerance::from_scalar(Scalar::ONE)?; let tolerance = Tolerance::from_scalar(Scalar::ONE)?;
let mut shape = Shape::new();
let a = Point::from([0., 0.]); let a = Point::from([0., 0.]);
let b = Point::from([3., 0.]); let b = Point::from([3., 0.]);
let c = Point::from([3., 3.]); let c = Point::from([3., 3.]);
@ -107,7 +104,7 @@ mod tests {
let g = Point::from([2., 2.]); let g = Point::from([2., 2.]);
let h = Point::from([1., 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_exterior_polygon([a, b, c, d])
.with_interior_polygon([e, f, g, h]) .with_interior_polygon([e, f, g, h])
.build(); .build();

View File

@ -273,7 +273,6 @@ mod tests {
algorithms::Tolerance, algorithms::Tolerance,
iter::ObjectIters, iter::ObjectIters,
objects::{Face, Surface}, objects::{Face, Surface},
shape::Shape,
}; };
#[test] #[test]
@ -362,9 +361,7 @@ mod tests {
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
let tolerance = Tolerance::from_scalar(Scalar::ONE)?; let tolerance = Tolerance::from_scalar(Scalar::ONE)?;
let mut shape = Shape::new(); let sketch = Face::builder(Surface::xy_plane())
let sketch = Face::builder(Surface::xy_plane(), &mut shape)
.with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]]) .with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]])
.build(); .build();
@ -376,11 +373,10 @@ mod tests {
.map(|vertex| vertex.into()) .map(|vertex| vertex.into())
.collect(); .collect();
let mut shape = Shape::new();
let faces = expected_surfaces.into_iter().map(|surface| { let faces = expected_surfaces.into_iter().map(|surface| {
let surface = Surface::plane_from_points(surface); let surface = Surface::plane_from_points(surface);
Face::builder(surface, &mut shape) Face::builder(surface)
.with_exterior_polygon(expected_vertices.clone()) .with_exterior_polygon(expected_vertices.clone())
.build() .build()
}); });

View File

@ -89,19 +89,16 @@ mod tests {
use crate::{ use crate::{
algorithms::Tolerance, algorithms::Tolerance,
objects::{Face, Surface}, objects::{Face, Surface},
shape::Shape,
}; };
#[test] #[test]
fn simple() -> anyhow::Result<()> { fn simple() -> anyhow::Result<()> {
let mut shape = Shape::new();
let a = [0., 0.]; let a = [0., 0.];
let b = [2., 0.]; let b = [2., 0.];
let c = [2., 2.]; let c = [2., 2.];
let d = [0., 1.]; 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]) .with_exterior_polygon([a, b, c, d])
.build(); .build();
@ -122,8 +119,6 @@ mod tests {
#[test] #[test]
fn simple_hole() -> anyhow::Result<()> { fn simple_hole() -> anyhow::Result<()> {
let mut shape = Shape::new();
let a = [0., 0.]; let a = [0., 0.];
let b = [4., 0.]; let b = [4., 0.];
let c = [4., 4.]; let c = [4., 4.];
@ -134,7 +129,7 @@ mod tests {
let g = [3., 3.]; let g = [3., 3.];
let h = [1., 2.]; 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_exterior_polygon([a, b, c, d])
.with_interior_polygon([e, f, g, h]) .with_interior_polygon([e, f, g, h])
.build(); .build();

View File

@ -439,10 +439,7 @@ impl<T> Iterator for Iter<T> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::{ use crate::objects::{Curve, Cycle, Edge, Face, Surface, Vertex};
objects::{Curve, Cycle, Edge, Face, Surface, Vertex},
shape::Shape,
};
use super::ObjectIters as _; use super::ObjectIters as _;
@ -488,8 +485,7 @@ mod tests {
#[test] #[test]
fn face() { fn face() {
let mut shape = Shape::new(); let face = Face::builder(Surface::xy_plane())
let face = Face::builder(Surface::xy_plane(), &mut shape)
.with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]]) .with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]])
.build(); .build();

View File

@ -3,10 +3,7 @@ use std::hash::{Hash, Hasher};
use fj_interop::mesh::Color; use fj_interop::mesh::Color;
use fj_math::Triangle; use fj_math::Triangle;
use crate::{ use crate::{builder::FaceBuilder, shape::LocalForm};
builder::FaceBuilder,
shape::{LocalForm, Shape},
};
use super::{Cycle, Surface}; use super::{Cycle, Surface};
@ -57,7 +54,7 @@ impl Face {
}) })
} }
/// Build a face using the [`FaceBuilder`] API /// 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) FaceBuilder::new(surface)
} }

View File

@ -2,7 +2,6 @@ use fj_interop::debug::DebugInfo;
use fj_kernel::{ use fj_kernel::{
algorithms::Tolerance, algorithms::Tolerance,
objects::{Face, Surface}, objects::{Face, Surface},
shape::Shape,
validation::{validate, Validated, ValidationConfig, ValidationError}, validation::{validate, Validated, ValidationConfig, ValidationError},
}; };
use fj_math::{Aabb, Point}; use fj_math::{Aabb, Point};
@ -16,12 +15,10 @@ impl ToShape for fj::Sketch {
_: Tolerance, _: Tolerance,
_: &mut DebugInfo, _: &mut DebugInfo,
) -> Result<Validated<Vec<Face>>, ValidationError> { ) -> Result<Validated<Vec<Face>>, ValidationError> {
let mut tmp = Shape::new();
let surface = Surface::xy_plane(); let surface = Surface::xy_plane();
let points = self.to_points().into_iter().map(Point::from); 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_exterior_polygon(points)
.with_color(self.color()) .with_color(self.color())
.build(); .build();