Grasshopper

algorithmic modeling for Rhino

hi all,

I am trying to group point clouds, each group having 3 points. any ideas how it can be done in python ??? 

Thank u .

Views: 543

Replies to This Discussion

I'm not sure I understand your question, but here is a way to group a list into sub-lists, each with three members(the last list may have fewer):

grouped_lst = [lst[x:x+3] for x in range(0, len(lst), 3)]

Thank u fro reply...i tried and get nothing. when input point cloud. how to do this ?

Hi Shridhar, I don't speak Parseltongue so I cannot help you with your script, but I don't think Grasshopper supports pointclouds at all.
Or did you just mean 'multiple points'...?

If you post the file that you are working with it will be easier to debug.

If I have to guess, you need an output on your ghPython component called grouped_lst (or whatever name you assign the list of grouped points.)

a = (x[:y]) is the one liner in the py comp. the idea is to slice points into 3 groups and mesh em.

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