transfered function from libeyesis into lib3dreconstruct