mirror of
https://github.com/hannobraun/Fornjot
synced 2025-11-06 15:10:04 +00:00
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:
parent
d5876b9650
commit
3437463070
@ -28,7 +28,7 @@ impl Approximation {
|
|||||||
///
|
///
|
||||||
/// `tolerance` defines how far the approximation is allowed to deviate from
|
/// `tolerance` defines how far the approximation is allowed to deviate from
|
||||||
/// the actual edges.
|
/// 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
|
// Curved faces whose curvature is not fully defined by their edges
|
||||||
// are not supported yet. For that reason, we can fully ignore `face`'s
|
// are not supported yet. For that reason, we can fully ignore `face`'s
|
||||||
// `surface` field and just pass the edges to `Self::for_edges`.
|
// `surface` field and just pass the edges to `Self::for_edges`.
|
||||||
@ -203,7 +203,7 @@ mod tests {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Approximation::for_face(&face, tolerance),
|
Approximation::new(&face, tolerance),
|
||||||
Approximation {
|
Approximation {
|
||||||
points: set![a, b, c, d],
|
points: set![a, b, c, d],
|
||||||
segments: set![
|
segments: set![
|
||||||
|
|||||||
@ -25,7 +25,7 @@ pub fn triangulate(
|
|||||||
match &*face {
|
match &*face {
|
||||||
Face::Face { surface, color, .. } => {
|
Face::Face { surface, color, .. } => {
|
||||||
let surface = surface.get();
|
let surface = surface.get();
|
||||||
let approx = Approximation::for_face(&face, tolerance);
|
let approx = Approximation::new(&face, tolerance);
|
||||||
|
|
||||||
let points: Vec<_> = approx
|
let points: Vec<_> = approx
|
||||||
.points
|
.points
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user