visualization of clipping plane for HEX7

This commit is contained in:
Joachim Schoeberl 2023-09-27 12:20:38 +02:00
parent 04ad6239d2
commit 7d409e6ec4
2 changed files with 10 additions and 2 deletions

View File

@ -2092,7 +2092,8 @@ namespace netgen
{ {
T y = p(1); T y = p(1);
T z = p(2); T z = p(2);
T den = (1-y)*(1-z); // T den = (1-y)*(1-z);
T den = (1-y*z);
den += T(1e-12); den += T(1e-12);
T x = p(0) / den; T x = p(0) / den;

View File

@ -4008,7 +4008,7 @@ namespace netgen
if(vispar.donotclipdomain > 0 && vispar.donotclipdomain == (*mesh)[ei].GetIndex()) continue; if(vispar.donotclipdomain > 0 && vispar.donotclipdomain == (*mesh)[ei].GetIndex()) continue;
ELEMENT_TYPE type = (*mesh)[ei].GetType(); ELEMENT_TYPE type = (*mesh)[ei].GetType();
if (type == HEX || type == PRISM || type == TET || type == TET10 || type == PYRAMID || type == PYRAMID13 || type == PRISM15 || type == HEX20) if (type == HEX || type == PRISM || type == TET || type == TET10 || type == PYRAMID || type == PYRAMID13 || type == PRISM15 || type == HEX20 || type == HEX7)
{ {
int ii = 0; int ii = 0;
int cnt_valid = 0; int cnt_valid = 0;
@ -4087,6 +4087,13 @@ namespace netgen
double(iz)/n); double(iz)/n);
if (iz == n) ploc = Point<3> (0,0,1-1e-8); if (iz == n) ploc = Point<3> (0,0,1-1e-8);
break; break;
case HEX7:
ploc = Point<3> (double(ix) / n * (1-double(iz)/n*double(iy)/n),
double(iy) / n,
double(iz)/n);
if (iz == n && iy==n) ploc = Point<3> (0,1-1e-8,1-1e-8);
break;
default: default:
cerr << "clip plane trigs not implemented" << endl; cerr << "clip plane trigs not implemented" << endl;
ploc = Point<3> (0,0,0); ploc = Point<3> (0,0,0);