wholeFilter SetExtent 0 [expr $n0-1] 0 [expr $n0-1] 0 [expr$n0-1]
This will force it to create the planes of the geometry for the mapper (as I understand it).
Good luck,
Jim
drew@pixar.com wrote:
I've been trying to do something simple but don't seem to be
having much luck. I want to display the surface of a StructuredGrid
as a solid (or even a wireframe). When I execute the code below
all I get is a 5x5x5 grid of points. Anyone have any idea what
I'm doing wrong?Drew
drew@pixar.com#!/usr/local/bin/vtk
catch {load vtktcl}
# create a window to render into
vtkRenderWindow renWin
vtkRenderer ren1
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWinset n0 5
set n0m1 [expr $n0 - 1]
vtkFloatPoints points
for {set x 0} {$x < $n0} {incr x} {
for {set y 0} {$y < $n0} {incr y} {
for {set z 0} {$z < $n0} {incr z} {
points InsertNextPoint [expr (1.0/$n0m1) * $x] \
[expr (1.0/$n0m1) * $y] \
[expr (1.0/$n0m1) * $z]
}
}
}#
# The whole enchilada
vtkStructuredGrid grid
grid SetDimensions $n0 $n0 $n0
grid SetPoints pointsvtkStructuredGridGeometryFilter wholeFilter
wholeFilter SetInput gridvtkDataSetMapper wholeMapper
wholeMapper SetInput [wholeFilter GetOutput]vtkActor theWhole
theWhole SetMapper wholeMapper
[theWhole GetProperty] SetRepresentationToSurfaceren1 AddActor theWhole
# Render an image; since no lights/cameras specified, created automatically
renWin Render;# Begin mouse interaction
iren Start;-----------------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo@gsao.med.ge.com>. For help, send message body containing
"info vtkusers" to the same address. Live long and prosper.
-----------------------------------------------------------------------------
-- James C Moore, Vice President URS Technologies, LLC ph: 614-540-8041, jmoore@qn.net