From 10d80d21b65c6a1b023cfbd8a6a94bc5b68cc81b Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 18 Jun 2014 20:28:10 +0000 Subject: [PATCH] recompule mean plane in Geo import (if the surface has changed - fixes Debian Bug#751464) --- Geo/GModelIO_GEO.cpp | 17 +++++++---------- Geo/gmshEdge.cpp | 2 -- Geo/gmshFace.cpp | 1 - 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Geo/GModelIO_GEO.cpp b/Geo/GModelIO_GEO.cpp index 0fec60f139..59d761acc4 100644 --- a/Geo/GModelIO_GEO.cpp +++ b/Geo/GModelIO_GEO.cpp @@ -164,7 +164,6 @@ int GModel::importGEOInternals() add(e); } - if(!c->Visible) e->setVisibility(0); if(c->Color.type) e->setColor(c->Color.mesh); if(c->degenerated) { @@ -195,7 +194,6 @@ int GModel::importGEOInternals() } } int param = CTX::instance()->mesh.remeshParam; - GFaceCompound::typeOfCompound typ = GFaceCompound::HARMONIC_CIRCLE; if (param == 1) typ = GFaceCompound::CONFORMAL_SPECTRAL; if (param == 2) typ = GFaceCompound::RADIAL_BASIS; @@ -204,18 +202,16 @@ int GModel::importGEOInternals() if (param == 5) typ = GFaceCompound::CONVEX_PLANE; if (param == 6) typ = GFaceCompound::HARMONIC_SQUARE; if (param == 7) typ = GFaceCompound::CONFORMAL_FE; - int algo = CTX::instance()->mesh.remeshAlgo; f = new GFaceCompound(this, s->Num, comp, b[0], b[1], b[2], b[3], typ, algo); - f->meshAttributes.recombine = s->Recombine; f->meshAttributes.recombineAngle = s->RecombineAngle; f->meshAttributes.method = s->Method; f->meshAttributes.extrude = s->Extrude; - // transfinite import Added by Trevor Strickler. This helps when experimenting - // to create compounds from transfinite surfs. Not having it does not break - // anything Gmsh *officially* does right now, but maybe it was left out by mistake??? and could - // cause problems later? + // transfinite import Added by Trevor Strickler. This helps when + // experimenting to create compounds from transfinite surfs. Not having + // it does not break anything Gmsh *officially* does right now, but + // maybe it was left out by mistake??? and could cause problems later? f->meshAttributes.transfiniteArrangement = s->Recombine_Dir; f->meshAttributes.corners.clear(); for(int i = 0; i < List_Nbr(s->TrsfPoints); i++){ @@ -227,7 +223,6 @@ int GModel::importGEOInternals() else Msg::Error("Unknown vertex %d in transfinite attributes", corn->Num); } - add(f); if(s->EmbeddedCurves){ for(int i = 0; i < List_Nbr(s->EmbeddedCurves); i++){ @@ -256,8 +251,10 @@ int GModel::importGEOInternals() f = new gmshFace(this, s); add(f); } - else + else{ + if(s->Typ == MSH_SURF_PLAN) f->computeMeanPlane(); // recompute in case geom has changed f->resetMeshAttributes(); + } if(!s->Visible) f->setVisibility(0); if(s->Color.type) f->setColor(s->Color.mesh); } diff --git a/Geo/gmshEdge.cpp b/Geo/gmshEdge.cpp index abfe16ea78..4d99633c79 100644 --- a/Geo/gmshEdge.cpp +++ b/Geo/gmshEdge.cpp @@ -46,7 +46,6 @@ Range<double> gmshEdge::parBounds(int i) const GPoint gmshEdge::point(double par) const { - Vertex a = InterpolateCurve(c, par, 0); return GPoint(a.Pos.X, a.Pos.Y, a.Pos.Z, this, par); } @@ -59,7 +58,6 @@ SVector3 gmshEdge::firstDer(double par) const SVector3 gmshEdge::secondDer(double par) const { - Vertex a = InterpolateCurve(c, par, 2); return SVector3(a.Pos.X, a.Pos.Y, a.Pos.Z); } diff --git a/Geo/gmshFace.cpp b/Geo/gmshFace.cpp index a5f4db2174..39fa658790 100644 --- a/Geo/gmshFace.cpp +++ b/Geo/gmshFace.cpp @@ -437,5 +437,4 @@ bool gmshFace::buildSTLTriangulation(bool force) } va_geom_triangles->finalize(); return true; - } -- GitLab