I would like to use floats and decimals in my Rhino Common scripts when importing math.sin and math.cos
I also want to move away from rhino.scriptsyntax in my ghpython nodes.
How does one change a rhinoscriptsyntax
for i in rs.frange(0.0,100.0, 0.1):
into
for i in Rhino.?(0.0, 100.0, 0.1)
a Rhino Common function/method in order to deal with floats in the range function?
What namespace follows Rhino.? to access floats in range in Rhino common?
def fxrange(start, stop, step):
"float version of the xrange function"
if step==0: raise ValueError("step must not equal 0")
x = start
if start<stop:
if step<0: raise ValueError("step must be greater than 0")
while x<=stop:
yield x
x+=step
else:
if step>0: raise ValueError("step must be less than 0")
while x>=stop:
yield x
x+=step
def frange(start, stop, step):
"float version of the range function"
return [x for x in fxrange(start, stop, step)]