Grasshopper

algorithmic modeling for Rhino

Hi,

First of all, I am a beginner of python and I'd like to learn more about this language. I've watched and learned some basics script about looping, conditional, etc, but I still couldn't figure it out.

Ok so, basically, I would like to develop a continuous path along specific curves ( see image below), which my goal is to have a maximum length of the path without pass through twice.

For the initial experiment, I will start with simple rules :

1. It starts from the point A and ended up in point B

2. Because of the goal is to have a family of a possible path, the chosen line for the next move is random depend on the closest lines.

3. The line cannot be used twice.

All of the suggestion will be so helpful

Cheers!

F

Views: 684

Attachments:

Replies to This Discussion

First of all, i think you should make your code run iteratively. I believe then the logic of your problem should be as simple as using an agent that scans the closest point from the "unscanned" points inside your grids, then label the point as "scanned" in every frames. So in the next frame, the agent won't scan any point that has been labelled. 

To tackle the iteration using timer, lets start with following this discussion http://www.grasshopper3d.com/forum/topics/c-timer-to-python-timer?x...


I've been struggling to write a simple agent simulation as well, maybe you should come to my place and bring a giant bucket of KFC so we can work on it together :))

Hi, Akbar,

Thanks for your suggestion.. I get it dude!! I will try following those step first and if it doesn't work, maybe I'll knock your door (and bring 'ipb' chicken instead of  a bucket of KFC for sure).  lol

Also, this really sounds like an obvious graph theoretical problem (i.e. finding the longest path in a network between two nodes). You can use the Python library networkx for this (several posts on how to use this on the forum), but that might be getting a bit ahead of yourself if you're just getting started with Python. Might be more fun/educational to try and solve it yourself. There's a ton of lectures on Youtube on these topics by the way. Hope that helps, at least with considering which algorithm to go with :)

Hi Anders, 

Thanks for your suggestion, I'll look at those websites!

Hope I will figure it out soon.

Cheers!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service