Skip to content

Commit

Permalink
regression Mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarusA committed Aug 6, 2024
1 parent bc9c1f7 commit f6dfcfd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/3d/meshes/isosurfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ using Meshing, GeometryBasics
GLMakie.activate!()

isoval = 100
algo = MarchingCubes(iso=isoval, insidepositive=false)
algo = MarchingCubes(; iso=isoval)

function show_isosurface(f,h,ξ; color=(:dodgerblue,0.5))
s = [h(x,y,z) for x in ξ, y in ξ, z in ξ] .+ isoval
mc = GeometryBasics.Mesh(s, algo)

return mesh(f, normal_mesh(mc); color,
# generate the mesh using marching cubes
vts, fcs = isosurface(s, algo)
# mc = GeometryBasics.Mesh(s, algo)
return mesh(f, vts, map(v -> GeometryBasics.TriangleFace(v...), fcs); color,
diffuse = Vec3f0(0.8),
specular = Vec3f0(1.1),
shininess = 30f0,
Expand Down

0 comments on commit f6dfcfd

Please sign in to comment.