|
3 | 3 | !!! info |
4 | 4 |
|
5 | 5 | 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...😢 |
6 | | - 1) We assume that your device has at least one modern browser that supports WebGL 2.0 |
7 | | - 2) Or you are using the official Julia extension in VSCode |
8 | 6 |
|
9 | | -This implementation is achieved through [WGLMakie.jl](https://github.com/MakieOrg/Makie.jl/tree/master/WGLMakie), where users only need to provide the coordinates of the particles, and all other aspects are optional. |
| 7 | +This implementation is achieved through [MeshCat.jl](https://github.com/rdeits/MeshCat.jl), which provides an interactive 3D visualization viewer accessible through a standard web browser. |
10 | 8 |
|
11 | 9 | ```@docs |
12 | 10 | vispts( |
13 | | - coord ::Matrix; |
14 | | - colorby ::String, |
15 | | - attr ::Vector, |
16 | | - psize ::Real, |
17 | | - colormap::Symbol=:turbo, |
18 | | - sample_n::Int=1000000 |
| 11 | + raw_pts ::Array{<:Real, 2}; |
| 12 | + markersize ::Real=0.002, |
| 13 | + cval ::Vector{<:Real}=Float32[], |
| 14 | + colormap ::ColorScheme=ColorSchemes.jet |
19 | 15 | ) |
| 16 | +``` |
20 | 17 |
|
21 | | -visvol( |
22 | | - coord ::Matrix; |
23 | | - colorby ::String, |
24 | | - attr ::Vector, |
25 | | - vsize ::Real, |
26 | | - colormap::Symbol=:turbo, |
27 | | - sample_n::Int=1000000, |
28 | | - ncolors ::Int=64 |
29 | | -) |
| 18 | +## Quick Start |
| 19 | + |
| 20 | +### Visualize Point Cloud |
| 21 | + |
| 22 | +```julia |
| 23 | +using MaterialPointVisualizer |
| 24 | + |
| 25 | +# Create random points |
| 26 | +pts = rand(10000, 3) |
| 27 | + |
| 28 | +# Visualize with default settings |
| 29 | +vis = vispts(pts) |
| 30 | +``` |
| 31 | + |
| 32 | +### Add Color by Values |
| 33 | + |
| 34 | +```julia |
| 35 | +# Create points and corresponding values |
| 36 | +pts = rand(10000, 3) |
| 37 | +vals = rand(10000) |
| 38 | + |
| 39 | +# Visualize with color mapping |
| 40 | +vis = vispts(pts, cval=vals, colormap=ColorSchemes.viridis, markersize=0.001) |
| 41 | +``` |
| 42 | + |
| 43 | +### Visualize 2D Points |
| 44 | + |
| 45 | +```julia |
| 46 | +# 2D points are automatically converted to 3D (z=0) |
| 47 | +pts_2d = rand(5000, 2) |
| 48 | +vis = vispts(pts_2d, markersize=0.005) |
30 | 49 | ``` |
31 | 50 |
|
32 | | -!!! warning |
| 51 | +## Browser Display |
33 | 52 |
|
34 | | - If you are connecting to a remote headless server via SSH, you may encounter issues. |
| 53 | +The visualization opens in your default web browser. You can interact with the viewer using: |
| 54 | +- **Mouse drag**: Rotate the view |
| 55 | +- **Mouse scroll**: Zoom in/out |
| 56 | +- **Right-click drag**: Pan the view |
0 commit comments