I wrote my first lines (with the help of SO):
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a curve", rs.filter.curve)
maxd = input("max offset: ")
a = input("first offset: ")
b = input("next offset: ")
if rs.IsCurve(obj):
i=0
while i < maxd:
rs.OffsetCurve( obj, [0,0,0], -i )
i += a
rs.OffsetCurve( obj, [0,0,0], -i )
i += b
Now I've tried to take it further by inserting a list for the offset inputs. But it seems I get an infinite loop at the end. Also, the first rs.OffsetCurve()
seems to run twice or i
is not updated with the first run of the second rs.OffserCurve()
while loop.
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a curve", rs.filter.curve)
maxd = input("max offset: ")
a = input("first offset: ")
offlist = []
while True:
b = input("next offset or 0 for exit: ")
offlist.append(b)
if b == 0:
break
if rs.IsCurve(obj):
i=0
while i < maxd:
rs.OffsetCurve( obj, [0,0,0], -i )
i = a
c = len(offlist)
k = 0
while k != c:
rs.OffsetCurve( obj, [0,0,0], -i )
i = offlist[k]
k += 1