diff --git a/Mesh/Utils.cpp b/Mesh/Utils.cpp index 6d2ecd433e93935d1de4c89952f051a6ba4f22c4..6d3cd1ba82cc66453fad3f81a55639eedde0c2eb 100644 --- a/Mesh/Utils.cpp +++ b/Mesh/Utils.cpp @@ -1,4 +1,4 @@ -// $Id: Utils.cpp,v 1.26 2004-07-16 18:02:20 geuzaine Exp $ +// $Id: Utils.cpp,v 1.27 2004-10-28 07:43:39 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -531,6 +531,14 @@ int Oriente(List_T * cu, double n[3]) N = List_Nbr(cu); + if(N < 3){ + Msg(GERROR, "Unable to orient contour with less than 3 vertices"); + n[0] = 0.; + n[1] = 0.; + n[2] = 1.; + return 0; + } + sum = 0.0; for(i = 0; i < N; i++) { if(i == N - 1) {