JuliaGeometry/Meshes.jl

`viz` of heterogeneous `GeometrySet` failing

Closed this issue · 0 comments

MWE:

julia> using Meshes

julia> r = rand(Ray{3,Float64})
Ray{3,Float64}
├─ p: Point(0.7360479943648276, 0.6948384847462729, 0.3266295752917948)
└─ v: Vec(0.9355715212749416, 0.6316329492035335, 0.06137673429150914)

julia> p = rand(Pyramid{3,Float64})
Pyramid{3,Float64}
├─ Point(0.2960543973397628, 0.25411228851504053, 0.42574591556067953)
├─ Point(0.8468411159039378, 0.9190604022568394, 0.6161933672247601)
├─ Point(0.5015995665953364, 0.3512978625800376, 0.9747397477686447)
├─ Point(0.1985419647032033, 0.1560672184811016, 0.15951869162840726)
└─ Point(0.954434228384798, 0.9264659134234772, 0.6821448643989674)

julia> d = GeometrySet([r, p])
2 GeometrySet{3,Float64}
├─ Ray(p: (0.736048, 0.694838, 0.32663), v: (0.935572, 0.631633, 0.0613767))
└─ Pyramid((0.296054, 0.254112, 0.425746), ..., (0.954434, 0.926466, 0.682145))

julia> viz(d)
ERROR: StackOverflowError:
Stacktrace:
     [1] simplexify(geometry::Ray{3, Float64})
       @ Meshes ~/.julia/dev/Meshes/src/discretization.jl:141
     [2] discretize(geometry::Ray{3, Float64})
       @ Meshes ~/.julia/dev/Meshes/src/discretization.jl:110
--- the last 2 lines are repeated 39990 more times ---
 [79983] simplexify(geometry::Ray{3, Float64})
       @ Meshes ~/.julia/dev/Meshes/src/discretization.jl:141

We have recipe for Ray and Pyramid and yet the viz fails.