GUI
Info
Sometimes we already have data in Julia and just want to see the results without exporting it to other software for visualization, which is too troublesome...😢
This implementation is achieved through MeshCat.jl, which provides an interactive 3D visualization viewer accessible through a standard web browser.
MaterialPointVisualizer.vispts Method
vispts(raw_pts::Array{<:Real, 2}; markersize::Real=0.002, cval::Vector{<:Real}=Float32[], colormap::ColorScheme=ColorSchemes.jet)Visualize 3D or 2D point cloud using MeshCat interactive viewer.
Arguments
raw_pts::Array{<:Real, 2}: Nx2 or Nx3 array where each row contains the coordinates [x, y] or [x, y, z] of a point.markersize::Real=0.002: Size of the point markers in the visualization.cval::Vector{<:Real}=Float32[]: Values for coloring each point. If empty, all points use the default color from colormap.colormap::ColorScheme=ColorSchemes.jet: ColorScheme object from ColorSchemes.jl for mapping values to colors.
Returns
vis::Visualizer: A MeshCat Visualizer object that can be displayed interactively.
Examples
# Visualize random 3D points
pts = rand(10000, 3)
vis = vispts(pts)
# Visualize with color values
vals = rand(10000)
vis = vispts(pts, cval=vals, colormap=ColorSchemes.viridis, markersize=0.001)
# Visualize 2D points (will be converted to 3D with z=0)
pts_2d = rand(5000, 2)
vis = vispts(pts_2d)Quick Start
Visualize Point Cloud
using MaterialPointVisualizer
# Create random points
pts = rand(10000, 3)
# Visualize with default settings
vis = vispts(pts)Add Color by Values
# Create points and corresponding values
pts = rand(10000, 3)
vals = rand(10000)
# Visualize with color mapping
vis = vispts(pts, cval=vals, colormap=ColorSchemes.viridis, markersize=0.001)Visualize 2D Points
# 2D points are automatically converted to 3D (z=0)
pts_2d = rand(5000, 2)
vis = vispts(pts_2d, markersize=0.005)Browser Display
The visualization opens in your default web browser. You can interact with the viewer using:
Mouse drag: Rotate the view
Mouse scroll: Zoom in/out
Right-click drag: Pan the view