[vtkusers] Can a VTK file consists of Points only

Hayden Smith s_hayden_28 at yahoo.com
Fri Apr 26 09:45:04 EDT 2013


Hi,
   I have tried the following .vtk data file with the foloowing tcl code. I tried to generate glyphs at each point. But my screen in blank without any output. I have placed the code here. Please help me clarify what's going wrong, is it something with code (tcl file) or the data file?
/******************************************/package require vtk
package require vtkinteraction
 
# Create arc plots
# get the interactor ui
 
vtkCamera camera
# read the bore
v
tkPolyDataReader bore
bore SetFileName "bore.vtk"
vtkMaskPoints ptMask
ptMask SetInputConnection [bore GetOutputPort]
ptMask SetOnRatio 1
>ptMask RandomModeOff
>ptMask SetMaximumNumberOfPoints 10
>ptMask GenerateVerticesOn
>ptMask SingleVertexPerCellOn
vtkArrowSource arrow
arrow SetTipResolution 6 
>arrow SetTipRadius 0.25 
>arrow SetTipLength 0.5
>arrow SetShaftResolution 6 
>arrow SetShaftRadius 0.125
vtkGlyph3D glyph
glyph SetInput [ptMask GetOutput] 
>glyph SetSource [arrow GetOutput] 
>glyph SetVectorModeToUseVector 
>glyph SetColorModeToColorByScalar
>glyph SetScaleModeToDataScalingOff 
>glyph OrientOn 
>glyph SetScaleFactor 0.5
vtkPolyDataMapper mapBore
mapBore SetInputConnection [glyph GetOutputPort]
>mapBore ScalarVisibilityOff
vtkActor boreActor
boreActor SetMapper mapBore
>[boreActor GetProperty] SetColor 0 0 0
# create the arc plots
#
# Create graphics objects
# Create the rendering window renderer and interactive renderer
vtkRenderer ren1
ren1 SetActiveCamera camera
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
# Add the actors to the renderer set the background and size
ren1 AddActor boreActor
ren1 SetBackground 1 1 1
renWin SetSize 235 500
camera SetClippingRange 14144 32817
camera SetFocalPoint -1023 680 5812
camera SetPosition 15551 -2426 19820
camera SetViewUp -0.651889 -0.07576 0.754521
camera SetViewAngle 20
renWin Render
# render the image
#
iren AddObserver UserEvent {wm deiconify .vtkInteract}
iren Initialize
# prevent the tk window from showing up then start the event loop
wm withdraw .
 
/******************************************/
 
Thanks,
Hayden

From: Hal Canary <hal at cs.unc.edu>
To: Hayden Smith <s_hayden_28 at yahoo.com> 
Cc: "vtkusers at vtk.org" <vtkusers at vtk.org> 
Sent: Friday, April 26, 2013 6:54 AM
Subject: Re: [vtkusers] Can a VTK file consists of Points only


Try this:

/**************************************************/
# vtk DataFile Version 3.0
track data of XX well
ASCII
DATASET POLYDATA
POINTS 10 float
0.00 0.00 0.00
0.00 0.00 1400.00
0.00 0.48 1466.00
0.50 2.34 1600.00
2.68 4.17 1800.00
5.53 4.68 2000.00
9.15 4.36 2200.00
12.02 1.95 2400.00
8.68 -0.86 2599.96
-1.14 4.81 2799.95
VERTICES 10 20
1 0
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
/**************************************************/


On 04/26/2013 12:12 AM, Hayden Smith wrote:
> Hello,
>    Thank you very much for the reply. Could you tell me what is the
> problem with the following vtk file, why it shows error reading cell data?
> /**************************************************/
> # vtk DataFile Version 1.0
> track data of XX well
> ASCII
> DATASET POLYDATA
> POINTS 10 float
> 0.00 0.00 0.00
> 0.00 0.00 1400.00
> 0.00 0.48 1466.00
> 0.50 2.34 1600.00
> 2.68 4.17 1800.00
> 5.53 4.68 2000.00
> 9.15 4.36 2200.00
> 12.02 1.95 2400.00
> 8.68 -0.86 2599.96
> -1.14 4.81 2799.95
> VERTICES 10 10
> 0  0.00 0.00 0.00
> 1  0.00 0.00 1400.00
> 2  0.00 0.48 1466.00
> 3  0.50 2.34 1600.00
> 4  2.68 4.17 1800.00
> 5  5.53 4.68 2000.00
> 6  9.15 4.36 2200.00
> 7  12.02 1.95 2400.00
> 8  8.68 -0.86 2599.96
> 9  -1.14 4.81 2799.95
>  
> CELLS 10 10
> 1  0.00 0.00 0.00
> 1  0.00 0.00 1400.00
> 1  0.00 0.48 1466.00
> 1  0.50 2.34 1600.00
> 1  2.68 4.17 1800.00
> 1  5.53 4.68 2000.00
> 1  9.15 4.36 2200.00
> 1  12.02 1.95 2400.00
> 1  8.68 -0.86 2599.96
> 1    -1.14 4.81 2799.95
> CELL_TYPES 10
> /***************************************************/
> Thanks,
> Hayden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130426/5130128b/attachment.htm>


More information about the vtkusers mailing list