refactoring and more scripts

Added getFunctionalMap
Added getShape
tried to match parts using the segment constraints