Refactored out triangulation from qrad.