How to get in order the coordinates of all corners from any mesh?

Try something along the lines of:

This will need more work to get it right, as in: there should not be 24 spline points here.


the coordinates of all the corners from any mesh

There is a also the questions of what you define as a corner - a vertex?