Grasshopper

algorithmic modeling for Rhino

Is there any documentation generated for Vector Field class and its methods & properties? I've been searching for it.

Thanks in advance.

A gif maked with the last definition:

Views: 3724

Replies to This Discussion

Here you have the other solution with euler solver ;)

Attachments:

You can use the solvestep method. For the particle to come back, you just need to add some inertial mass.


Dim field As New gh_field
field.Elements.AddRange(x)
Dim pl As New list(Of point3d)
Dim acc As New vector3d

For i As Integer = 1 To 1000
acc += field.SolveStep(p, 0.01, gh_differentialsolver.RungeKutta4)
p += acc
pl.add(p)
Next
a = pl

Nice!...but, you have made the same iteration...only you are changing the method to calculate the vector that you add to the point. You are using solveStep and I'm using TensorAt.

What do you think is the point of using solveStep in this case? (perhaps this question is better for David :P)

P.S.: Your solution solve the problem I told before about vector addition ;)

Yes, .solvesteps is for moving a particle without mass and intertia through the field. If you want it to have inertia you'll have to create your own little physics engine. (Your previous code seemed to try to move the particle without any inertia).

 

As I understand it, the difference is that .tensortat will calculate the resulting vector at a particular point, while .solvestep will actually move the point through the field. Every infinitesimal step the point makes, it changes direction because the location of the charges relative to the point change.

In this case there is probably very little effect between the two because inside the little physics engine (if you can call it that) the point moves a very short distance between iterations.

red = solvestep, green = tensorat:

Yes, I see your point and I think that you are right.

Indeed If you see the captures I made, when my particle was moved by a big tensor vector, the displacement becomes erratic an not very precise. That is because the tensor vector is not added to the next tensor vector calculated. 

I'm enjoying this post ;) 

P.D.: It's a little bit strange talk to other spaniard guy about technical stuff in english :P But I prefer it, because this information could be useful for someone else ;)

I'm sure someone will complain if we start to type in spanish.

 

Talking GH in spanish is also not that great. When I teach GH in spanish, since it's not yet translated, the result is a horrible spanenglish "Ahora conectamos el "eslaider" al componente "list aitem"...".

When I teach GH in english the only problem is my horrible spanish accent.

I've implemented your particle+tail visualization style in this VB component. I'm thinking about code it properly in VS with other tools.

Yeah, I understand you, sometimes if you pronounce "correctly" English words, some spanish people don't understand or show some strange faces. Last month I teach in a workshop at out of Spain, in English and it was an amazing experience. Always code is easier to explain in english ("bucle"..."declaración condicional"...:S).

Attachments:

This is really funny :) Added floor detection :D

Other kind of possible uses:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service