Grasshopper

algorithmic modeling for Rhino

Is there a component for selecting points after dividing a line?

Hi,

I'm currently working on a script that uses a module, a rectangular prism with 5 equally distanced points along it's length, to rotate pieces around one of those 5 points. The angle of the rotations come from an outside script that translates music into a text file and is plugged into the rotation component. I have the script working the way I want it to (choosing which point the piece will rotate on and following the previous piece that it is attached to).

 

The issue:

I started the script with a point xyz and connected it to a line SDL and divided that line SDL using a slider which then extends lines perpendicular to the first. These will be the points where my "module" are placed and dividing the line will give me a series of that module. Now, what I want to do is mass produce this piece (using this line and dividing method or any other suggested methods) and be able to manipulate the next row from the division (possibly having the next row rotate like the first, but with its own set values so that it is connected at the first piece on the second row to the first piece on the first row and all pieces that follow will rotate at their own values using the random component). I have attached my script to this post. The line and divider component that I am referring to is located at the very beginning of the script. Any help with this will be great!

 

Another issue I am having is mass producing the modules that attach to the previous module at one of those 5 points. If you look at the script, there is a large section where I basically copied and pasted a module over and over again until there were 15 of them. Is there a simpler way of doing this?

 

The last issue that I am having is that my script seems to be making the computer run really slow and moving some sliders around takes quite some time. Any suggestions on how to simplify my script to make it run smoothly again will be great as well!

 

Thank You

Tim

Views: 288

Replies to This Discussion

Hi Tim

 

Any chance of attaching the text files that are being read by the script as well as so i can visually see what happening though the script.

 

Matt

 

Hey Tim,

 

I have attached a Working Progress Version in a new file that would now let you define every point and angle of rotate for each module...  I still requires duplication of the code to create each of the modules that use the last modules data as well as duplication of sliders for each mass Produced module.

Though these sliders could be replaced when changed back to a list of numbers from file that matched the Mass product length.

 

 

Also i have changed the Surface creation to the end of the code as this will speed up the process alot as you can enable this when you need it and now just work with lines and points.

 

Sorry i have not copied and pasted all the modules back togther, but hope you get the idea from my start.

 

I will think about how to get round duplication on code modules though at present i think its only possible with scripting the module/s

 

Hope this Helps

 

Matt


Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service