<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<b>Bertwim</b>
<p><b>I've just done exactly this in my&nbsp; tcl/tk general purpose display
package using vtk3.2.</b>
<p><b>Steps were as follows :</b>
<p><b>###&nbsp; Define a suitable implicit function to cut unstructured
grid#####</b>
<br><i>vtkCylinder $CC</i>
<br><i>&nbsp; $CC SetCenter&nbsp; 0 0 0</i>
<br><i>&nbsp; $CC SetRadius 100</i><i></i>
<p><i>vtkSphere $CS</i>
<br><i>&nbsp; $CS SetCenter&nbsp; 0 0 0</i>
<br><i>&nbsp; $CS SetRadius 100</i><i></i>
<p><i>vtkPlane $CP</i>
<br><i>&nbsp;&nbsp;&nbsp; $CP&nbsp; SetOrigin 0 0 0</i>
<br><i>&nbsp;&nbsp;&nbsp; $CP SetNormal -1 -1 .5</i>
<br><i>#CN</i>
<p><i>set imp $CC</i>
<br><i>set imp $C</i>P
<p><b>############### Now Clip The Unstuctured Grid Boundary (i.e after
vtkGeometryFilter) ##############</b>
<br><i>vtkClipPolyData $CN</i>
<br><i>&nbsp;&nbsp;&nbsp; $CN&nbsp; SetInput [$boundary GetOutput]</i>
<br><i>&nbsp;&nbsp;&nbsp; $CN&nbsp; SetClipFunction $imp</i>
<br><i>&nbsp;&nbsp;&nbsp; $CN&nbsp; GenerateClipScalarsOff</i>
<br><i>&nbsp;&nbsp;&nbsp; $CN&nbsp; SetValue 0.5</i>
<br><i>$CN Update</i>
<br><b><i>###### Also for in front of implicit function#####</i></b>
<br><i>vtkClipPolyData $Cn</i>
<br><i>&nbsp;&nbsp;&nbsp; $Cn&nbsp; SetInput [$boundary GetOutput]</i>
<br><i>&nbsp;&nbsp;&nbsp; $Cn&nbsp; SetClipFunction $imp</i>
<br><i>&nbsp;&nbsp;&nbsp; $Cn&nbsp; GenerateClipScalarsOff</i>
<br><i>&nbsp;&nbsp;&nbsp; $Cn&nbsp; SetInsideOut 1</i>
<br><i>&nbsp;&nbsp;&nbsp; $Cn&nbsp; SetValue 0.5</i>
<br><i>$Cn Update</i>
<br><b>########## Now Cut The Full Structure to get better cut mesh ##############</b>
<p><i>vtkCutter $CE; #Generate cut lines</i>
<br><i>&nbsp;&nbsp; $CE SetInput [$thresh GetOutput]</i>
<br><i>&nbsp;&nbsp; $CE SetCutFunction $imp</i>
<br><i>&nbsp; $CE GenerateCutScalarsOff</i>
<br><i>&nbsp; $CE SetValue 0 0.5</i><b><i></i></b>
<p><b>######## Now Append cutter mesh&nbsp; to front and back clipped Polys
and map them ############</b>
<br><i>vtkAppendPolyData $AP</i>
<br><i>&nbsp; $AP AddInput [$CN GetOutput]</i>
<br><i>&nbsp; $AP AddInput [$CE GetOutput]</i><i></i>
<p><i>vtkDataSetMapper $CL</i>
<br><i>$CL SetInput [$AP GetOutput]</i>
<br><i>$CL SetLookupTable&nbsp; vTK_LUT($LUT(no))</i>
<br><i>$CL SetScalarRange $LUT($LUT(no),bot)&nbsp; $LUT($LUT(no),top)</i>
<br><i>$CL SetScalarModeToUsePointData</i><i></i>
<p><i>vtkAppendPolyData $Ap</i>
<br><i>&nbsp; $Ap AddInput [$Cn GetOutput]</i>
<br><i>&nbsp; $Ap AddInput [$CE GetOutput]</i>
<br><i>#</i>
<br><i>vtkDataSetMapper $Cl</i>
<br><i>$Cl SetInput [$Ap GetOutput]</i>
<br><i>$Cl SetLookupTable&nbsp; vTK_LUT($LUT(no))</i>
<br><i>$Cl SetScalarRange $LUT($LUT(no),bot)&nbsp; $LUT($LUT(no),top)</i>
<br><i>$Cl SetScalarModeToUsePointData</i>
<br><b>###################Actors For Front and Back###################################</b>
<br><i>vtkActor $CA</i>
<br><i>&nbsp;&nbsp;&nbsp; $CA SetMapper $CL</i>
<br><i>&nbsp;&nbsp;&nbsp; $CA SetProperty property(front)</i>
<br><i>vtkActor $Ca</i>
<br><i>&nbsp;&nbsp;&nbsp; $Ca SetMapper $Cl</i>
<br><i>&nbsp;&nbsp;&nbsp; $Ca SetProperty property(back)</i>
<br><b>##################Finally Render the actors #############################</b>
<br><i>Renderer($widget) AddActor $CA</i>
<br><i>Renderer($widget) AddActor $Ca</i><i></i>
<p><b><i>It Works Well for me with dials in control of the implicit funtion
positioning running under a&nbsp; vtkTkRenderWidget's $widget.</i></b>
<br><b><i></i></b>&nbsp;
<p>Bertwim van Beest wrote:
<blockquote TYPE=CITE>I simply don't understand how to do the following:
<p>I have a certain UnstructuredGrid, with one data value per cell.
<br>,
<br>Bertwim
<p>_______________________________________________</blockquote>
</html>