Grasshopper

algorithmic modeling for Rhino

Hello, could someone please help me translate this vb code for python?  I can translate it until I get into the vector output, then I get a little confused.  I have attached the grasshopper file with the vb component in it.

Basically the script will find the nearest point in a list of attractors and draw a line to the nearest one as seen in this photo.

Thanks!

A

Views: 958

Attachments:

Replies to This Discussion

After playing with it a bit I figured out how to do it in Python.  If anyone can take a look at it and let me know if there are any better ways to write the code please let me know.  I'm still learning so it always helps to learn tricks or more efficient ways of setting up the code.  thanks!  

Here is the python version, which allows you to separate  the points which are nearest each attractor into lists, which cant be done currently in grasshopper alone as far as I know.

Attachments:

code in python is a simpler!


it can be done very easily in gh alone :)

also if your interested this was the discussion that lead to this realization. http://www.grasshopper3d.com/forum/topics/min-max-on-grafted-list?x...

The python script looks nice and simple.  I had a hard time making it any simpler, but here's a version that doesn't use rhinoscriptsyntax.

https://gist.github.com/2432281

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service