From: Anthony Geay Date: Thu, 6 Apr 2017 22:24:34 +0000 (+0200) Subject: OK on HEXA20 with 27 gps X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c65290373e4873432d0ba4f827ff5fa1b1edc1c5;p=tools%2Fmedcoupling.git OK on HEXA20 with 27 gps --- diff --git a/src/MEDCoupling/MEDCouplingVoronoi.cxx b/src/MEDCoupling/MEDCouplingVoronoi.cxx index 40d6b1215..515fbc445 100644 --- a/src/MEDCoupling/MEDCouplingVoronoi.cxx +++ b/src/MEDCoupling/MEDCouplingVoronoi.cxx @@ -150,6 +150,40 @@ MCAuto MergeVorCells(const std::vector< MCAuto SimplifyPolygon(const MEDCouplingUMesh *m, double eps) +{ + if(m->getNumberOfCells()!=1) + throw INTERP_KERNEL::Exception("SimplifyPolygon : internal error !"); + const int *conn(m->getNodalConnectivity()->begin()),*conni(m->getNodalConnectivityIndex()->begin()); + int nbPtsInPolygon(conni[1]-conni[0]-1); + const double *coo(m->getCoords()->begin()); + std::vector resConn; + for(int i=0;ieps) + resConn.push_back(current); + } + MCAuto ret(MEDCouplingUMesh::New("",2)); + ret->setCoords(m->getCoords()); + ret->allocateCells(); + ret->insertNextCell(INTERP_KERNEL::NORM_POLYGON,resConn.size(),&resConn[0]); + return ret; +} + MCAuto MergeVorCells3D(const std::vector< MCAuto >& vcs, double eps) { std::size_t sz(vcs.size()); @@ -205,6 +239,7 @@ MCAuto MergeVorCells3D(const std::vector< MCAutogetNodalConnectivity()->begin()),*ciPtr(tmp2->getNodalConnectivityIndex()->begin()); conn.insert(conn.end(),cPtr+1,cPtr+ciPtr[1]); }