Expand description
Dear ImPlot3D - Rust bindings (high level)
Safe wrapper over dear-implot3d-sys, designed to integrate with
dear-imgui-rs. Mirrors dear-implot design: context + Ui facade,
builder-style helpers, optional mint inputs.
§Quick Start
use dear_imgui_rs::*;
use dear_implot3d::*;
let mut imgui_ctx = Context::create();
let plot3d_ctx = Plot3DContext::create(&imgui_ctx);
// In your main loop:
let ui = imgui_ctx.frame();
let plot_ui = plot3d_ctx.get_plot_ui(&ui);
if let Some(_token) = plot_ui.begin_plot("3D Plot").build() {
let xs = [0.0, 1.0, 2.0];
let ys = [0.0, 1.0, 0.0];
let zs = [0.0, 0.5, 1.0];
plot_ui.plot_line_f32("Line", &xs, &ys, &zs, Line3DFlags::NONE);
}§Features
- mint: Enable support for
mintmath types (Point3, Vector3)
§Architecture
This crate follows the same design patterns as dear-implot:
Plot3DContext: Manages the ImPlot3D context (create once)Plot3DUi: Per-frame access to plotting functions- RAII tokens:
Plot3DTokenautomatically callsEndPloton drop - Builder pattern: Fluent API for configuring plots
- Type-safe flags: Using
bitflags!for compile-time safety
Re-exports§
pub use plots::*;
Modules§
Structs§
- Axis3D
Flags - Axis flags (per-axis)
- Colormap
Color Index - Zero-based color entry inside the active or selected colormap.
- Colormap
Index - Runtime ImPlot3D colormap index.
- Colormap
Token - Token for managing colormap changes.
- Context
- An imgui context.
- Image3D
ByAxes Builder - Image by axes builder
- Image3D
ByCorners Builder - Image by corners builder
- Image3D
Flags - Image flags
- Item3D
Flags - Item flags (common to plot items)
- Line3D
Flags - Line flags
- Mesh3D
Builder - Mesh plot builder
- Mesh3D
Flags - Mesh flags
- Plot3D
Builder - Plot builder for configuring the 3D plot
- Plot3D
Context - Plot3D context wrapper
- Plot3D
Data Layout - Data layout used by ImPlot3D item builders.
- Plot3D
Data Offset - Sample-index offset used by ImPlot3D item data access.
- Plot3D
Data Stride - Byte stride used by ImPlot3D item data access.
- Plot3D
Flags - Flags for ImPlot3D plot configuration
- Plot3D
Item Array Style - One-shot array-backed item style overrides for the next ImPlot3D submission.
- Plot3D
Item Style - Common style overrides for plot items backed by
ImPlot3DSpec. - Plot3D
Token - RAII token that ends the plot on drop
- Plot3D
Ui - Per-frame access helper mirroring
dear-implot - Quad3D
Flags - Quad flags
- Scatter3D
Flags - Scatter flags
- Style
Color Token - Token for managing style color changes.
- Style
VarToken - Token for managing style variable changes.
- Styled
Plot3D - Styled wrapper for plot types that do not store item-style state directly.
- Surface3D
Builder - Surface (grid) plot builder (f32 variant)
- Surface3D
Flags - Surface flags
- Triangle3D
Flags - Triangle flags
- Ui
- Represents the Dear ImGui user interface for one frame
Enums§
- Axis3D
- 3D axis selector (X/Y/Z)
- Colormap
- Built-in ImPlot3D colormaps.
- Marker3D
- Plot3D
Color Element - Colorable ImPlot3D style elements.
- Plot3D
Cond - Condition for setup calls (match ImGuiCond)
- Plot3D
Style Var - ImPlot3D style variables.
Traits§
- Plot3D
Item Flagged - Shared ImPlot3D item-flag builder methods for plot builders backed by
ImPlot3DSpec. - Plot3D
Item Styled - Shared ImPlot3D item-style builder methods for plot builders backed by
ImPlot3DSpec.