Robotic fabrication planning with the COMPAS framework and the
compas_fabpackage: building robot cells, solving kinematics, and planning motions, in Rhino/Grasshopper and standalone Python.
👉 Slides · Written guide
We will install compas_fab in Rhino and also in a standalone Python environment.
- Open Rhino 8, then open the
Package Manager(typePackageManagerin the command line), and search forcompas_fab, install version2.0.1. - Restart Rhino.
Install uv as pre-requisite (if you don't have it yet):
On Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"On MacOS / Linux:
curl -Ls https://astral.sh/uv/install.sh | shYou might need to restart VS Code if it was open during the installation of uv.
Open VS Code and open a terminal in the folder of this repository.
Create a new virtual environment:
uv venv --python 3.12Activate it:
On Windows:
.venv\Scripts\activateOn MacOS / Linux:
source .venv/bin/activateThen, install the package via pip:
uv pip install compas_fab~=2.0Finally, test the installation by running the 01_hello_world.py script from the examples folder.
Make sure you select the newly created virtual environment in VS Code before running the script. You can do this by clicking on the Python version in the bottom-left corner of VS Code and selecting the interpreter from the
.venvfolder.
Example 05_collision_aware_ik.py needs
the PyBullet backend, which is an optional dependency:
uv pip install pybulletOn macOS, PyBullet may fail to build unless you pass an extra compiler flag:
CFLAGS="-fno-define-target-os-macros" uv pip install pybulletSome examples require a planning backend. compas_fab supports several:
- Analytical: closed-form inverse kinematics, runs in-process, no setup.
- PyBullet: in-process collision checking and motion planning.
- ROS / MoveIt: full motion planning over a ROS bridge. A ready-to-use
docker-compose.ymlis included to spin up ROS + MoveIt (see the COMPAS FAB docs for details).
The first examples run without any backend; later ones note which backend they need.
The examples/ folder is a progression: standalone Python scripts first (run
them with VS Code), then Grasshopper definitions (open them in Rhino 8). Each
example notes which backend it needs.
| # | Example | What it shows | Backend |
|---|---|---|---|
| 01 | 01_hello_world.py |
Verify the install; print the COMPAS and COMPAS FAB versions. | none |
| 02 | 02_robot_cell.py |
Load a UR5 robot cell from the library and inspect its model, tools, joints, and default state. | none |
| 03 | 03_forward_kinematics.py |
Forward kinematics: joint values → flange frame, with the closed-form solver. | Analytical |
| 04 | 04_inverse_kinematics.py |
Inverse kinematics: a target frame → all closed-form solutions. | Analytical |
| 05 | 05_collision_aware_ik.py |
Collision-aware IK that avoids a floor obstacle, then verifies the result with FK. | PyBullet |
| # | Example | What it shows | Backend |
|---|---|---|---|
| 00 | 00_install.ghx |
Installation check for Rhino/Grasshopper | none |
| 06 | 06_visualize_and_pose.ghx |
Load a robot cell, set a configuration, and visualize it in Rhino. | none |
| 07 | 07_inverse_kinematics.ghx |
Solve analytical IK from a frame target and visualize the result. | Analytical |
| 08 | 08_build_robot_cell.ghx |
Build a cell from scratch: import a tool from a mesh, add a rigid body, attach the tool, then solve IK. | Analytical |
| 09 | 09_plan_motion.ghx |
Plan a motion to a frame target over ROS/MoveIt and deconstruct the resulting trajectory. | ROS / MoveIt |
| 10 | 10_kitchen_sink.ghx |
End-to-end definition: FK, IK, Cartesian motion, and action chains with full ROS/MoveIt planning. | ROS / MoveIt |
| 11 | 11_install.ghx |
Installation of optional Pybullet backend for Rhino/Grasshopper | none |
A couple of the Grasshopper definitions ship with a preview of the expected result:
06_visualize_and_pose |
07_inverse_kinematics |
|---|---|
![]() |
![]() |
LAMCP ("Lambda MCP") lets an AI
coding assistant inspect and edit a live Grasshopper session: read the
canvas, wire components, set slider values, run RhinoCommon calls, and
hot-reload modules, all from inside the agent loop without rebuilding
userobjects or restarting Rhino. It is handy during the workshop for
scaffolding Grasshopper definitions with compas_fab robot planning and debugging them conversationally.
It has two halves: an MCP server (runs in your system Python) and a bridge component (runs inside Rhino). They talk over loopback HTTP.
- Download
Lamcp_Bridge.ghuserfrom the latest release. - In Grasshopper: File → Special Folders → Components Folder, and move the
.ghuserfile there. - Restart Grasshopper. The
LAMCP Bridgecomponent appears under theLAMCPtab. - Drop it on the canvas and wire a
Boolean Toggleset toTrueinto itsenableinput. Thestatusoutput should readlistening on http://127.0.0.1:8765.
You only need one of these, depending on which assistant you use. Both
launch the server with uvx, so there is nothing to install first.
Claude Code (VS Code extension) registers MCP servers from the command line. Run this once, at user scope so it is available in every project:
claude mcp add lamcp --scope user -- uvx lamcpVerify it with claude mcp list. The LAMCP tools then show up in any new
Claude Code conversation.
Codex (VS Code extension) reads MCP servers from ~/.codex/config.toml.
Add this block (create the file if it does not exist):
[mcp_servers.lamcp]
command = "uvx"
args = ["lamcp"]Restart the Codex extension so it picks up the new server.
Using a different MCP client? Point it at the
uvx lamcpcommand over stdio.
With both halves running, your assistant has a run_python_script tool
that executes code inside your live Rhino session.


