Shape transformations in optically trapped particles and minimal surfaces: An experimental and theoretical study