Grasshopper

algorithmic modeling for Rhino

UCount Value is not valid for this amount of points / API

Hi,

I am trying to make a surface from set of points - which are live coordinates of about 15-30 vessels that change every two minutes -. So that the surface changes shape every two minutes since these points are supposed to be the control points of the surface. I attached that live data to P, and have been trying to find the right value for U and I on the SRFGRID. Yet it still says UCount Value is not valid for this amount of points. 

I have attached the file, would really appreciate if someone could assist.

Thank you,

Levent

Views: 8869

Attachments:

Replies to This Discussion

Nikos,

Sorry for late response. I tried to merge the live data with your latest version - did not quite understand whether you had already done that or not -. I still only see points though, no surfaces.

Thanks a lot!

Levent

Attachments:

Hi,

I checked the file again and now it seems to be working except one error which is shown in the uploaded image.

Best,

Levent

Attachments:

I also tried to make something like this but it does not seem to be working

Attachments:

Hi Levent,

Your file works just fine on my GH.

What I noticed is that you don't have the latest version of grasshopper. Why don't you try updating it HERE and see if this solves the problems with the errors?

best,

nikos 

Nikos,

I tried to download it but it says it does not work with the Rhino Installing Engine I have, yet the model seems to be working now.

What we are trying to do with this model now is to record it for a day and merge every single surface - in this case 24x60/2= 720 Topological Model -. and then put that into a box in rhino and get the inverted volume, reflecting somewhat the "free territory" on the sea. This will be then cnc milled. Do you think there is any way to merge the recorded topologies at once rather than me trying to bake, copy and paste 720 of them. Also do you think 720 is to much performance wise?

Secondly - if you are still not annoyed by the number of questions -, we are doing this cnc drawing machine using arduino and firefly. Since we have the live data of the vessel positions we want the machine to be drawing this live data.

Our initial thinking was to make simulate polylines made by these points and then in summary basically tell the machine to replicate those lines in grasshopper / rhino. One way I thought about matching the points - each polyline having different coordinates of the same vessel -, was to match them with their name, since the xml gives us their name as well. I uploaded the xml file with the new extended list of info. So every two minutes I want grasshopper to add a new line to each polyline - whose correspondant vessel have just moved -, by joining the two dots. 

However in real life for the machine, since we dont have 30-40 pens moving around but only one, I want to machine start from one and go to the others - possibly in 2 minutes before the new data arrives - and then come back to the first vesel, yet this time on the second point.

Would be grateful if you could help,

Best,

Levent

Attachments:

Hi Levent,

Sorry for the late reply but I was kind of busy the last few days.

Unfortunately the /msgtype:extended link doesn't provide any info when I use it on the definition. Actually, even on my browser it is an empty page. Maybe this is because I don't have an acount?...

Anyway, I used the MMSI value (I don't know what it is but it seems to be a vessel-specific value) in order to sort the coordinates and create the route of each vessel.

All you need to change is the XML address and the item index for the vessel's name (I think it is 6 in the extended XML) and hopefully this should work (fingers crossed).

this definition creates the routes as polylines (or points when there is a single point for a vessel) for all vessels or for one chosen vessel. (I am not familiar with cnc so I don't know how the output polylines should be organised but I think you can take it from there.)

Regarding the other question, I would advise you against using solids booleans on such large number of breps as they often don't work well (and even if they did they would probably cause GH to crash with 720 breps). 

I suggest you tried to come up with a different approach, maybe offseting the polylines and subtracting those regions from the rectangle?... (clipper is a great plugin for offseting)...or something similar which will not put a big load on GH...

cheers,

nikos

Attachments:

Dear Nikos,

Thanks again for your kind help and sorry for even much later reply, the cnc machine we are doing still has not worked yet so still could not have tested your file.

Yet back to the spikey version you have made - surfacepointnt(1) - I want to have an opinion / advise from you on that. 

In the simplest logic, if I were to merge 30 of them lets say to obtain the data for 60 minutes, we might interpret the vertical dimension as time since the bottom is a rectangle - which suggests the whole area is empty, referring to an infinitely distant time where there are no boats in the region - where as the top layer is present. So if we were to take horizontal slices of the 3d model each contour could show the position of the boats - in other words the territory in which the boats could be - in a logarithmic scale.

Yet than the problem is, this only works under very defined circumstances such as where everysingle boat has the same speed and in the bigger picture I think it is a bit too abstract.

Now as a final version of this grasshopper model I am trying to make a model which will record these points of boats for a given time. The xz - horizontal - plane will be showing the coordinates of the boats yet I want the y dimension to be time, almost stacking xz planes - or topologies in this case - vertically.

Would love to hear your comments on this and how to do it.

Hope not bothered you so much,

Best,

Levent

Hello Levent,

I am not sure I understand what exactly you mean by merging a number of surfaces. 

If you want the z axis to represent time, then you would have an array of 2d representations, one on top of the other(they could be extruded but its still the same thing). This is a bit different from what you were doing so far.

So for adding time into the equation, I can think of 2 approaches:

1. Use metaballs to draw smooth circular outiles around the points and subtract those from the rectangle. Repeat the above for every time step and stack those surfaces in layers.

This can easily be constructed using plexiglass layers with standoff fasteners:

2. For each vessel, draw a curve that rises in Z direction and draw pipes around those curves. This is better if you want to focus on the the vessels' routes but I can't think of a direct way to construct it.

Anyway, see how these work out and I am waitting for your feedback.

Good luck, Nikos 

Attachments:

Dear Nikos,

Sorry for such, such late response I only see now that my latest reply did not go through.

Your last example was really good, especially the first one helped a lot.

Now I am trying to make a grasshopper file that will merge all of these things discussed before and also add another aspect;

Instead of equally pulling them upwards just by their location, I decided to use acceleration as the specific force parameter for each of the points. In order to measure the acceleration I obviously need at least two consecutive speed values which is provided by the same xml data. The nice thing about this one I believe is that it not only creates a mountain topology but also icebergs beneath the ground level as some of the accelerations happen to be negative.

Until I added this aspect to the file the simulation worked well, yet I believe a problem I am about to mention below blocks the simulation from working. I hope I can describe it as clearly as possible.

In the shortest way possible, the number of points (of a selected set of data) do not match with the number of (V2 - V1)s. Bear in mind that if in reality lets say there are 25 vessels in that territory not all of them manage to send their data in every 2 minutes (time interval provided by the marinetraffic website). So what happens is that right after you start recording the data each of the points in the first set obtain an index number of 0 under different data branches. In the second set (at the 4th minute) if there is a boat sending its data for the first time it automatically obtains an index number of 0 while all the ones in the first set have already a second value with an index number of 1.

What will solve the issue I believe is to manage the delayed / previously-absent datas in a way that they will follow up with the rest but not start from 0 all the time.

But perhaps the problem is something else?

PS: Is there a way to put a timer to the simulation so that when you press play it automatically stops after some seconds?

All the best,

Levent

Attachments:

Hello Levent,

I am afraid I can't really understand your last definition... it has grown too complex and seems to have taken a different path from the last one I had suggested.

So I suggest we, kind of, start over:

I believe the problem of assigning the correct X,Y coordinates to each vessel, was solved in the last definition I posted (I used the first value of each branch -MMSI- to identify the vessels and it seems to be working OK...). This way, even if a vessel stops transmitting for a while, the definition will find it when it starts transmitting again and continue drawing it's course.

Before we get into implementing the acceleration into the definition I'd like you to explain how you imagine this (even with a quick sketch). The first thing I am skeptical about is this:

You say you want to create a construction out of this definition. This means you have 3 available dimensions to work with. Right now X and Y dimensions represent the vessels' position. So this leaves you with Z and you will have to decide what will be represented in this dimension. Until now it was time that was represented in Z. If you want this to be acceleration instead, then you will not be able to show the vessel's position in a specific time (and I thought this was a thing you wanted). So please, explain this thought a little bit better and we will get to it!

PS. What exactly do you have in mind? To stop getting info from the site after some time?

Hi Nikos,

Ok I will try to explain differently. I connected an number slider for the acceleration aspect. For example;

If the slider is at 3, this will suggest that it will take all of the speed data given with the third set of information (at the 6th minute). From that, it will then match - for the same exact boats - the speed data given at the 4th minute. Finally it will do a matched subtraction of V(4th) from V(6th) for each boat. Those numbers - whether then scaled up / down or somehow manipulated - will act as the Z dimension which will create the topology. Since V2 - V1 can have a minus value, the overall topology will be a mix of mountains and icebergs this time.

Perhaps to be more accurate, we could divide V2-V1 by 120 and let the topology show the change in speed in a second within that two minutes; the XY coordinates belonging to the latter position of the ships, not the first. 

Your definition as you say helps for the linear drawing as it continues from it's stopped. I used that in the current sketch as well for again doing the same thing.However when, I tried to use it for what I am trying to do with the acceleration thing, the result was different. I will try to explain this again;

Let's say that until this point 6 sets of data has arrived - so 12 minutes has passed -. Within that 6 sets, the number of of boats for each one differ as not all of them are able to send data every time. Let's assume in total there are 25 boats and 18 of them have always managed to send data in those 12 minutes. So 18 from the beginning until the end, and finally let's say the remaining 7 of them only could manage to come into the picture at the 4th set of data (so 4,5 and 6).

Now, if I were to build a topology of acceleration for the 6th minute which would mean that I would have to subtract V(4th minute) from V(6th minute) of all 18 vessels, I would need index 2 and 1 from all the branches. If I do this only after 6 minutes has passed from the beginning it would probably work, however if I do it later like at the 12th minute, it does not.

And the very reason for that is when the remaining 7 join the crowd at the 8th minute they obtain an index number of 0, and then 1, and then 2 - at the 12th minute. Because of that when I try to match the V2-V1s with Coordinates on the Unary Force component, while there are 18 sets of coordinates, there are 25 different speed values.

Of course this is quite a simplified scenario and perhaps your vessel matching could solve this specific one but there are cases where its more complicated and random. 

I do still want to show vessels' position in a specific time with such pipes you have suggested, but I am trying to construct a collective model, in its simplest form being equal to pipes + topology

For the time thing, what I meant was in this version when you click play the mountains just keep on rising and the topology is constantly deformed. I was wondering if we can set up a timer so that it runs the physics engine for couple of seconds and then freezes the topology as it is. Otherwise I would have to press pause manually everytime, which is not that big of a deal tbh, just for the accuracy sake it would be good to run the engine for the same interval for each model.

All the best,

Levent

Ok, quick reply about kangaroo:

If your mesh keeps deforming indefinitely, then, most likely, you have set up the forces wrong (you probably need something like "springs from mesh" as a balancing force).

Or you can use zombie kangaroo which accepts a threshold.

On a more general note, I don't believe kangaroo is needed in your case.

I'll get back to the main issues later, as I am kind of busy at the moment.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service