pub fn build(self) -> Result<Mesh, Error>
    {
        let positions = self.positions.ok_or(
            Error::NoPositionsSpecified {message: format!("Did you forget to specify the vertex positions?")})?;
        let indices = self.indices.unwrap_or((0..positions.len() as u32/3).collect());
        Ok(Mesh::new(indices, positions))
    }
///
/// Builds the mesh. Returns the mesh if the definition is valid and otherwise an error.
///
/// # Errors
///
/// If no positions are specified, [NoPositionsSpecified](crate::mesh_builder::Error::NoPositionsSpecified) error is returned.
///
Builds the mesh. Returns the mesh if the definition is valid and otherwise an error.
Builds the mesh . Returns the mesh if the definition is valid and otherwise an error .
pub fn build(self) -> Result<Mesh, Error>
    {
        let positions = self.positions.ok_or(
            Error::NoPositionsSpecified {message: format!("Did you forget to specify the vertex positions?")})?;
        let indices = self.indices.unwrap_or((0..positions.len() as u32/3).collect());
        Ok(Mesh::new(indices, positions))
    }
pub fn build ( self ) -> Result < Mesh , Error > { let positions = self . positions . ok_or ( Error :: NoPositionsSpecified { message : format ! ( " " ) } ) ? ; let indices = self . indices . unwrap_or ( ( 0 .. positions . len ( ) as u32 / 3 ) . collect ( ) ) ; Ok ( Mesh :: new ( indices , positions ) ) }
Builds the mesh.
Builds the mesh .
self
self
errors
If no positions are specified, [NoPositionsSpecified](crate::mesh_builder::Error::NoPositionsSpecified) error is returned.
If no positions are specified [ NoPositionsSpecified ] ( crate :: mesh_builder :: Error :: NoPositionsSpecified ) error is returned .