# OpenNest can't use some shapes

**URL:** <https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502>\
**Category:** OpenNest\
**Tags:** windows\
**Created:** [September 30, 2022, 9:21am UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502 "2022-09-30T09:21:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [September 30, 2022, 9:21am UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/1 "2022-09-30T09:21:57Z")

</div>

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:

 ![Desired_Result](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/2/b/12b72d240bbfb1dcc815d46d934983c8f2324834.png)

But what I do get it is this:

 ![Wrong_result](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/2/6/526e5b83119db4b4df11f2b427b2f3ab9fc6b979.png)

Bellow are the Rhino and Grasshopper files used:  
[Nesting\_issue.gh](https://discourse.mcneel.com/uploads/short-url/AuqBSubUaGq2kxNklifXTGYhqr1.gh) (8.5 KB)  
[Nesting\_issue.3dm](https://discourse.mcneel.com/uploads/short-url/373F2qLCwNYx7L47H7Cc1sCidI9.3dm) (24.3 KB)

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [September 30, 2022, 9:31am UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/2 "2022-09-30T09:31:10Z")

</div>

This :

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/f/e/2fe965dd7dcf431e0806f3195acfa72c897bdeb6.png)  
[Nesting\_issue\_Petras\_.gh](https://discourse.mcneel.com/uploads/short-url/fYBJFLRD3KNaPhGqcRuoINEGtEP.gh) (34.5 KB)

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [September 30, 2022, 10:27am UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/3 "2022-09-30T10:27:22Z")

</div>

Thank you. It is working now.

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [September 30, 2022, 10:46am UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/4 "2022-09-30T10:46:08Z")

</div>

So the solution is to ignore the holes? 🤦‍♂️

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [September 30, 2022, 2:42pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/5 "2022-09-30T14:42:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [September 30, 2022, 3:13pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/6 "2022-09-30T15:13:24Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/d/c/0dcf302daf968b3a01f202391ee0452b6d7dee34.png)

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [September 30, 2022, 3:15pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/7 "2022-09-30T15:15:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [September 30, 2022, 3:50pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/8 "2022-09-30T15:50:10Z")

</div>

> [@Macuso](#):
>
> I do need to nest each shape to different numbers for each one.

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_2022Sep30a2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/0/8/308f5a3356bbaa25abc754d8535a77d17f31c638.png)  
 ![Nesting_issue_Petras_2022Sep30a](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/f/e/5fe0df05e2b2b7b4674285ff16c82b36a64262be.png)  
[Nesting\_issue\_Petras\_2022Sep30a.gh](https://discourse.mcneel.com/uploads/short-url/6XX8IEayRG5bNSixGYyF4C5FcBp.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.

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [September 30, 2022, 3:53pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/9 "2022-09-30T15:53:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanielPiker](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/danielpiker/32/666337_2.png) [@DanielPiker](https://discourse.mcneel.com/u/DanielPiker)\
**Post date:** [September 30, 2022, 4:14pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/10 "2022-09-30T16:14:30Z")

</div>

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

> **[GitHub - Jack000/SVGnest: An open source vector nesting tool](https://github.com/Jack000/SVGnest)**
>
> An open source vector nesting tool. Contribute to Jack000/SVGnest development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [September 30, 2022, 5:12pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/11 "2022-09-30T17:12:54Z")

</div>

> [@Macuso](#):
>
> 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.

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](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/2/e/72e7e7f9ffaa9921908936dd0d5a3be60ecd19a1.png)  
[Nesting\_issue\_Petras\_2022Sep30b.gh](https://discourse.mcneel.com/uploads/short-url/2qjcNHTv750Ofll8p5p8VmVxgcx.gh) (39.5 KB)  
 ![Nesting_issue_Petras_2022Sep30b2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/3/b/03b53e9b59c9048f61ec013618651d2463cfaa58.png)

---

<div class="post-metadata">

**Author:** ![ThomasE](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/thomase/32/516431_2.png) [@ThomasE](https://discourse.mcneel.com/u/ThomasE)\
**Post date:** [September 30, 2022, 5:21pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/12 "2022-09-30T17:21:25Z")

</div>

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

> [@Increase Rotation to 360 doesn't nest some elements](https://discourse.mcneel.com/t/increase-rotation-to-360-doesnt-nest-some-elements/143821):
>
> Hello @Petras_Vestartas @Petras1 How can I achieve a good result with large geometries when using 360 rotation? because some elements were lost. why this happen? When combine freeform and rectangualr shapes, I think It would be beneficial if Rotation could accept up to 2 values ​​(the first value for any shapes and an optional one for rectangular shapes). or any idea to restrict the rotation of the rectangular shapes? I did a manual nesting with this example, I would like to try your best res…

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [September 30, 2022, 6:21pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/13 "2022-09-30T18:21:38Z")

</div>

This is as much rewritten as Kangaroo2 from ShapeOP:  
[https://www.shapeop.org/](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.

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [September 30, 2022, 6:25pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/14 "2022-09-30T18:25:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [September 30, 2022, 7:12pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/15 "2022-09-30T19:12:47Z")

</div>

I do use the [EasyCut Python script](https://www.food4rhino.com/en/app/easycut) 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.

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [September 30, 2022, 7:25pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/16 "2022-09-30T19:25:48Z")

</div>

> [@Macuso](#):
>
> 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!

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [September 30, 2022, 7:26pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/17 "2022-09-30T19:26:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [September 30, 2022, 7:27pm UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/18 "2022-09-30T19:27:35Z")

</div>

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:

 ![2D](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/3/9/9397b1400ef203601cbee73d8fd7e5c7ac9a12df.png)

Example of 3D STEP file that I do receive:

 ![3D](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/c/5/3c5904c5b7d6bbd7faa74df483d6127cba6a3d79.png)

Nesting result (one of the sheets):

 ![Nesting](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/0/5/3056c5ef33795a5167230fd852ce4a547cca70df.png)

Sheets been cutted:

 ![20221001_093352](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/3/6/836b60c296b8cd3dc59dc55d97af078b83b13c4f.jpeg)

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [October 1, 2022, 10:49am UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/19 "2022-10-01T10:49:59Z")

</div>

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](https://discourse.mcneel.com/t/cnc-furniture-nesting/119103/3) 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.

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [October 1, 2022, 11:57am UTC](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502/20 "2022-10-01T11:57:10Z")

</div>

> [@Macuso](#):
>
> 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.

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:

> [@Macuso](#):
>
> 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.

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)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/e/7/6e71b4a14301fd715afbbb1490872d10904d5422.png)

[Next page](https://discourse.mcneel.com/t/opennest-cant-use-some-shapes/148502.md?page=2)
