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

        if self.reverse {
            vertices.reverse()
        }

        let mut segment_vertices = vertices.clone();
        if self.vertices.is_none() {
            // The edge has no vertices, which means it connects to itself. We
            // need to reflect that in the approximation.

            if let Some(&vertex) = vertices.first() {
                segment_vertices.push(vertex);
            }
        }

        let mut segments = Vec::new();
        for segment in segment_vertices.windows(2) {
            let v0 = segment[0];
            let v1 = segment[1];

            segments.push([v0, v1].into());
        }

        Approx { vertices, segments }
    }
/// Compute an approximation of the edge
///
/// `tolerance` defines how far the approximation is allowed to deviate from
/// the actual edge.
Compute an approximation of the edge
`tolerance` defines how far the approximation is allowed to deviate from
the actual edge.
Compute an approximation of the edge ` tolerance ` defines how far the approximation is allowed to deviate from the actual edge .
pub fn approx(&self, tolerance: f64) -> Approx {
        let mut vertices = Vec::new();
        self.curve.approx(tolerance, &mut vertices);
        if self.reverse {
            vertices.reverse()
        }
        let mut segment_vertices = vertices.clone();
        if self.vertices.is_none() {
            // The edge has no vertices, which means it connects to itself. We
            // need to reflect that in the approximation.
            if let Some(&vertex) = vertices.first() {
                segment_vertices.push(vertex);
            }
        }
        let mut segments = Vec::new();
        for segment in segment_vertices.windows(2) {
            let v0 = segment[0];
            let v1 = segment[1];
            segments.push([v0, v1].into());
        }
        Approx { vertices, segments }
    }
pub fn approx ( & self , tolerance : f64 ) -> Approx { let mut vertices = Vec :: new ( ) ; self . curve . approx ( tolerance , & mut vertices ) ; if self . reverse { vertices . reverse ( ) } let mut segment_vertices = vertices . clone ( ) ; if self . vertices . is_none ( ) { // The edge has no vertices, which means it connects to itself. We // need to reflect that in the approximation. if let Some ( & vertex ) = vertices . first ( ) { segment_vertices . push ( vertex ) ; } } let mut segments = Vec :: new ( ) ; for segment in segment_vertices . windows ( 2 ) { let v0 = segment [ 0 ] ; let v1 = segment [ 1 ] ; segments . push ( [ v0 , v1 ] . into ( ) ) ; } Approx { vertices , segments } }
Compute an approximation of the edge
`tolerance` defines how far the approximation is allowed to deviate from
the actual edge.
Compute an approximation of the edge ` tolerance ` defines how far the approximation is allowed to deviate from the actual edge .
&self
tolerance
f64