Skip to main content

Crate dear_implot3d

Crate dear_implot3d 

Source
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 mint math 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: Plot3DToken automatically calls EndPlot on drop
  • Builder pattern: Fluent API for configuring plots
  • Type-safe flags: Using bitflags! for compile-time safety

Re-exports§

pub use plots::*;

Modules§

meshes
Predefined mesh data for common 3D shapes
plots
Modular plot types for ImPlot3D

Structs§

Axis3DFlags
Axis flags (per-axis)
ColormapColorIndex
Zero-based color entry inside the active or selected colormap.
ColormapIndex
Runtime ImPlot3D colormap index.
ColormapToken
Token for managing colormap changes.
Context
An imgui context.
Image3DByAxesBuilder
Image by axes builder
Image3DByCornersBuilder
Image by corners builder
Image3DFlags
Image flags
Item3DFlags
Item flags (common to plot items)
Line3DFlags
Line flags
Mesh3DBuilder
Mesh plot builder
Mesh3DFlags
Mesh flags
Plot3DBuilder
Plot builder for configuring the 3D plot
Plot3DContext
Plot3D context wrapper
Plot3DDataLayout
Data layout used by ImPlot3D item builders.
Plot3DDataOffset
Sample-index offset used by ImPlot3D item data access.
Plot3DDataStride
Byte stride used by ImPlot3D item data access.
Plot3DFlags
Flags for ImPlot3D plot configuration
Plot3DItemArrayStyle
One-shot array-backed item style overrides for the next ImPlot3D submission.
Plot3DItemStyle
Common style overrides for plot items backed by ImPlot3DSpec.
Plot3DToken
RAII token that ends the plot on drop
Plot3DUi
Per-frame access helper mirroring dear-implot
Quad3DFlags
Quad flags
Scatter3DFlags
Scatter flags
StyleColorToken
Token for managing style color changes.
StyleVarToken
Token for managing style variable changes.
StyledPlot3D
Styled wrapper for plot types that do not store item-style state directly.
Surface3DBuilder
Surface (grid) plot builder (f32 variant)
Surface3DFlags
Surface flags
Triangle3DFlags
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
Plot3DColorElement
Colorable ImPlot3D style elements.
Plot3DCond
Condition for setup calls (match ImGuiCond)
Plot3DStyleVar
ImPlot3D style variables.

Traits§

Plot3DItemFlagged
Shared ImPlot3D item-flag builder methods for plot builders backed by ImPlot3DSpec.
Plot3DItemStyled
Shared ImPlot3D item-style builder methods for plot builders backed by ImPlot3DSpec.