Correlation between shape and electronic states in nanostructures