Grasshopper

algorithmic modeling for Rhino

Hello guys. 
I've been trying to generate a set of randomly twisted spirals around a curve with python but there's something strange about it. Basically is a set of division points of a initial curve with their respective lists of tangent and perpendicular vectors. I'm trying to rotate randomly this perpendicular vector around the tangent axis at each point and generate another point for the spiral curve. It's suposed to generate spirals around that first curve at a fixed distance (the lenght of the perp vectors, that are all unitized), but it's like this distance accumulates in each loop and this generated spirals rotate around the guide curve like too coordinated to be random. I don't know if the problem is in the random function that generate similar values in the different loops (I've tried some with same result http://docs.python.org/library/random.html) or I'm not seeing some concept error here in the for structure. 

Would appreciate so much the help.

Views: 939

Replies to This Discussion

Okey, problem solved! It was for using MoveObject instead of CopyObject. In GH the transformations generate new independent objects but seems that doesn't work that way in Python. The translation vector was applied to the same point successively.

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