From ec42d9ad4505a4013f15f6ded0d0759548e9cd77 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 8 Apr 2016 07:03:38 +0000
Subject: [PATCH] error if GEO ruled surface without curves on boundary

---
 Geo/GeoInterpolation.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Geo/GeoInterpolation.cpp b/Geo/GeoInterpolation.cpp
index edd0553a28..b4145f5df1 100644
--- a/Geo/GeoInterpolation.cpp
+++ b/Geo/GeoInterpolation.cpp
@@ -634,6 +634,7 @@ static void TransfiniteSph(Vertex S, Vertex center, Vertex *T)
 bool iSRuledSurfaceASphere(Surface *s, SPoint3 &center, double &radius)
 {
   if(s->Typ != MSH_SURF_REGL && s->Typ != MSH_SURF_TRIC) return false;
+  if(!List_Nbr(s->Generatrices)) return false;
 
   bool isSphere = true;
   Vertex *O = 0;
@@ -681,6 +682,11 @@ static Vertex InterpolateRuledSurface(Surface *s, double u, double v)
 {
   Curve *C[4] = {0, 0, 0, 0};
 
+  if(!List_Nbr(s->Generatrices)){
+    Msg::Error("No curves on boundary of ruled surface");
+    return Vertex(0., 0., 0.);
+  }
+
   for(int i = 0; i < std::min(List_Nbr(s->Generatrices), 4); i++)
     List_Read(s->Generatrices, i, &C[i]);
 
-- 
GitLab