Rename method

It's the only constructor left, so it can have the traditional name of a
constructor without loss of clarity.
This commit is contained in:
Hanno Braun 2022-03-22 15:29:29 +01:00
parent d5876b9650
commit 3437463070
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ impl Approximation {
///
/// `tolerance` defines how far the approximation is allowed to deviate from
/// the actual edges.
pub fn for_face(face: &Face, tolerance: Scalar) -> Self {
pub fn new(face: &Face, tolerance: Scalar) -> Self {
// Curved faces whose curvature is not fully defined by their edges
// are not supported yet. For that reason, we can fully ignore `face`'s
// `surface` field and just pass the edges to `Self::for_edges`.
@ -203,7 +203,7 @@ mod tests {
};
assert_eq!(
Approximation::for_face(&face, tolerance),
Approximation::new(&face, tolerance),
Approximation {
points: set![a, b, c, d],
segments: set![

View File

@ -25,7 +25,7 @@ pub fn triangulate(
match &*face {
Face::Face { surface, color, .. } => {
let surface = surface.get();
let approx = Approximation::for_face(&face, tolerance);
let approx = Approximation::new(&face, tolerance);
let points: Vec<_> = approx
.points