Serialize and de-serialize using compas_rhino.geometry.RhinoNurbsSurface
from Rhino.Geometry import Circle, Cylinder, Plane, Vector3d, Point3d
from compas_rhino.geometry import RhinoNurbsSurface
r = 1.4
p = Point3d(0, 0, 0)
x_axis = Vector3d(1, 0, 0)
yz_plane = Plane(p, x_axis)
yz_circle = Circle(yz_plane, r)
cx = Cylinder(yz_circle, 4 * r)
surface = cx.ToNurbsSurface()
data = RhinoNurbsSurface.from_rhino(surface).data
RhinoNurbsSurface.from_data(data)
The following error occurs:
Message: 'NoneType' object has no attribute 'KnotsU'
Traceback:
line 85, in rhino_surface_from_parameters, "C:\Users\usename\AppData\Roaming\McNeel\Rhinoceros\7.0\scripts\compas_rhino\geometry\surfaces\nurbs.py"
line 321, in from_parameters, "C:\Users\username\AppData\Roaming\McNeel\Rhinoceros\7.0\scripts\compas_rhino\geometry\surfaces\nurbs.py"
line 201, in from_data, "C:\Users\username\AppData\Roaming\McNeel\Rhinoceros\7.0\scripts\compas_rhino\geometry\surfaces\nurbs.py"
line 15, in <module>, "C:\Users\username\Downloads\brep\cylinder.py"
Expected behavior
De-serialization should succeed.
Getting an attribute error when de-serializing a RhinoNurbsSurface with a cylinder shape. The error is a result of the following method returning
None
To Reproduce
Rhino.Geometry.Cylinder
compas_rhino.geometry.RhinoNurbsSurface
The following error occurs:
Expected behavior De-serialization should succeed.
Screenshots