A level set approach to model directed nanocrack patterns