How to make GLMakie's Volume function look like a solid

I’m trying to visualize a solid 3d object using GLMakie’s volume function:

using GLMakie

n = 150 # Resolution

x = range(0, 1, length=n)
y = range(0, 1, length=n)
z = range(0, 1, length=n)

vol = [ (0 ≤ xi ≤ 1 && 0 ≤ yi ≤ sqrt(xi) && 0 ≤ zi ≤ yi) ? 1.0 : 0.0 
        for xi in x, yi in y, zi in z ]

fig = Figure(size = (1400, 800))
ax = LScene(fig[1, 1])

volume!(ax, vol,
    algorithm = :iso,
    isorange = 0.05,
    isovalue = 0.7,
)

display(fig)
wait(display(fig))

However the resulting object doesn’t look nice, even after playing around with the parameters:

One can see that two of the four faces are missing, and the faces that are there look like a bunch of points instead of one compact surface.

How can I make it look better?

Thanks for any help!

1 Like