Should move this into a common worker utils file since they are used by the simpleMesher code as well.