RainWater Topo

Trying to analyse the rainwater drainoff on a topo surface to identify rainwater basins, but encountering a problem with the logic, the vectors from points are attracted towards the surface, I want it more to be like rain!(first a straight drop then the flow)
Rain Topo.gh (17.4 KB)

1 Like

Hello
you can use MeshRay, RayShoot, project instead of closest Point
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.intersect.intersection/rayshoot
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.ray3d
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.intersect.intersection/projectpointstobreps

Or this one but you must make a line long enough
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.intersect.intersection/curvebrep

Here what you can do by just adding 6 components.


I also added my tool that calculate a bit faster but uses meshes.

Rain Topo.gh (16.4 KB)

3 Likes

Thanks a lot for these, I already achieved these, If you directlly input points(flatten) from divide surface to c# script you get these result! I added a extra c# script to change the values of Z to desired level, i want to use that points to fall like rain! I simulation should look like rain!

@dhruvinkataria786 This topic piqued my interest and I played around with your script a bit.

One potential optimization I thought of is that instead of “stepping” through the tracing one line at a time within the script to achieve an animation, you can run the script with a loop to solve for each next line and store that in the output list and then step through those lines or points after the fact with a slider or timed function that simply lists each next item.

The loop should be conditional based on the number of contours so that you avoid “pooling” of unnecessary vertices at the bottom of your topo. (unless that’s what you want?)

Graph Space: (stepping through the list of points and passing this to a Interpolate Curve → Curve Preview with a gradient for transparency)

Model Space: (Adjusting the slider value or choosing “Animate…”)
topo_flow_example_01a

Just food for thought, thanks for sharing your stuff, I always enjoy looking at random topics like this.

If you use marching cubes you can even flow around objects and have the flow split in some instances

For even more realism, you can use a physical solver like Kangaroo, with tiny spheres which roll down the surface, and you can trace the movement of the spheres

For maximum realism (and complexity) you can use a fluid simulator like FlexHopper