[vtkusers] Unstructured grid visualization problem......please help

Mathieu Malaterre mathieu.malaterre at kitware.com
Thu Mar 18 15:35:27 EST 2004


Nikhil,

	What type of file are you reading. I strongly suggest you use an 
already existing file reader to achieve this.

	I look at your file, and your tetras do not respect the right hand 
rule. Please see doc for more info:

http://www.vtk.org/doc/nightly/html/classvtkTetra.html

HTH,
Mathieu

nikhil butala wrote:
> 
> 
> Note: forwarded message attached.
> 
> Do you Yahoo!?
> *Yahoo! Mail* <http://us.rd.yahoo.com/mailtag_us/*http://mail.yahoo.com> 
> - More reliable, more storage, less spam
> 
> ------------------------------------------------------------------------
> 
> Subject:
> unstructured grid visualization problem
> From:
> nikhil butala <nvbutala at yahoo.com>
> Date:
> Wed, 17 Mar 2004 15:11:17 -0800 (PST)
> To:
> vtkusers at vtk.org
> 
> 
> 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* <http://us.rd.yahoo.com/mailtag_us/*http://mail.yahoo.com> 
> - More reliable, more storage, less spam
> 






More information about the vtkusers mailing list