Three-dimensional modeling of shape-memory materials