Grasshopper

algorithmic modeling for Rhino

hi i am new with vb script, and i am trying to remove data base off a list of booleans, just like the cull pattern component in GH. I am trying to cull a list of points (culled_pts) with the boolean list(pt_dist_boolean). I think one problem is that the list comes out in individual branches for each data item, I'm not really sure. I would like to know how do i flatten out the data within the script if that is at all possible.

15g-pbridges%20upload%20to%20ghwebsite.gh
Dim culled_pts As New List( Of Point3d)
Dim cu_pt As New point3d
cu_pt.X = cop_x
cu_pt.Y = cop_y
cu_pt.Z = cop_z
culled_pts.Add(cu_pt)

Dim pt_dist As Double

pt_dist = pt.DistanceTo(cloud_of_pts)

Dim pt_dist_boolean As New list(Of Boolean)

If pt_dist <= distance_factor Then

pt_dist_boolean.Add(True)

Else

pt_dist_boolean.Add(False)


End If
culled_pts.Remove(pt_dist_boolean)True
list_of_int_pts = culled_pts
boolean_list = pt_dist_boolean
A = pt_dist

Views: 407

Replies to This Discussion

Hi Phillip,

a bit more surrounding code would be nice. Is your component set up to accept individual items, lists or trees? If your inputs are set to 'tree' access, do you really need this? Couldn't you achieve the same with 'list' access?

Which lists are you generating and which lists come from elsewhere? Are you trying to generate a culling pattern or are you trying to do the culling yourself?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

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