made 3D triangulation more robust, removed obsolete parameters