From f2016718cdc8313e751488ce3a91edc65d84bc78 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 12 Aug 2001 00:15:04 +0000 Subject: [PATCH] *** empty log message *** --- Mesh/3D_Extrude.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Mesh/3D_Extrude.cpp b/Mesh/3D_Extrude.cpp index dbdcb503f8..d82e7927b9 100644 --- a/Mesh/3D_Extrude.cpp +++ b/Mesh/3D_Extrude.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Extrude.cpp,v 1.22 2001-08-11 23:53:35 geuzaine Exp $ +// $Id: 3D_Extrude.cpp,v 1.23 2001-08-12 00:15:04 geuzaine Exp $ #include "Gmsh.h" #include "Numeric.h" @@ -463,20 +463,18 @@ void copy_mesh (Curve * from, Curve * to){ if (Vertex_Bound && (vexist = (Vertex **) Tree_PQuery (Vertex_Bound, &to->beg))){ (*vexist)->u = to->ubeg; - Tree_Insert (THEM->Vertices, vexist); - if ((*vexist)->ListCurves) - List_Add ((*vexist)->ListCurves, &to); - List_Add (to->Vertices, vexist); + vi = *vexist; } else{ vi = Create_Vertex (++CurrentNodeNumber, to->beg->Pos.X, to->beg->Pos.Y, to->beg->Pos.Z, to->beg->lc, to->ubeg); Tree_Insert (THEM->Vertices, &vi); Tree_Insert (Vertex_Bound, &vi); - vi->ListCurves = List_Create (1, 1, sizeof (Curve *)); - List_Add (vi->ListCurves, &to); - List_Add (to->Vertices, &vi); } + if(!vi->ListCurves) + vi->ListCurves = List_Create (1, 1, sizeof (Curve *)); + List_Add (vi->ListCurves, &to); + List_Add (to->Vertices, &vi); for (int i = 1; i < List_Nbr (list)-1; i++){ List_Read (list, i, &v); @@ -498,22 +496,22 @@ void copy_mesh (Curve * from, Curve * to){ List_Add (to->Vertices, &vi); } + if (Vertex_Bound && (vexist = (Vertex **) Tree_PQuery (Vertex_Bound, &to->end))){ (*vexist)->u = to->uend; - Tree_Insert (THEM->Vertices, vexist); - if ((*vexist)->ListCurves) - List_Add ((*vexist)->ListCurves, &to); - List_Add (to->Vertices, vexist); + vi = *vexist; } else{ vi = Create_Vertex (++CurrentNodeNumber, to->end->Pos.X, to->end->Pos.Y, to->end->Pos.Z, to->end->lc, to->uend); Tree_Insert (THEM->Vertices, &vi); Tree_Insert (Vertex_Bound, &vi); - vi->ListCurves = List_Create (1, 1, sizeof (Curve *)); - List_Add (vi->ListCurves, &to); - List_Add (to->Vertices, &vi); } + if(!vi->ListCurves) + vi->ListCurves = List_Create (1, 1, sizeof (Curve *)); + List_Add (vi->ListCurves, &to); + List_Add (to->Vertices, &vi); + } -- GitLab