diff --git a/.gitignore b/.gitignore index 0513ba2..ce9fb81 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +Manifest.toml diff --git a/LICENSE b/LICENSE index 86e9dec..f446734 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/Project.toml b/Project.toml index 7ba032d..2a6dab3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "MaterialPointVisualizer" uuid = "9ce2fbfb-c269-402f-8683-a675189e795c" -version = "0.3.1" +version = "0.3.2" authors = ["ZenanH "] [deps] diff --git a/README.md b/README.md index bbceb86..21d4132 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/make.jl b/docs/make.jl index 6bf1437..9244684 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -18,7 +18,6 @@ makedocs( "usage/pts2surf.md", "usage/display.md" ], - # "utils.md" ], warnonly = [:missing_docs, :cross_references], ) diff --git a/docs/package.json b/docs/package.json index 0ed8718..c6c6ae3 100644 --- a/docs/package.json +++ b/docs/package.json @@ -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" } } diff --git a/docs/src/usage/display.md b/docs/src/usage/display.md index 9ea5ad7..46f8ac1 100644 --- a/docs/src/usage/display.md +++ b/docs/src/usage/display.md @@ -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. \ No newline at end of file +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 \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index bc78885..e85313b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,2 +1,4 @@ using MaterialPointVisualizer -using Test \ No newline at end of file +using Test + +