Grasshopper

algorithmic modeling for Rhino

Happy new year ! Love, Health, Nice Projects, Money and Power for all grasshopper users !

In my country (Bulgaria) we believe that what you do on the first day of the year will give the mood for the rest of the year so I'm trying to understand new things...

I downloaded Boids by Jan Pernecky and tried to do something like the flocking 2d pattern of this amazing video video (2:41) but i'm not very happy with it. You can see the first result on this image.Image of the code

For now, I have 3 groups of 3 circles with 12 points on each: blue circles (points) are used for the "Adhere" flock location and the red ones for the "Repulse" flock location. 

After, I cut the whole thing with the wire-frame of the bounding box of the emitter of the points and their mirror according to the center axis of the central circle. (red rectangle on image).

First, how can i contain the curves into a region ?(without the bounce component because it's very slow...)

I think to have a result like the one in the video, i need many other forces ? I didn't understand the "finesse" of the flocking concept... 

Is there a way to trim vectors but not just by speed but by angle or to replace them ?

I tried to put more forces like the "align" but results are bad for now: curves are too flat or not aligned at all.

The * parameter is also hard to manipulate (for nuts like me hehe): for example, my repulse forces are kind of not existing or too strong... ?

How can i use the stick geometry component with other behaviours on the same time ?

It will be very nice if someone can give some advises or share some codes to help me... first time I use agents in grasshopper... 

Thanks in advance.

Peace.

Sorry for my frenchy English.

Views: 8214

Attachments:

Replies to This Discussion

Well ...

... always there's some Plan B to skin a cat but (since you are after AEC matters) it could be way better to provide some sketches with regard your final goal:

  • some paranoid skin (plastic is fantastic) of some building?
  • some Solaronix next gen P/V collector? (http://www.solaronix.com/materials/products/)
  • some ultra paranoid (and "cheap") truss?
  • some artistic/decorative one-off "academic" thingy?
  • what? 

BTW: You know my way of thinking: first master the details and then do(?) the whole.

First goal is to understand how particles work.

I don't intend to build anything bigger than some laser engraving in cheap wood hehe

I would like to contain the particles inside a region like in the video (minute 2:41).

Also to adjust correctly the repulsive force ? When i say that, i mean to always have vectors with a positive X and after the particles pass those circles (repulse and adhere), they go back to the mirror of their emitter positions (mirror according to the YZ plane on the middle of the red region).

Thanks for your reply Peter !!

I'm post some more explanations in an hour...

An image with the solution before starting anemoneThe bad vectors, how can i replace them by some vectors tending to their "final destination" ?The base setup for the adhere and the repulseThe setup with the bounce who's not really workin

Hmm ... you have a collection of // rays that collide (sooner or later) with some shapes right?

If the shape is "bending" then the ray follows an arc (inwards) where the R depends on the bending property ("force" so to speak) of the given shape and the distance from the shape's centroid. If the shape does the other thing then the arc points outwards.

This is doable solely with code (but I bet that you don't want a similar "option"). If no good Samaritan can provide some solution I'll post a far more "generic" case (any collection of blobs that act as the red/blue thingies of yours ... and you can alter their position AND "mode" (inactive/push/pull) AND the "bending" force on a per individual shape basis.

Assume that all the above are doable in 3d space (rather easily): then what? you want to create a zillion of mini pipes and then union them (good luck) in order to make a 3d printed "model" or you want to create a graph of some sort and attempt (good luck + Karma) to use ExoW for the "thickened" end result? (or TSplines as Plan Z if you are desperate enough).

I think you're right Peter, that's only doable with code... year ago I started some processing tutorials and it was fine, i understood the thing but code is not like riding a bike... you forget everything if you don't practice. So I'm trying "something" with grasshopper but every recursive things in gh seems so complex compared to recursion in python or processing... I was just hoping that those new plugins (Boids/Quelea) will help people like me experiment things with particles but for now i can't do better than some ants going crazy in boxes.  So I'm gona finish my architectural studies, learn code, read "Nature of Code" and do my own thing. 

So don't lose your time doing some crazy, hyper complex, funny  C code of yours cause I just use things I understand. (more or less)

I was hoping Boids would be enaugh for the things I'm trying to achieve.

In a far-distant futur I wanna 3d print some marching cubes mesh for my dirty kitchen... for now just engrave some wood. 

Well ... it's ONLY doable with code (as the 99% or real-life engineering cases - although this is not an engineering thing, but it could be ... he he ) but not for the reasons that you think. We must switch this talking off-line if you are interested to know the real reasons in depth.

What is the pro way? Well ... imagine objects (blobs et all) that are placed in 3d space by some per object policy whilst their "property" (bend,repulse) is user controlled on a per object basis. Then imagine variants of all that spaghetti yielded (the rays, that is) stored in parameters in order to do the obvious : take control of all your previous attempts (replace, remove, swap, reset etc etc).

Get a 10-- minute thingy (straight out of my head: NO checks OF ANY kind performed [bugs possible], just a grid that shoots rays and a single blob (a sphere) that does the job). Not even a decent random policy is applied in order to have some nice looking rays (not to mention their directions).

Now ... imagine any collection of breps distorting the ray chaos: i.e. a ray meets a blob > is distorted (or not) > then meets another > ... > blah, blah (plus some policy for killing rays heading to Sahara instead of Vienna - but that's elementary).

This requires at least 2 hours of coding to do it properly (+ the variants "management" C#).

But ... well ... it could be a good real-life case when Solaronix "sponge" type of U/V collectors could be available (rather soon) > I'll do it > the future > the glory > the cash > the polar bears.

Attachments:

Hi there,

First, afaik, boids are about iteration (and behavior), not recursion. And yes, all these new plugins will help you with particles and stuff, even if you get sad, discouraging replys telling you the opposite.

The problem with your def is that you are feeding the |x| pull at the begining, but then, in the loop you are using last "vector velocity" and lose all the "x movement". It's like 100% inertia and no "x pull".

Then, it's only playing with domain and multiplier. ;)

I made one example using fields, and even works in 3d.

And then made a fancy one with the boid library (I didn't know that), with inertia control, "x normalization" (like vector triming, but only "x coordinate")...up to you to add self repulsion, individual inertia...

I hope you find it useful.

Attachments:

Wow thanks Pablo !!

I have to study you defs for a while to understand them.

I'll post results when there something cool comin out of this.

And I knew i had a major mistake in my code, i was just hoping someone could lead me to the right path... thanks again. 

Hi Pablo.

Really love your scripts!! But had a few questions as I'm still new to grasshopper.

When I open up the definition a few things are un-connected. At the end loop it seems as the pick and choose are both connected to the end loop. this gives me an error of uneven numbers from start to end. Does the move need to be flattened to run? And the other question is with the circles specifically with "position". Is this suppose to be connected to the circle points or back to the start points. I'm not sure why everything has disconnected when opened. I get the error need anemone but have it plugged in and then have to re plug in the start and end loop. Thank you!

Hello Pablo,

I am New at agent based modeling, and i was trying to create a 3d that looks similar to the 2d form you made, so i was trying to convert the circles with sphere and the divide curve with divide surface but still, when i run the simulation afterwards it crashes and rhino stop working, and i have to shut it down, so do you know how to fix this problem?  

Hi Pablo,

Would you mind explaining the Max Normalisation you use? How did you know how to define this number? Is it meant as a distance threshold? Your script is really helpful but I cant figure out how did you get this particular variable.

Thanks,

Agata

happy to see you using the Boid library.
it's hard to achieve a precise result with behavioral simulations like this. after all, i made it as an experiment in emergent design, which by definition is unexpected. nevertheless, i hope you managed to achieve your goal.
cheers!

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