From c65290373e4873432d0ba4f827ff5fa1b1edc1c5 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 7 Apr 2017 00:24:34 +0200 Subject: [PATCH] OK on HEXA20 with 27 gps --- src/MEDCoupling/MEDCouplingVoronoi.cxx | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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]); } -- 2.39.2