I was wondering this as well. Does anyone know how it is done?
Maybe something like this:
- Create the 2D Oriented Bounding Box of the feature (BoundingBoxReplacer)
- Calculate the azimuth of one side of this Bounding Box
- Convert the original polygon to segments of 2 points (Chopper)
- Calculate the azimuth of every segment
- If the azimuth of a segment is close enough to the azimuth of the bounding box (or close enough to this azimuth +/- 90 or 180 degrees, or - if you want to - close enough to this azimuth +/- 45 degrees or +/- 135 degrees), rotate the segment around it's middle point to the desired azimuth
- Calculate the intersection point of every pair of adjacent segments
- Re-create the polygon from the intersection points
Ensure the polygons have no corners of (approximately) 180 degrees.
Make sure every original polygon has a unique ID, and use Group By on this ID where this applies.
An implementation of the process mentioned above (not thoroughly tested!):
The workspace uses a simplified version of the HorizontalAngleCalculator from FME Hub.