Error when working with OpenNest and Rhino Compute

Hi @Petras_Vestartas,

I am currently trying to use OpenNest for Grasshopper in my Rhino.Compute workflow but I am facing an error that I suspect to be a backend issue.

Error message:

"System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at OpenNestLib.OpenNestUtil.ToPolyline(Curve curve, Boolean collapseShortSegments)\r\n   at OpenNestLib.OpenNestUtil.ToPolylines(IEnumerable`1 nurbsCurves, Boolean collapseShortSegments)\r\n   at OpenNest.OpenNestFullComponentCleanUp.SolveInstance(IGH_DataAccess DA): component \"OpenNest\" (29e017d9-7a67-48ca-b1c7-35b7b9c10f30)"

I am quite certain of the following:

  1. The problem does not lie in the grasshopper plugin. There is no problems when I open the .ghx file in Grasshopper. (See screenshot of GH code)

  2. There is no problem with my Rhino.Compute syntax. This is because I have a working version by using PackRat (but I really prefer using your algorithm).

Screenshot of working .ghx file

Screenshot of Rhino Compute

What if you convert curves to polylines in Grasshopper rather putting curves circles as input?

Hi Petras,

Thank you for the suggestion. However, converting curves to polyline in GH resulted in the same issue. (Works in Grasshopper, but shows same error message when used in Rhino Compute)

I have uploaded the python and ghx file in the link below. They include tests for OpenNest and Packrat.

Thank you so much for looking into this issue!

Screenshot of working code in grasshopper

File upload
opennest (37.2 KB)

Hi @Jing_Zhi_Tay , I have the same problem when trying to nest curves or surfaces using OpenNest with Rhino.Compute server, was wondering did you manageto find a solution for it, Thank you!

Unfortunately not :frowning:

1 Like

@Jing_Zhi_Tay :frowning:
Hi @Petras_Vestartas , Iā€™m facing the same problem, do you have any update regarding this issue? Thank you!

To be honest I never used Rhino Compute, What at least error says that there is so mismatch within RhinoCommon version.

Just to mention - the issue is also present when Hops spins up a Rhino.Compute instance to run a definition containing OpenNest: