diff --git a/Geo/GeoUtils.cpp b/Geo/GeoUtils.cpp index 8a0042c4f74319ba83578c161e20fc0370e6d385..002941e7d241f42418b3106b86b4a5d21f48ec32 100644 --- a/Geo/GeoUtils.cpp +++ b/Geo/GeoUtils.cpp @@ -1,4 +1,4 @@ -// $Id: GeoUtils.cpp,v 1.8 2006-01-06 00:34:24 geuzaine Exp $ +// $Id: GeoUtils.cpp,v 1.9 2006-03-29 01:45:13 geuzaine Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -41,8 +41,22 @@ void sortEdgesInLoop(int num, List_T *edges) for(int i = 0; i < nbEdges; i++) { int j; List_Read(edges, i, &j); - if((c = FindCurve(j, THEM))) + if((c = FindCurve(j, THEM))){ List_Add(temp, &c); + // FIXME: if the loop is composed of a single curve and if the + // curve is already discretized, we check if the first vertex + // and the last vertex are the same. If not, we assume that they + // should, and we add the missing end vertex. (This situation + // can arise due to a limitation in Read_Mesh, where we do a + // List_Insert() to add the vertices in discrete curves--so that + // we never get the last vertex for single, closed curves.) + if(nbEdges == 1 && List_Nbr(c->Vertices) && c->Typ == MSH_SEGM_DISCRETE){ + Vertex *first = *(Vertex**)List_Pointer(c->Vertices, 0); + Vertex *last = *(Vertex**)List_Pointer(c->Vertices, List_Nbr(c->Vertices) - 1); + if(first != last) + List_Add(c->Vertices, &first); + } + } else Msg(GERROR, "Unknown curve %d in line loop %d", j, num); } diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp index c26fc82d19f136ea6ec3b9a2d7b3a6e2a961a3f5..c298e2869171e69de34d8836431f71e783405c91 100644 --- a/Mesh/Read_Mesh.cpp +++ b/Mesh/Read_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Read_Mesh.cpp,v 1.101 2006-03-24 21:37:14 geuzaine Exp $ +// $Id: Read_Mesh.cpp,v 1.102 2006-03-29 01:45:13 geuzaine Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -432,7 +432,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp) else{ // this can be quite slow if there are many nodes on the curve... for(i = 0; i < Nbr_Nodes; i++) - List_Insert(c->Vertices, &vertsp[i], fcmp_int); + List_Insert(c->Vertices, &vertsp[i], compareVertex); } break; case TRI1: diff --git a/doc/TODO b/doc/TODO index fae8dd807f5fb38f60abcd475053e4a337ca106b..891e85505b73c5491339c45ea08c9df222657d5b 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,4 +1,4 @@ -$Id: TODO,v 1.4 2006-03-25 14:34:27 geuzaine Exp $ +$Id: TODO,v 1.5 2006-03-29 01:45:13 geuzaine Exp $ ******************************************************************** @@ -6,13 +6,6 @@ add support for off-screen rendering using OSMesa ******************************************************************** -if we try to mesh a surface from a single discrete curve mesh read -from a .msh file we get a "non contour" error in Mesh_2D (since we -List_Insert the vertices in c->Vertices, thus never having -last==first) - -******************************************************************** - add a min_recursion option for adaptve views (to force at least a certain number of subdivisions) diff --git a/doc/gmsh.html b/doc/gmsh.html index 7e5695dbc56c716f9cd3ca3d90200d7eb171d448..c9a18dd3ddd6b885cbc73f518b6ea7eb6ebccff8 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -232,7 +232,7 @@ thumbnail"></a> (P. Geuzaine). <li>Log-periodic antenna in the demo files: <a href="/gmsh/gallery/antenna.gif">pict1</a>. -<li>Breads: +<li>Braids: <a href="/gmsh/gallery/tresse1.gif">pict1</a>, <a href="/gmsh/gallery/tresse2.gif">pict2</a> (D. Colignon).