From 1db7ba531c75da93f586fa8a86965daf12553b13 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 13 Aug 2008 00:53:47 +0000 Subject: [PATCH] try fix for occ constraints --- Geo/GModelIO_OCC.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp index 07b27a0967..b2afd05c63 100644 --- a/Geo/GModelIO_OCC.cpp +++ b/Geo/GModelIO_OCC.cpp @@ -599,16 +599,17 @@ static void applyOCCMeshConstraints(GModel *m, const void *constraints) // set the mesh as immutable ge->meshAttributes.Method == MESH_NONE; // set the correct tags on the boundary vertices - int numbeg = nodeNum.Value(1); - int numend = nodeNum.Value(n); + bool invert = (nodePar.Value(1) > nodePar.Value(n)); + int numbeg = nodeNum.Value(invert ? n : 1); + int numend = nodeNum.Value(invert ? 1 : n); Msg::Debug("Applying mesh contraints on edge %d: beg=%d end=%d", ge->tag(), numbeg, numend); ge->getBeginVertex()->mesh_vertices[0]->setNum(numbeg); ge->getEndVertex()->mesh_vertices[0]->setNum(numend); // set the mesh on the edge for(int i = 2; i < n; i++){ - int num = nodeNum.Value(i); - double u = nodePar.Value(i); + int num = nodeNum.Value(invert ? n - i + 1 : i); + double u = nodePar.Value(invert ? n - i + 1 : i); GPoint p = ge->point(u); Msg::Debug("... adding vertex on edge %d: num=%d u=%g xyz=(%g,%g,%g)", ge->tag(), num, u, p.x(), p.y(), p.z()); -- GitLab