Grasshopper

algorithmic modeling for Rhino

I am attempting to analyse the way in which the tide would drain from a coastal bay using Kangaroo and Grasshopper. I have trawled the forums and found several useful definitions including a 'drop point simulator' which uses a the Collidetomesh command to trace the paths of falling points. This apparently only works with closed meshes. However, the mesh I am using is not closed and I have not been able to close it. Therefore, I have attempted to use the Pulltomesh command instead and my grasshopper definition is attached. I am very new to grasshopper and this has been boggling my mind for a while now. I wonder if anyone could take a look at my files and suggest any changes I can implement to be grasshopper definition so that I can achieve a similar result to the drop point simulator linked above.

Thanks,

Peter

Views: 1753

Attachments:

Replies to This Discussion

Hi Peter,

Maybe you have seen this already, but I posted an example of something similar here:

http://www.grasshopper3d.com/forum/topics/drainage-direction-script...

Does that help at all?

Daniel, 

Thank you for the prompt reply. I have in fact looked at your definition and it is what I based my current definition on. However, it has not worked with my mesh and I cannot understand why. Again I am not entirely competent with grasshopper or kangaroo but I did my best to address the issues without success. Any tips?

From a quick look, it might be something to do with the scale - I see that your model is almost a kilometre across, but the units are mm.

Either the forces might need scaling or change the units to metres

Thanks Daniel, I have got the collide mesh to work on a much simpler and scaled down mesh but I am going to give Anders' method a go.

In addition to Daniel's suggestion I also just tried it out using the drainage definition I uploaded here. I had to clean up the mesh in Rhino, scale it down and move it the origin in order for the script to run. Does seems to work though. Perhaps your definition will work with these modifications as well. Attached the definition, you'll need GHPython to run it. Note the the drainage particles are randomly picked from the mesh vertices, but one could easily replace that logic. Hope that helps in one way or the other :)

Edit: I see Daniel already figured out the scale issues before I posted.

Attachments:

Thanks Anders. Yes the scale is huge! I have just scaled my mesh down and reduced the complexity of the terrain so that it runs with the collide mesh function. However, it would be great if you could send the cleaned up mesh that would work with your definition, it would be very helpful. I have tried to clean up my mesh without reducing the complexity drastically but haven't managed.

Thanks again,

Peter

I internalized the mesh in the file attached above. I did it rather quickly so I might have deleted too much of the mesh in the process. Here's a quick guide for future reference:

0) Run the Rhino command "check" on the mesh. If you've got a "good" mesh you're likely good.

if not:

1) "Explodeblock" and "ungroup" to get to the geometry.
2) Isolate the meshes that you want (yours also had breps in there).
3) "Join" these, "weld" the vertices and "unify" the normals (under "Mesh Repair Tools" and "Mesh Edit tools").

Run the check command again. If you're still not good you might have to do some manual fixes. Alternatively you could try the MeshRepair command which takes you through similar steps. There are also quite a few mesh commands which are useful such as snapping all vertices within a certain tolerance etc. You can look these up in help or fiddle with the tools in the mesh tab.

In any case you probably do not need a perfect mesh to implement either drainage method. I think the biggest problem was that of scale and that the mesh was very far from the world origin.

Best,

Anders

I cleaned up the mesh using meshlabs and sketchup as well to make it closed. I have been able to apply the Python definition and the results look good, however, I there are some areas where the points to not seem to 'flow' and I wonder if there is a way to specify points to use as oppose to using randomly generated points?

Peter

Sorry missed this. In line 89 in the Python code:

DrainCurves = makeDrainMeshPaths(Mesh,Vertices,MaxSteps,Tolerance)

You should be able to replace the Vertices parameter with any list of starting points. I don't have Rhino handy right now to test this, but I'm fairly certain it should work. 

Hope that helps..

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service