[vtk-developers] New nonlinear celltypes
Soeren Gebbert
soeren.gebbert at inpro.de
Mon Jan 9 11:17:14 EST 2006
Dear developers,
sorry for the delay, i was on vacation for a while.
Thank you for your help!
Im still developing the nonlinear cells. Tcl test running well.
I have extendet the contouring, clipping and edge-extraction quadratic
cell tcl tests.
The tcl errors i reported bevor are no erros, it was all my fault.
But i still runing into a problem im not able to fix. I have implemented
contouring and
clipping of the new cells. The methods for that are quite similar. The
contouring
is working very well, but the clipping produces strange output. I have
attached some pictures of
the TriQuadraticHexahedron, to show you the point.
I have defined 8 linear hexes and contour and clip them. Contouring dont
have any problems with that.
But "clipping by value" produce wired output.
The result changes if i change the index of linear hexes. I tried the exact
(internal) enumeration of vtkQuadraticHexahedron, but the result is
still looking strange.
I tried some permutation, but never got a acceptable result.
Some pictures of the triquadratic Hexahedron:
Normal view with scalar labeling
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexahedron.png
Edge View with scalar labeling
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexahedron-edges.png
Contour (value 0.5) view with scalar labeling
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexahedron-contour.png
Clipping (value 0.5) view with scalar labeling --< strange clipping
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexahedron-clip-value.png
Tessellation view with scalar labeling
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexahedron-tessellated.png
Is there a magic rule in enumeration of the linear hexes/Wedges to get
this to work? I have these Problems
with 3 new Celltypes:
vtkTriQuadraticHexahedron
vtkBiQuadraticHexahedron
vtkBiquaraticQuadraticWedge
This is a code example from vtkTriQuadraticHexahedron:
//----------------------------------------------------------------------------
void
vtkTriQuadraticHexahedron::Contour (double value,
vtkDataArray * cellScalars,
vtkPointLocator * locator,
vtkCellArray * verts,
vtkCellArray * lines,
vtkCellArray * polys,
vtkPointData * inPd,
vtkPointData * outPd,
vtkCellData * inCd, vtkIdType cellId, vtkCellData *
outCd)
{
int i, j;
//contour each linear quad separately
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)
{
this->Hex->Points->SetPoint (j, this->Points->GetPoint
(LinearHexs[i][j]));
this->Hex->PointIds->SetId (j, LinearHexs[i][j]);
this->Scalars->SetValue (j, cellScalars->GetTuple1
(LinearHexs[i][j]));
}
this->Hex->Contour (value, this->Scalars, locator, verts, lines,
polys, inPd, outPd, inCd, cellId, outCd);
}
}
//----------------------------------------------------------------------------
// Clip this triquadratic hex using scalar value provided. Like contouring,
// except that it cuts the hex to produce tetrahedra.
void
vtkTriQuadraticHexahedron::Clip (double value,
vtkDataArray * cellScalars,
vtkPointLocator * locator,
vtkCellArray * tets,
vtkPointData * inPd,
vtkPointData * outPd,
vtkCellData * inCd, vtkIdType cellId, vtkCellData *
outCd, int insideOut)
{
int i, j;
//clip each linear quad separately
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)
{
this->Hex->Points->SetPoint (j, this->Points->GetPoint
(LinearHexs[i][j]));
this->Hex->PointIds->SetId (j, LinearHexs[i][j]);
this->Scalars->SetValue (j, cellScalars->GetTuple1
(LinearHexs[i][j]));
}
this->Hex->Clip (value, this->Scalars, locator, tets, inPd, outPd,
inCd, cellId, outCd, insideOut);
}
}
Any help is welcome, i stuck on this for 3 days now.
After i resolved this (hopefully) last problem, i will take care of the
vtkEnSightWriter.
Thanks and best regards
Soeren Gebbert
More information about the vtk-developers
mailing list