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)