Added exporter

This commit is contained in:
Thomas Forgione
2018-02-23 14:34:25 +01:00
parent dd8e9be0d9
commit ac010c0530
4 changed files with 150 additions and 13 deletions
+13 -13
View File
@@ -45,9 +45,9 @@ impl ObjParser {
/// Parses an obj vertex line.
///
/// ```
/// # use dash_3d_exporter::math::vector::Vector3;
/// # use dash_3d_exporter::parser::obj::ObjParser;
/// # use dash_3d_exporter::parser::Element::Vertex;
/// # use model_converter::math::vector::Vector3;
/// # use model_converter::parser::obj::ObjParser;
/// # use model_converter::parser::Element::Vertex;
/// let obj = ObjParser::new();
/// let vertex = obj.parse_vertex(0, "v 1 2 3", "file.obj").unwrap();
/// assert_eq!(vertex, Vertex(Vector3::new(1.0, 2.0, 3.0)));
@@ -65,9 +65,9 @@ impl ObjParser {
/// Parses an obj texture coordinate line.
///
/// ```
/// # use dash_3d_exporter::math::vector::Vector2;
/// # use dash_3d_exporter::parser::obj::ObjParser;
/// # use dash_3d_exporter::parser::Element::TextureCoordinate;
/// # use model_converter::math::vector::Vector2;
/// # use model_converter::parser::obj::ObjParser;
/// # use model_converter::parser::Element::TextureCoordinate;
/// let obj = ObjParser::new();
/// let texture_coordinate = obj.parse_texture_coordinate(0, "vt 1 2", "file.obj").unwrap();
/// assert_eq!(texture_coordinate, TextureCoordinate(Vector2::new(1.0, 2.0)));
@@ -84,9 +84,9 @@ impl ObjParser {
/// Parses an obj normal line.
///
/// ```
/// # use dash_3d_exporter::math::vector::Vector3;
/// # use dash_3d_exporter::parser::obj::ObjParser;
/// # use dash_3d_exporter::parser::Element::Normal;
/// # use model_converter::math::vector::Vector3;
/// # use model_converter::parser::obj::ObjParser;
/// # use model_converter::parser::Element::Normal;
/// let obj = ObjParser::new();
/// let normal = obj.parse_normal(0, "vn 1 2 3", "file.obj").unwrap();
/// assert_eq!(normal, Normal(Vector3::new(1.0, 2.0, 3.0)));
@@ -106,10 +106,10 @@ impl ObjParser {
///
/// The index is changed to start from 0.
/// ```
/// # use dash_3d_exporter::math::vector::Vector3;
/// # use dash_3d_exporter::parser::obj::ObjParser;
/// # use dash_3d_exporter::parser::Element;
/// # use dash_3d_exporter::model::{Face, FaceVertex};
/// # use model_converter::math::vector::Vector3;
/// # use model_converter::parser::obj::ObjParser;
/// # use model_converter::parser::Element;
/// # use model_converter::model::{Face, FaceVertex};
/// let obj = ObjParser::new();
/// let face1 = obj.parse_face(0, "f 1 2 3", "file.obj").unwrap();
/// let face2 = Element::Face(Face::new(