Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Feb 7, 2022
1 parent ffbb0fb commit 231b10f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ surfaceplot(

#### Isosurface Plot

Uses the `Marching Cubes` algorithm to extract an isosurface, where `isovalue` controls the surface isovalue. Using `centroid` enables plotting the triangulation centroids instead of the triangle vertices (better for small plots). Back face culling (hide not visible facets) can be activated using `cull=true`. One can use the legacy 'Marching Cubes' algorithm using `legacy=true`.
Uses [`MarchingCubes.jl`](https://github.com/t-bltg/MarchingCubes.jl) to extract an isosurface, where `isovalue` controls the surface isovalue. Using `centroid` enables plotting the triangulation centroids instead of the triangle vertices (better for small plots). Back face culling (hide not visible facets) can be activated using `cull=true`. One can use the legacy 'Marching Cubes' algorithm using `legacy=true`.

```julia
torus(x, y, z, r=0.2, R=0.5) = ((x^2 + y^2) - R)^2 + z^2 - r^2
Expand Down
2 changes: 1 addition & 1 deletion docs/generate_docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ $(examples.surfaceplot2)
#### Isosurface Plot
Uses the `Marching Cubes` algorithm to extract an isosurface, where `isovalue` controls the surface isovalue.
Uses [`MarchingCubes.jl`](https://github.com/t-bltg/MarchingCubes.jl) to extract an isosurface, where `isovalue` controls the surface isovalue.
Using `centroid` enables plotting the triangulation centroids instead of the triangle vertices (better for small plots).
Back face culling (hide not visible facets) can be activated using `cull=true`.
One can use the legacy 'Marching Cubes' algorithm using `legacy=true`.
Expand Down
5 changes: 5 additions & 0 deletions test/tst_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ end
@test UnicodePlots.colormap_callback([1, 2, 3]) isa Function
@test UnicodePlots.colormap_callback(nothing) === nothing

# clamp in range
values = collect(1:10)
callback = UnicodePlots.colormap_callback(:viridis)
colors = [callback(v, values[2], values[end - 1]) for v in values]

# en.wikipedia.org/wiki/ANSI_escape_code#8-bit
@test UnicodePlots.rgb2ansi((0, 0, 0)) == 016 # black
@test UnicodePlots.rgb2ansi((1, 0, 0)) == 196 # red
Expand Down

0 comments on commit 231b10f

Please sign in to comment.