Gradient-based non-linear microstructure design