Automatic structure decomposition of planar geared linkage mechanisms