Grasshopper

algorithmic modeling for Rhino

c# for loop's break doesn't work (goal: Clustering points in voxel grid)

Hi, i am new on c#, usually i do scripting on processing.

i am now trying to cluster a list of point from a mesh topology using voxel grid.

The method that i use is using for loop with break in the end (you can see in the code a public void named assignVoxID inside a class named meshVertices). it works to create an id for each point based on in which voxel the point is.

The problem is :

1. everytime i replug the initial mesh parameter to the c# component, the number of output of the c# component keeps increasing, looks like the loop doesn't stop.

2. the amount of the id (inside the list of id (int) i made) always be less than the amount of the mesh point)

Could somebody please take a look at the script and give me some advice?

Thank you very much for the help?

Views: 391

Attachments:

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service