Crate deuxfleurs

Source
Expand description

§Deuxfleurs

Documentation

pres

Viewer for geometry processing / meshes / 3d related stuff heavily inspired by polyscope (which is very nice, check it out!).

Can be used in webpages thanks to wasm, so web-based slides can include demos, or simply for making code demo easily accessible on the web. An example can be found here.

§How to use

Here’s a quick example that loads a mesh and uses a button to show/hide it:

use deuxfleurs::egui;
use deuxfleurs::{load_mesh, RunningState, Settings};
// Init the app
let mut handle = deuxfleurs::init();
// Load the mesh and register it:
let (v, f) = load_mesh("bunny.obj").await.unwrap();
handle.register_surface("bunny".into(), v, f);

// Toggle between shown or not on button pressed
let callback = |ui: &mut egui::Ui, state: &mut RunningState| {
    if ui
        .add(egui::Button::new("Toggle shown"))
        .clicked()
    {
        let mut surface = state.get_surface_mut("bunny").unwrap();
        let shown = surface.shown();
        surface.show(!shown);
    }
};
// Run the app
handle.run(
    1080,
    720,
    Some("deuxfleurs-demo".into()),
    Settings::default(),
    callback,
);

More examples are available in the corresponding folder.

Re-exports§

pub use egui;

Modules§

attachment
data
internal
Re exported types for visibility
point_cloud
segment
surface
types
General types for genericity in functions parameters.
ui
Custom Ui components for mesh loading

Structs§

Color
RGBA double precision color.
Settings
Global rendering settings

Functions§

init
First initialization of the app. The resulting InitialState can then be used to register geometries and data. It the has to be ran.
load_mesh
load_mesh_blocking

Type Aliases§

InitialState
Starting point to build the app.
RunningState
Holds the application state. Starting point to add visualization datas.