From e37bc69c045a3b678967832f803cbfa34bd92598 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 26 Feb 2013 17:45:20 +0000
Subject: [PATCH] fix for discrete edges

---
 Geo/Geo.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp
index fe510f1663..936603deb8 100644
--- a/Geo/Geo.cpp
+++ b/Geo/Geo.cpp
@@ -3545,9 +3545,15 @@ void sortEdgesInLoop(int num, List_T *edges, bool orient)
     List_Read(edges, i, &j);
     if((c = FindCurve(j))){
       List_Add(temp, &c);
+      if(c->Typ == MSH_SEGM_DISCRETE){
+        Msg::Debug("Aborting line loop sort for discrete edge: hope you know "
+		   "what you're doing ;-)");
+        return;
+      }
     }
     else{
-      Msg::Debug("Aborting line loop sort: at your own risk :-)");
+      Msg::Debug("Unknown curve %d, aborting line loop sort: hope you know "
+                 "what you're doing ;-)", j);
       List_Delete(temp);
       return;
     }
-- 
GitLab