Grasshopper

algorithmic modeling for Rhino

Hi there,

I am trying to create a mountain / iceberg topology by smoothly moving closest points to some random ones that have different z values from those points - which are to be moved -. The points to be moved are of a rectangular grid. I have come up with this sketch that I attached but there a number of problems;

1) Since distance values - between the two sets of points - are only given as absolute values - no negatives -, it has been trick to create the iceberg ones.

2) With the current way I make a mesh out of it there are some open faces and overall it is not as smooth as it is desired to be.

Overall I have to solve these issues in a permanant way but not specifically for this configuration of points as the determining points are to be transformed later on to a complex imput of live data.

Thanks!

Levent

Views: 659

Attachments:

Replies to This Discussion

Hmm ... there's 2 ways to address this:

1. The simple and rather incomplete (using native GH components) is via the attached def (spot the "perimeter" points [Anchors] policy).

2. The other (using solely C#) is far more capable since it allows you to control points (location in grid AND Z value) on a per point basis (individual control of items in collections, so to speak) and is capable to manage variations of solutions stored (as persistent data) in parameters. But in order to handle this you must be very familiar with C#. It uses Ball Pivot code as well instead of the Delauney triangulation native component.

best, Peter

Attachments:

Dear Peter,

Thanks very much for such detailed reply and file, yet I believe it slightly exceeds further than my comfort zone in the program that as I could not make it work after I opened it. Could you either assist me on that or perhaps help me on a solution similar to what I initially posted?

Sorry for the inconvenience,

Kind Regards,

Levent

Dear Levent,

1. Let's start from the beginning: a 2d grid of points sampled into a Data Tree (you know - I hope - what this thing is, if not notify): like the one used by you. This the the original DataTree.

2. Since GH is acyclic by design we can't pick individually (without code, that is) our "picks" for the iceberg ... thus we need a global policy applied to ALL grid points at once.

3. This is what the next part does: it picks randomly some iceberg stuff and modifies their Z by a random value. If the Z is always "above" the grid or not it depends upon the domain of values to operate. Seed means "roll the bones again" (meaning another collection).

4. So we have the modified points Data Tree (that are steady - acting as the tips of the iceberg). Let's call them Anchors.

5. If we subtract set 4 from 1 we have the points prone to vary according some manipulation. Kangaroo does that manipulation (this is the best add-on that GH has to offer by 1M miles made by a very clever fella).

6. But if we instruct Kangaroo to do the job... he makes chaos since the points in 4 are not sufficient: we need perimeter steady points that act as Anchors as well. So we manage some logic to pick a variable set of perimeter points and we "merge" 4 and 6 and we have the final set of Anchors on hand - whilst all the rest are points willing to change.

7. Kangaroo is a physics engine meaning that the only thing that understands is ... er ... points and their relation (the "line" connecting them, that is). Kinda like a  CPU that understands 0 and 1 and nothing else.

8. So we provide Kangaroo info about all the lines involved: how "stiff" they are and what is the expected/desired final length.

9. By double clicking the Kangaroo component ... the "simulation" starts running (in some kind of "loops") and goes towards an "equilibrium" where all our desires are satisfied  - or the solution's entropy is the minimum possible (well up to some level, he he). Kangaroo displays a small control dialog that allows you to halt the process or reset it (meaning: start again).

10. If the instructions are "good"/"proper" the "loops" (iterations) are relatively few: if  K does 1M "loops" ... this means that your instructions are silly or not well thought.

After stopping Kangaroo ... we have (hopefully) a "well" distorted collection of points (and their equivalent mesh) to proceed further via components usually found in the WB add-on

PS: If all the above sound Greek to you ... it's because I'm Greek, he he.

Moral: Get the gist of Kangaroo ASAP - worth spending some time I recon. If you do that and you need examples (other than the ones available at download time) ... well I have more than 300 (from simple to ultra paranoid).

Dear Peter,

Thanks for the detailed explanation. Funny enough that when I opened the file in my personal computer it worked fine - I had opened at work for the first time and did not seem to have the main kangaroo simulator and bunch of other components despite they are installed -.

But nevermind, this is very nice and thank you very much for that - I have been also playing with different configurations.

I am essentially trying to create something more complex and I have had perhaps satisfactory results but now that you have provided such file I would be keen on linking this to my original project which I have now attached.

Essentially I am trying to create a topology based on the acceleration data of cargo vessels in on the Firth of Forth in Scotland. 

I have an api for such data in a pre-determined area of the whole Forth. The data updates itself every two minutes and it does not give the acceleration value but instead the speed of the boats. So I thought I could substract V2 from V1 every two minutes and divide by the time that has passed - V2 always being the newest data and V1 the one before. 

I have categorized the boats according to the Vessel ID so that the speeds match to the appropiate boat however there is still a problem. In reality not every boat manages to send an updated info every two minutes so what happens is that;

-lets say at the very beginning we received data from 10 boats - creating 10 data branches.

-And in the second set of data arrival only 6 could manage to send data - so in 6 data branches there are indexis of 0 and 1 and the other four there is only 0.

-When the third set arrives and its the same 10 boats again, the four that could not manage in the second set writes its speed values to index number of 1 but the other 6 is already at 2. So I believe those 4 have to somehow skip index no 1 and write the values on the 2nd although it is their only second data.

-So that the index number represents the overall number of present data but not the number of data sets received for each boat.

In summary, my aim is to achieve a topology using your file, but instead of picking random points from the grid and getting random heights for it, finding the closest point from the grid to each of the actual boat locations and then pulling them according to ther (V2-V1).

P.S: What would you recommend on making the mesh out of more triangles in the pursuit of a smoother surface - I will then render this as a real landscape - iceberg fantasty. I have tried to decrease the distance between the cells and increasing the number of points but it is somehow related to number of random points as well so although it is a better resolution there are this time too many peaks.

ΕΥΧΑΡΙΣΤΏ!

Levent
Attachments:

Hmm ... I completely misunderstood the scope of this, he he (appeared another Academic "exploitation", that is).

I have good, good and good news: Skype tomorrow (Note: I do hope that Valentino would deliver the goods in tomorrow's MotoGP > if not > I'll be in despair > no serious talking up to the next year).

Reason for Skype? Well ... this is serious (most notably: the managerial aspect of things - forget "geometry") and requires ... er ... Skype. Send me an invitation for friendship in order to pass you my ID, e-mail etc etc.

Moral: Forza Valentino (and Lewis > USA F1 GP also tomorrow > the D-Day).

 

haha sure, I added

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service