Skip to content

Commit

Permalink
Add Reverse and Reversed for PolyRegion
Browse files Browse the repository at this point in the history
  • Loading branch information
hyazinthh committed Jul 7, 2022
1 parent b3215ea commit 2ee5137
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Aardvark.Geometry/PolyRegion2d.fs
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ type PolyRegion private(polygons : list<Polygon2d>) =
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))

Expand Down

0 comments on commit 2ee5137

Please sign in to comment.