From 0408a4fdfab898304040fa515e2ab4ef8a41326b Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 2 Aug 2010 10:44:32 +0000
Subject: [PATCH] fix old bug relvealed by last commit (forgot to change verts
 in CircParam during RemoveDuplicates)

---
 Geo/Geo.cpp              |  3 ---
 Geo/Geo.h                |  1 -
 Geo/GeoInterpolation.cpp | 13 +++++++------
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp
index 26e5f6f198..1e8cfc4e7c 100644
--- a/Geo/Geo.cpp
+++ b/Geo/Geo.cpp
@@ -421,9 +421,6 @@ void End_Curve(Curve *c)
     c->Circle.f1 = f1;
     c->Circle.f2 = f2;
 
-    for(int i = 0; i < 4; i++)
-      c->Circle.v[i] = v[i];
-
     if(!CTX::instance()->expertMode && c->Num > 0 && A3 - A1 > 1.01 * M_PI){
       Msg::Error("Circle or ellipse arc %d greater than Pi (angle=%g)", c->Num, A3-A1);
       Msg::Error("(If you understand what this implies, you can disable this error");
diff --git a/Geo/Geo.h b/Geo/Geo.h
index efb639bab7..f4613af332 100644
--- a/Geo/Geo.h
+++ b/Geo/Geo.h
@@ -105,7 +105,6 @@ class DrawingColor{
 class CircParam{
  public:
   double t1, t2, f1, f2, incl;
-  Vertex *v[4];
   double invmat[3][3];
   double n[3];
 };
diff --git a/Geo/GeoInterpolation.cpp b/Geo/GeoInterpolation.cpp
index f372cbdd40..b253df6290 100644
--- a/Geo/GeoInterpolation.cpp
+++ b/Geo/GeoInterpolation.cpp
@@ -284,9 +284,10 @@ Vertex InterpolateCurve(Curve *c, double u, int derivee)
       c->Circle.f2 * sin(theta) * cos(c->Circle.incl);
     V.Pos.Z = 0.0;
     Projette(&V, c->Circle.invmat);
-    V.Pos.X += c->Circle.v[1]->Pos.X;
-    V.Pos.Y += c->Circle.v[1]->Pos.Y;
-    V.Pos.Z += c->Circle.v[1]->Pos.Z;
+    List_Read(c->Control_Points, 1, &v[0]);
+    V.Pos.X += v[0]->Pos.X;
+    V.Pos.Y += v[0]->Pos.Y;
+    V.Pos.Z += v[0]->Pos.Z;
     V.w = (1. - u) * c->beg->w + u * c->end->w;
     V.lc = (1. - u) * c->beg->lc + u * c->end->lc;
     break;
@@ -454,9 +455,9 @@ bool iSRuledSurfaceASphere(Surface *s, SPoint3 &center, double &radius)
       else if(isSphere){
         if(!i){
           List_Read(C[i]->Control_Points, 1, &O);
-          ((double *)center)[0]= O->Pos.X;
-          ((double *)center)[1]= O->Pos.Y;
-          ((double *)center)[2]= O->Pos.Z;
+          ((double *)center)[0] = O->Pos.X;
+          ((double *)center)[1] = O->Pos.Y;
+          ((double *)center)[2] = O->Pos.Z;
         }
         else{
           Vertex *tmp;
-- 
GitLab