During an animation, I want certain objects in Rhino Viewport to also follow the animation. For this, I am using RhinoDoc.ActiveDoc.Objects.Transform(). I realized that this operation is a bottleneck for my framerate in the animation. I have around 50 objects in a list and I am applying transformation to each object using a foreach loop. The total time take is around 300ms and it simply kills my framerate.
When I use Mesh.Transform() or Brep.Transform() on my plugin geometries, the transformation is quite fast (around 20-30ms) even when I have more than 100 objects in the list.
Is there something special happening behind the scene when I use RhinoDoc. Transform()?
How can I speed up my transformation operation for RhinoDoc objects?
I am animating a serial 6 axis robot operating on a workpiece fixed to a turn table (another moveable axis). The robot moves from a start plane to a target plane. I am interpolating x number of planes in between depending on the distance between start and target, and I am iterating through each plane while doing inverse kinematics on my robot and the turn table axis. Its similar to a CAM milling operation on a workpiece fixed to a turn table. So when I perform inverse kinematics on my turn table axis and also my robot, I would also like for my workpiece on the turntable to rotate along with it. I am not using a particular tool for animating this.
Hahaha fair enough. My question was more along the lines of “Am I doing something wrong here?”.
Generally speaking, if you want to animate objects, then you should not be transforming document objects. Rather, you should be drawing objects dynamically using a display conduit. This method will take a little more to setup, but it should give you the frame rate you are looking for.
Ah I see. I am already using display conduits for displaying my plugin generated geometries (robot trajectories, target planes, etc). So like you said, its best that I use that for displaying my workpiece as well to get decent framerates.