Skip to content

Commit

Permalink
fixes for discontinuous function plots
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Feb 5, 2023
1 parent 13934b0 commit ba65f98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PlutoVista"
uuid = "646e1f28-b900-46d7-9d87-d554eb38a413"
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>"]
version = "0.8.17"
version = "0.8.18"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand All @@ -16,7 +16,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
ColorSchemes = "3"
Colors = "0.12,1"
DocStringExtensions = "0.8,0.9"
GridVisualizeTools = "0.2.1,0.3"
GridVisualizeTools = "0.3"
HypertextLiteral = "0.9"
Pluto = "0.19"
julia = "1.6"
16 changes: 9 additions & 7 deletions src/plutovtkplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,11 @@ contour!(p::PlutoVTKPlot,X,Y,f; kwargs...)=tricontour!(p,triang(X,Y)...,vec(f);k
$(SIGNATURES)
Plot isosurfaces given by `levels` and contour maps on planes given by the `*planes` parameters
for piecewise linear function on tetrahedral mesh.
for piecewise linear function on tetrahedral mesh.
`pts,tets,func` can be arrays of grid data, allowing to plot discontinouos functions
"""
function tetcontour!(p::PlutoVTKPlot, pts, tets,func; kwargs...)
function tetcontour!(p::PlutoVTKPlot, pts, tets,func; parentpts=pts, kwargs...)
reset!(p)

default_args=(colormap=:viridis,
Expand Down Expand Up @@ -326,12 +328,12 @@ function tetcontour!(p::PlutoVTKPlot, pts, tets,func; kwargs...)
if facecolormap==nothing
facecolormap=bregion_cmap(nbregions)
end

@views for idim=1:3
xyzmin[idim]=minimum(pts[idim,:])
xyzmax[idim]=maximum(pts[idim,:])
xyzmin[idim]=minimum(parentpts[idim,:])
xyzmax[idim]=maximum(parentpts[idim,:])
end

xplanes=args[:xplanes]
yplanes=args[:yplanes]
zplanes=args[:zplanes]
Expand Down Expand Up @@ -400,7 +402,7 @@ function tetcontour!(p::PlutoVTKPlot, pts, tets,func; kwargs...)

if args[:outlinealpha]>0 && faces!=nothing
parameter!(p,"outline",1)
outline!(p,pts,faces,facemarkers,facecolormap,nbregions,xyzmin,xyzmax;alpha=args[:outlinealpha])
outline!(p,parentpts,faces,facemarkers,facecolormap,nbregions,xyzmin,xyzmax;alpha=args[:outlinealpha])
else
parameter!(p,"outline",0)
end
Expand Down

2 comments on commit ba65f98

@j-fu
Copy link
Owner Author

@j-fu j-fu commented on ba65f98 Feb 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/77036

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.18 -m "<description of version>" ba65f98f01f5973b93f94e1dd298567c4bff69f4
git push origin v0.8.18

Please sign in to comment.