From 2ee51370f36dd7f9868638ea3c642dd99f3c1b83 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 7 Jul 2022 11:15:47 +0200 Subject: [PATCH] Add Reverse and Reversed for PolyRegion --- src/Aardvark.Geometry/PolyRegion2d.fs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Aardvark.Geometry/PolyRegion2d.fs b/src/Aardvark.Geometry/PolyRegion2d.fs index 748cb646..e3edf118 100644 --- a/src/Aardvark.Geometry/PolyRegion2d.fs +++ b/src/Aardvark.Geometry/PolyRegion2d.fs @@ -517,6 +517,14 @@ type PolyRegion private(polygons : list) = member x.Transformed(s : Scale2d) = PolyRegion (polygons |> List.map (fun p -> p.Transformed s)) + /// Returns a copy of the PolyRegion with the vertex order of all polygons reversed. + member x.Reversed = + PolyRegion (polygons |> List.map (fun p -> p.Reversed)) + + /// Reverses the vertex order of all polygons in-place. + member x.Reverse() = + polygons |> List.iter (fun p -> p.Reverse()) + member x.BoundingBox = Box2d(polygons |> Seq.collect (fun p -> p.Points))