Hi all,
I am trying to use a set of randomly selected points from a divided surface to generate peaks in the surface over each selected point. I need to have a total of 383 randomly selected points. I got the definition to work fine with a rectangular surface, but trying to repeat the procedure with an organically shaped surface returns many null points and therefore won’t create a surface. I would like to get the same effect I achieve on the “Test Rectangle” on the “Site Surface.” I have tried using the clean tree component and changing the U value to remove the null the points but the surface generated is a mess and nothing like the original that I’m going for.
I’m not even sure what I’m trying do is possible with the tools I’m using. Any help or direction would be greatly appreciated.
Peaked Surfaces.gh (212.9 KB)
If you run the output from Divide Surface through Clean Tree, you will see only 4346 points instead of 6561, so your plan is doomed from the start. I suggest using PopGeo to get your 383 random points on each surface and work from there.
So it starts to look more like this:
Peaked Surface_2022_Nov7a.gh (204.7 KB)
But you will never (?) get a non-rectangular surface from SrfGrid so ultimately will need to project the ‘Site Surface’ boundary curve onto the SrfGrid output and trim it.
P.S. Here is a quickie effort, without looking at (or changing) the guts of your code:
Peaked Surface_2022_Nov7b.gh (215.5 KB)
The yellow group finds the grid points closest to the PopGeo output. It can be skipped but appears to give slightly better results?
1 Like
I took a closer look at the guts of your code and made a few more changes:
- Flattened all points, the data tree structure is irrelevant.
- Used Closest Point instead of sorting distances. (faster)
- Computed the number of U and V divisions based on ‘Grid’ size (slider in blue group).
- Replaced Graph Mapper ‘Graph type’ with Bezier.
Peaked Surface_2022_Nov7c.gh (214.3 KB)
Thank you so much for the quick and thorough reply. So far this seems to be just the ticket. I’ll have to work on manipulating it for bit before I know for sure. I really appreciate your help!
Definitely inspect it closely, I tried to avoid mistakes but won’t guarantee it.
The grid size slider is only a close approximation, due to UV integer round off.
The ‘Test Rectangle’ is larger than the ‘Site Surface’, yet they both have the same number of peaks (383), so area (square units) per peak is ~7 for the rectangle and ~5.5 for the smaller ‘Site Surface’.