rdeits / MeshCat.jl

WebGL-based 3D visualizer in Julia
MIT License
233 stars 43 forks source link

Problem with demo notebook #167

Closed pauljurczak closed 4 years ago

pauljurczak commented 4 years ago

I'm trying MeshCat with Julia 1.5.0-beta1. The cell:

using MeshIO
using FileIO
cat_mesh = load(joinpath(dirname(pathof(GeometryTypes)), "..", "test", "data", "cat.obj"))
setobject!(vis, cat_mesh)
settransform!(vis, LinearMap(AngleAxis(pi/2, 1, 0, 0)))

produces this error:

┌ Info: Precompiling MeshIO [7269a6da-0436-5bbc-96c2-40638cbb6118]
└ @ Base loading.jl:1278
MethodError: no method matching setobject!(::Visualizer, ::GeometryBasics.Mesh{3,Float32,GeometryBasics.Ngon{3,Float32,3,GeometryBasics.PointMeta{3,Float32,GeometryBasics.Point{3,Float32},(:uv, :normals),Tuple{GeometryBasics.Vec{2,Float32},GeometryBasics.Vec{3,Float32}}}},FaceView{GeometryBasics.Ngon{3,Float32,3,GeometryBasics.PointMeta{3,Float32,GeometryBasics.Point{3,Float32},(:uv, :normals),Tuple{GeometryBasics.Vec{2,Float32},GeometryBasics.Vec{3,Float32}}}}}})
Closest candidates are:
  setobject!(::AbstractVisualizer, !Matched::Union{GeometryTypes.AbstractGeometry, GeometryTypes.AbstractMesh, MeshFileGeometry}) at /home/paul/.julia/packages/MeshCat/ECbzr/src/abstract_visualizer.jl:21
  setobject!(::AbstractVisualizer, !Matched::Union{GeometryTypes.AbstractGeometry, GeometryTypes.AbstractMesh, MeshFileGeometry}, !Matched::AbstractMaterial) at /home/paul/.julia/packages/MeshCat/ECbzr/src/abstract_visualizer.jl:29
  setobject!(::Visualizer, !Matched::AbstractObject) at /home/paul/.julia/packages/MeshCat/ECbzr/src/visualizer.jl:196

Stacktrace:
 [1] top-level scope at In[18]:6
rdeits commented 4 years ago

Duplicate of #154. Workaround is here: https://github.com/rdeits/MeshCat.jl/issues/154#issuecomment-624917911 and the more permanent fix will be #166