Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5846

Looping to make serial points

$
0
0

Hello, I have this simple definition to move a point.

However, instead of giving me 100 points spread out at 1 increment, it gave me 100 points in 1 location (p3)

Does anyone know how to fix this?

>def movepoint(point,distance):
    p = rs.PointCoordinates(point)
    px , py , pz = p[0] , p[1] , p[2]
    p2x = px + distance
    p2y = py
    p2z = pz
    p2 = p2x , p2y , p2z
    pt2 = rs.AddPoint(p2)
    return (pt2)

n = 20
point = rs.GetObject('')

p2 = movepoint(point,1)

count = 0
while count < 100:
    count += 1
    p3 = movepoint(p2,1)
    p2.append(p3)

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 5846

Latest Images

Trending Articles



Latest Images