Hi guys, I am working on Holomark3 and really want a good way to manually control the camera and target and update the view in the same speed as rs.
Here are my results from this test:
Turn on/off EnableRedraw: 3.43
Using rs.Redraw(): 10.14
Using Rhino.Display.RhinoView Redraw: 3.33
ViewSpeedTest 1 frame at a time: 3.33
As you can see it is much (3x!) faster to turn redraw off and on than to just call redraw, is that a bug?
Note: I’m on a laptop with a 750m on this test. Simple cube in wireframe.
And the built in testmaxspeed is done in 1.6 seconds…
Could I achive something similar in Python if I moved the camera along a path?
(I can get good results with rs.ViewSpeedTest() by setting the target and only moving a segment of a circle, but I would like even more freedom )
And here is the code:
import Rhino
import rhinoscriptsyntax as rs
import time
import scriptcontext
view=rs.CurrentView()
camera1=(50,-50,50)
camera2=(-50,-50,50)
target1=(0,0,0)
target2=(0,0,0)
time1=time.time()
for i in range(100):
rs.EnableRedraw(False)
rs.ViewCameraTarget(view,camera1, target1)
rs.EnableRedraw(True)
rs.EnableRedraw(False)
rs.ViewCameraTarget(view,camera2, target2)
rs.EnableRedraw(True)
time2=time.time()
print "Turn on/off EnableRedraw:",round(time2-time1,2)
time1=time.time()
for i in range(100):
rs.ViewCameraTarget(view,camera1, target1)
rs.Redraw()
rs.ViewCameraTarget(view,camera2, target2)
rs.Redraw()
time2=time.time()
print "Using rs.Redraw():",round(time2-time1,2)
view2 = scriptcontext.doc.Views.ActiveView
time1=time.time()
for i in range(100):
rs.ViewCameraTarget(view,camera1, target1)
rs.Sleep(0)
Rhino.Display.RhinoView.Redraw(view2)
rs.ViewCameraTarget(view,camera2, target2)
rs.Sleep(0)
Rhino.Display.RhinoView.Redraw(view2)
time2=time.time()
print "Using Rhino.Display.RhinoView Redraw:",round(time2-time1,2)
time1=time.time()
for i in range(100):
rs.ViewSpeedTest(view, frames=1, direction=0, angle_degrees=45)
rs.ViewSpeedTest(view, frames=1, direction=1, angle_degrees=45)
time2=time.time()
print "ViewSpeedTest 1 frame at a time:",round(time2-time1,2)