Grasshopper

algorithmic modeling for Rhino

Hey!

I have included the file that reproduces swarm (flocking) behavior inside grasshoper, using scripted language. The currently moving particles are nodes (points) and I would like instead to attack some simple geometry on to them (probably cudes or  rectanglular boxes). 

Any ideas? If this cannot be done here, could I transfer the entire function in another program and work there? 

thank you in advance.

NOTE: the BOIDS grasshopper file was created by Dimitrie Andrei Stefanescu for further info see: http://improved.ro/blog/

Views: 4098

Attachments:

Replies to This Discussion

Try the flocking example I posted here:

http://www.grasshopper3d.com/forum/topics/processing-example-files-...

 

It's the example script from Processing ported to GH. The boid geometry (moving cones) is generated by standard components so it should be simple enough to substitute it with something else.

WOW that was really fast! :)

Thanks a lot. There is a problem though...most of the VB scripts inside "flock" are lebelled "old" and especially one of them produces numerous runtime errors entitled: "Public member "Count" on type Double not found" (line 01-...)

Now what?

It says "old" because it was made with components from an earlier version but they should still work.
I just tested it in Rhino 4 and 5 and works without any errors on my computer.

True!

But what about the runtime errors?

I can't reproduce the errors, you'll need to give me more info. Which of the two VB components is returning an error? What version of GH/Rhino are you using? Did you change anything on the file?

no I just downloaded them straight from your links.

the VB script located right next to the random component is the problematic one.

I 'm using GH version 0.9.0006 and Rhino 4.0

:) thanks again for your help!

Right click on the 'x' input of that component and make sure "List Access" is selected.

 

I've got it working on Rhino 4.0 SR9 and GH 0.9.0014. Can you update GH?

Hehe! thanks! with the new version it works smoothly!

The thing is that you cannot control some parameters like "cohesion" etc, which although can be done in the file I uploaded... but this can also be fixed right?

They are hardcoded in the script, but you can change them manually. Double click on the second VB component to open the code editor and search (ctrl+f) for the lines:

sep *= 1.2
ali *= 1.2
coh *= 1.5

Try tweaking those values. You can also search and change for these other values (which are also hardcoded in the other script you have):

Dim desiredseparation As Double = 20.0
Dim neighbordist As Double = 25.0
Dim neighbordist As Double = 25.0

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