diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp index cca7ca04992479359bd151d86fcd12d266578881..491e8773427035ae5189aee59cbd15d3401c77b5 100644 --- a/Geo/GModelIO_Mesh.cpp +++ b/Geo/GModelIO_Mesh.cpp @@ -572,7 +572,8 @@ int GModel::writeMSH(const std::string &name, double version, bool binary, // get the number of vertices and index the vertices in a continuous // sequence - int numVertices = indexMeshVertices(saveAll); + bool renumber = true; // FIXME + int numVertices = renumber ? indexMeshVertices(saveAll) : getNumMeshVertices(); // binary format exists only in version 2 if(version > 1 || binary) diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 8766d3ceedaa792b9d08c7b1a9251191f6373424..79142edf79e281b76fe6be3ebd632c4e6eb31669 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -534,6 +534,14 @@ Curve *Create_Curve(int Num, int Typ, int Order, List_T *Liste, pC->k = NULL; if(Liste) { + if(Typ == MSH_SEGM_LINE && List_Nbr(Liste) == 2){ + int iPnt0, iPnt1; + List_Read(Liste, 0, &iPnt0); + List_Read(Liste, 1, &iPnt1); + if(iPnt0 == iPnt1) + Msg::Error("Zero-length straight line from point %d to point %d", + iPnt0, iPnt1); + } pC->Control_Points = List_Create(List_Nbr(Liste), 1, sizeof(Vertex *)); for(int j = 0; j < List_Nbr(Liste); j++) { int iPnt;