The following Julia program uses Makie to create the image shown below, a “cube with holes.” However, I would like to eliminate the holes, and also make the cube nearer the shape of an actual cube, with only slightly rounded corners and edges. I’ve tried changing the exponent to values other than ^2
and also passing the range
directly to the volume!
function, to no avail. Examples of the types of cubes desired can be found in three-rounded-box
images at CodeSandbox.
using Makie, GLMakie
fig = Figure()
range = LinRange(-1, 1, 5) # LinRange{Float64, Int64}
cube = [ (x.^2 + y.^2 + z.^2) for x = range, y = range, z = range ] # Array{Float64, 3}
ax = Axis3( fig[1,1], aspect = :data, azimuth = 1.17 * pi, viewmode = :fit, title = "Cube" )
volume!( cube, algorithm = :iso, isorange = 0.05, isovalue = 1.7 )
fig
I would consider another plotting library, if there is another that is much more suitable to this task.