fix polygon orientations
use auto ref to support r-values