Grasshopper

algorithmic modeling for Rhino

Reduce running time for a list containing around 2000 points?

Basically I want to:

1. select all points within 30-meter radius from each point,

2. if the z-coordinate of this point falls within +- 2 meters of the average radius of the selected points, then the point is appended to the output list; else the point is discarded.

3. from the remaining points create a patch surface that represents the terrain.

For the first two steps, it seems I have to create two "for" loops, first loop through each point, then for each point, select the adjacent points to check if the point is too far off from its neighbors. 

My company's computer is rather old and I don't want to spend too much time running such script just to create a terrain. 

The data that I have now contain some points measured on existing buildings/overpass etc., so I need to filter out these points and create the terrain surface. 

Is there any quicker way to achieve the same goal without having to loop through the list so many times?

Views: 282

Attachments:

Replies to This Discussion

Hi Yuxuan,

I'm a little bit confused about steps 2 and 3. Once you have the list of all other points within 30m distance of each point in the 1972 collection, what should happen next? What do you mean by "average radius"?

On closer inspection, I think I understand. You want to remove all points from a cloud whose elevation is more than 2m away from the average elevation of all points within 30m of that point.

You can use OcTree to speed up this search. See attached.

Attachments:

Thank you David!

Your method is really elegant! I should have spent more time testing with the native grasshopper components. Have a nice day!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service