So I am creating a model of a heavily forested area. I have modeled the topography as a single undulating surface. Additionally I have modeled a simple but effective tree. It’s a block with a point inside it for placing. Here is my question. Is there a want I can randomly generate a certain number of points and the point will then be placed randomly on said surface in all three dimensions? In other words, the point will be scattered to follow the surface in the X,Y, and Z directions.

Hello - you can try this old script I dug up - Drag and drop the rvb file from where ever you save it onto Rhino - that will reagister the alias

Sprinkler

and you can use that to launch the script - just follow the (many…) prompts.

Sprinkler.rvb (3.3 KB)

-Pascal

Thank you so very much! I will try that ot.

Hello -

It looks like @pascal got to this before I could finish what I was doing in Grasshopper, but here is my take on this with Grasshopper.

random seeds for tree.3dm (81.8 KB)

random seeds for tree.gh (18.0 KB)

-Ben

Hi Pascal, How do I run this in Rhino 6 Mac? Thanks!

Found your answer (YOU CAN’T) elsewhere. So … is there a python version of your Sprinkler script? Trying to populate this site surface with trees for an animation. New site.3dm (18.2 MB)

Hello - no, nothing in Python… I may have a look at doing that but not right away - try the GH solution a couple of posts up.

-Pascal

Got it. Thanks!

First time delving into GH so probably a silly question but how would you increase the number of seeds? I have tried changing all the sliders.

And substituting a block or mesh object for Geometry is probably a more advanced operation. So one would still have to manually place the trees after using this?random seeds for tree_MN.3dm (18.8 MB)

Hi - If by “number of seeds” you mean the number of trees that will be generated, there are no sliders in that definition to do that.

The base component that sets that number is the `Divide Surface` component that you can find here:

It has inputs for `U and V count`

that are currently both set at 10:

You can change these to change the number of trees.

No. You need a mesh or NURBS object (your “tree”) in your Rhino scene. Then, in Grasshopper, right-click on the `Geometry` component and select `Set one Geometry`

:

So, for a simple object that is made of a cylinder and a cone, you’d get something like this:

-wim

It’s taken me an hour to find something that would work and this is exactly it!

Great script!

Thank you!

Does anyone know of a resource where I can learn to create a script like this in grasshopper from scratch. Specifically for use with any block which can be defined.