How to rebuild a collection of lines with another collection of lines?

Hi all!

[This is a shorter description of the text below:
I have two sets of lines of various lengths. The first set needs to be used as efficiently as possible to recreate the second set. The main rule is that the second set of lines can only be made up of two or three lines. Three for the longer ones and two for the shorter ones.]

The project I am working on is about disassembling and reusing steel pylons in the façade of a new building. The pylons are constructed by four trusses put together to form a square cross section (equal sides). The webs of the trusses are what we are using to form new elements in the new façade. Because the new façade elements longer than nearly all the webs we are using 2 webs for the shorter new elements and 3 webs for the longer ones. So the problem I have is how do I find the optimal way of combining the old elements to make up new elements with as little waste/cut offs as possible?

In the image you see the red webs that we are reusing. A and B are the new façade modules. The image shows an attempt by me to do this task manually. Keep in mind that the red webs are multiplied by four because the pylon has four identical sides of webs. In the image I have started with two sides of a Pylon.

Thanks for any help!

Hi, interesting project. I have a friend who worked on a similar task (using stock of defined lengths to fill other length) before, he made a few c# scripts for that. I can share his definition if you dm me.
Also there was an old topic for that, check this out:

1 Like

Here is a quick example of how that can be used (anemone needed)
Anemone_lengths.gh (21.4 KB)

1 Like

I think you ll find some tools for linear cutting here

You can search for 1d packing.