I’m a total novice with Grasshopper and I’m trying to use OpenNest to automate nesting for some patches for a plotter. I’ve followed several video tutorials, but I’ve hit a wall with an error I can’t seem to bypass.
I have converted all my input curves into closed polylines.
Everything is strictly on the World XY (Z=0) plane.
I have tried both with and without scribes (including text and exploded curves), but the error persists.
Errors:
1. Invalid cast: Brep » nest_geo
2. Solution exception: Object reference not set to an instance of an object.
to make things a bit more automated you could use a Geometry pipeline on the layer names, filtered using Curves and something like *CUT* and *SCRIBES* (sheet is on layer 0) {the most important thing is that layer naming and content is always the same, boundary curves always on the layer CUT, sheet on 0, ecc etc}
Hi Inno! I tried other geometries and i noticed the curves are now polyline even on the output.
So i tried to use transform geometry to just rotate the initial shape but it’s a bit of a mess.
I ended up including the border in the scribes too so everything get transformed and changing the final layer by hand. is there a smarter solution for this? Thank you!
the reason why these 2 shapes are not being nested is because rotating them by 180 degress (360 divided by Rotations value, which is 2, so 360/2=180°) does not allow those to be contained in the sheet height, so they are not part of the nesting
increasing Rotations to maybe 3, for sure 4, will eventually allow EVERYTHING to be rotated in steps of 120 degrees or 90 degrees
So I keep trying to make this tool as clean and foolproof as I can. I added a layer selector and a baking option. I’m trying to turn it into a cluster leaving out:
Dropdown menus to select cut layer, scribes layer, and sheet layer from the ones in Rhino.
Nesting options.
Selecting whether to output curves or surfaces.
Number of iterations (I still didn’t understand if this actually improves the solution; it doesn’t look to change anything with the files I tried).
Once the operator is happy with the preview, they should just hit a single bake button and the result is computed in Rhino and no other previews are shown. I’m facing these problems:
The Jitter/Multiple Iterations: Even when I stop the OpenNest solver, hitting the bake button seems to trigger a re-calculation that results in multiple overlapping objects being baked, sometimes offset by a fixed distance. I tried using a Data Dam or a Data Recorder as a buffer, but it didn’t solve the issue.
Sequencing scribes baking and cut baking: I am trying to use a single “RUN” button to trigger two separate bake operations in a specific order (Scribes then Cuts) without the user having to click twice. If you bake the other way around, OpenNest recalculates things and moves the scribes according to the new nest solution (see pic).
I’m trying to understand if it’s possible to freeze the output geometry once the operator is happy with the result, and bake that instead of recomputing constantly. I tried using data dams and recorders as a buffer, but it still recalculates things even if OpenNest run is set to False.
At the moment, to prevent multiple plot of geometries i use Data Dams between transform block and bake block but is quite annoying that i have to press play every time i run the solver.
the reason why the OpenNest retriggers is because you have GeometryPipeline that reads the content of a given Layer
when you bake the result of the nesting, you use the very same layer where non-nested geometries came from, so adding items to that layer re-triggers the Geometry pipeline which imports also what you have just nested and baked and nests them again
I think your setup would work fine as it is, if instead of baking stuff on the very same layers you would just bake on new layers (or existing but not auto-imported layers)
(I added a Curve Join component in order to eventually bake curve boundaries as single closed curves instead of shattered parts, and merged the two bool-buttons into one in such a way it just bakes everything at once)