[vtkusers] Help with vtkStructuredPoints
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Mon Feb 11 03:41:30 EST 2002
>>>>> "TJC" == Tan Jui Cheng <(Chen Weizhen)" <jctan at email.com>> writes:
TJC> In the "Vol.cxx" example, the dimension is set to
TJC> 26*26*26, with spacing of 1/25 in x,y,z plane and origin set
TJC> to (-0.5, -0.5, -0.5). Please correct me if I am wrong, my
TJC> understanding is that an invisible cubic volume of 26*26*26
TJC> points having its origin at (-0.5, -0.5, -0.5), the spacing
TJC> of each point is 1/25 or 0.04. In the example, every point is
Yes, that is correct. Also remember that the scalars are to be
specified with the x values varying first. Effectively the reader
reads the data in the following manner:
for z in n_z:
for y in n_y:
for x in n_x:
read_scalar()
The example Vol.cxx makes this clear but when you create a VTK data
file you have to keep this in mind.
TJC> being defined by the scalar value, s, where s=(x*x+y*y+z*z) -
TJC> (0.4*0.4), the explicit equation of a sphere. I have tried
TJC> assigning different value of s, either by assigning it with
TJC> random numbers or a constant value, but by doing so, nothing
TJC> will display. Why is this so? So, how can I generate a volume
Because you might be asking for a contour that is not there. Make
sure your contour filter is asking for the right contour.
contour->SetValue(0,0.0);
^^^^^^^
TJC> with any scalar value I assign myself? What is the
TJC> relationship between a scalar value and the "contour-filter"?
TJC> How can I create a cube instead?
The contour filter simply identifies surfaces which have a consant
scalar value that the user can specify. Its as simple as that.
prabhu
More information about the vtkusers
mailing list