Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ docs/site/
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
Manifest.toml
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 LandslideSIM
Copyright (c) 2025 LandslideSIM

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "MaterialPointVisualizer"
uuid = "9ce2fbfb-c269-402f-8683-a675189e795c"
version = "0.3.1"
version = "0.3.2"
authors = ["ZenanH <[email protected]>"]

[deps]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![CI](https://github.com/LandslideSIM/MaterialPointVisualizer.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/LandslideSIM/MaterialPointVisualizer.jl/actions/workflows/ci.yml)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg?logo=quicklook)](https://LandslideSIM.github.io/MaterialPointVisualizer.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-red.svg?logo=quicklook)](https://LandslideSIM.github.io/MaterialPointVisualizer.jl/dev)
[![Version](https://img.shields.io/badge/version-v0.3.1-pink)]()
[![Version](https://img.shields.io/badge/version-v0.3.2-pink)]()

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.

Expand Down
1 change: 0 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ makedocs(
"usage/pts2surf.md",
"usage/display.md"
],
# "utils.md"
],
warnonly = [:missing_docs, :cross_references],
)
Expand Down
4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"markdown-it": "^14.1.0",
"markdown-it-footnote": "^4.0.0",
"markdown-it-mathjax3": "^4.3.2",
"vitepress": "^1.6.3",
"vitepress-plugin-tabs": "^0.6.0"
},
"devDependencies": {
"vitepress": "^1.6.4"
}
}
62 changes: 42 additions & 20 deletions docs/src/usage/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,54 @@
!!! 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...😢
1) We assume that your device has at least one modern browser that supports WebGL 2.0
2) Or you are using the official Julia extension in VSCode

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

```@docs
vispts(
coord ::Matrix;
colorby ::String,
attr ::Vector,
psize ::Real,
colormap::Symbol=:turbo,
sample_n::Int=1000000
raw_pts ::Array{<:Real, 2};
markersize ::Real=0.002,
cval ::Vector{<:Real}=Float32[],
colormap ::ColorScheme=ColorSchemes.jet
)
```

visvol(
coord ::Matrix;
colorby ::String,
attr ::Vector,
vsize ::Real,
colormap::Symbol=:turbo,
sample_n::Int=1000000,
ncolors ::Int=64
)
## Quick Start

### Visualize Point Cloud

```julia
using MaterialPointVisualizer

# Create random points
pts = rand(10000, 3)

# Visualize with default settings
vis = vispts(pts)
```

### Add Color by Values

```julia
# 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

```julia
# 2D points are automatically converted to 3D (z=0)
pts_2d = rand(5000, 2)
vis = vispts(pts_2d, markersize=0.005)
```

!!! warning
## Browser Display

If you are connecting to a remote headless server via SSH, you may encounter issues.
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
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
using MaterialPointVisualizer
using Test
using Test


Loading