Computer aided methods for the synthesis of mechanism kinematic models: planar and spatial cases