The desired task, in this case spray painting a car door, is specified as required positions/orientation and/or velocities for the tool, independent of the actor used to perform the task.
The task constraints are used to automatically compute a path for the tool. This tool path is then used to automatically compute a set of robot joint velocities that guarantees that the tool will follow the required path.
Common sense requirements for successfully completing the task, e.g. collision avoidance, are built into the low-level inverse kinematics techniques that generate the desired robot joint velocities.
For a more complete description of the technique used to create this simulation, see:
A. A. Maciejewski and C. A. Klein, ``SAM: Animation software for simulating articulated motion,'' Computers and Graphics: An International Journal, Vol. 9, No. 4, pp. 383-391, 1985.