Grasshopper

algorithmic modeling for Rhino

How to change a flat hexagonal grid's density with an attractor ?

Hi guys,

 

Has someone ever managed to change the density of a hexagonal flat grid in GH based on an attractor ?

 

I have tried jellyfish but couldn't keep the outcome flat.

 

Many thanks,

 

Arthur

Views: 56552

Replies to This Discussion

(in reply to your question above this one)

 

I guess if you have only a repulsor expanding one area, with no attractors contracting any other areas, the hexagons have to buckle to make room. You can avoid this by just reducing the overall rest length to give a sort of pre-tension to the grid. (See attached definition)

Attachments:

Hi Daniel,

Thanks a lot for this definition.

I am trying to define a path on a slope using a start and an end point as well as several obstacles which would attract the path. I would also like the path to stick to the slope. I have tried to adapt the definition above but I get this weird reaction.

What have I done wrong?

Thanks again,

Jakob

Attachments:

see if this file helps.

It has a pull to surface force, bending resistance to stop the path kinking too sharply, springs for the length, and attraction to the obstacles.

Which points you pull towards the obstacles and which order the obstacles are in will affect the result you end up with here

Attachments:

Thank you Daniel for your quick response, I will test it now =)

 

Cheers

 

Jakob

Hi Daniel,

We are having a hard time understanding how the rest length works with negative values in this definition. Isn't the rest length the dimensions that lines try to reach in Kangaroo? How do the lines then deal with negative dimensions?

Looking forward to hearing from you,

Many thanks.

Arthur

Hi Arthur,

I hadn't actually noticed that the definition I made was causing the rest lengths to be negative. It is a little odd, but it makes sense that it would still work, and maybe this is a good time to explain a little more about how the springs in Kangaroo are working...

 

You are quite right that the rest lengths are basically the lengths the springs are trying to reach.

 

The spring forces are calculated using Hooke's law (along with some damping terms),

so essentially :

 

(current length - rest length) * stiffness

 

applied to each end of the spring towards the other end

 

So if the current length is longer than the rest length (the spring is in tension) this value is positive and the spring will try to get shorter, and if it is compressed the value is negative and the spring will try to get longer.

 

If the rest length supplied is negative, this value will always be positive (because current length is a distance so it can never be less than zero), so the spring will always try to get shorter (it will just try a bit harder than if the rest length was zero).

 

If you consider these force graphs from the manual:

 

Spring with positive rest length:

Spring with zero rest length:

You can see that the distance where the line intersects the horizontal axis is simply the rest length. (and the steepness is the stiffness)

So a negative rest length spring would just be this graph shifted further over to the left. The odd thing would be that this spring would never be able to reach its rest length, and would always have some elastic potential energy, so it would forever bounce back and forth around zero length, even with damping.

 

So negative rest lengths are a generalization of the mathematical physical laws to something which never actually occurs in nature, but can nevertheless sometimes be useful for form-finding purposes.

 

There are several settings in Kangaroo like this where I didn't really design them to be used in this way, I just didn't block users from supplying non-real-world values.

For example, it is even possible to supply a negative value for timestep and make time run backwards...

 

 

 

 

For example, it is even possible to supply a negative value for timestep and make time run backwards...

This sounds cool!

How is it set up? I get this error:

Not the Timer interval - the Timestep in Kangaroo Settings.

 

For something like simulating planetary orbits, running time backwards should not be a problem, but I expect things will get pretty weird in any simulation where drag is involved though.

 

One of the nice properties of the Velocity Verlet integrator (the default one) is that it has time-reversibility, whereas RK4 for instance does not.

Thanks Daniel.

It went throgh my .3dm file like a vacuum cleaner though. In a few milliseconds all (rhino) geometry was gone! I could still select it (and it would go yellow) but after deselecting, it looked all blank. Strange. I'll use it with caution in the future...

That sounds very odd. Can you post the file so I can see if I can replicate this ?

Sometimes if particles fly way, way outside the visible area, you need to reset the viewports (click _4View a couple of times) to make things visible again.

That sounds like a very good explanation. I've noticed that when working very far from the origin, the view will start to flicker. This sounds like something related to that. I've attached the files.
Attachments:

Hi Daniel,

 

I replaced the hexagonal grid with a rectangular grid which I kept as 1*1mm in order to map it onto a surface. Unfotunately, the deformation is gets quite strange as shown on the printscreen below. I played with all the sliders but couldn't find a solution.

 

I hope you can help,

many thanks,

 

Arthur

 

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service