- this is my scaled box:
- I capture its extents before any rotation is applied and only then rotate it:
- the result of the above (ignored Z on purpose for simplification):
- to get verts with Z:
- to get the points I think you originally mentioned:
Hope I got the intent right!