Grasshopper

algorithmic modeling for Rhino

Hello everyone,

I have a problem where I need to pack rectangle stripes of different length into a certain area. 

The problem becomes a simple number-packing task...

I think that it would be a very handy default tool in Grasshopper, like a Random function, just from predefined values, don't you think? 

Does anyone have a ready to use solution? 

If not, I'll probably go into creating a Hoopsnake algorithm for this...

Thanks.

Views: 491

Replies to This Discussion

Hi Artyom,

This is not an easy task and it is related to the bin-packing problem, if I am understanding you clearly?

This is an algorithmic routine with many different solutions(brute force, first fit ect). I think pack-rat is using brute  force.

Would really like to see the hoopsnake def if you end up developing it.

Best,

M. 

Hi Marios,

that's exactly what I need,

thanks for the link, very helpful,

In my case, in general, I need to pack rows of numbers, for example:

max length: 10

array of numbers: 1,4,5,7,9,3,6,5,2,2,5,1

condition: largest number<max length

then the packing would look something like this:

         1 |4 |5 |7 |2

         9 |6 |5 |3 |2

                        |5

                        |1

sums|10|10|10|10|10 => 100% efficiency

And the algorithm is:

1.Place first number(x=1)

2.Calculate the rest(R) in this row(10-1=9)

3.Search for closest x <= than R

3.1 If x=R -> place that number -> end of cycle

3.2 If x<=R -> place that number -> return to 2.

3.3 If x=null -> end of cycle

Something like this.

Can this be classified as brute force?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service