Meshes.jl
Meshes.jl copied to clipboard
Add discretize method for Cylinder volume
Hello,
Running test() generates a stackoverflow error:
import Meshes
cylinder = Meshes.Cylinder((0,0,0), (1,1,1), 0.1)
sphere = Meshes.discretize(Meshes.Sphere((2,2,2), 0.1))
function test()
Meshes.merge(cylinder, sphere)
end
julia> test()
ERROR: StackOverflowError:
Stacktrace:
[1] simplexify(geometry::Meshes.Cylinder{Float64})
@ Meshes C:\Users\sdl96354\.julia\packages\Meshes\uPQGa\src\discretization.jl:130
[2] discretize(geometry::Meshes.Cylinder{Float64})
@ Meshes C:\Users\sdl96354\.julia\packages\Meshes\uPQGa\src\discretization.jl:103
--- the last 2 lines are repeated 39990 more times ---
[79983] simplexify(geometry::Meshes.Cylinder{Float64})
@ Meshes C:\Users\sdl96354\.julia\packages\Meshes\uPQGa\src\discretization.jl:130
You are trying to merge a 3D volume with a 2D surface. You probably want CylinderSurface instead of Cylinder.
In any case, we should probably fix our merge method to accept meshes of different parametric dimension.
We don't have a method to discretize the Cylinder volume yet. It should be easy to add a method to RegularSampling and then a method to RegularDiscretization, similar to what we do with CylinderSurface.
Closing in favor of #890