Hi,
@stevebaer and @pascal
I am running some tests for Holomark3 and wanted to clean up some code so I thought rs.Redraw() could be a nicer way to refresh the view than to use rs.EnableRedraw(False) and rs.EnableRedraw(True) but on a simple test where I add a spotlight and rotate it around (0,0,0) I get 2x the speed on the latter. Is that as expected, and if so why?
Here are my scores on a simple test with a cube with soft edges:
test 1 - nothing : 3.59
test 2 - rs.EnableRedraw() : 3.83
test 3 - rs.Redraw() : 6.91
And here is the code:
import rhinoscriptsyntax as rs
import time
test1=True
test2=True
test3=True
if test1:
light = rs.AddSpotLight( (30,0,0), 15, (50,0,10) )
time1=time.time()
for i in range(100):
rs.RotateObject(light, (0,0,0), 3.6)
time2=time.time()
rs.DeleteObject(light)
print "test 1 - nothing :",round(time2-time1,2)
if test2:
light = rs.AddSpotLight( (30,0,0), 15, (50,0,10) )
time1=time.time()
for i in range(100):
rs.EnableRedraw(False)
rs.RotateObject(light, (0,0,0), 3.6)
rs.Sleep(0)
rs.EnableRedraw(True)
time2=time.time()
rs.DeleteObject(light)
print "test 2 - rs.EnableRedraw() :",round(time2-time1,2)
if test3:
light = rs.AddSpotLight( (30,0,0), 15, (50,0,10) )
rs.EnableRedraw(False)
time1=time.time()
for i in range(100):
rs.RotateObject(light, (0,0,0), 3.6)
rs.Redraw()
time2=time.time()
rs.EnableRedraw(True)
rs.DeleteObject(light)
print "test 3 - rs.Redraw() :",round(time2-time1,2)
