Skip to content

Commit a74fa96

Browse files
authored
Merge pull request #18 from ZenanH/main
Release new version with docs
2 parents 330949d + a37537f commit a74fa96

8 files changed

Lines changed: 52 additions & 27 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ docs/site/
2525
# It records a fixed state of all packages used by the project. As such, it should not be
2626
# committed for packages, but should be committed for applications that require a static
2727
# environment.
28-
Manifest.toml
28+
Manifest.toml

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 LandslideSIM
3+
Copyright (c) 2025 LandslideSIM
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "MaterialPointVisualizer"
22
uuid = "9ce2fbfb-c269-402f-8683-a675189e795c"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
authors = ["ZenanH <zenan.huo@outlook.com>"]
55

66
[deps]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![CI](https://github.com/LandslideSIM/MaterialPointVisualizer.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/LandslideSIM/MaterialPointVisualizer.jl/actions/workflows/ci.yml)
44
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg?logo=quicklook)](https://LandslideSIM.github.io/MaterialPointVisualizer.jl/stable)
55
[![Dev](https://img.shields.io/badge/docs-dev-red.svg?logo=quicklook)](https://LandslideSIM.github.io/MaterialPointVisualizer.jl/dev)
6-
[![Version](https://img.shields.io/badge/version-v0.3.1-pink)]()
6+
[![Version](https://img.shields.io/badge/version-v0.3.2-pink)]()
77

88
With this package, we can convert the MPM simulation results (HDF5 files from ***[MaterialPointSolver.jl](https://github.com/LandslideSIM/MaterialPointSolver.jl)*** ) into `.vtp` files or create ParaView-compatible animations. Additionally, it includes some post-processing functionalities.
99

docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ makedocs(
1818
"usage/pts2surf.md",
1919
"usage/display.md"
2020
],
21-
# "utils.md"
2221
],
2322
warnonly = [:missing_docs, :cross_references],
2423
)

docs/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"markdown-it": "^14.1.0",
1010
"markdown-it-footnote": "^4.0.0",
1111
"markdown-it-mathjax3": "^4.3.2",
12-
"vitepress": "^1.6.3",
1312
"vitepress-plugin-tabs": "^0.6.0"
13+
},
14+
"devDependencies": {
15+
"vitepress": "^1.6.4"
1416
}
1517
}

docs/src/usage/display.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,54 @@
33
!!! info
44

55
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
86

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.
108

119
```@docs
1210
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
1915
)
16+
```
2017

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)
3049
```
3150

32-
!!! warning
51+
## Browser Display
3352

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

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
using MaterialPointVisualizer
2-
using Test
2+
using Test
3+
4+

0 commit comments

Comments
 (0)