Skip to content

Commit 3aff0a4

Browse files
authored
Merge pull request #12 from ZenanH/main
πŸŽ‰ Release new version v0.1.10
2 parents 65d402b + aab561e commit 3aff0a4

6 files changed

Lines changed: 15 additions & 11 deletions

File tree

β€ŽProject.tomlβ€Ž

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

66
[deps]
77
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"

β€Ž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.1.9-pink)]()
6+
[![Version](https://img.shields.io/badge/version-v0.1.10-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/src/usage/surfreconstruction.mdβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ply2surface(
3737
cube_size = 0.6,
3838
surface_threshold = 0.6,
3939
smoothing_length = 1.2,
40+
output_format::String = "obj",
4041
splashsurf::String = "nothing"
4142
)
4243
```

β€Žsrc/MaterialPointVisualizer.jlβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import MaterialPointSolver: DeviceArgs2D, DeviceGrid2D, DeviceParticle2D, Device
2020

2121
const trimesh = PythonCall.pynew()
2222

23-
include(joinpath(@__DIR__, "mpm2vtp.jl" ))
24-
include(joinpath(@__DIR__, "particle2vtp.jl" ))
25-
include(joinpath(@__DIR__, "particle2surf.jl" ))
26-
include(joinpath(@__DIR__, "plot/display.jl" ))
23+
include(joinpath(@__DIR__, "mpm2vtp.jl" ))
24+
include(joinpath(@__DIR__, "particle2vtp.jl" ))
25+
include(joinpath(@__DIR__, "particle2surf.jl"))
26+
include(joinpath(@__DIR__, "plot/display.jl" ))
2727

2828
function __init__()
2929
@info "checking environment..."

β€Žsrc/particle2surf.jlβ€Ž

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ end
127127

128128
"""
129129
ply2surface(ply_dir, splash_dir, radius, num_threads; cube_size=0.6,
130-
surface_threshold=0.6, smoothing_length=1.2, splashsurf="nothing")
130+
surface_threshold=0.6, smoothing_length=1.2, output_format="obj",
131+
splashsurf="nothing")
131132
132133
Description:
133134
---
@@ -151,6 +152,7 @@ function ply2surface(
151152
cube_size = 0.6,
152153
surface_threshold = 0.6,
153154
smoothing_length = 1.2,
155+
output_format::String = "obj",
154156
splashsurf::String = "nothing"
155157
)
156158
if splashsurf == "nothing"
@@ -183,13 +185,14 @@ function ply2surface(
183185
splashsurfcmd = splashsurf
184186
end
185187

188+
output_format = output_format ∈ ["obj", "ply"] ? output_format : "obj"
186189
num_threads = 1 ≀ num_threads ≀ Sys.CPU_THREADS ? num_threads : Sys.CPU_THREADS
187190
splash_dir β‰  ply_dir || throw(ArgumentError(
188191
"The splash output directory should be different from the ply input directory"))
189192
isdir(splash_dir) || mkpath(splash_dir)
190193
if isfile(ply_dir)
191194
inputs = ply_dir
192-
outputs = joinpath(splash_dir, "surface.vtk")
195+
outputs = joinpath(splash_dir, "surface.$(output_format)")
193196
run(`$(splashsurfcmd) reconstruct $(inputs) --output-file=$(outputs)
194197
--particle-radius=$(radius*1.5)
195198
--cube-size=$(cube_size)
@@ -204,7 +207,7 @@ function ply2surface(
204207
)
205208
elseif isdir(ply_dir)
206209
inputs = joinpath(ply_dir, "iteration_{}.ply")
207-
outputs = joinpath(splash_dir, "iteration_{}.vtk")
210+
outputs = joinpath(splash_dir, "iteration_{}.$(output_format)")
208211
run(`$(splashsurfcmd) reconstruct $(inputs) --output-file=$(outputs)
209212
--particle-radius=$(radius*1.5)
210213
--cube-size=$(cube_size)

β€Žsrc/plot/display.jlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include(joinpath(@__DIR__, "plotutils.jl"))
1414

1515
"""
1616
vispts(coord, colormap::Symbol=:viridis, colorby::String="-1", attr::Vector=[-1],
17-
psize::Float32=1f-2, sample_n::Int=1000000)
17+
psize::Real=1f-2, sample_n::Int=1000000)
1818
1919
Description:
2020
---
@@ -42,7 +42,7 @@ vispts(rand(10, 3), colorby="random vals", attr=rand(10), psize=1f0, sample_n=5,
4242
colormap::Symbol=:viridis,
4343
colorby ::String="-1",
4444
attr ::Vector=[-1],
45-
psize ::Float32=1f-2,
45+
psize ::Real=1f-2,
4646
sample_n::Int=1000000
4747
)
4848
# check input file

0 commit comments

Comments
Β (0)