Skip to content
Snippets Groups Projects
Commit 28103b3a authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

add error check in Oriente()
parent a4449418
No related branches found
No related tags found
No related merge requests found
// $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 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -531,6 +531,14 @@ int Oriente(List_T * cu, double n[3]) ...@@ -531,6 +531,14 @@ int Oriente(List_T * cu, double n[3])
N = List_Nbr(cu); 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; sum = 0.0;
for(i = 0; i < N; i++) { for(i = 0; i < N; i++) {
if(i == N - 1) { if(i == N - 1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment