diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h
index 0011a293c147b4a49b3379a3ca1495c25f8ca161..1000ded61f06b5d8aca1242275a0f37f38409797 100644
--- a/Common/DefaultOptions.h
+++ b/Common/DefaultOptions.h
@@ -837,7 +837,7 @@ StringXNumber MeshOptions_Number[] = {
     "3D mesh algorithm (1=isotropic, 4=netgen, 5=tetgen)" }, 
   { F,   "AllowDegeneratedExtrude" , opt_mesh_allow_degenerated_extrude , 0. , 
     "Allow the generation of degenerated hexahedra or prisms during extrusion" },
-  { F|O, "AngleSmoothNormals" , opt_mesh_angle_smooth_normals , 180.0 ,
+  { F|O, "AngleSmoothNormals" , opt_mesh_angle_smooth_normals , 30.0 ,
     "Threshold angle below which normals are not smoothed" }, 
 
   { F|O, "BetaSmoothMetric" ,opt_mesh_beta_smooth_metric, 0.9 ,
@@ -1086,7 +1086,7 @@ StringXNumber PostProcessingOptions_Number[] = {
 } ;
 
 StringXNumber ViewOptions_Number[] = {
-  { F|O, "AngleSmoothNormals" , opt_view_angle_smooth_normals , 180. ,
+  { F|O, "AngleSmoothNormals" , opt_view_angle_smooth_normals , 30.0 ,
     "Threshold angle below which normals are not smoothed" },
   { F|O, "ArrowHeadRadius" , opt_view_arrow_head_radius , 0.12 ,
     "Relative radius of arrow head" },
diff --git a/Common/Makefile b/Common/Makefile
index 764793ac99fa2733dc7a2f7712e21d43f82fb6ac..3debdb36ecb541a0697c890e2fe567e24ae57a7c 100644
--- a/Common/Makefile
+++ b/Common/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.79 2006-01-06 00:34:21 geuzaine Exp $
+# $Id: Makefile,v 1.80 2006-01-14 16:24:53 geuzaine Exp $
 #
 # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 #
@@ -77,17 +77,17 @@ Context.o: Context.cpp Gmsh.h Message.h ../DataStr/Malloc.h \
 AdaptiveViews.o: AdaptiveViews.cpp AdaptiveViews.h ../DataStr/List.h \
   GmshMatrix.h ../Plugin/Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h
 Views.o: Views.cpp Gmsh.h Message.h ../DataStr/Malloc.h ../DataStr/List.h \
   ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h \
   ../DataStr/Tree.h ../Numeric/Numeric.h Views.h ColorTable.h \
   VertexArray.h SmoothNormals.h GmshMatrix.h AdaptiveViews.h Context.h \
-  Options.h
+  Options.h xyzv.h
 Options.o: Options.cpp ../Plugin/PluginManager.h ../Plugin/Plugin.h \
   ../Common/Options.h ../Common/Message.h ../Common/Views.h \
   ../Common/ColorTable.h ../DataStr/List.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h Gmsh.h Message.h \
   ../DataStr/Malloc.h ../DataStr/Tree.h ../DataStr/avl.h \
   ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h GmshUI.h \
@@ -123,8 +123,8 @@ Visibility.o: Visibility.cpp Gmsh.h Message.h ../DataStr/Malloc.h \
   ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
   ../Geo/ExtrudeParams.h ../Parser/Parser.h Visibility.h
 Trackball.o: Trackball.cpp Trackball.h
 VertexArray.o: VertexArray.cpp Gmsh.h Message.h ../DataStr/Malloc.h \
diff --git a/Common/SmoothNormals.cpp b/Common/SmoothNormals.cpp
index c6fbb1a49e75bcedd556cc2f03263ed5d5eff9b3..687053c74243aa2453ae7e133c88b21b0cc3296a 100644
--- a/Common/SmoothNormals.cpp
+++ b/Common/SmoothNormals.cpp
@@ -1,4 +1,4 @@
-// $Id: SmoothNormals.cpp,v 1.4 2006-01-06 00:34:21 geuzaine Exp $
+// $Id: SmoothNormals.cpp,v 1.5 2006-01-14 16:24:53 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -23,123 +23,88 @@
 #include "Numeric.h"
 #include "SmoothNormals.h"
 
-double xyzv::eps = 1.e-12;
+double xyzn::eps = 1.e-12;
 
-xyzv::xyzv(double xx, double yy, double zz)
-  : x(xx), y(yy), z(zz), vals(0), nbvals(0), nboccurences(0)
+float xyzn::angle(int i, float nx, float ny, float nz)
 {
+  // computes the angle between the ith normal stored at point xyz and
+  // the new normal nx,ny,nz
+  double a[3] = {n[i].nx, n[i].ny, n[i].nz};
+  double b[3] = {nx, ny, nz};
+  norme(a);
+  norme(b);
+  double c[3];
+  prodve(a, b, c);
+  double cosc; 
+  prosca(a, b, &cosc);
+  double sinc = sqrt(c[0] * c[0] + c[1] * c[1] + c[2] * c[2]);
+  double angplan = myatan2(sinc, cosc);
+  return (float)(angplan * 180. / Pi);
 }
 
-xyzv::~xyzv()
+void xyzn::update(float nx, float ny, float nz, double tol)
 {
-  if(vals)
-    delete [] vals;
-}
+  int N = n.size();
 
-xyzv::xyzv(const xyzv & other)
-{
-  x = other.x;
-  y = other.y;
-  z = other.z;
-  nbvals = other.nbvals;
-  nboccurences = other.nboccurences;
-  if(other.vals && other.nbvals) {
-    vals = new double[other.nbvals];
-    for(int i = 0; i < nbvals; i++)
-      vals[i] = other.vals[i];
+  if(N > 100){
+    // just ignore it if we have more than 100 clusters (think "more
+    // than 100 elements touching a single vertex")
+    return;
   }
-}
 
-xyzv & xyzv::operator =(const xyzv & other)
-{
-  if(this != &other) {
-    x = other.x;
-    y = other.y;
-    z = other.z;
-    nbvals = other.nbvals;
-    nboccurences = other.nboccurences;
-    if(other.vals && other.nbvals) {
-      vals = new double[other.nbvals];
-      for(int i = 0; i < nbvals; i++)
-        vals[i] = other.vals[i];
+  // we average by clusters of normals separated by tol; the result of
+  // the averaging depends on the order in which we average (since we
+  // store the average value as the cluster center as we go), but it
+  // seems to work very nicely in practice (and it's faster than
+  // storing everyting and averaging at the end)
+  for(int i = 0; i < N; i++){
+    if(tol >= 180. || fabs(angle(i, nx, ny, nz)) < tol){
+      float c1 = (float)(n[i].nb) / (float)(n[i].nb + 1);
+      float c2 = 1. / (float)(n[i].nb + 1);
+      n[i].nx = (c1 * n[i].nx + c2 * nx);
+      n[i].ny = (c1 * n[i].ny + c2 * ny);
+      n[i].nz = (c1 * n[i].nz + c2 * nz);
+      n[i].nb++;
+      return;
     }
   }
-  return *this;
-}
-
-void xyzv::update(int n, double *v)
-{
-  int i;
-  if(!vals) {
-    vals = new double[n];
-    for(i = 0; i < n; i++)
-      vals[i] = 0.0;
-    nbvals = n;
-    nboccurences = 0;
-  }
-  else if(nbvals != n) {
-    throw n;
-  }
-
-  double x1 = (double)(nboccurences) / (double)(nboccurences + 1);
-  double x2 = 1. / (double)(nboccurences + 1);
-  for(i = 0; i < nbvals; i++)
-    vals[i] = (x1 * vals[i] + x2 * v[i]);
-  nboccurences++;
-
-  //printf("val(%d,%f,%f,%f) = %f\n",nboccurences,x,y,z,vals[0]);
-}
 
-double smooth_normals::get_angle(double *aa, double *bb)
-{
-  double angplan, cosc, sinc, a[3], b[3], c[3];
-  if(!aa || !bb)
-    return 0.;
-  a[0] = aa[0];
-  a[1] = aa[1];
-  a[2] = aa[2];
-  b[0] = bb[0];
-  b[1] = bb[1];
-  b[2] = bb[2];
-  norme(a);
-  norme(b);
-  prodve(a, b, c);
-  prosca(a, b, &cosc);
-  sinc = sqrt(c[0] * c[0] + c[1] * c[1] + c[2] * c[2]);
-  angplan = myatan2(sinc, cosc);
-  return angplan * 180. / Pi;
+  // create a new cluster
+  nnb nn = {nx, ny, nz, 0};
+  n.push_back(nn);
 }
 
 void smooth_normals::add(double x, double y, double z,
 			 double nx, double ny, double nz)
 {
-  double n[3] = { nx, ny, nz };
-  xyzv xyz(x, y, z);
-  xyziter it = c.find(xyz);
+  xyzn xyz(x, y, z);
+  xyzn_iter it = c.find(xyz);
   if(it == c.end()) {
-    xyz.update(3, n);
+    xyz.update((float)nx, (float)ny, (float)nz, tol);
     c.insert(xyz);
   }
   else {
-    xyzv *xx = (xyzv *) & (*it);
-    xx->update(3, n);
+    xyzn *p = (xyzn *) & (*it);
+    p->update((float)nx, (float)ny, (float)nz, tol);
   }    
 }
 
 bool smooth_normals::get(double x, double y, double z,
-			 double &nx, double &ny, double &nz, double tol)
+			 double &nx, double &ny, double &nz)
 {
-  double n[3] = { nx, ny, nz };
-  xyzv xyz(x, y, z);
-  xyziter it = c.find(xyz);
+  xyzn xyz(x, y, z);
+  xyzn_iter it = c.find(xyz);
   if(it == c.end())
     return false;
-  double angle = get_angle((*it).vals, n);
-  if(fabs(angle) < tol) {
-    nx = (*it).vals[0];
-    ny = (*it).vals[1];
-    nz = (*it).vals[2];
+
+  xyzn *p = (xyzn *) & (*it);
+  for(unsigned int i = 0; i < p->n.size(); i++){
+    if(fabs(p->angle(i, (float)nx, (float)ny, (float)nz)) < tol) {
+      nx = p->n[i].nx;
+      ny = p->n[i].ny;
+      nz = p->n[i].nz;
+      break;
+    }
   }
   return true;
 }
-
diff --git a/Common/SmoothNormals.h b/Common/SmoothNormals.h
index 4418e52236f438b0300943adaad0884c3510dc0d..df2f8db328e190b72236dce114cbb8eafcd45783 100644
--- a/Common/SmoothNormals.h
+++ b/Common/SmoothNormals.h
@@ -20,53 +20,58 @@
 // 
 // Please report all bugs and problems to <gmsh@geuz.org>.
 
+#include <set>
+#include <vector>
+#include "Numeric.h"
 
 using namespace std;
 
-struct xyzv
+struct nnb
 {
-  double x, y, z, *vals;
-  int nbvals;
-  int nboccurences;
+  float nx, ny, nz;
+  int nb;
+};
+
+struct xyzn
+{
+  double x, y, z;
+  vector<nnb> n;
   static double eps;
-  void update(int nbVals, double *);
-  xyzv(double x, double y, double z);
-  ~xyzv();
-  xyzv & operator =(const xyzv &);
-  xyzv(const xyzv &);
+  xyzn(double xx, double yy, double zz) : x(xx), y(yy), z(zz){}
+  ~xyzn(){}
+  float angle(int i, float n0, float n1, float n2);
+  void update(float n0, float n1, float n2, double tol);
 };
 
-struct lessthanxyzv
+struct lessthanxyzn
 {
-  bool operator () (const xyzv & p2, const xyzv & p1)const
+  bool operator () (const xyzn & p2, const xyzn & p1)const
   {
-    if(p1.x - p2.x > xyzv::eps)
+    if(p1.x - p2.x > xyzn::eps)
       return true;
-    if(p1.x - p2.x < -xyzv::eps)
+    if(p1.x - p2.x < -xyzn::eps)
       return false;
-    if(p1.y - p2.y > xyzv::eps)
+    if(p1.y - p2.y > xyzn::eps)
       return true;
-    if(p1.y - p2.y < -xyzv::eps)
+    if(p1.y - p2.y < -xyzn::eps)
       return false;
-    if(p1.z - p2.z > xyzv::eps)
+    if(p1.z - p2.z > xyzn::eps)
       return true;
     return false;
   }
 };
 
-#include <set>
-typedef set < xyzv, lessthanxyzv > xyzcont;
-typedef xyzcont::const_iterator xyziter;
+typedef set < xyzn, lessthanxyzn > xyzn_cont;
+typedef xyzn_cont::const_iterator xyzn_iter;
 
 class smooth_normals{
  private:
-  double get_angle(double *aa, double *bb);
+  double tol;
+  xyzn_cont c;  
  public:
-  xyzcont c;
-  void add(double x, double y, double z,
-	   double nx, double ny, double nz);
-  bool get(double x, double y, double z,
-	   double &nx, double &ny, double &nz, double angletol = 180.0);
+  smooth_normals(double angle) : tol(angle) {}
+  void add(double x, double y, double z, double nx, double ny, double nz);
+  bool get(double x, double y, double z, double &nx, double &ny, double &nz);
 };
 
 #endif
diff --git a/Common/Views.cpp b/Common/Views.cpp
index 6aae3f70b901a74a84d4750887cd183db45ab965..909489488b5476a841ef2e68e2a97503f6c9a5be 100644
--- a/Common/Views.cpp
+++ b/Common/Views.cpp
@@ -1,4 +1,4 @@
-// $Id: Views.cpp,v 1.180 2006-01-06 00:34:21 geuzaine Exp $
+// $Id: Views.cpp,v 1.181 2006-01-14 16:24:53 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -29,6 +29,7 @@
 #include "Context.h"
 #include "Options.h"
 #include "ColorTable.h"
+#include "xyzv.h"
 #include "SmoothNormals.h"
 
 #if defined(HAVE_MATH_EVAL)
@@ -150,7 +151,7 @@ Post_View *BeginView(int allocate)
   v->AliasOf = 0;
   v->ScalarOnly = 1;
   v->TextOnly = 1;
-  v->normals = new smooth_normals;
+  v->normals = new smooth_normals(v->AngleSmoothNormals);
   v->Min = VAL_INF;
   v->Max = -VAL_INF;
   v->adaptive = 0;
@@ -164,6 +165,13 @@ Post_View *BeginView(int allocate)
   return v;
 }
 
+void Post_View::reset_normals()
+{
+  if(normals)
+    delete normals;
+  normals = new smooth_normals(AngleSmoothNormals);
+}
+
 double ComputeVonMises(double *V)
 {
   static const double THIRD = 1.e0 / 3.e0;
@@ -1497,15 +1505,10 @@ void Post_View::splitCurvedElements()
 
 // Smoothing
 
-void Post_View::reset_normals()
-{
-  if(normals)
-    delete normals;
-  normals = new smooth_normals;
-}
+double xyzv::eps = 1.e-12;
 
 void generate_connectivities(List_T * list, int nbList, int nbTimeStep, int nbVert,
-                             xyzcont & connectivities)
+                             xyzv_cont & connectivities)
 {
   double *x, *y, *z, *v;
   int i, j, k;
@@ -1524,7 +1527,7 @@ void generate_connectivities(List_T * list, int nbList, int nbTimeStep, int nbVe
       for(k = 0; k < nbTimeStep; k++)
         vals[k] = v[j + k * nbVert];
       xyzv xyz(x[j], y[j], z[j]);
-      xyziter it = connectivities.find(xyz);
+      xyzv_iter it = connectivities.find(xyz);
       if(it == connectivities.end()) {
         xyz.update(nbTimeStep, vals);
         connectivities.insert(xyz);
@@ -1542,7 +1545,7 @@ void generate_connectivities(List_T * list, int nbList, int nbTimeStep, int nbVe
 
 void smooth_list(List_T * list, int nbList,
 		 double *min, double *max, double *tsmin, double *tsmax, 
-                 int nbTimeStep, int nbVert, xyzcont & connectivities)
+                 int nbTimeStep, int nbVert, xyzv_cont & connectivities)
 {
   if(!nbList)
     return;
@@ -1555,7 +1558,7 @@ void smooth_list(List_T * list, int nbList,
     double *v = (double *)List_Pointer_Fast(list, i + 3 * nbVert);
     for(int j = 0; j < nbVert; j++) {
       xyzv xyz(x[j], y[j], z[j]);
-      xyziter it = connectivities.find(xyz);
+      xyzv_iter it = connectivities.find(xyz);
       if(it != connectivities.end()) {
         for(int k = 0; k < nbTimeStep; k++) {
 	  double dd = (*it).vals[k];
@@ -1580,7 +1583,7 @@ void Post_View::smooth()
   xyzv::eps = CTX.lc * 1.e-8;
 
   if(NbSL || NbST || NbSQ || NbSS || NbSH || NbSI || NbSY) {
-    xyzcont con;
+    xyzv_cont con;
     Msg(INFO, "Smoothing scalar primitives in View[%d]", Index);
     Min = VAL_INF;
     Max = -VAL_INF;
diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index db14742e1e667215bb56c94399d5f676b7ab27eb..5365f53eaef8550510614c82015377fa93a6b978 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.394 2006-01-11 05:37:35 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.395 2006-01-14 16:24:53 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -174,6 +174,11 @@ void window_cb(CALLBACK_ARGS)
     // the order is important!
     WID->g_window->show();
     if(WID->opt_window->shown()) WID->opt_window->show();
+    if(WID->context_geometry_window->shown()) WID->context_geometry_window->show();
+    if(WID->context_mesh_window->shown()) WID->context_mesh_window->show();
+    for(int i = 0; i < MAXSOLVERS; i++) {
+      if(WID->solver[i].window->shown()) WID->solver[i].window->show();
+    }
     if(WID->vis_window->shown()) WID->vis_window->show();
     if(WID->clip_window->shown()) WID->clip_window->show();
     if(WID->manip_window->shown()) WID->manip_window->show();
diff --git a/Fltk/Makefile b/Fltk/Makefile
index 3445d5c76f6a2555275d9c910bc7440e83e3064d..fbb851af1b4799910659182b35895d1b4a569eca 100644
--- a/Fltk/Makefile
+++ b/Fltk/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.77 2006-01-06 00:34:23 geuzaine Exp $
+# $Id: Makefile,v 1.78 2006-01-14 16:24:54 geuzaine Exp $
 #
 # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 #
@@ -68,18 +68,18 @@ Main.o: Main.cpp GUI.h Opengl_Window.h ../Mesh/Mesh.h ../DataStr/List.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  Colorbar_Window.h ../Common/GmshUI.h ../Common/ColorTable.h \
-  ../Plugin/PluginManager.h ../Plugin/Plugin.h ../Common/Options.h \
-  ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
-  ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
-  ../Common/GmshVersion.h ../Geo/Geo.h ../Graphics/Draw.h \
-  ../Common/Context.h ../Parser/Parser.h ../Parser/OpenFile.h \
-  ../Common/CommandLine.h ../Numeric/Numeric.h Solvers.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h Colorbar_Window.h ../Common/GmshUI.h \
+  ../Common/ColorTable.h ../Plugin/PluginManager.h ../Plugin/Plugin.h \
+  ../Common/Options.h ../Common/Message.h ../Common/Views.h \
+  ../Common/ColorTable.h ../Common/VertexArray.h \
+  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Gmsh.h \
+  ../Common/Message.h ../DataStr/Malloc.h ../DataStr/Tools.h \
+  ../DataStr/List.h ../DataStr/Tree.h ../Common/GmshVersion.h \
+  ../Geo/Geo.h ../Graphics/Draw.h ../Common/Context.h ../Parser/Parser.h \
+  ../Parser/OpenFile.h ../Common/CommandLine.h Solvers.h
 Message.o: Message.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -89,21 +89,21 @@ Message.o: Message.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h \
   ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h Colorbar_Window.h \
-  ../Common/ColorTable.h GUI_Extras.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  Colorbar_Window.h ../Common/ColorTable.h GUI_Extras.h
 GUI.o: GUI.cpp ../Plugin/PluginManager.h ../Plugin/Plugin.h \
   ../Common/Options.h ../Common/Message.h ../Common/Views.h \
   ../Common/ColorTable.h ../DataStr/List.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Gmsh.h \
   ../Common/Message.h ../DataStr/Malloc.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
-  ../Common/GmshUI.h ../Numeric/Numeric.h ../Common/GmshVersion.h \
-  ../Common/Context.h ../Geo/Geo.h ../Geo/CAD.h ../Mesh/Mesh.h \
-  ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
-  ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h \
-  ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Common/GmshUI.h ../Common/GmshVersion.h ../Common/Context.h \
+  ../Geo/Geo.h ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h \
+  ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h \
+  ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h \
+  ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
   ../Geo/ExtrudeParams.h ../Graphics/Draw.h GUI.h Opengl_Window.h \
@@ -117,13 +117,13 @@ GUI_Extras.o: GUI_Extras.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  File_Picker.h Shortcut_Window.h ../Graphics/CreateFile.h \
-  ../Common/Options.h ../Common/Context.h ../Graphics/Draw.h \
-  ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
-  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h File_Picker.h Shortcut_Window.h \
+  ../Graphics/CreateFile.h ../Common/Options.h ../Common/Context.h \
+  ../Graphics/Draw.h ../Common/Views.h ../Common/ColorTable.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h
 Callbacks.o: Callbacks.cpp ../Mesh/BDS.h ../Common/Gmsh.h \
   ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
   ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h \
@@ -132,8 +132,8 @@ Callbacks.o: Callbacks.cpp ../Mesh/BDS.h ../Common/Gmsh.h \
   ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
   ../Geo/ExtrudeParams.h ../Geo/ExtractContour.h ../Graphics/Draw.h \
   ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
   ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
@@ -142,7 +142,7 @@ Callbacks.o: Callbacks.cpp ../Mesh/BDS.h ../Common/Gmsh.h \
   ../Common/Context.h ../Common/Options.h GUI.h Opengl_Window.h \
   Colorbar_Window.h GUI_Extras.h Callbacks.h ../Plugin/Plugin.h \
   ../Plugin/PluginManager.h ../Plugin/Plugin.h ../Common/Visibility.h \
-  ../Geo/MinMax.h ../Numeric/Numeric.h Solvers.h
+  ../Geo/MinMax.h Solvers.h
 Opengl.o: Opengl.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -179,9 +179,9 @@ Colorbar_Window.o: Colorbar_Window.cpp ../Common/Gmsh.h \
   ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h Colorbar_Window.h \
-  ../Common/ColorTable.h ../Common/Context.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  Colorbar_Window.h ../Common/ColorTable.h ../Common/Context.h
 Solvers.o: Solvers.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -190,9 +190,10 @@ Solvers.o: Solvers.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  Colorbar_Window.h ../Common/ColorTable.h ../Graphics/Draw.h \
-  ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
-  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h Colorbar_Window.h ../Common/ColorTable.h \
+  ../Graphics/Draw.h ../Common/Views.h ../Common/ColorTable.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
+  ../Common/Context.h
diff --git a/Geo/Makefile b/Geo/Makefile
index ca8477b294cf8eff0d8a330a497bb93002354c05..e3b83049d8d547465822131f8e61d8c1aea68f27 100644
--- a/Geo/Makefile
+++ b/Geo/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.69 2006-01-10 15:13:25 geuzaine Exp $
+# $Id: Makefile,v 1.70 2006-01-14 16:24:54 geuzaine Exp $
 #
 # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 #
@@ -82,9 +82,9 @@ ExtrudeParams.o: ExtrudeParams.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  ExtrudeParams.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h ExtrudeParams.h
 Geo.o: Geo.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
   ../DataStr/List.h ../DataStr/Tree.h ../Numeric/Numeric.h Geo.h CAD.h \
@@ -102,9 +102,9 @@ GeoUtils.o: GeoUtils.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  ExtrudeParams.h ../Numeric/Numeric.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h ExtrudeParams.h
 StepGeomDatabase.o: StepGeomDatabase.cpp ../Common/Gmsh.h \
   ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
   ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h \
@@ -125,9 +125,9 @@ ExtractContour.o: ExtractContour.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  CAD.h ExtrudeParams.h ../Numeric/Numeric.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h CAD.h ExtrudeParams.h
 Print_Geo.o: Print_Geo.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -135,6 +135,6 @@ Print_Geo.o: Print_Geo.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  CAD.h ExtrudeParams.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h CAD.h ExtrudeParams.h
diff --git a/Graphics/Iso.cpp b/Graphics/Iso.cpp
index a6875a062b783f043e81e06593bb7a2ffcd367c1..d802e57efdf787631b28cf175948e334182b89d5 100644
--- a/Graphics/Iso.cpp
+++ b/Graphics/Iso.cpp
@@ -1,4 +1,4 @@
-// $Id: Iso.cpp,v 1.35 2006-01-06 00:34:24 geuzaine Exp $
+// $Id: Iso.cpp,v 1.36 2006-01-14 16:24:54 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -390,8 +390,7 @@ void EnhanceSimplexPolygon(Post_View * View, int nb,    // nb of points in polyg
         norms[3 * i + 1] = n[1];
         norms[3 * i + 2] = n[2];
         View->normals->get(Xp[i], Yp[i], Zp[i], 
-			   norms[3 * i], norms[3 * i + 1], norms[3 * i + 2],
-			   View->AngleSmoothNormals);
+			   norms[3 * i], norms[3 * i + 1], norms[3 * i + 2]);
       }
     }
   }
diff --git a/Graphics/Makefile b/Graphics/Makefile
index e029815e3ed35cde9bfab6ef48f66c42f8be9e4f..65b8fd01f9ab73e217a74054574f4bc72a7d1a50 100644
--- a/Graphics/Makefile
+++ b/Graphics/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.75 2006-01-06 00:34:24 geuzaine Exp $
+# $Id: Makefile,v 1.76 2006-01-14 16:24:54 geuzaine Exp $
 #
 # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 #
@@ -76,12 +76,13 @@ Draw.o: Draw.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  ../Geo/ExtrudeParams.h Draw.h ../Common/Views.h ../Common/ColorTable.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Geo/MinMax.h ../Numeric/Numeric.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h ../Geo/ExtrudeParams.h Draw.h ../Common/Views.h \
+  ../Common/ColorTable.h ../Common/VertexArray.h \
+  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
+  ../Geo/MinMax.h
 Mesh.o: Mesh.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
   ../DataStr/List.h ../DataStr/Tree.h ../Common/GmshUI.h ../Geo/Geo.h \
@@ -89,12 +90,13 @@ Mesh.o: Mesh.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  ../Geo/ExtrudeParams.h Draw.h ../Common/Views.h ../Common/ColorTable.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Geo/MinMax.h gl2ps.h ../Numeric/Numeric.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h ../Geo/ExtrudeParams.h Draw.h ../Common/Views.h \
+  ../Common/ColorTable.h ../Common/VertexArray.h \
+  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
+  ../Geo/MinMax.h gl2ps.h
 Geom.o: Geom.cpp ../Mesh/BDS.h ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -134,12 +136,12 @@ PostElement.o: PostElement.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h Draw.h \
-  ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  Draw.h ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
   ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h Iso.h \
-  ../Common/Context.h ../Numeric/Numeric.h
+  ../Common/Context.h
 Iso.o: Iso.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
   ../DataStr/List.h ../DataStr/Tree.h ../Common/GmshUI.h ../Geo/Geo.h \
@@ -147,22 +149,21 @@ Iso.o: Iso.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h Draw.h \
-  ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  Draw.h ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
   ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
-  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
-  ../Numeric/Numeric.h
+  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h
 Entity.o: Entity.cpp ../Mesh/Mesh.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ../Common/Gmsh.h \
-  ../Common/Message.h ../DataStr/Malloc.h ../DataStr/Tools.h \
-  ../DataStr/List.h ../DataStr/Tree.h ../Common/GmshUI.h \
-  ../Numeric/Numeric.h Draw.h ../Common/Views.h ../Common/ColorTable.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
+  ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
+  ../Common/GmshUI.h Draw.h ../Common/Views.h ../Common/ColorTable.h \
   ../Common/VertexArray.h ../Common/SmoothNormals.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   ../Common/Context.h gl2ps.h
@@ -170,7 +171,7 @@ ReadImg.o: ReadImg.cpp ReadImg.h ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   ../Common/GmshUI.h ../Common/Views.h ../Common/ColorTable.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h
 Scale.o: Scale.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -206,13 +207,14 @@ CreateFile.o: CreateFile.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
   ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
-  ../Parser/OpenFile.h Draw.h ../Common/Views.h ../Common/ColorTable.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Common/Options.h gl2ps.h gl2gif.h gl2jpeg.h \
-  gl2png.h gl2ppm.h gl2yuv.h
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
+  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
+  ../Mesh/Matrix.h ../Parser/OpenFile.h Draw.h ../Common/Views.h \
+  ../Common/ColorTable.h ../Common/VertexArray.h \
+  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
+  ../Common/Options.h gl2ps.h gl2gif.h gl2jpeg.h gl2png.h gl2ppm.h \
+  gl2yuv.h
 gl2ps.o: gl2ps.cpp gl2ps.h
 gl2gif.o: gl2gif.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp
index 8daa6ae550e6694795d372df05ca01abf2161ccd..e43649e6f5ed0bec53c1904577d761b28a37be65 100644
--- a/Graphics/Mesh.cpp
+++ b/Graphics/Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Mesh.cpp,v 1.149 2006-01-10 03:58:31 geuzaine Exp $
+// $Id: Mesh.cpp,v 1.150 2006-01-14 16:24:54 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -136,6 +136,8 @@ int getPartition(int index)
     return (*part)->Num; // partition number
 }
 
+static int preproNormals = 0;
+
 void Draw_Mesh(Mesh * M)
 {
   for(int i = 0; i < 6; i++)
@@ -262,6 +264,11 @@ void Draw_Mesh(Mesh * M)
       else
 	glDisable((GLenum)(GL_CLIP_PLANE0 + i));
 
+    if(CTX.mesh.changed){
+      if(M->normals) delete M->normals;
+      M->normals = new smooth_normals(CTX.mesh.angle_smooth_normals);
+    }
+
     // Dimension 3
 
     if(M->status >= 3 && (CTX.mesh.volumes_faces || CTX.mesh.volumes_edges ||
@@ -276,6 +283,11 @@ void Draw_Mesh(Mesh * M)
     if(M->status >= 2 && (CTX.mesh.surfaces_faces || CTX.mesh.surfaces_edges ||
 			  CTX.mesh.surfaces_num || CTX.mesh.points_per_element ||
 			  CTX.mesh.normals)) {
+      if(CTX.mesh.changed && CTX.mesh.smooth_normals){
+	preproNormals = 1;
+	Tree_Action(M->Surfaces, Draw_Mesh_Surface);
+	preproNormals = 0;
+      }
       Tree_Action(M->Surfaces, Draw_Mesh_Surface);
       if(CTX.mesh.oldxtrude)  //old extrusion algo
 	Tree_Action(M->Volumes, Draw_Mesh_Extruded_Surfaces);
@@ -386,8 +398,6 @@ void Draw_Mesh_Volume(void *a, void *b)
   }
 }
 
-static int preproNormals = 0;
-
 void Draw_Mesh_Surface(void *a, void *b)
 {
   Surface *s = *(Surface **) a;
@@ -411,15 +421,11 @@ void Draw_Mesh_Surface(void *a, void *b)
   theSurface = s;
   theColor = s->Color;
 
-  if(CTX.mesh.changed && CTX.mesh.smooth_normals){
-    Msg(DEBUG, "pre-processing smooth normals");
-    if(s->normals) delete s->normals;
-    s->normals = new smooth_normals;
-    preproNormals = 1;
+  if(preproNormals){
     Tree_Action(s->Simplexes, Draw_Mesh_Triangle);
     Tree_Action(s->SimplexesBase, Draw_Mesh_Triangle);
     Tree_Action(s->Quadrangles, Draw_Mesh_Quadrangle);
-    preproNormals = 0;
+    return;
   }
 
   if(CTX.mesh.vertex_arrays){
@@ -752,10 +758,10 @@ void _triFace(double x0, double y0, double z0,
 
   if(CTX.mesh.light || (theSurface && preproNormals)){
     normal3points(x0, y0, z0, x1, y1, z1, x2, y2, z2, n);
-    if(theSurface && preproNormals){
-      theSurface->normals->add(x0, y0, z0, n[0], n[1], n[2]);
-      theSurface->normals->add(x1, y1, z1, n[0], n[1], n[2]);
-      theSurface->normals->add(x2, y2, z2, n[0], n[1], n[2]);
+    if(preproNormals){
+      THEM->normals->add(x0, y0, z0, n[0], n[1], n[2]);
+      THEM->normals->add(x1, y1, z1, n[0], n[1], n[2]);
+      THEM->normals->add(x2, y2, z2, n[0], n[1], n[2]);
       return;
     }
     glNormal3dv(n);
@@ -763,24 +769,21 @@ void _triFace(double x0, double y0, double z0,
 
   if(CTX.mesh.light && theSurface && CTX.mesh.smooth_normals){
     ns[0] = n[0]; ns[1] = n[1]; ns[2] = n[2];
-    theSurface->normals->get(x0, y0, z0, ns[0], ns[1], ns[2], 
-			     CTX.mesh.angle_smooth_normals);
+    THEM->normals->get(x0, y0, z0, ns[0], ns[1], ns[2]);
     glNormal3dv(ns);    
   }
   glVertex3d(x0, y0, z0);
 
   if(CTX.mesh.light && theSurface && CTX.mesh.smooth_normals){
     ns[0] = n[0]; ns[1] = n[1]; ns[2] = n[2];
-    theSurface->normals->get(x1, y1, z1, ns[0], ns[1], ns[2], 
-			     CTX.mesh.angle_smooth_normals);
+    THEM->normals->get(x1, y1, z1, ns[0], ns[1], ns[2]);
     glNormal3dv(ns);    
   }
   glVertex3d(x1, y1, z1);
 
   if(CTX.mesh.light && theSurface && CTX.mesh.smooth_normals){
     ns[0] = n[0]; ns[1] = n[1]; ns[2] = n[2];
-    theSurface->normals->get(x2, y2, z2, ns[0], ns[1], ns[2], 
-			     CTX.mesh.angle_smooth_normals);
+    THEM->normals->get(x2, y2, z2, ns[0], ns[1], ns[2]);
     glNormal3dv(ns);    
   }
   glVertex3d(x2, y2, z2);
@@ -806,11 +809,11 @@ void _quadFace(double *x, double *y, double *z,
     normal3points(x[i0], y[i0], z[i0],
 		  x[i1], y[i1], z[i1],
 		  x[i2], y[i2], z[i2], n);
-    if(theSurface && preproNormals){
-      theSurface->normals->add(x[i0], y[i0], z[i0], n[0], n[1], n[2]);
-      theSurface->normals->add(x[i1], y[i1], z[i1], n[0], n[1], n[2]);
-      theSurface->normals->add(x[i2], y[i2], z[i2], n[0], n[1], n[2]);
-      theSurface->normals->add(x[i3], y[i3], z[i3], n[0], n[1], n[2]);
+    if(preproNormals){
+      THEM->normals->add(x[i0], y[i0], z[i0], n[0], n[1], n[2]);
+      THEM->normals->add(x[i1], y[i1], z[i1], n[0], n[1], n[2]);
+      THEM->normals->add(x[i2], y[i2], z[i2], n[0], n[1], n[2]);
+      THEM->normals->add(x[i3], y[i3], z[i3], n[0], n[1], n[2]);
       return;
     }
     glNormal3dv(n);
@@ -818,32 +821,28 @@ void _quadFace(double *x, double *y, double *z,
 
   if(CTX.mesh.light && theSurface && CTX.mesh.smooth_normals){
     ns[0] = n[0]; ns[1] = n[1]; ns[2] = n[2];
-    theSurface->normals->get(x[i0], y[i0], z[i0], ns[0], ns[1], ns[2], 
-			     CTX.mesh.angle_smooth_normals);
+    THEM->normals->get(x[i0], y[i0], z[i0], ns[0], ns[1], ns[2]);
     glNormal3dv(ns);    
   }
   glVertex3d(x[i0], y[i0], z[i0]);
 
   if(CTX.mesh.light && theSurface && CTX.mesh.smooth_normals){
     ns[0] = n[0]; ns[1] = n[1]; ns[2] = n[2];
-    theSurface->normals->get(x[i1], y[i1], z[i1], ns[0], ns[1], ns[2], 
-			     CTX.mesh.angle_smooth_normals);
+    THEM->normals->get(x[i1], y[i1], z[i1], ns[0], ns[1], ns[2]);
     glNormal3dv(ns);    
   }
   glVertex3d(x[i1], y[i1], z[i1]);
 
   if(CTX.mesh.light && theSurface && CTX.mesh.smooth_normals){
     ns[0] = n[0]; ns[1] = n[1]; ns[2] = n[2];
-    theSurface->normals->get(x[i2], y[i2], z[i2], ns[0], ns[1], ns[2], 
-			     CTX.mesh.angle_smooth_normals);
+    THEM->normals->get(x[i2], y[i2], z[i2], ns[0], ns[1], ns[2]);
     glNormal3dv(ns);    
   }
   glVertex3d(x[i2], y[i2], z[i2]);
 
   if(CTX.mesh.light && theSurface && CTX.mesh.smooth_normals){
     ns[0] = n[0]; ns[1] = n[1]; ns[2] = n[2];
-    theSurface->normals->get(x[i3], y[i3], z[i3], ns[0], ns[1], ns[2], 
-			     CTX.mesh.angle_smooth_normals);
+    THEM->normals->get(x[i3], y[i3], z[i3], ns[0], ns[1], ns[2]);
     glNormal3dv(ns);    
   }
   glVertex3d(x[i3], y[i3], z[i3]);
@@ -1009,15 +1008,14 @@ void Draw_Mesh_Triangle(void *a, void *b)
 		   X[2], Y[2], Z[2], n);
     if(preproNormals){
       for(int i = 0; i < 3; i++)
-	theSurface->normals->add(X[i], Y[i], Z[i], n[0], n[1], n[2]);
+	THEM->normals->add(X[i], Y[i], Z[i], n[0], n[1], n[2]);
       return;
     }
     if(theSurface->TriVertexArray->fill){
       for(int i = 0; i < 3; i++){
 	double ns[3] = {n[0], n[1], n[2]};
 	if(CTX.mesh.smooth_normals)
-	  theSurface->normals->get(X[i], Y[i], Z[i], ns[0], ns[1], ns[2], 
-				   CTX.mesh.angle_smooth_normals);
+	  THEM->normals->get(X[i], Y[i], Z[i], ns[0], ns[1], ns[2]);
 	theSurface->TriVertexArray->add(X[i], Y[i], Z[i], ns[0], ns[1], ns[2], col);
       }
       theSurface->TriVertexArray->num++;
@@ -1203,15 +1201,14 @@ void Draw_Mesh_Quadrangle(void *a, void *b)
 		    X[2], Y[2], Z[2], n);
     if(preproNormals){
       for(int i = 0; i < 4; i++)
-	theSurface->normals->add(X[i], Y[i], Z[i], n[0], n[1], n[2]);
+	THEM->normals->add(X[i], Y[i], Z[i], n[0], n[1], n[2]);
       return;
     }
     if(theSurface->QuadVertexArray->fill){
       for(int i = 0; i < 4; i++){
 	double ns[3] = {n[0], n[1], n[2]};
 	if(CTX.mesh.smooth_normals)
-	  theSurface->normals->get(X[i], Y[i], Z[i], ns[0], ns[1], ns[2], 
-				   CTX.mesh.angle_smooth_normals);
+	  THEM->normals->get(X[i], Y[i], Z[i], ns[0], ns[1], ns[2]);
 	theSurface->QuadVertexArray->add(X[i], Y[i], Z[i], ns[0], ns[1], ns[2], col);
       }
       theSurface->QuadVertexArray->num++;
diff --git a/Graphics/PostElement.cpp b/Graphics/PostElement.cpp
index 41c947c35c8b10b2c1e7d6bfeaf253a3872dc196..32c1da90f6824d8d6e41e56f2d5762e5cc09d108 100644
--- a/Graphics/PostElement.cpp
+++ b/Graphics/PostElement.cpp
@@ -1,4 +1,4 @@
-// $Id: PostElement.cpp,v 1.70 2006-01-06 00:34:25 geuzaine Exp $
+// $Id: PostElement.cpp,v 1.71 2006-01-14 16:24:54 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -457,8 +457,7 @@ void Draw_ScalarTriangle(Post_View * View, int preproNormals,
       }
       if(View->SmoothNormals)
 	for(int i = 0; i < 3; i++)
-	  View->normals->get(X[i], Y[i], Z[i], norms[3*i], norms[3*i+1], norms[3*i+2],
-			     View->AngleSmoothNormals);
+	  View->normals->get(X[i], Y[i], Z[i], norms[3*i], norms[3*i+1], norms[3*i+2]);
      
       if(View->TriVertexArray && View->TriVertexArray->fill){
 	unsigned int col;
@@ -498,8 +497,7 @@ void Draw_ScalarTriangle(Post_View * View, int preproNormals,
 	}
 	if(View->SmoothNormals)
 	  for(int i = 0; i < nb; i++)
-	    View->normals->get(Xp[i], Yp[i], Zp[i], norms[3*i], norms[3*i+1], norms[3*i+2],
-			       View->AngleSmoothNormals);
+	    View->normals->get(Xp[i], Yp[i], Zp[i], norms[3*i], norms[3*i+1], norms[3*i+2]);
 	
 	if(View->TriVertexArray && View->TriVertexArray->fill){
 	  for(int i = 2; i < nb; i++) {
@@ -557,8 +555,7 @@ void Draw_ScalarTriangle(Post_View * View, int preproNormals,
 	  }
 	  if(View->SmoothNormals)
 	    for(int i = 0; i < nb; i++)
-	      View->normals->get(Xp[i], Yp[i], Zp[i], norms[3*i], norms[3*i+1], norms[3*i+2],
-				 View->AngleSmoothNormals);
+	      View->normals->get(Xp[i], Yp[i], Zp[i], norms[3*i], norms[3*i+1], norms[3*i+2]);
 
 	  if(View->TriVertexArray && View->TriVertexArray->fill){
 	    for(int i = 2; i < nb; i++) {
diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp
index d02ae8ec864dc765f80f9d26f0ff2e272c590ebe..7b35ae9e8ea677e2f271b7ed47bc8d514eabf8fb 100644
--- a/Mesh/Create.cpp
+++ b/Mesh/Create.cpp
@@ -1,4 +1,4 @@
-// $Id: Create.cpp,v 1.80 2006-01-06 00:34:26 geuzaine Exp $
+// $Id: Create.cpp,v 1.81 2006-01-14 16:24:54 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -677,7 +677,6 @@ Surface *Create_Surface(int Num, int Typ)
   pS->Extrude = NULL;
   pS->TriVertexArray = NULL;
   pS->QuadVertexArray = NULL;
-  pS->normals = new smooth_normals;
   return (pS);
 }
 
@@ -706,8 +705,6 @@ void Free_Surface(void *a, void *b)
       delete pS->TriVertexArray;
     if(pS->QuadVertexArray)
       delete pS->QuadVertexArray;
-    if(pS->normals)
-      delete pS->normals;
     Free(pS);
     pS = NULL;
   }
diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp
index 50e0f073ac4ff17bddb2872c4564c82eb85ae6df..a29d59cbdf24638d94e87b80effdafdb3c24f0ff 100644
--- a/Mesh/Generator.cpp
+++ b/Mesh/Generator.cpp
@@ -1,4 +1,4 @@
-// $Id: Generator.cpp,v 1.74 2006-01-06 00:34:26 geuzaine Exp $
+// $Id: Generator.cpp,v 1.75 2006-01-14 16:24:54 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -422,6 +422,9 @@ void Init_Mesh(Mesh * M)
   if(M->Grid.init)
     List_Delete(M->Grid.Bricks);
 
+  if(M->normals)
+    delete M->normals;
+
   M->Vertices = Tree_Create(sizeof(Vertex *), compareVertex);
   M->Simplexes = Tree_Create(sizeof(Simplex *), compareSimplex);
   M->Points = Tree_Create(sizeof(Vertex *), compareVertex);
@@ -435,6 +438,7 @@ void Init_Mesh(Mesh * M)
   M->Metric = new GMSHMetric;
   M->BGM.bgm = NULL;
   M->Grid.init = 0;
+  M->normals = new smooth_normals(CTX.mesh.angle_smooth_normals);
 
   M->status = 0;
 
diff --git a/Mesh/Makefile b/Mesh/Makefile
index e9c5693cfcbb10b1a7f62462c8a236c582625029..129c4e558bd573fba3670d89a62fd966163f14b9 100644
--- a/Mesh/Makefile
+++ b/Mesh/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.100 2006-01-06 00:34:26 geuzaine Exp $
+# $Id: Makefile,v 1.101 2006-01-14 16:24:54 geuzaine Exp $
 #
 # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 #
@@ -133,7 +133,7 @@ depend:
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   ../Geo/Geo.h Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h ../Numeric/Numeric.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
   Interpolation.h
 2D_Elliptic.o: 2D_Elliptic.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -202,7 +202,8 @@ depend:
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h 2D_Mesh.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
+  2D_Mesh.h
 2D_Cylindrical.o: 2D_Cylindrical.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -238,7 +239,7 @@ depend:
   ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h \
   ../DataStr/Tree.h Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h ../Numeric/Numeric.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
   ../Common/Context.h
 3D_Mesh.o: 3D_Mesh.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -252,16 +253,17 @@ depend:
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h Interpolation.h Create.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
+  Interpolation.h Create.h
 3D_BGMesh.o: 3D_BGMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h 2D_Mesh.h 3D_Mesh.h \
-  ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
-  ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Numeric/Numeric.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
+  2D_Mesh.h 3D_Mesh.h ../Common/Views.h ../Common/ColorTable.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   ../Common/Context.h
 3D_Extrude.o: 3D_Extrude.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -308,15 +310,15 @@ depend:
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   ../Geo/Geo.h Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h Create.h \
-  ../Numeric/Numeric.h ../Common/Context.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
+  Create.h ../Common/Context.h
 3D_Mesh_Tetgen.o: 3D_Mesh_Tetgen.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h Create.h \
-  ../Numeric/Numeric.h ../Common/Context.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
+  Create.h ../Common/Context.h
 BDS.o: BDS.cpp ../Numeric/Numeric.h ../Common/GmshMatrix.h BDS.h \
   ../Common/Message.h
 MeshQuality.o: MeshQuality.cpp ../Common/Gmsh.h ../Common/Message.h \
@@ -366,11 +368,10 @@ Read_Mesh.o: Read_Mesh.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h \
   ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
   ../Geo/ExtrudeParams.h Mesh.h 3D_Mesh.h Create.h Vertex.h \
-  ../Geo/MinMax.h ../Numeric/Numeric.h ../Common/Context.h \
-  PartitionMesh.h
+  ../Geo/MinMax.h ../Common/Context.h PartitionMesh.h
 DiscreteSurface.o: DiscreteSurface.cpp ../Common/Gmsh.h \
   ../Common/Message.h ../DataStr/Malloc.h ../DataStr/List.h \
   ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h \
@@ -413,9 +414,9 @@ Nurbs.o: Nurbs.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Nurbs.h Vertex.h Mesh.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h ../Geo/Geo.h \
-  ../Geo/GeoUtils.h ../Mesh/Mesh.h Create.h ../Geo/CAD.h ../Mesh/Vertex.h \
-  ../Geo/ExtrudeParams.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
+  ../Geo/Geo.h ../Geo/GeoUtils.h ../Mesh/Mesh.h Create.h ../Geo/CAD.h \
+  ../Mesh/Vertex.h ../Geo/ExtrudeParams.h
 Interpolation.o: Interpolation.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -428,8 +429,8 @@ SecondOrder.o: SecondOrder.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   ../Geo/Geo.h Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h Utils.h Interpolation.h \
-  ../Numeric/Numeric.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h \
+  Utils.h Interpolation.h
 PartitionMesh.o: PartitionMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -450,7 +451,7 @@ CrossData.o: CrossData.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h
 Vertex.o: Vertex.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
@@ -472,7 +473,7 @@ Element.o: Element.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h Metric.h Matrix.h ../Numeric/Numeric.h
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h Metric.h Matrix.h
 Simplex.o: Simplex.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h
index daf026dc0353bfd5cbefa92efaf435e8f2aca6b5..db0309dbe5912263743aec0e7aa3558ca59ab786 100644
--- a/Mesh/Mesh.h
+++ b/Mesh/Mesh.h
@@ -256,7 +256,6 @@ struct _Surf{
   DrawingColor Color;
   VertexArray *TriVertexArray;
   VertexArray *QuadVertexArray;
-  smooth_normals *normals;
 };
 
 typedef struct _Surf Surface;
@@ -413,6 +412,7 @@ struct _Mesh{
   List_T *PhysicalGroups;
   List_T *Partitions;
   Grid_T Grid; // fast search grid
+  smooth_normals *normals; // container for smooth normals
   LcField BGM; // background mesh
   double timing[3]; // timing for 1d, 2d and 3d mesh
   double quality_gamma[3]; // mesh quality statistics
diff --git a/Parser/Makefile b/Parser/Makefile
index afdd9a0b888b04981eee02a57120044d22a83c77..e4cbd662541dda142e32b2240b2b182a882c12a6 100644
--- a/Parser/Makefile
+++ b/Parser/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.77 2006-01-06 00:34:32 geuzaine Exp $
+# $Id: Makefile,v 1.78 2006-01-14 16:24:54 geuzaine Exp $
 #
 # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 #
@@ -78,18 +78,18 @@ depend:
 Gmsh.tab.o: Gmsh.tab.cpp ../Plugin/PluginManager.h ../Plugin/Plugin.h \
   ../Common/Options.h ../Common/Message.h ../Common/Views.h \
   ../Common/ColorTable.h ../DataStr/List.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Parallel/ParUtil.h \
   ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
   ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h \
-  ../DataStr/Tree.h ../Numeric/Numeric.h ../Common/Context.h ../Geo/Geo.h \
-  ../Geo/GeoUtils.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Element.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
-  ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
-  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
-  ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
-  ../Mesh/Matrix.h ../Mesh/Nurbs.h ../Mesh/Vertex.h ../Mesh/Mesh.h \
-  ../Geo/CAD.h ../Geo/ExtrudeParams.h ../Graphics/Draw.h ../Mesh/Create.h \
+  ../DataStr/Tree.h ../Common/Context.h ../Geo/Geo.h ../Geo/GeoUtils.h \
+  ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
+  ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
+  ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
+  ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  ../Mesh/Nurbs.h ../Mesh/Vertex.h ../Mesh/Mesh.h ../Geo/CAD.h \
+  ../Geo/ExtrudeParams.h ../Graphics/Draw.h ../Mesh/Create.h \
   ../Mesh/Vertex.h ../Mesh/Mesh.h ../Geo/StepGeomDatabase.h \
   ../Common/Colors.h ../Common/Options.h Parser.h OpenFile.h \
   ../Common/CommandLine.h FunctionManager.h ../Common/Timer.h \
diff --git a/Plugin/Makefile b/Plugin/Makefile
index 3cb4131034800f7ed99caa428556d6560e1afe65..1bbfb3f7d3f51e3caa86cefec093fc127d3856dd 100644
--- a/Plugin/Makefile
+++ b/Plugin/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.87 2006-01-06 00:34:33 geuzaine Exp $
+# $Id: Makefile,v 1.88 2006-01-14 16:24:55 geuzaine Exp $
 #
 # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 #
@@ -74,7 +74,7 @@ depend:
 # DO NOT DELETE THIS LINE
 Plugin.o: Plugin.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   PluginManager.h CutMap.h Levelset.h CutGrid.h StreamLines.h CutPlane.h \
   CutParametric.h CutSphere.h Skin.h ../DataStr/Tree.h ../DataStr/avl.h \
@@ -87,19 +87,19 @@ Plugin.o: Plugin.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ../Common/GmshUI.h \
-  Eigenvectors.h Eigenvalues.h Lambda2.h ../Numeric/Numeric.h Evaluate.h \
-  OctreePost.h Octree.h OctreeInternals.h Probe.h ../Common/Context.h
+  Eigenvectors.h Eigenvalues.h Lambda2.h Evaluate.h OctreePost.h Octree.h \
+  OctreeInternals.h Probe.h ../Common/Context.h
 Levelset.o: Levelset.cpp Levelset.h Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  DecomposeInSimplex.h ../DataStr/Tools.h ../DataStr/List.h \
-  ../DataStr/Tree.h ../DataStr/avl.h ../Graphics/Iso.h \
-  ../Numeric/Numeric.h ../Common/Context.h ../DataStr/Malloc.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h DecomposeInSimplex.h ../DataStr/Tools.h \
+  ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../Graphics/Iso.h \
+  ../Common/Context.h ../DataStr/Malloc.h
 CutPlane.o: CutPlane.cpp CutPlane.h Levelset.h Plugin.h \
   ../Common/Options.h ../Common/Message.h ../Common/Views.h \
   ../Common/ColorTable.h ../DataStr/List.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
   ../Common/GmshUI.h ../Graphics/Draw.h ../Mesh/Mesh.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
@@ -110,7 +110,7 @@ CutPlane.o: CutPlane.cpp CutPlane.h Levelset.h Plugin.h \
 CutSphere.o: CutSphere.cpp CutSphere.h Levelset.h Plugin.h \
   ../Common/Options.h ../Common/Message.h ../Common/Views.h \
   ../Common/ColorTable.h ../DataStr/List.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
   ../Common/GmshUI.h ../Graphics/Draw.h ../Mesh/Mesh.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
@@ -121,54 +121,54 @@ CutSphere.o: CutSphere.cpp CutSphere.h Levelset.h Plugin.h \
 CutMap.o: CutMap.cpp CutMap.h Levelset.h Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Common/Context.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h ../Common/Context.h
 Smooth.o: Smooth.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   Smooth.h ../Common/Context.h
 CutParametric.o: CutParametric.cpp OctreePost.h Octree.h \
   OctreeInternals.h CutParametric.h Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h \
-  ../Mesh/Mesh.h ../DataStr/Tree.h ../DataStr/avl.h ../Mesh/Vertex.h \
-  ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h \
-  ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h \
-  ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h ../Common/Context.h ../Common/GmshUI.h \
+  ../Graphics/Draw.h ../Mesh/Mesh.h ../DataStr/Tree.h ../DataStr/avl.h \
+  ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h \
+  ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h
 Lambda2.o: Lambda2.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Lambda2.h ../Numeric/Numeric.h ../Common/Context.h ShapeFunctions.h
+  Lambda2.h ../Common/Context.h ShapeFunctions.h
 Eigenvectors.o: Eigenvectors.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Eigenvectors.h ../Common/Context.h ../DataStr/Malloc.h \
-  ../Numeric/Numeric.h ../Numeric/EigSolve.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h Eigenvectors.h ../Common/Context.h \
+  ../DataStr/Malloc.h ../Numeric/EigSolve.h
 Eigenvalues.o: Eigenvalues.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Eigenvalues.h ../Common/Context.h ../DataStr/Malloc.h \
-  ../Numeric/Numeric.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h Eigenvalues.h ../Common/Context.h \
+  ../DataStr/Malloc.h
 Octree.o: Octree.cpp Octree.h OctreeInternals.h
 OctreeInternals.o: OctreeInternals.cpp ../Common/Message.h \
   OctreeInternals.h
 OctreePost.o: OctreePost.cpp Octree.h OctreeInternals.h OctreePost.h \
   ../DataStr/List.h ../Common/Views.h ../Common/ColorTable.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Numeric/Numeric.h ../Common/Message.h ShapeFunctions.h
+  ../Common/Message.h ShapeFunctions.h
 StreamLines.o: StreamLines.cpp OctreePost.h Octree.h OctreeInternals.h \
   StreamLines.h Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h \
   ../Mesh/Mesh.h ../DataStr/Tree.h ../DataStr/avl.h ../Mesh/Vertex.h \
@@ -180,7 +180,7 @@ StreamLines.o: StreamLines.cpp OctreePost.h Octree.h OctreeInternals.h \
 CutGrid.o: CutGrid.cpp OctreePost.h Octree.h OctreeInternals.h CutGrid.h \
   Plugin.h ../Common/Options.h ../Common/Message.h ../Common/Views.h \
   ../Common/ColorTable.h ../DataStr/List.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Context.h \
   ../Common/GmshUI.h ../Graphics/Draw.h ../Mesh/Mesh.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
@@ -191,13 +191,13 @@ CutGrid.o: CutGrid.cpp OctreePost.h Octree.h OctreeInternals.h CutGrid.h \
 Transform.o: Transform.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Transform.h ../Common/Context.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h Transform.h ../Common/Context.h
 Triangulate.o: Triangulate.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   Plugin.h ../Common/Options.h ../Common/Views.h ../Common/ColorTable.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   Triangulate.h ../Common/Context.h ../Geo/Geo.h ../Mesh/Mesh.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
@@ -210,77 +210,77 @@ Triangulate.o: Triangulate.cpp ../Common/Gmsh.h ../Common/Message.h \
 SphericalRaise.o: SphericalRaise.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  SphericalRaise.h ../Common/Context.h ../Numeric/Numeric.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h SphericalRaise.h ../Common/Context.h
 DisplacementRaise.o: DisplacementRaise.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  DisplacementRaise.h ../Common/Context.h ../Numeric/Numeric.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h DisplacementRaise.h ../Common/Context.h
 StructuralSolver.o: StructuralSolver.cpp StructuralSolver.h ../Geo/Geo.h \
   ../DataStr/List.h ../Mesh/Mesh.h ../DataStr/Tree.h ../DataStr/avl.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h \
   ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
-  ../Common/SmoothNormals.h ../Mesh/Metric.h ../Mesh/Vertex.h \
-  ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h Plugin.h \
-  ../Common/Options.h ../Common/Message.h ../Common/Views.h \
+  ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
+  ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
+  Plugin.h ../Common/Options.h ../Common/Message.h ../Common/Views.h \
   ../Common/ColorTable.h ../Common/VertexArray.h \
   ../Common/SmoothNormals.h ../Common/GmshMatrix.h \
   ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/GmshUI.h \
   ../Common/Context.h ../DataStr/Tools.h ../DataStr/List.h \
   ../DataStr/Tree.h ../Graphics/Draw.h ../Mesh/Utils.h ../Mesh/Vertex.h \
-  ../Mesh/Mesh.h ../Numeric/Numeric.h ../Fltk/Shortcut_Window.h
+  ../Mesh/Mesh.h ../Fltk/Shortcut_Window.h
 Skin.o: Skin.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   Skin.h ../DataStr/Tree.h ../DataStr/avl.h ../Common/Context.h \
   ../DataStr/Malloc.h
 Extract.o: Extract.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
   Extract.h ../Common/Context.h ../DataStr/Malloc.h
 DecomposeInSimplex.o: DecomposeInSimplex.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  DecomposeInSimplex.h ../DataStr/Tree.h ../DataStr/avl.h \
-  ../Common/Context.h ../DataStr/Malloc.h ../Numeric/Numeric.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h DecomposeInSimplex.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../Common/Context.h ../DataStr/Malloc.h
 Evaluate.o: Evaluate.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Evaluate.h OctreePost.h Octree.h OctreeInternals.h ../Common/Context.h \
-  ../Numeric/Numeric.h
+  Evaluate.h OctreePost.h Octree.h OctreeInternals.h ../Common/Context.h
 Integrate.o: Integrate.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Integrate.h ../Common/Context.h ../Numeric/Numeric.h ShapeFunctions.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h Integrate.h ../Common/Context.h ShapeFunctions.h
 Gradient.o: Gradient.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Gradient.h ../Common/Context.h ../Numeric/Numeric.h ShapeFunctions.h
+  Gradient.h ../Common/Context.h ShapeFunctions.h
 Curl.o: Curl.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Curl.h ../Common/Context.h ../Numeric/Numeric.h ShapeFunctions.h
+  Curl.h ../Common/Context.h ShapeFunctions.h
 Divergence.o: Divergence.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Divergence.h ../Common/Context.h ../Numeric/Numeric.h ShapeFunctions.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h Divergence.h ../Common/Context.h \
+  ShapeFunctions.h
 Annotate.o: Annotate.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Annotate.h ../Common/Context.h ../Numeric/Numeric.h ../Common/GmshUI.h \
-  ../Fltk/GUI.h ../Fltk/Opengl_Window.h ../Mesh/Mesh.h ../DataStr/Tree.h \
+  Annotate.h ../Common/Context.h ../Common/GmshUI.h ../Fltk/GUI.h \
+  ../Fltk/Opengl_Window.h ../Mesh/Mesh.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
   ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
@@ -289,28 +289,28 @@ Annotate.o: Annotate.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Fltk/Colorbar_Window.h ../Graphics/Draw.h
 Remove.o: Remove.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
   ../Common/Views.h ../Common/ColorTable.h ../DataStr/List.h \
-  ../Common/VertexArray.h ../Common/SmoothNormals.h \
+  ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
   ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  Remove.h ../Common/Context.h ../Numeric/Numeric.h
+  Remove.h ../Common/Context.h
 Probe.o: Probe.cpp Probe.h Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h \
-  ../Mesh/Mesh.h ../DataStr/Tree.h ../DataStr/avl.h ../Mesh/Vertex.h \
-  ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h \
-  ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h \
-  ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h ../Common/Context.h ../Common/GmshUI.h \
+  ../Graphics/Draw.h ../Mesh/Mesh.h ../DataStr/Tree.h ../DataStr/avl.h \
+  ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
+  ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h \
+  ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
   ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Mesh/Vertex.h \
   ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h OctreePost.h Octree.h \
   OctreeInternals.h
 HarmonicToTime.o: HarmonicToTime.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  HarmonicToTime.h ../Common/Context.h ../Numeric/Numeric.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h HarmonicToTime.h ../Common/Context.h
 ModulusPhase.o: ModulusPhase.cpp Plugin.h ../Common/Options.h \
   ../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
   ../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
-  ../Common/GmshMatrix.h ../Common/AdaptiveViews.h ../Common/GmshMatrix.h \
-  ModulusPhase.h ../Common/Context.h ../Numeric/Numeric.h
+  ../Numeric/Numeric.h ../Common/GmshMatrix.h ../Common/AdaptiveViews.h \
+  ../Common/GmshMatrix.h ModulusPhase.h ../Common/Context.h
diff --git a/doc/VERSIONS b/doc/VERSIONS
index 56bf9cbc23e77e70411b61cac0893731ba07171d..36e95de79e3487a3c2f0d9304e09f69c6c5d3e04 100644
--- a/doc/VERSIONS
+++ b/doc/VERSIONS
@@ -1,10 +1,10 @@
-$Id: VERSIONS,v 1.350 2006-01-06 00:34:34 geuzaine Exp $
+$Id: VERSIONS,v 1.351 2006-01-14 16:24:55 geuzaine Exp $
 
 New since 1.61: new option to draw color gradients in the background;
 enhanced perspective projection mode; new "lasso" selection mode (same
 as "lasso" zoom, but in selection mode); new "invert selection" button
 in the visibility browser; new snapping grid when adding points in the
-GUI; various small bug fixes and enhancements.
+GUI; nicer normal smoothing; various small bug fixes and enhancements.
 
 New in 1.61: added support for second order (curved) elements in
 post-processor; new version (1.4) of post-processing file formats; new