Controlled nanocrack patterns for nanowires