Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
asny committed Sep 2, 2024
1 parent 7dcbf32 commit a6cfc80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ default = []

[dependencies]
cgmath = "0.18"
three-d-asset = "0.4"
three-d-asset = "0.7"
thiserror = "1.0"

[dev-dependencies]
three-d-asset = {version="0.4", features = ["obj"] }
three-d-asset = {version="0.7", features = ["obj"] }
10 changes: 8 additions & 2 deletions src/mesh/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ impl Mesh {
/// # use tri_mesh::*;
/// let model: three_d_asset::Model =
/// three_d_asset::io::load_and_deserialize("cube.obj").expect("Failed loading asset");
/// let mesh = Mesh::new(&model.geometries[0]);
/// let mesh = match &model.geometries[0].geometry {
/// three_d_asset::Geometry::Triangles(mesh) => Mesh::new(mesh),
/// _ => panic!("Geometry is not a triangle mesh")
/// };
/// ```
///
/// ```
Expand Down Expand Up @@ -190,7 +193,10 @@ mod tests {
let mut raw_assets = three_d_asset::io::RawAssets::new();
raw_assets.insert("cube.obj", source);
let mut model: three_d_asset::Model = raw_assets.deserialize(".obj").unwrap();
let mesh: Mesh = model.geometries.remove(0).into();
let three_d_asset::Geometry::Triangles(m) = model.geometries.remove(0).geometry else {
unreachable!()
};
let mesh: Mesh = m.into();
assert_eq!(mesh.no_faces(), 12);
assert_eq!(mesh.no_vertices(), 8);
mesh.is_valid().unwrap();
Expand Down

0 comments on commit a6cfc80

Please sign in to comment.