DiscretizeGraphics issues with transformations
Here are a four possibilities. Two of them are due to @JM's comments. (Thanks!) All of them are based on the fact that Rectangle[]
can be used as a geometric region as well as a graphics primitive, and they all use TransformedRegion
to get the rotation rather than GeometricTransformation
, RotationTransform
or Rotate
.
Define the rotated rectangle as a region:
reg = TransformedRegion[Rectangle[], RotationTransform[π/6]]
(* Parallelogram[{0, 0}, {{-(1/2), Sqrt[3]/2}, {Sqrt[3]/2, 1/2}}] *)
Then we can do
GraphicsRow[
Through[{DiscretizeRegion, DiscretizeGraphics,
BoundaryDiscretizeRegion, BoundaryDiscretizeGraphics}@reg]
]
For the time being a workaround is using first DiscretizeGraphics
and then transforming the region e.g.
Rectangle[] // DiscretizeGraphics //TransformedRegion[#, RotationTransform[30°]]&