[vtk-developers] New nonlinear celltypes
John Platt
jcplatt at lineone.net
Mon Jan 9 16:33:38 EST 2006
Hi Soeren,
I have just had a quick look at the version of
vtkQuadraticHexahedron::Contour() I am using from 4.4. The call to the
linear Hex contouring
this->Hex->Contour(value,this->Scalars,locator,verts,lines,polys,
this->PointData,outPd,this->CellData,0,outCd);
takes the local PointData and CellData from Subdivide(). Your call
this->Hex->Contour(value,this->Scalars,locator,verts,lines,polys,
inPd, outPd, inCd, cellId, outCd);
passes the dataset point and cell data.
I don't know if this has changed at version 5.
John.
-----Original Message-----
From: Soeren Gebbert [mailto:soeren.gebbert at inpro.de]
Sent: 09 January 2006 16:17
To: vtk-developers at vtk.org
Cc: David C. Thompson; John Platt
Subject: Re: [vtk-developers] New nonlinear celltypes
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/TriQuadraticHexah
edron.png
Edge View with scalar labeling
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexah
edron-edges.png
Contour (value 0.5) view with scalar labeling
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexah
edron-contour.png
Clipping (value 0.5) view with scalar labeling --< strange clipping
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexah
edron-clip-value.png
Tessellation view with scalar labeling
http://www-pool.math.tu-berlin.de/~soeren/VTK/Pictures/TriQuadraticHexah
edron-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