Python Forum

Full Version: For loop
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I use python code in dynamo (visual programming) and I have a situation that can not be done (as far as I know) in Dynamo, but I think it could be done with python code.

I have a curve (it could be an arc or straight line, but it is never closed) and at the start point of that curve has a circle it's center point with a parametric radius. Then I need a second circle with it's center point on the intersection of the first circle and the curve. And this should go on until the last circle has no intersection anymore with the curve. Could this be done with a for-loop?
Probably me, but I'm having difficulty visualizing what your aiming for, something like a nautilus shell?  Anyway, a 'for' loop might be a part of the solution, but most likely you'll need more than that including importing some 3rd party modules.  I've no doubt it can be done in Python, but without seeing the outcome in my mind, it's hard to make any recommendations.  Perhaps those with more nimble minds can point the way.
You should look at the examples here http://matplotlib.org/2.0.0/examples/
There are literally hundreds of examples, each with the python code that created them.
You should be able to find something that, even remotely, looks like what you want.

Once found, you have the code to start with that you can modify to get just what your looking for.