swap open/closed segments, and rename open/closed trails to line/loop