Jump to content

Rectangle Packing 1.0.1

   (0 reviews)

3 Screenshots

About This File

The heart of this Marionette example is the RectPack node. A node with over 2600 lines of code! 

It supports dozens of packing algorithm to pack rectangles on another rectangular area in a space and time-saving way. 

The right combination of packing and bin algo gives the ability to pack rectangles in a way you want to have them on your machines (as close as possible, always cut complete board, less cuts etc.)

 

Actually not even myself know, which packing algo ist right for which use case. 

Also for professional use case, usually there is a machine dedicated software, which packs the port in a way which match best for the machine. 

So I see the main use case to pack parts on a board for milling them on a cnc-machine as example for model-making. Workflows which uses a guillotine-workflow (always cut the whole board) often have special requirements which maybe could be reached with the choice of packing algorithm or maybe can not. 

 

The Marionette Example based on foundational work:

http://www.secnot.com/   Python code for packing algorithm

Jukka Jylang - A Thousand Ways to Pack the Bin - A Practical Approach to Two-Dimensional Rectangle Bin Packing (2010)

Huang, E. Korf - Optimal Rectangle Packing: An Absolute Placement Approach (2013)

 

General Features:

- Input of basic data like length and width

- Input of additional data

- object input (node detects if part input are objects and process them like rectangles)

- sort by material

- use a list of stock materials

....

 

Not all input combinations works at the moment. Recommended to use the existing examples to get correct input values.

 


What's New in Version 1.0.1   See changelog

Released

New Version, with small fixes for 2020 and 2021.
Some Wrappers and nodes with "empty" outputs, results in freezing the Application in Vectorworks 2020 and Vectorworks 2021 if the Network is wrapped in an Object Node.

  • Like 6

User Feedback

Recommended Comments

Some Screenshots of a carpenter who uses this for cutting arrangements.

So great to see, how other people uses those technology (and days of work) to improve their workflows. http://www.garzotto-ag.ch/

 

Screenshots attached

 

5a3ae63760824_TheProject.thumb.jpg.60817b8488f6de241e3c3752acbbb426.jpg

 

5a3ae65fa7b02_CuttingArrangement.thumb.jpg.577834b88bcaf5d2876418e2ebf1a063.jpg

 

5a3ae673141de_Stackedworkpieces.thumb.JPG.8a9c5d8c601aa0903a272a6151018fb1.JPG

 

 

 

 

 

 

Link to comment

Hi,

Ich benutze dein Programm um in unserer Firma Plattenzuschnitte zu optimieren und bin begeistert.

Allerdings bekomme ich bei der Variante WorksheetInput, also die Eingabe über die Tabelle immer eine Fehlermeldung.

Vielleicht schaust du dir das mal an!

 

Danke für deine echt coolen Programmierungen die du hier veröffentlichst, von diesen benutze ich einige um mir den Arbeitstag zu erleichtern!

 

🙂

Link to comment

@Gescher

Hallo

Ich kann mir das gerne anschauen. Es gibt zwei Tabellen-Inputs. Einerseits die Teileliste, andererseits eine Plattenliste um für verschiedene Materialien, verschiedene Plattengrössen zu definieren und um zu sehen, welche Platten bestellt werden müssen. Wobei man auch bei der Lager-Liste Stk 1 verwenden darf, wenn man das nicht braucht.

 

Also Board-List ist der Platten-Lagerbestand und Stückliste-Küche ist die Stückliste. Es könnte dann Fehler geben, wenn die Spaltenreihenfolge nicht stimmt, die Zahlen mit Komma getrennt sind (7,1 statt 7.0). Poste doch mal Deine Beispieldatei und Beispieltabelle.

Link to comment

This looks great! Would it also be possible to use this principle for fitting furniture in a room?

 

Link to comment

Hallo DomC,

Vielen Dank für dieses sehr nützliche Tool.


Ich habe festgestellt, dass es ein Limit für die Anzahl der Ausfahrtsschilder gibt.

Nach 20 Platten "boards_out" die Berechnung stoppt und der Rest wird ausgelassen
Wissen Sie, wo ich die Anzahl der Ausgangsfelder im Code anpassen kann?
Vielen Dank im Voraus

Raphael

Capture_06_28_2021_084042.png

Link to comment

Hi
Oups, did not thought about that limit. There was a plan to implement code for checking stock material. That code was not implemented completely and there was set a constant maximum of boards per material of 10. And the Standard input of material was 2. So this results in 20 Boards. As a short fix you can change the code on apprx line 2474 to

 

max_board = 100

or more if needed. But this needed to be fixed in the node anytime I take time for that.

Link to comment

Hi Dom,

Thank you for your answer
As you can imagine it works.

 

Now I have a problem with the "worksheetInput_Example" file.
I think it comes from the version of vectorworks 2021 !?

Because I opened it with the 2020 version and it worked

 

Can you look at what's going on?

Thanks in advance

Link to comment
On 8/6/2021 at 9:44 AM, Raph said:

Now I have a problem with the "worksheetInput_Example" file.

This File "WorksheetInputExample_v2" (without any changes) runs without issues here in 2021. Can you attach your File here?

Link to comment

Hello
Aha, you really take the Original File. So the issue could be related to the following:
1. Platform (Mac Win)
2. Country-Settings (dezimal seperator is point here)
3. Vectorworks Version (I have German SP4)
4. Program Settings (more or less Standard)

Ah see the issue while I am writing here. On my windows computer it hangs since over a Minute. Seems to be the issue can be confirmed on windows here too. Thanks, I will update for any news.
 

 

Link to comment

Ok
1) I work on Mac. It sure can make a difference but it used to work with the 2020.
2) I work with the separators in dot mode.
3) The version I use is in French.
4) I can't help you there, please give me more details on what you need to know.

I'm not really sure I didn't modify the raw panel list and part list. But I'm sure it was working.

I hope I can help you find the problem

RAph

  • Like 1
Link to comment

Challenge Question

I would like to cut out these 50 layers on the CNC. How would you do it?

I tried to use your tool with these shapes but it doesn't work. I think they are not rectangles so it's impossible for the program to calculate that!

 

the work is already done but I'd like to do a smaller one

 

The idea would be to find an easier and faster method than the one I did.


Because I took each layer one after the other to extract the surface and place it manually on a panel. Then I exported a cutting file for each panel with 3-5 shapes.

 

What do you think about it?

 

RAph

WhatsApp Image 2021-08-07 at 14.08.41.jpeg

Link to comment
DomC

Posted (edited)

Cool

 

Spontaneously  I would say, It has to go this way since we have no other Marionette:
1. Unfold (Extracting Tool) Click on every shape and extract planar shapes
2. Put them on screen-plane (Infopalette)
3. Or alternatively there would maybe be a quite simple script to put every shape on a different layer (maybe not, because the pathes may be NURBS and they are not CNC-compatible)

4. Next exporting DXF and (I don't like to say) import it in an other software to nest those polys. 
maybe this one, looks free and looks at it runs on macintosh:
https://deepnest.io/

just downloaded it looks promising good!
Edit:
Seems that every DXF have to be imported one by one manually. Also it needs some settings (units). Did not testes, It did not work after one Minute.

5. Some CNC-CAM-Software could automatically extract your 3D Model (export Parasolid)

The really cool thing would to have a poly-nest similar to the rectangle-nest. There is open-source-code for this available so it would not be a project from scratch. Also this would allow us, for automating the complete process. That would be my next project if I would find the time because that is also a kind of project that is interesting for me.

 

Edited by DomC
Link to comment
DomC

Posted (edited)

OK
Just tested that application.
1. Import units should be set in the settings to mm
2. The sheet(board) must be added or imported by dxf

So far, then it works. It seems to be a try and error algorithm, because it uses quite a while. Would be nice, to have a tool like this directly implemented in Vectorworks (also something, that can be handled by script/marionette)
 

Bildschirmfoto 2021-08-09 um 18.32.01.png

Bildschirmfoto 2021-08-09 um 18.44.44.png

Bildschirmfoto 2021-08-09 um 18.45.27.png

 

 

Source code nesting algorithm, seems to be java:
image.png.9dbb209bd8779234ff1472d21ad7ac65.png

Edited by DomC
  • Like 1
Link to comment

Hi dom

Thanks for your answers and your interest.

first of all, did you update your "WorksheetInputExample_v2" file?


Thanks for your advice,
I installed deepnest and tried to import dxf.
No dxf file opened.
I tried with lines, surfaces, only the surface extractor.
really weird.
but it must be a good tool and very handy.

it would be really nice if vector works would do the surface calculation directly. I am unfortunately not strong enough in python to do this.

I will try again


Thank you Dom
++Capture_09_12_2021_120643.thumb.png.f79aba12ac4df7426ed39ebdae7cd799.png

Link to comment
DomC

Posted (edited)

On 8/22/2021 at 1:39 PM, Raph said:

Hi dom

Thanks for your answers and your interest.

first of all, did you update your "WorksheetInputExample_v2" file?

 

 

I was able to reproduce the "freeze" on my computer also with VW 2020 and VW 2021. It seems it freezes by wrapping the Network to a Object Node before the code runs. So the Code is all right, it is the Wrapping-Technique, which produces a problem. I will submit a Bug for that.

I deleted the empty pass nodes and deleted the name of the Wrapper of the Worksheet Wrappers. Those Wrappers and nodes produces empty outputs in the network, which maybe is results the appHang.

New Version 1.0.1 of Worksheet Input Example Created for Vectorworks 2020/2021

Edited by DomC
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...