Scaling of bounding box (instead of increasing size in all directions)

This commit is contained in:
Matthias Hochsteger 2021-07-06 14:46:58 +02:00
parent 65c5e2d244
commit a89cf0089a
2 changed files with 9 additions and 2 deletions

View File

@ -406,6 +406,13 @@ namespace netgen
} }
} }
void Scale (double factor)
{
auto center = Center();
pmin = center + factor*(pmin-center);
pmax = center + factor*(pmax-center);
}
void DoArchive(Archive& archive) void DoArchive(Archive& archive)
{ archive & pmin & pmax; } { archive & pmin & pmax; }
}; };

View File

@ -4881,8 +4881,8 @@ namespace netgen
box.Add (points[pi]); box.Add (points[pi]);
auto & el = volelements[ei]; auto & el = volelements[ei];
if(el.IsCurved()) if(el.IsCurved() && curvedelems->IsElementCurved(ei))
box.Increase(1.2*box.Diam()); box.Scale(1.2);
elementsearchtree -> Insert (box, ei+1); elementsearchtree -> Insert (box, ei+1);