Constraint translations for nesting

I need to nest panelized pieces from boards, on sheets that are made from boards as well. similar to this image.
nest

therefore i have a lot more reduced search space, since the boards need to align together. translations on Y direction can happen every N unit (steps) and rotation is also bound to 0 or 180 degrees (which is already implemented in the solver).

so far I can nest my parts in this way, by post processing the initial nest and re-aligning the parts after nesting. Would you know of any way to implement this constraint in the nesting algorithm?

1 Like

Seems to me your best bet is automating this post processing step. Hard to see the difference between ā€œwrongā€ and ā€œidealā€ nest, though I guess you move both pieces vertically to make board seams even, top and bottom? Individually or move them both together? Do you really need OpenNest at all for this?

sorry if it wasnā€™t clear:
in the ideal nest, the board seams from input geometry and sheet are aligned together. where in wrong nest they are not.

yes in this case. they can be moved individually or together. I think in the algorithm it happens individually.

this was a very simplified diagram to describe the question. I am dealing with many many parts and i prefer to use a nesting algorithm. in this case i am using OpenNest since I can integrate with grasshopper.

I have the post-processing automated; but a drawback of this workflow with nesting first and then post processing it, is that sometimes the initial nesting can be so packed that the post-processing wouldnā€™t be able to find ideal position for objects in one sheet and Iā€™d need to move the geometry from one sheet to another. therefore not a very optimized process.

How does the input geometry have board seams? Looks like a chicken-egg scenario to me. Asking quite a lot from OpenNest to align board seamsā€¦ If the seams on the input geometry were rotated 90 degrees then OpenNest is supposed to only use the same orientation in layout solutions? Does setting ā€˜Rotationsā€™ = 1 do that for you?

P.S. Here is an OpenNest model from three weeks ago to experiment with:


With ā€˜Rotationsā€™ = 1, OpenNest fails to fit the big rectangle at all unless itā€™s rotated 90 degrees, which does make sense, eh?

1 Like

I agree this is asking quite a lot from openNest. I donā€™t know of any way to get the result I want with the existing solver, but I was hoping to get some suggestions. In my understanding this means reducing the search space (or discretizing it) based on the boards.
For example in this post, imagine that the piece couldnā€™t be placed on all the possible options, but only the ones that would fit the board seam criteria.

Iā€™m not quite sure why it would be a chicken-egg scenario. I am making a part (out of wood boards) that I need to control the seams for construction/structure purposes. And I am doing a CNC milling from sheets that are not plywood (homogenous) but rather made from Boards. So Iā€™d need to nest the pieces with this board pattern.


I do already consider the Rotation, and that does makes sense. But on top of that Iā€™d like to constrain the movements or placements of the pieces too.

Because the pieces have board lines before they are nested instead of nesting first and then post processing to make the seams ā€œevenā€ (or aligned with their longest edge).

could you please attach a Rhino file with a collection of different pieces to be nested (please include their desired board-line orientation) and also a rectangle indicating the total size of your board (please include board-lines also on that)? Iā€™d like to experiment a few ideas :slight_smile:

like this, but as hands-on Rhino file that you were actually going to cut for real:

thank you so much!

Iā€™ll try to put down a definition, in the meanwhile this is a sort of basic explanation of my idea, in such a way you can stop me now if you think itā€™s basically wrong :slight_smile:

the main point is: when we let OpenNest place this blue piece on the board, just that one piece, what is the maximum ā€œerrorā€ (in terms of board misalign) that I can get?

I think the answer is ā€œalways less than 5.5 units along Yā€

this means that we can always move a piece by less than 5.5 units along Y and find its right placement on the board

ok ā†’ so why not nesting pieces that are all enlonged by 5.5 units along Y, in such a way we are not nesting just them, but we are nesting the area in which a solution to their placement will exist?

for instance, instead of nesting the left ones in this picture, we nest the right ones:

and get something like this as output from OpenNest:

at this point we will have another portion of code that just puts the right shape into the right container, and that just moves along Y each piece to its corresponding closest horizontal line

from this:

to this:

I know, it will for sure consume some more spaceā€¦ but looks like a plan :slight_smile:

the best solution would of course be to have some kind of customizable snap with OpenNestā€¦ but I think that is out of reach :slight_smile:

2 Likes

Thinking outside the box is always good. Remember too that OpenNest has a ā€˜Spacingā€™ parameter, though it applies to all sides, X and Y.

Iā€™m still hung up on the issue of the input geometry having ā€œboard seamsā€ instead of finding a best fit in the post processing stage. (even seams top and bottom unless top or bottom is a straight line?)

Here is a basic test bench for OpenNest with your parts and sheet internalized.


Nesting_issue_2022Oct20a.gh (534.7 KB)

Based on subtle color variations, it looks like some of your parts need to be flipped?

Hah! I got what I wanted, though maybe itā€™s not what you needā€¦ Best explained by looking closely at one sheet. The white curves were done by OpenNest. The black line is the longest segment produced by Convex Hull (the curves are polylines with short segments). The blue curves are done by moving the white curves the direction and distance from the black lines to the nearest sheet seam. :sunglasses:


It might not always be the best strategy? In some cases, the opposite curved edge of the parts leaves a vey thin overlap with a seam, which probably should be avoided? But itā€™s very close to what Iā€™ve been advocating, which is to forget about seams in the original geometry and handle that by post processing after OpenNest does its best.


Nesting_issue_2022Oct20b.gh (559.5 KB)

P.S. Setting ā€˜Rotationsā€™ = 2 gives a different layout but still uses 13 sheets.

1 Like

It would be nice if the test data included these parts:

I would modify my green group that gets the longest edge to make sure it is ā€œhorizontalā€ (parallel with the sheet seams). That would handle the pieces in this image that have such an edge already, and in those cases the long segment from Convex Hull would not be parallel to the seams so it would be ignored. With this small change, these ā€œcorner piecesā€ that have two square edges would be handled properly.

That leaves the issue of nudging the post-processed curves in Y to avoid small slivers, however that is defined. My Rhino file ā€˜Unitsā€™ are inches which makes the sheets 55 inches by 120 inches (10 feet), and the boards 5.5 inches between seams, is that correct? What is the minimum ā€œsliverā€ dimension in the Y direction? Say 1.5 inches?

this is a very dirty prototype of what I meant
gin tonics have had a bad influence on my ability to do things the smart way tonight, so I solved several small problems the weirdest possible way without thinking too muchā€¦ it should be improved in its execution, but the basic idea is there (tomorrow Iā€™ll add some comments to the GH file to give it more sense)


Nesting_GinTonics.gh (31.2 KB)
this GH file should work seamlessly with the provided Rhino file (calculation time is 18s on my machineā€¦)

I believe I havenā€™t used any plugin apart from opennest, but still:

2 Likes

Very nice work. Only ten sheets used! ā€˜Iterationsā€™ = 1? ā€˜Spacingā€™ = 1.

  • When I use those settings in my model, I get only 7 sheets but a few of the post-processed curves overlap slightly and one exceeds the sheet boundary.

  • With ā€˜Spacingā€™ = 2, eight sheets are used with no overlaps but several parts extend beyond the sheet boundaries! OOPS! I didnā€™t check for that.

  • ā€˜Spacingā€™ = 3.75 looks OK in my model with 11 sheets required, but a couple of them still overlap the sheet boundary. I can fix that and add collision/boundary detection but OpenNest spacing is my only recourse, which affects X and Y instead of only Y, as yours does. Well done!

P.S. I made a few simple changes and got better results.

  • Added a ā€œPad Y (scale Y)ā€ group at the top that uses the Scale NU in Y only to get more room without infringing on X. Transform replaces scaled part with original before post-processing.
  • Added ā€˜Collisionsā€™ at the bottom right to detect (but not avoid) overlaps, including sheet boundaries.
  • Reduced ā€˜Iterationsā€™ to 5 so itā€™s quicker.
  • Ten sheets.
  • Uses Rhino file, not internalized.

Nesting_issue_2022Oct20c.gh (49.9 KB)

2 Likes

Thank you @Joseph_Oster !

Would you mind sharing the result from this? Iā€™m curious! I also get around 10 sheets in my computer. even with more Iterations and ā€˜Spacing = 1ā€™ !
Do you think there is a difference in results based on the pc configuration?

Yes correct with the sizes! sorry I didnā€™t understand what you mean by ā€˜silverā€™ :sweat_smile:

:clinking_glasses: @inno

Thank you! very much like the idea to modify the input geometry to consider for the seams! that sounds like a good plan.
I will test this further with a larger dataset and compare with what I had previously. Hope this can improve it.

Meanwhile I also made a little benchmark with a manual nesting with these parts.

I feel the difference is large enough (almost 1/3 material saving) to invest more time in the nesting algorithm.

Those results were using version Nesting_issue_2022Oct20b.gh from this post, with changes to the parameter values as noted. But the overlaps (collisions) were unacceptable so I would ignore that.

No.

Version Nesting_issue_2022Oct20c.gh looks much better to me, using ten sheets. Space between the post-processed parts depends on ā€˜Pad_Yā€™ and ā€˜Spacingā€™ values. I havenā€™t tried yet to avoid the few cases where there is a very small piece on one edge due to board/sheet seam alignment.

P.S. Your benchmark results are interesting, though small changes to parameter values may change them without modifying any code. But again, Iā€™d be interested in trying an expanded set of input geometry including those in the image you shared.

1 Like

This image from your benchmark file shows two of the ā€œsliversā€ I referred to that should be avoided?

However, they donā€™t look correct because those parts have not been post-processed. I disabled the ā€˜Bakeā€™ feature in my last model (version Oct20c) because itā€™s not correctly wired to the post-processed results, which is also the case for version Oct20b. An oversight.

P.S. This image shows sheets 3 and 4 using version Oct20c. These ā€œsliversā€ are so small that I wonder if the parts are designed to fit in five board widths? 27.5 inches?

1 Like

yes thatā€™s right! thatā€™s something i need to avoid and consider again in the panelization.