[vtkusers] unstructured grid visualization problem

nikhil butala nvbutala at yahoo.com
Wed Mar 17 18:11:17 EST 2004


Dear vtk-users,
 
                   I am a newbie with vtk and am trying to read 3D tetrahedral mesh from FEA softwares into VTK. 
I converted the FEA mesh into vtk format. I am first trying to read simple mesh of a cube. The input vtk file is as follows:

# vtk DataFile Version 2.0

Trial

ASCII 



DATASET UNSTRUCTURED_GRID 

POINTS 10 float 

-1 1 2 

-1 1 0 

-1 -1 2 

-1 -1 0 

1 -1 2 

1 -1 0 

1 1 2 

1 1 0 

0.400316 0.171597 0.759397 

-0.099509 -0.159484 1.126592 

CELLS 16 80

4 7 1 10 2 

4 9 8 2 6 

4 10 1 5 3 

4 10 7 5 1 

4 7 2 10 9 

4 10 9 5 7 

4 6 9 10 2 

4 8 6 9 5 

4 8 5 9 7 

4 8 7 9 2 

4 6 5 3 10 

4 6 2 10 4 

4 10 4 2 1 

4 4 1 10 3 

4 6 10 3 4 

4 6 5 10 9 

CELL_TYPES 16 

10

10

10

10

10

10

10

10

10

10

10

10

10

10

10

10

 
I am reading the vtk file using the following code:
 
package require vtk

vtkUnstructuredGridReader reader
    reader SetFileName "$DataSource/outputfile2.vtk"

vtkDataSetMapper mapper
    mapper SetInput [reader GetOutput]
   
vtkActor actor
   actor SetMapper mapper
    [actor GetProperty] SetColor .2 .2 .2
    [actor GetProperty] SetRepresentationToWireframe
vtkExtractUnstructuredGrid extractGrid
    extractGrid SetInput [reader GetOutput]
  
    
# graphics stuff
vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin
# Add the actors to the renderer, set the background and size
#
ren1 AddActor actor
ren1 SetBackground 1 1 1
[ren1 GetActiveCamera] Azimuth 60
[ren1 GetActiveCamera] Roll -90
[ren1 GetActiveCamera] Dolly 2
ren1 ResetCameraClippingRange
renWin SetSize 500 375
iren Initialize
# prevent the tk window from showing up then start the event loop
wm withdraw .
 
The output visualization of the mesh is not as expected. I are not able to see the outer bounds of the cube. Can anyone help me and tell why this problem is arising???
 
thanking you,
regards,
Nikhil Butala

 

Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040317/8ab48004/attachment.htm>


More information about the vtkusers mailing list