{"id":5784,"library":"meshcat","title":"MeshCat","description":"MeshCat is a remotely-controllable WebGL-based 3D visualizer for Python, built on top of three.js. It allows users to create 3D visualizations of geometries, mechanisms, and robots with a scene graph approach, communicating with a browser-based viewer via WebSockets. The current version is 0.3.2.","status":"active","version":"0.3.2","language":"en","source_language":"en","source_url":"https://github.com/rdeits/meshcat-python","tags":["visualization","3d","robotics","jupyter","webgl","scene graph"],"install":[{"cmd":"pip install meshcat","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core library for ZeroMQ communication with the MeshCat server.","package":"pyzmq","optional":false},{"reason":"Used for the MeshCat web server backend.","package":"tornado","optional":false},{"reason":"Efficient MessagePack serialization for transferring data to the viewer.","package":"u-msgpack-python","optional":false},{"reason":"Commonly used for defining geometries and transformations.","package":"numpy","optional":false},{"reason":"Required for using image textures in MeshCat geometries.","package":"Pillow","optional":true},{"reason":"Enables exposing the local MeshCat server publicly, e.g., for use in cloud notebooks like Google Colab.","package":"pyngrok","optional":true}],"imports":[{"symbol":"Visualizer","correct":"import meshcat\nvis = meshcat.Visualizer()"},{"symbol":"geometry","correct":"import meshcat.geometry as g"},{"symbol":"transformations","correct":"import meshcat.transformations as tf"}],"quickstart":{"code":"import meshcat\nimport meshcat.geometry as g\nimport meshcat.transformations as tf\n\n# Create a new visualizer. This will launch a local server\n# and typically open a browser window with the visualization.\nvis = meshcat.Visualizer().open()\n\n# You can also get the URL to open it manually:\n# print(f\"MeshCat URL: {vis.url()}\")\n\n# Set a red box at the root of the scene\nvis.set_object(g.Box([0.2, 0.2, 0.2]), g.MeshPhongMaterial(color=0xff0000))\n\n# Move the box slightly along the x-axis\nvis.set_transform(tf.translation_matrix([0.5, 0, 0]))\n\n# Add a blue sphere at a sub-path within the scene tree\nvis[\"sphere\"].set_object(g.Sphere(0.1), g.MeshPhongMaterial(color=0x0000ff))\nvis[\"sphere\"].set_transform(tf.translation_matrix([0, 0.5, 0]))\n\nprint(\"Visualization created. Check your browser window or the URL printed above.\")","lang":"python","description":"Initializes a MeshCat visualizer, opens it in a web browser, and displays a red box and a blue sphere. The example demonstrates setting objects at the root and at a sub-path, and applying transformations."},"warnings":[{"fix":"Upgrade `meshcat` and `pyzmq` if available; otherwise, be aware of the warning. The `meshcat-python` project mentions this issue but has not released a new version since `0.3.2`.","message":"The `zmq.eventloop.ioloop` module used internally by older `meshcat` versions is deprecated in `pyzmq` 17+. While `meshcat` typically handles this gracefully, direct usage or older environments might show warnings.","severity":"deprecated","affected_versions":"<=0.3.2"},{"fix":"Consider converting DAE files to other supported formats like STL, or manually adjusting `meshScale` if using a wrapper like `pinocchio.visualize.MeshcatVisualizer`.","message":"MeshCat has known limitations with DAE (Collada) files, particularly regarding scaling and display. They may not appear or scale correctly in the viewer.","severity":"gotcha","affected_versions":"All"},{"fix":"Increase the `frames_per_second` parameter when initializing or recording the MeshCat visualization if your integration allows.","message":"When integrating with simulation environments (e.g., Drake), the default visualization update frequency of MeshCat might cause initial conditions or very fast state changes to be visually missed or incorrectly displayed. The visualization might lag behind the simulation's true initial state.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure `ffmpeg` is installed and accessible in your system's PATH. For Linux, `sudo apt install ffmpeg` or similar. For macOS, `brew install ffmpeg`.","message":"Converting MeshCat animations to video files requires `ffmpeg` to be installed on your system. If `ffmpeg` is not found, the video conversion functions will fail silently or with an error about `ffmpeg` not being callable.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}