Author Topic: Loop for calculation of random lines on a 3dcube  (Read 6575 times)

0 Members and 1 Guest are viewing this topic.

Offline surfer96

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • prefered language: VB
    • Prog expertise: Beginner
    • View Profile
Loop for calculation of random lines on a 3dcube
« on: May 02, 2013, 07:01:16 PM »
Hi all,
I'm trying to generate a "grid" of randomly generated 3dlines on the surface of a 3dcube.
Any of the single areas on the cube's surface shall be within a certain range, eg between 1 and 5 m².
In case one or more of the areas shall be outside the wanted range (1 to 5 m²), the generation of the 3dlines shall be sent back to a loop, where a new set of 3dlines will be regenerated. And so on and so on until the loop's result is matching the geometric constraints.
Can this be achieved by The random-lines and the conditional loop should be no problem, but what about the calculation of each of the single areas on the surface?
Here are some ideas for calculating the areas, although I do not exactly know whether they will work or not:
In AutoCAD one could break up all the lines at their reciprocal intersection points (But how can this be done?). The result would be a set of collinear yet seperate line objects which could be converted into regions bearing their area as property. The AutoCAD regions' areas could then be sent to the conditional loop.
Or, instead of an area, the conditional statement for the loop could be a minimum distance between all the intersection points of the 3dlines. So one would have a set of let's say 100 points, and each of these points would have to be tested whether being in a certain distance intervall to the closest of the 99 other points.
Does anyone have an idea, if this can be solved in returning the wanted random-grid to AutoCAD???
By the way I tried all this in Rhino supported by Grasshopper and Hoopsnake. It worked, but the calculation (requiring thousands or even millions of iterations) was VERY MUCH too slow. So I hope that might be a faster alternative for this kind of random based design approach.
Thanks for your help in advance.