Added ability to check whether piecewise surface is closed or open.