mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-08 11:58:27 +00:00
Prepare to display intermediate result
This commit is contained in:
parent
e86b14ef0c
commit
6db159c174
@ -10,9 +10,7 @@ mod topology;
|
|||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
let tri_mesh = fj_viewer::make_viewer_and_spawn_thread(|viewer| {
|
let tri_mesh = fj_viewer::make_viewer_and_spawn_thread(|viewer| {
|
||||||
let tri_mesh = model::model();
|
model::model(&viewer)
|
||||||
viewer.display(tri_mesh.clone());
|
|
||||||
tri_mesh
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
fj_export::export(&tri_mesh, "output.3mf")?;
|
fj_export::export(&tri_mesh, "output.3mf")?;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use fj_interop::TriMesh;
|
use fj_interop::TriMesh;
|
||||||
use fj_math::{Point, Vector};
|
use fj_math::{Point, Vector};
|
||||||
|
use fj_viewer::Viewer;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
geometry::{Sketch, ToTriMesh},
|
geometry::{Sketch, ToTriMesh},
|
||||||
@ -9,7 +10,7 @@ use crate::{
|
|||||||
topology::surface::Surface,
|
topology::surface::Surface,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn model() -> TriMesh {
|
pub fn model(viewer: &Viewer) -> TriMesh {
|
||||||
let top = {
|
let top = {
|
||||||
let sketch = Sketch::from([
|
let sketch = Sketch::from([
|
||||||
// outer boundary
|
// outer boundary
|
||||||
@ -44,6 +45,7 @@ pub fn model() -> TriMesh {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let solid = top.sweep([0., 0., -2.]);
|
let solid = top.sweep([0., 0., -2.]);
|
||||||
|
viewer.display(solid.to_tri_mesh());
|
||||||
|
|
||||||
solid.to_tri_mesh()
|
solid.to_tri_mesh()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user