pub fn build<T: Float>(mut self) -> OffParseResult<Concrete<T>> {
        // Reads the rank of the polytope.
        let rank = self.rank()?;

        // Deals with dumb degenerate cases.
        match rank {
            0 => return Ok(Concrete::nullitope()),
            1 => return Ok(Concrete::point()),
            2 => return Ok(Concrete::dyad()),
            _ => {}
        }

        // Reads the element numbers and vertices.
        let num_elems = self.el_nums(rank)?;
        let vertices = self.parse_vertices(num_elems[0], rank - 1)?;

        // Adds nullitope and vertices.
        self.abs.reserve(rank + 2);
        self.abs.push_min();
        self.abs.push_vertices(vertices.len());

        // Reads edges and faces.
        if rank >= 3 {
            let (edges, faces) = self.parse_edges_and_faces(rank, num_elems[1], num_elems[2])?;
            self.abs.push(edges);
            self.abs.push(faces);
        }

        // Adds all higher elements.
        for &num_el in num_elems.iter().take(rank - 1).skip(3) {
            let subelements = self.parse_els(num_el)?;
            self.abs.push(subelements);
        }

        // Caps the abstract polytope.
        if rank != 3 {
            self.abs.push_max();
        }

        // Builds the concrete polytope.

        // Safety: TODO this isn't actually safe. We need to do some checking.
        Ok(Concrete::new(vertices, unsafe { self.abs.build() }))
    }
/// Builds a concrete polytope from the OFF reader.
Builds a concrete polytope from the OFF reader.
Builds a concrete polytope from the OFF reader .
pub fn build<T: Float>(mut self) -> OffParseResult<Concrete<T>> {
        // Reads the rank of the polytope.
        let rank = self.rank()?;
        // Deals with dumb degenerate cases.
        match rank {
            0 => return Ok(Concrete::nullitope()),
            1 => return Ok(Concrete::point()),
            2 => return Ok(Concrete::dyad()),
            _ => {}
        }
        // Reads the element numbers and vertices.
        let num_elems = self.el_nums(rank)?;
        let vertices = self.parse_vertices(num_elems[0], rank - 1)?;
        // Adds nullitope and vertices.
        self.abs.reserve(rank + 2);
        self.abs.push_min();
        self.abs.push_vertices(vertices.len());
        // Reads edges and faces.
        if rank >= 3 {
            let (edges, faces) = self.parse_edges_and_faces(rank, num_elems[1], num_elems[2])?;
            self.abs.push(edges);
            self.abs.push(faces);
        }
        // Adds all higher elements.
        for &num_el in num_elems.iter().take(rank - 1).skip(3) {
            let subelements = self.parse_els(num_el)?;
            self.abs.push(subelements);
        }
        // Caps the abstract polytope.
        if rank != 3 {
            self.abs.push_max();
        }
        // Builds the concrete polytope.
        // Safety: TODO this isn't actually safe. We need to do some checking.
        Ok(Concrete::new(vertices, unsafe { self.abs.build() }))
    }
pub fn build < T : Float > ( mut self ) -> OffParseResult < Concrete < T > > { // Reads the rank of the polytope. let rank = self . rank ( ) ? ; // Deals with dumb degenerate cases. match rank { 0 => return Ok ( Concrete :: nullitope ( ) ) , 1 => return Ok ( Concrete :: point ( ) ) , 2 => return Ok ( Concrete :: dyad ( ) ) , _ => { } } // Reads the element numbers and vertices. let num_elems = self . el_nums ( rank ) ? ; let vertices = self . parse_vertices ( num_elems [ 0 ] , rank - 1 ) ? ; // Adds nullitope and vertices. self . abs . reserve ( rank + 2 ) ; self . abs . push_min ( ) ; self . abs . push_vertices ( vertices . len ( ) ) ; // Reads edges and faces. if rank >= 3 { let ( edges , faces ) = self . parse_edges_and_faces ( rank , num_elems [ 1 ] , num_elems [ 2 ] ) ? ; self . abs . push ( edges ) ; self . abs . push ( faces ) ; } // Adds all higher elements. for & num_el in num_elems . iter ( ) . take ( rank - 1 ) . skip ( 3 ) { let subelements = self . parse_els ( num_el ) ? ; self . abs . push ( subelements ) ; } // Caps the abstract polytope. if rank != 3 { self . abs . push_max ( ) ; } // Builds the concrete polytope. // Safety: TODO this isn't actually safe. We need to do some checking. Ok ( Concrete :: new ( vertices , unsafe { self . abs . build ( ) } ) ) }
Builds a concrete polytope from the OFF reader.
Builds a concrete polytope from the OFF reader .
mut self
mut self