RhinoScript/RhinoCommon Bugs

Rhinoscript and Rhinocommon also have bugs that i never saw in previous versions (5, 6 and 7) but I understand that moving to CPython may be difficult…

hi @pau.natividad please specify, and ideally start new thread for those, thanks

You can continue to use IronPython 2.7 if you wish, it’s still supported. It should run like in V7.

There are some issues that are caused by Python 3 working differently than Python 2, some issues with how Python 3 calls RhinoCommon methods, and some issues with the script editor itself. The second and third will mostly be ironed out over time I’m sure,

If you have bugs, please let us know about them. We are not aware of general “bugs” with RhinoScript and RhinoCommon so we’ll need help better understanding what it is that you are seeing.

Thanks,
-Steve

Here’s one I found today:

This runs fine in Python 2:

import Rhino

plane=Rhino.Geometry.Plane.WorldXY
iv=Rhino.Geometry.Interval(0,100.0)
box=Rhino.Geometry.Box(plane,iv,iv,iv)
brep=Rhino.Geometry.Brep.CreateFromBox(box)

mp=Rhino.Geometry.MeshingParameters.Default
meshes=Rhino.Geometry.Mesh.CreateFromBrep(brep,mp)
if meshes:
    joined_mesh = Rhino.Geometry.Mesh()
    joined_mesh.Append(meshes)

Running it in Python 3 ends up with this:

In order to make it run in Py3 it is necessary to do this:

#! python 3
import Rhino

plane=Rhino.Geometry.Plane.WorldXY
iv=Rhino.Geometry.Interval(0,100.0)
box=Rhino.Geometry.Box(plane,iv,iv,iv)
brep=Rhino.Geometry.Brep.CreateFromBox(box)

mp=Rhino.Geometry.MeshingParameters.Default
meshes=Rhino.Geometry.Mesh.CreateFromBrep(brep,mp)
if meshes:
    joined_mesh = Rhino.Geometry.Mesh()
    joined_mesh.Append(list(meshes))

IIRC, there have been a bunch of issues like this with methods not outputting basic Python lists…

I agree there are issues that we need to tune up with CPython 3 in Rhino, but since CPython 3 was never in Rhino 5,6,7 it seems like something different than what I assume Pau is referring to.

Is this a bug or am I doing something wrong?

This way it works:

All the bugs I’ve seen are things like this. Some of them I see that are being corrected with the Service Releases.

This is Python 3, and apparently not considered a bug. You can no longer import ‘static’ classes like that.

from Rhino.Geometry import Transform as XF
xform=XF.PlaneToPlane
#etc.
1 Like

Thanks @Helvetosaur!

1 Like