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 1f1f4f8..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)" ] }, @@ -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 }