Skip to content

Commit

Permalink
Return bare Solid from vertices-indices model
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jan 30, 2024
1 parent aab193e commit 379965d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
17 changes: 7 additions & 10 deletions models/vertices-indices/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ use fj::core::{
update::UpdateSolid,
},
services::Services,
storage::Handle,
};

pub fn model(services: &mut Services) -> Handle<Solid> {
Solid::empty()
.add_shells([Shell::from_vertices_and_indices(
[[0., 0., 0.], [1., 0., 0.], [0., 1., 0.], [0., 0., 1.]],
[[2, 1, 0], [0, 1, 3], [1, 2, 3], [2, 0, 3]],
services,
)
.insert(services)])
.insert(services)
pub fn model(services: &mut Services) -> Solid {
Solid::empty().add_shells([Shell::from_vertices_and_indices(
[[0., 0., 0.], [1., 0., 0.], [0., 1., 0.], [0., 0., 1.]],
[[2, 1, 0], [0, 1, 3], [1, 2, 3], [2, 0, 3]],
services,
)
.insert(services)])
}
4 changes: 1 addition & 3 deletions models/vertices-indices/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::ops::Deref;

use fj::{core::services::Services, handle_model};

fn main() -> fj::Result {
let mut services = Services::new();
let model = vertices_indices::model(&mut services);
handle_model(model.deref(), services)?;
handle_model(&model, services)?;
Ok(())
}

0 comments on commit 379965d

Please sign in to comment.