Skip to content
Snippets Groups Projects
Commit 10d80d21 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

recompule mean plane in Geo import (if the surface has changed - fixes Debian Bug#751464)

parent 624ab65c
Branches
Tags
No related merge requests found
...@@ -164,7 +164,6 @@ int GModel::importGEOInternals() ...@@ -164,7 +164,6 @@ int GModel::importGEOInternals()
add(e); add(e);
} }
if(!c->Visible) e->setVisibility(0); if(!c->Visible) e->setVisibility(0);
if(c->Color.type) e->setColor(c->Color.mesh); if(c->Color.type) e->setColor(c->Color.mesh);
if(c->degenerated) { if(c->degenerated) {
...@@ -195,7 +194,6 @@ int GModel::importGEOInternals() ...@@ -195,7 +194,6 @@ int GModel::importGEOInternals()
} }
} }
int param = CTX::instance()->mesh.remeshParam; int param = CTX::instance()->mesh.remeshParam;
GFaceCompound::typeOfCompound typ = GFaceCompound::HARMONIC_CIRCLE; GFaceCompound::typeOfCompound typ = GFaceCompound::HARMONIC_CIRCLE;
if (param == 1) typ = GFaceCompound::CONFORMAL_SPECTRAL; if (param == 1) typ = GFaceCompound::CONFORMAL_SPECTRAL;
if (param == 2) typ = GFaceCompound::RADIAL_BASIS; if (param == 2) typ = GFaceCompound::RADIAL_BASIS;
...@@ -204,18 +202,16 @@ int GModel::importGEOInternals() ...@@ -204,18 +202,16 @@ int GModel::importGEOInternals()
if (param == 5) typ = GFaceCompound::CONVEX_PLANE; if (param == 5) typ = GFaceCompound::CONVEX_PLANE;
if (param == 6) typ = GFaceCompound::HARMONIC_SQUARE; if (param == 6) typ = GFaceCompound::HARMONIC_SQUARE;
if (param == 7) typ = GFaceCompound::CONFORMAL_FE; if (param == 7) typ = GFaceCompound::CONFORMAL_FE;
int algo = CTX::instance()->mesh.remeshAlgo; int algo = CTX::instance()->mesh.remeshAlgo;
f = new GFaceCompound(this, s->Num, comp, b[0], b[1], b[2], b[3], typ, algo); f = new GFaceCompound(this, s->Num, comp, b[0], b[1], b[2], b[3], typ, algo);
f->meshAttributes.recombine = s->Recombine; f->meshAttributes.recombine = s->Recombine;
f->meshAttributes.recombineAngle = s->RecombineAngle; f->meshAttributes.recombineAngle = s->RecombineAngle;
f->meshAttributes.method = s->Method; f->meshAttributes.method = s->Method;
f->meshAttributes.extrude = s->Extrude; f->meshAttributes.extrude = s->Extrude;
// transfinite import Added by Trevor Strickler. This helps when experimenting // transfinite import Added by Trevor Strickler. This helps when
// to create compounds from transfinite surfs. Not having it does not break // experimenting to create compounds from transfinite surfs. Not having
// anything Gmsh *officially* does right now, but maybe it was left out by mistake??? and could // it does not break anything Gmsh *officially* does right now, but
// cause problems later? // maybe it was left out by mistake??? and could cause problems later?
f->meshAttributes.transfiniteArrangement = s->Recombine_Dir; f->meshAttributes.transfiniteArrangement = s->Recombine_Dir;
f->meshAttributes.corners.clear(); f->meshAttributes.corners.clear();
for(int i = 0; i < List_Nbr(s->TrsfPoints); i++){ for(int i = 0; i < List_Nbr(s->TrsfPoints); i++){
...@@ -227,7 +223,6 @@ int GModel::importGEOInternals() ...@@ -227,7 +223,6 @@ int GModel::importGEOInternals()
else else
Msg::Error("Unknown vertex %d in transfinite attributes", corn->Num); Msg::Error("Unknown vertex %d in transfinite attributes", corn->Num);
} }
add(f); add(f);
if(s->EmbeddedCurves){ if(s->EmbeddedCurves){
for(int i = 0; i < List_Nbr(s->EmbeddedCurves); i++){ for(int i = 0; i < List_Nbr(s->EmbeddedCurves); i++){
...@@ -256,8 +251,10 @@ int GModel::importGEOInternals() ...@@ -256,8 +251,10 @@ int GModel::importGEOInternals()
f = new gmshFace(this, s); f = new gmshFace(this, s);
add(f); add(f);
} }
else else{
if(s->Typ == MSH_SURF_PLAN) f->computeMeanPlane(); // recompute in case geom has changed
f->resetMeshAttributes(); f->resetMeshAttributes();
}
if(!s->Visible) f->setVisibility(0); if(!s->Visible) f->setVisibility(0);
if(s->Color.type) f->setColor(s->Color.mesh); if(s->Color.type) f->setColor(s->Color.mesh);
} }
......
...@@ -46,7 +46,6 @@ Range<double> gmshEdge::parBounds(int i) const ...@@ -46,7 +46,6 @@ Range<double> gmshEdge::parBounds(int i) const
GPoint gmshEdge::point(double par) const GPoint gmshEdge::point(double par) const
{ {
Vertex a = InterpolateCurve(c, par, 0); Vertex a = InterpolateCurve(c, par, 0);
return GPoint(a.Pos.X, a.Pos.Y, a.Pos.Z, this, par); return GPoint(a.Pos.X, a.Pos.Y, a.Pos.Z, this, par);
} }
...@@ -59,7 +58,6 @@ SVector3 gmshEdge::firstDer(double par) const ...@@ -59,7 +58,6 @@ SVector3 gmshEdge::firstDer(double par) const
SVector3 gmshEdge::secondDer(double par) const SVector3 gmshEdge::secondDer(double par) const
{ {
Vertex a = InterpolateCurve(c, par, 2); Vertex a = InterpolateCurve(c, par, 2);
return SVector3(a.Pos.X, a.Pos.Y, a.Pos.Z); return SVector3(a.Pos.X, a.Pos.Y, a.Pos.Z);
} }
......
...@@ -437,5 +437,4 @@ bool gmshFace::buildSTLTriangulation(bool force) ...@@ -437,5 +437,4 @@ bool gmshFace::buildSTLTriangulation(bool force)
} }
va_geom_triangles->finalize(); va_geom_triangles->finalize();
return true; return true;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment