Grasshopper

algorithmic modeling for Rhino

hello,

I would like to ask you where can I put the "a =" as output in my grasshopper component to see all the circles (I've tried before rs.AddCircle (center, 2.0) but I have as output only one circle):

import rhinoscriptsyntax as rs

start=rs.AddPoint(0,0,0)

end=rs.AddPoint([10,0,0])

divide=20

vec=rs.VectorCreate(end,start)

vec=rs.VectorDivide(vec,divide)

centerList=list()

for i in range(divide):
newVec=rs.VectorScale(vec,i)
centerList.append(rs.CopyObject(start,newVec))

for center in centerList:
rs.AddCircle(center,2.0)


any help appreciate thanks,
roy

Views: 545

Replies to This Discussion

try this

hi Mohamed ,

thank you for your message.

I've tried but don't works for me. the script works fine if I use it in rhino but I would like to use it in grasshopper python but if I put the a = before the last string I receive only one circle instead of all circles. where can I put the "a =" (grasshopper component output variable ) to view the global solution of the script that works fine in rhino?

mohameds solution seems to work for me.

look at attached

Attachments:

yes to me too!

thank you very much to you and Mohamed,

my mistake was that after centerList I wrote [] instead of ()...

thanks again

hi mohamaed, i am struggeling with the isPointOnSurface method, trying to populate a surface with random points maybe you could help me with this?

regards!

Attachments:

randomPtsNum?

yes, to populate the surface(trimmed surface) i create in the first part.

randomPtsNum should be the count of points to populate

2

file attached with surface internalised 

Attachments:

thanks a lot Mohamed, i will study and try, that will help me understand

regards!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service