OpenNest can't use some shapes

I do try to nest some pieces into sheets using the OpenNest components but for some reason it is not able to use two of them.

This is the desired result, on top the pieces, on bottom, the pieces nested into sheets:

But what I do get it is this:

Bellow are the Rhino and Grasshopper files used:
Nesting_issue.gh (8.5 KB)
Nesting_issue.3dm (24.3 KB)

This :


Nesting_issue_Petras_.gh (34.5 KB)

1 Like

Thank you. It is working now.

So the solution is to ignore the holes? :man_facepalming:

I do need a little bit more help if possible.

I can’t find a way to say to OpenNest how many pieces of each shape I do need for nesting without copying the geometries a lot of time in Rhino. I do need to nest each shape to different numbers for each one.

In this example it is like this as it works for this case of the user.

You can write your own code that does this using surface input. You can do it using native grasshopper components.

I did a new code, which is not open-source at the moment. All the hassle of curve to polyline simplification is also solved, since there are two different ways to do it, rhino native and a standalone clipperish one. I took me quite some time to make it clean and structured:

1 Like

You need to use component “Repeat” to duplicate geometries and give it is a input.

The white group in this model identifies the unique parts. The yellow group (“View One Part”) is a way to see which part corresponds to the numbered sliders with pink border (‘gene pool’). That’s where you set the quantity for each part.



Nesting_issue_Petras_2022Sep30a.gh (33.5 KB)

I used single sheet which OpenNest copies as many times as necessary.

The TGuid (‘Bake’?) doesn’t have any effect that I can see? And the parts are missing the holes.

1 Like

I do need to nest a lot of shapes, so I will need a more manageable solution.

It is possible to read the objects “Atribute User Text” a Key like “Nesting_No”? I can assign a value number with the quantity that I do need to nest.

btw - I was wondering - does this plugin use any code from svgNest?

There are several ways to replace the ‘Gene Pool’ (Count of each unique part), as long as you make the correlation between part shape and quantity. Might be best to supply part shapes as surfaces (possibly with holes) and extract their edges before filtering out the holes as @Petras_Vestartas did.

I replaced the TGuid component with my own Bake component (cyan group), using the holed surfaces.


Nesting_issue_Petras_2022Sep30b.gh (39.5 KB)

1 Like

Hi guys, could you help me to nest these kind of shapes? some elements were lost. why this happen? thank you!

This is as much rewritten as Kangaroo2 from ShapeOP:
https://www.shapeop.org/

I think, I had already went through this discussion.
A good explanation and I talked with Jack to understand the logic, but the develolment went differently to that.

The idea is similar, Boost library generates minkowski shapes and a basic genetic algorithm.
Which is not the best way to test different samples, specially knowing that it is based on random mutations of rotations and placements.

The most simple code you can write is to generate minkowski via clipper and check all possible placements. It is literaly can be not longer than 100 lines of C# to illustrate the idea. You can then see how slow it becomes just by simple iteration of all possible solutions. Then comes the question how to make the code better so that it could be usuable by a user since no optimal solution exists. You can explore solutions on GPU by evaluating fixed size images or check randomly. Since it n! operation, the current version naively runs GA. If you know better solutions to such problems let me know. I like reading papers about these 2d nesting problems.

I ll try to test this in the new version I have not released yet.
There were quite some bugs that I left. I ll test and let you know.

1 Like

I do use the EasyCut Python script that it is very useful because can read all the 3D objects and it creates a cutting list. It is stores the values into each object itself using some Keys/Values stored in the “Attributtes User Text”. For example, the number of pieces that are repeating it is stored as Key=N and Value=2.

Will be wonderful if OpenNest will be able to read this keys and apply the value stored on them as input for the number of pieces to nest.

OpenNest doesn’t need to do that if you can you read those attributes yourself in Grasshopper?
Don’t wait for enhancements, work with how it is now!

1 Like

Can you show an example file of your workflow in the most simplified way?
But I agree to @Joseph_Oster custom input implementation are always a bit time taking, as you can easily get into a rabbit hole. Plus I have other work to do… Rhino object component and handling of user inputs took me 2 weeks, then a month of partly bug cleaning… Currently I have a good solution for curve to polyline conversion and input duplication using layer structure of rhino.

Try to write your own python input transformation and prepare it for the nest.
The only thing I see that is missing is that you want to duplicates parts as a user input.

I am doing some furniture, trying to make a workflow using only Rhino6+Grasshopper for all the necessary operations required. My teammate it is using SolidWorks with Alphacam but I can’t run that software in my CNC machine who have only 4GB of RAM and it is running Windows7.

I do use a mixed 2D and 3D workflow. I import objects from DXF and SolidWorks files as STEP into Rhino6 (the Rhino6 SolidWorks importer don’t work with the latest files). After that I need to prepare the objects for nesting, group them by thickness and material, create the mechanization layers for the machine and after that nesting the parts and exporting the result as DXF to import into SCM Maestro that it is doing the CAM operations for each layer. Create BOM files and drawings with assembly instructions.

Example of 2D DXF file that I do receive:

Example of 3D STEP file that I do receive:

Nesting result (one of the sheets):

Sheets been cutted:

Forgot to mention that because some of the inside lines are extended outside of the exterior shape of the peace I used the OpenNest definition from this tread that works better. The only downside it is that I do need to manually select the outside and inside shapes. Maybe there it’s a way to do the sorting operation automatically, still need to investigate how to do so.

you can do that using custom code or through some plugins like Elefront (here is with Elefront)

I didn’t fully understand the issue you describe in the following:

if the curves inside the DXF file you receive are already sorted inside/outside by layers or even just by color, then you could filter them by those properties (again you can do that by custom code or with plugins such as Elefront or Human, following is filtering by layer name with Elefront)

1 Like