plotting hex7

This commit is contained in:
Joachim Schoeberl 2023-09-29 09:30:19 +02:00
parent 7d409e6ec4
commit bbb91b704d
2 changed files with 13 additions and 6 deletions

View File

@ -2673,6 +2673,8 @@ namespace netgen
}
}
static float hex7col[] = { 1.0f, 0.65f, 0.0f, 1.0f };
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, hex7col);
for (ElementIndex ei = 0; ei < mesh->GetNE(); ei++)
{

View File

@ -4059,6 +4059,10 @@ namespace netgen
for (int iy = 0; iy <= n; iy++)
for (int iz = 0; iz <= n; iz++, ii++)
{
double x = double(ix)/n;
double y = double(iy)/n;
double z = double(iz)/n;
Point<3> ploc;
compress[ii] = ii;
@ -4088,12 +4092,13 @@ namespace netgen
if (iz == n) ploc = Point<3> (0,0,1-1e-8);
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);
{
if (iz == n && iy==n)
{ y -= 1e-7, z -= 1e-7; }
ploc = Point<3> (x * (1-y*z), y, z);
// if (iz == n && iy==n) ploc = Point<3> (0,1-1e-8,1-1e-8);
break;
}
default:
cerr << "clip plane trigs not implemented" << endl;
ploc = Point<3> (0,0,0);