diff --git a/Artifacts.toml b/Artifacts.toml index 25485a6..53b09df 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,5 +1,6 @@ [meshcat] -git-tree-sha1 = "15c3973b1084a231410e43e844c7714f1c41f163" +git-tree-sha1 = "7dd132db6118be7e071562fba91899d0e07e8f3a" + [[meshcat.download]] - url = "https://github.com/rdeits/meshcat/tarball/978cb8f519f9bb540e94b7f97a39ada4d7916b7c" - sha256 = "b3a5343bd0fcaabff4fcb73c0951a32d887d1cf0c69a64b52ea957704d4d1e0a" + url = "https://github.com/meshcat-dev/meshcat/tarball/3ce3dd6" + sha256 = "d5a56d2c959efd43397e0a819df1c2a61169405062f298484210d3d9ba5b30ed" diff --git a/Project.toml b/Project.toml index 4c7fac9..41f093b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MeshCat" uuid = "283c5d60-a78f-5afe-a0af-af636b173e11" authors = ["Robin Deits "] -version = "0.16.1" +version = "0.16.2" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/Readme.md b/Readme.md index 5c746c7..3fa658a 100644 --- a/Readme.md +++ b/Readme.md @@ -4,7 +4,7 @@ [![codecov.io](https://codecov.io/github/rdeits/MeshCat.jl/coverage.svg?branch=master)](https://codecov.io/github/rdeits/MeshCat.jl?branch=master) [![](https://img.shields.io/badge/docs-dev-blue.svg)](https://rdeits.github.com/MeshCat.jl/dev) -[MeshCat](https://github.com/rdeits/meshcat) is a remotely-controllable 3D viewer, built on top of [three.js](https://threejs.org/). The viewer contains a tree of objects and transformations (i.e. a scene graph) and allows those objects and transformations to be added and manipulated with simple commands. This makes it easy to create 3D visualizations of geometries, mechanisms, and robots. MeshCat.jl runs on macOS, Linux, and Windows. +[MeshCat](https://github.com/meshcat-dev/meshcat) is a remotely-controllable 3D viewer, built on top of [three.js](https://threejs.org/). The viewer contains a tree of objects and transformations (i.e. a scene graph) and allows those objects and transformations to be added and manipulated with simple commands. This makes it easy to create 3D visualizations of geometries, mechanisms, and robots. MeshCat.jl runs on macOS, Linux, and Windows. The MeshCat viewer runs entirely in the browser, with no external dependencies. All files are served locally, so no internet connection is required. Communication between the browser and your Julia code is managed by [HTTP.jl](https://github.com/JuliaWeb/HTTP.jl). That means that MeshCat should work: @@ -39,7 +39,7 @@ MeshCat.jl is a successor to [DrakeVisualizer.jl](https://github.com/rdeits/Drak You may also want to check out: -* [meshcat-python](https://github.com/rdeits/meshcat-python): the Python implementation of the same protocol +* [meshcat-python](https://github.com/meshcat-dev/meshcat-python): the Python implementation of the same protocol * [MeshCatMechanisms.jl](https://github.com/rdeits/MeshCatMechanisms.jl) extensions to MeshCat.jl for visualizing mechanisms, robots, and URDFs # Examples diff --git a/docs/Project.toml b/docs/Project.toml index 20ca623..faf8e00 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -3,4 +3,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" MeshCat = "283c5d60-a78f-5afe-a0af-af636b173e11" [compat] -Documenter = "0.24" +Documenter = "1" diff --git a/notebooks/Project.toml b/notebooks/Project.toml index 7e6a896..769cf92 100644 --- a/notebooks/Project.toml +++ b/notebooks/Project.toml @@ -13,4 +13,4 @@ Colors = "0.9, 0.10, 0.11, 0.12" FileIO = "1" GeometryBasics = "0.3, 0.4" MeshIO = "0.4" -Meshing = "0.5" +Meshing = "0.5, 0.6" diff --git a/notebooks/Static HTML Visualizers.ipynb b/notebooks/Static HTML Visualizers.ipynb index 6157050..9480e7c 100644 --- a/notebooks/Static HTML Visualizers.ipynb +++ b/notebooks/Static HTML Visualizers.ipynb @@ -55,21 +55,19 @@ "outputs": [], "source": [ "vis = Visualizer()\n", - "setobject!(vis[:box1], \n", - " Rect(Vec(0., 0, 0), Vec(0.1, 0.2, 0.3)))\n", + "setobject!(vis[:box1], Rect(Vec(0.0, 0, 0), Vec(0.1, 0.2, 0.3)))\n", "anim = Animation()\n", "atframe(anim, 0) do\n", - " settransform!(vis[:box1], \n", - " Translation(0., 0, -1) ∘ LinearMap(RotZ(-π/2)))\n", + " settransform!(vis[:box1],\n", + " Translation(0.0, 0, -1) ∘ LinearMap(RotZ(-π / 2)))\n", "end\n", "atframe(anim, 30) do\n", - " settransform!(vis[:box1], \n", - " Translation(0., 0, 0) ∘ LinearMap(RotY(π/2)) ∘\n", - " LinearMap(RotZ(π/2)))\n", + " settransform!(vis[:box1],\n", + " Translation(0.0, 0, 0) ∘ LinearMap(RotY(π / 2)) ∘ LinearMap(RotZ(π / 2)))\n", "end\n", "atframe(anim, 60) do\n", - " settransform!(vis[:box1], \n", - " Translation(0., 0, 1))\n", + " settransform!(vis[:box1],\n", + " Translation(0.0, 0, 1))\n", "end\n", "setanimation!(vis, anim)" ] @@ -112,8 +110,8 @@ "metadata": {}, "outputs": [], "source": [ - "setobject!(vis[:box1], \n", - " Rect(Vec(0., 0, 0), Vec(0.1, 0.2, 0.3)),\n", + "setobject!(vis[:box1],\n", + " Rect(Vec(0.0, 0, 0), Vec(0.1, 0.2, 0.3)),\n", " MeshPhongMaterial(color=colorant\"red\"))" ] }, @@ -167,17 +165,17 @@ "lastKernelId": null }, "kernelspec": { - "display_name": "Julia 1.6.3", + "display_name": "Julia 1.10.2", "language": "julia", - "name": "julia-1.6" + "name": "julia-1.10" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.6.3" + "version": "1.10.2" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/notebooks/animation.ipynb b/notebooks/animation.ipynb index cc177a6..e8105da 100644 --- a/notebooks/animation.ipynb +++ b/notebooks/animation.ipynb @@ -71,8 +71,7 @@ "metadata": {}, "outputs": [], "source": [ - "setobject!(vis[:box1], \n", - " Rect(Vec(0., 0, 0), Vec(0.1, 0.2, 0.3)))" + "setobject!(vis[:box1], Rect(Vec(0, 0, 0), Vec(0.1, 0.2, 0.3)))" ] }, { @@ -99,11 +98,11 @@ " # `settransform!` and `setprop!` are intercepted\n", " # and recorded in `anim` instead of having any\n", " # effect on `vis`.\n", - " settransform!(vis[:box1], Translation(0., 0, 0))\n", + " settransform!(vis[:box1], Translation(0, 0, 0))\n", "end\n", "\n", "atframe(anim, 30) do\n", - " settransform!(vis[:box1], Translation(0., 1, 0))\n", + " settransform!(vis[:box1], Translation(0, 1, 0))\n", "end\n", "\n", "# `setanimation!()` actually sends the animation to the\n", @@ -153,13 +152,13 @@ "anim = Animation()\n", "\n", "atframe(anim, 0) do\n", - " settransform!(vis[\"/Cameras/default\"], Translation(0., 0, 0))\n", + " settransform!(vis[\"/Cameras/default\"], Translation(0, 0, 0))\n", "end\n", "\n", "atframe(anim, 30) do\n", - " settransform!(vis[\"/Cameras/default\"], Translation(0., 0, 1))\n", + " settransform!(vis[\"/Cameras/default\"], Translation(0, 0, 1))\n", "end\n", - " \n", + "\n", "setanimation!(vis, anim)" ] }, @@ -167,7 +166,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We can also animate object properties. For example, let's animate the camera's `zoom` property to smoothly zoom out and then back in. Note that to do this, we have to access a deeper path in the visualizer to get to the actual camera object. For more information, see: https://github.com/rdeits/meshcat#camera-control" + "We can also animate object properties. For example, let's animate the camera's `zoom` property to smoothly zoom out and then back in. Note that to do this, we have to access a deeper path in the visualizer to get to the actual camera object. For more information, see: https://github.com/meshcat-dev/meshcat#camera-control" ] }, { @@ -179,7 +178,7 @@ "anim = Animation()\n", "\n", "atframe(anim, 0) do\n", - " setprop!(vis[\"/Cameras/default/rotated/\"], \"zoom\", 1)\n", + " setprop!(vis[\"/Cameras/default/rotated/\"], \"zoom\", 1.0)\n", "end\n", "\n", "atframe(anim, 30) do\n", @@ -187,9 +186,9 @@ "end\n", "\n", "atframe(anim, 60) do\n", - " setprop!(vis[\"/Cameras/default/rotated/\"], \"zoom\", 1)\n", + " setprop!(vis[\"/Cameras/default/rotated/\"], \"zoom\", 1.0)\n", "end\n", - " \n", + "\n", "setanimation!(vis, anim)" ] }, @@ -210,10 +209,8 @@ "metadata": {}, "outputs": [], "source": [ - "setobject!(vis[:box1], \n", - " Rect(Vec(0., 0, 0), Vec(0.1, 0.2, 0.3)))\n", - "setobject!(vis[:sphere],\n", - " HyperSphere(Point(0., 0, 0), 0.25))\n", + "setobject!(vis[:box1], Rect(Vec(0.0, 0, 0), Vec(0.1, 0.2, 0.3)))\n", + "setobject!(vis[:sphere], HyperSphere(Point(0.0, 0, 0), 0.25))\n", "\n", "# Start with the sphere hidden\n", "setvisible!(vis[:sphere], false)" @@ -228,7 +225,7 @@ "anim = Animation()\n", "atframe(anim, 0) do\n", " setvisible!(vis[:sphere], false)\n", - " settransform!(vis[:box1], Translation(0., 0, 0))\n", + " settransform!(vis[:box1], Translation(0.0, 0, 0))\n", "end\n", "\n", "atframe(anim, 15) do\n", @@ -236,9 +233,9 @@ "end\n", "\n", "atframe(anim, 30) do\n", - " settransform!(vis[:box1], Translation(0., 1, 0))\n", + " settransform!(vis[:box1], Translation(0.0, 1, 0))\n", "end\n", - " \n", + "\n", "setanimation!(vis, anim)" ] }, @@ -279,17 +276,17 @@ "lastKernelId": null }, "kernelspec": { - "display_name": "Julia 1.6.3", + "display_name": "Julia 1.10.2", "language": "julia", - "name": "julia-1.6" + "name": "julia-1.10" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.6.3" + "version": "1.10.2" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/notebooks/demo.ipynb b/notebooks/demo.ipynb index 7e72b23..c5c7d4c 100644 --- a/notebooks/demo.ipynb +++ b/notebooks/demo.ipynb @@ -32,8 +32,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Activate the MeshCat package, and import some other \n", - "# useful functions\n", + "# Activate the MeshCat package, and import some other useful functions\n", "using MeshCat\n", "using CoordinateTransformations\n", "using Rotations\n", @@ -126,7 +125,7 @@ "outputs": [], "source": [ "# First, we'll create a simple geometric object\n", - "box = HyperRectangle(Vec(0., 0, 0), Vec(1., 1, 1))" + "box = HyperRectangle(Vec(0.0, 0, 0), Vec(1.0, 1, 1))" ] }, { @@ -150,7 +149,7 @@ "# We can use settransform!() to tell the viewer to draw the box at a specific\n", "# position. Translation() creates a CoordinateTransformations.Transformation\n", "# corresponding to the given x; y; z translation.\n", - "settransform!(vis, Translation(0., 1, 0))" + "settransform!(vis, Translation(0.0, 1, 0))" ] }, { @@ -160,7 +159,7 @@ "outputs": [], "source": [ "# We can also rotate the model by sending a different transformation\n", - "settransform!(vis, LinearMap(AngleAxis(pi/4, 0, 0, 1)))" + "settransform!(vis, LinearMap(AngleAxis(pi / 4, 0, 0, 1)))" ] }, { @@ -359,10 +358,9 @@ "# just simple boxes. Let's load a 3D mesh and visualize it:\n", "using MeshIO\n", "using FileIO\n", - "cat_mesh = load(joinpath(dirname(pathof(MeshCat)), \"..\", \"test\", \"data\", \"meshes\",\n", - " \"cat.obj\"))\n", + "cat_mesh = load(joinpath(dirname(pathof(MeshCat)), \"..\", \"test\", \"data\", \"meshes\", \"cat.obj\"))\n", "setobject!(vis, cat_mesh)\n", - "settransform!(vis, LinearMap(AngleAxis(pi/2, 1, 0, 0)))" + "settransform!(vis, LinearMap(AngleAxis(pi / 2, 1, 0, 0)))" ] }, { @@ -373,19 +371,18 @@ "source": [ "delete!(vis)\n", "\n", - "# Next, let's create a triangulated mesh by finding\n", - "# the 0-level set of some function. \n", - "# \n", + "# Next, let's create a triangulated mesh by finding the 0-level set of some function. \n", + "\n", "# First, we'll define our function:\n", "f = x -> sum(sin, 5 * x)\n", "\n", "# Then we pick a region of interest in which to sample the function.\n", "# This region starts at (-1, -1, -1) and extends to (1, 1, 1):\n", - "lower_bound = Vec(-1.,-1,-1)\n", - "upper_bound = Vec(1., 1, 1)\n", + "lower_bound = Vec(-1.0, -1, -1)\n", + "upper_bound = Vec(1.0, 1, 1)\n", "\n", "# Those two pieces of information are all we need to construct a mesh geometry.\n", - "#\n", + "\n", "# Using `Meshing.jl`, we can construct a mesh directly from our function:\n", "using Meshing: MarchingCubes\n", "\n", @@ -475,8 +472,7 @@ "metadata": {}, "outputs": [], "source": [ - "image = PngImage(\n", - " joinpath(MeshCat.VIEWER_ROOT, \"..\", \"data\", \"HeadTextureMultisense.png\"))\n", + "image = PngImage(joinpath(MeshCat.VIEWER_ROOT, \"..\", \"data\", \"HeadTextureMultisense.png\"))\n", "texture = Texture(image=image)\n", "material = MeshLambertMaterial(map=texture)\n", "geometry = load(joinpath(MeshCat.VIEWER_ROOT, \"..\", \"data\", \"head_multisense.obj\"))\n", @@ -500,10 +496,8 @@ "outputs": [], "source": [ "path = joinpath(@__DIR__, \"..\", \"test\", \"data\", \"meshes\", \"cube.dae\")\n", - "setobject!(vis[\"meshes\", \"dae_file_geometry\"], \n", - " MeshFileGeometry(path))\n", - "settransform!(vis[\"meshes\", \"dae_file_geometry\"], \n", - " Translation(0.0, 1.25, 0.0))" + "setobject!(vis[\"meshes\", \"dae_file_geometry\"], MeshFileGeometry(path))\n", + "settransform!(vis[\"meshes\", \"dae_file_geometry\"], Translation(0.0, 1.25, 0.0))" ] }, { @@ -525,10 +519,8 @@ "source": [ "path = joinpath(@__DIR__, \"..\", \"test\", \"data\", \"meshes\", \"cube.dae\")\n", "\n", - "setobject!(vis[\"meshes\", \"dae_file_object\"], \n", - " MeshFileObject(path))\n", - "settransform!(vis[\"meshes\", \"dae_file_object\"], \n", - " Translation(0.0, 2.5, 0.0))" + "setobject!(vis[\"meshes\", \"dae_file_object\"], MeshFileObject(path))\n", + "settransform!(vis[\"meshes\", \"dae_file_object\"], Translation(0.0, 2.5, 0.0))" ] } ], @@ -538,17 +530,17 @@ "lastKernelId": null }, "kernelspec": { - "display_name": "Julia 1.9.0", + "display_name": "Julia 1.10.2", "language": "julia", - "name": "julia-1.9" + "name": "julia-1.10" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.9.0" + "version": "1.10.2" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/src/artifact_helper.jl b/src/artifact_helper.jl index 2c863f9..c058f66 100644 --- a/src/artifact_helper.jl +++ b/src/artifact_helper.jl @@ -1,7 +1,7 @@ using Tar, Inflate, SHA function artifact_helper(sha::AbstractString) - url = "https://github.com/rdeits/meshcat/tarball/$sha" + url = "https://github.com/meshcat-dev/meshcat/tarball/$sha" filename = download(url) println(""" diff --git a/src/assets.jl b/src/assets.jl index f51370c..56def78 100644 --- a/src/assets.jl +++ b/src/assets.jl @@ -23,6 +23,6 @@ function develop_meshcat_assets(skip_confirmation=false) end println("Removing $meshcat_dir") rm(meshcat_dir, force=true, recursive=true) - run(`git clone https://github.com/rdeits/meshcat $meshcat_dir`) + run(`git clone https://github.com/meshcat-dev/meshcat $meshcat_dir`) rm(joinpath(meshcat_dir, "..", "meshcat.stamp")) end diff --git a/src/lowering.jl b/src/lowering.jl index 7c5c837..d902bd7 100644 --- a/src/lowering.jl +++ b/src/lowering.jl @@ -216,7 +216,7 @@ function lower(obj::MeshFileObject) end -# TODO: Unify these two methods once https://github.com/rdeits/meshcat/issues/50 is resolved +# TODO: Unify these two methods once https://github.com/meshcat-dev/meshcat/issues/50 is resolved pack_mesh_file_data(s::AbstractString) = s pack_mesh_file_data(s::AbstractVector{UInt8}) = PackedVector(s) diff --git a/test/scenes.jl b/test/scenes.jl index 91626b5..27b795b 100644 --- a/test/scenes.jl +++ b/test/scenes.jl @@ -39,11 +39,11 @@ using CoordinateTransformations add_cats!(vis) setprop!(vis["/Lights/SpotLight"], "visible", true) # To understand why we need the here, see the documentation for - # set_property at https://github.com/rdeits/meshcat + # set_property at https://github.com/meshcat-dev/meshcat setprop!(vis["/Lights/SpotLight/"], "castShadow", true) setprop!(vis["/Lights/DirectionalLight"], "visible", false) # To understand why we need the here, see the documentation for - # set_property at https://github.com/rdeits/meshcat + # set_property at https://github.com/meshcat-dev/meshcat setprop!(vis["/Lights/AmbientLight/"], "intensity", 0.44) end end