Compas in rhino8

Hi,
interested to know how if I can run compas geometry in rhino8beta?
I tried to run a simple Mesh.from_points script in the rhino8 grasshopper script editor and I get an error while importing MeshArtist. (image below: left rhino8 beta right rhino7)

is this because the artist wrapper is for ironpython?

hi,

yes indeed. currently, compas_rhino and compas_ghpython only take the IronPython-based script interpreter into account. we are looking into supporting both use cases.

will keep you posted…

1 Like

should be available by the end of the week…

1 Like

1 Like

btw, currently the following combinations work smoothly:

  • R8 ScriptEditor CPython + Scene
  • R8 ScriptEditor IronPython + Scene
  • R8 GH IronPython component + Scene
  • R8 GH CPython component + geometry conversions (using the scene doesn’t work here, yet)
1 Like

yes this works for me as well

1 Like

how are you able to run it in ScriptEditor without adding the package requirements on top? like below, is there a better way to make rhino import compas?

#r: compas

hi,

the instructions for working in Rhino 8 are available here Working in Rhino 8 — COMPAS

1 Like

Hello @tomvanmele

After following the instructions to install compas on rhino 8 here, compas grasshopper components are still not showing up. Do I need to

python -m compas_rhino.install

to have the grasshopper components in rhino 8?

hi,

we are working to resolve this here.

should be fixed reasonably soon…

I followed this thread and it suggests adding # env: /path/to/site-package to the script to enable using that environment in Rhino. After adding this line, there’s no need to use # r: module.

I used conda to create an environment with the same Python version as Rhino 8, then installed compas and compas_fab packages. The py39-rh8 folder remained untouched in this process.

I tried the code snippet import compas ... scene.draw() with the mentioned code and here is the result so far:

  • R8 ScriptEditor CPython + Scene: works
  • R8 GH CPython component + Scene: No good

Will this workaround be helpful? I personally prefer conda over pip since I find it easier to manage environments with conda and rollback when something goes wrong. With pip, I’m not sure how to achieve that level of flexibility and resilience.

Didn’t notice that the GH+scene combination is not working is already mentioned.
Using conversions along with # env: /path/to/site=package works on Apple Silicon Mac

As for rhino + scene, I got various results from Intel Mac to ARM Mac. Need further test to verify.

According to the comment in the Rhino Script Editor

Use env directive to add an environment path to sys.path automatically