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::{
geometry,
objects::{Face, Surface},
shape::Shape,
};
use super::{CycleApprox, FaceApprox, Tolerance};
@ -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.]);
@ -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();

View File

@ -273,7 +273,6 @@ mod tests {
algorithms::Tolerance,
iter::ObjectIters,
objects::{Face, Surface},
shape::Shape,
};
#[test]
@ -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();
@ -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()
});

View File

@ -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();
@ -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.];
@ -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();

View File

@ -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 _;
@ -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();

View File

@ -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};
@ -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)
}

View File

@ -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};
@ -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();