pub fn approx(&self, tolerance: f64) -> Approx {
        let mut vertices = Vec::new();
        let mut segments = Vec::new();

        for edge in &self.edges {
            let approx = edge.approx(tolerance);

            vertices.extend(approx.vertices);
            segments.extend(approx.segments);
        }

        // As this is a cycle, the last vertex of an edge could be identical to
        // the first vertex of the next. Let's remove those duplicates.
        vertices.dedup();

        Approx { vertices, segments }
    }
/// Compute an approximation of the cycle
///
/// `tolerance` defines how far the approximation is allowed to deviate from
/// the actual cycle.
Compute an approximation of the cycle
`tolerance` defines how far the approximation is allowed to deviate from
the actual cycle.
Compute an approximation of the cycle ` tolerance ` defines how far the approximation is allowed to deviate from the actual cycle .
pub fn approx(&self, tolerance: f64) -> Approx {
        let mut vertices = Vec::new();
        let mut segments = Vec::new();
        for edge in &self.edges {
            let approx = edge.approx(tolerance);
            vertices.extend(approx.vertices);
            segments.extend(approx.segments);
        }
        // As this is a cycle, the last vertex of an edge could be identical to
        // the first vertex of the next. Let's remove those duplicates.
        vertices.dedup();
        Approx { vertices, segments }
    }
pub fn approx ( & self , tolerance : f64 ) -> Approx { let mut vertices = Vec :: new ( ) ; let mut segments = Vec :: new ( ) ; for edge in & self . edges { let approx = edge . approx ( tolerance ) ; vertices . extend ( approx . vertices ) ; segments . extend ( approx . segments ) ; } // As this is a cycle, the last vertex of an edge could be identical to // the first vertex of the next. Let's remove those duplicates. vertices . dedup ( ) ; Approx { vertices , segments } }
Compute an approximation of the cycle
`tolerance` defines how far the approximation is allowed to deviate from
the actual cycle.
Compute an approximation of the cycle ` tolerance ` defines how far the approximation is allowed to deviate from the actual cycle .
&self
tolerance
f64