Hey Lorenzo, <div><br><div><a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/blankGrid.tcl?root=VTK&content-type=text/plain">http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/blankGrid.tcl?root=VTK&content-type=text/plain</a> might help.</div>
<div><br></div><div><br><div class="gmail_quote">On Sun, Aug 2, 2009 at 2:24 PM, Lorenzo Bernardi <span dir="ltr"><<a href="mailto:lorenzo.bernardi@lpn.cnrs.fr">lorenzo.bernardi@lpn.cnrs.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear all,<br>
<br>
I'd like to blank sites from a structure grid and use warpscalar. I'm using the BlankPoint method of the vtkStructuredGrid class but it doesn't work. I'm missing something obvious?<br>
<br>
My use of blanking on the structured grid is to represent the data on the Cubic centered lattice. Is blanking made for this kind of things?<br>
<br>
Does someone have and example of how to use vtkBlankStructuredGrid with a StructuredGrid object?<br>
<br>
my code is given below. If I comment the blanking part I have a plane otherwise I have nothing<br>
<br>
sincerely<br>
<br>
L.<br>
<br>
<br>
<br>
<br>
<br>
#!/usr/bin/python<br>
<br>
import vtk<br>
import math<br>
<br>
<br>
Vpoints=vtk.vtkPoints()<br>
Vdata=vtk.vtkFloatArray()<br>
Vblank=vtk.vtkUnsignedCharArray()<br>
<br>
<br>
imax=10<br>
jmax=10<br>
kmax=10<br>
<br>
Vsg=vtk.vtkStructuredGrid()<br>
Vsg.SetDimensions(imax,jmax,kmax)<br>
<br>
l=0<br>
for k in range(kmax):<br>
for j in range(jmax):<br>
for i in range(imax):<br>
if (i+j+k)%2 == 1:<br>
Vsg.BlankPoint(l)<br>
<br>
Vpoints.InsertPoint(l,i,j,k)<br>
Vdata.InsertValue(l,2.+math.cos(i)*math.cos(j)*math.cos(k)) <br>
l+=1<br>
<br>
Vsg.SetPoints(Vpoints)<br>
Vsg.GetPointData().SetScalars(Vdata)<br>
<br>
<br>
plane = vtk.vtkStructuredGridGeometryFilter()<br>
plane.SetInputConnection(Vsg.GetProducerPort())<br>
plane.SetExtent(0, 40, 0, 40, 1, 1)<br>
<br>
<br>
warp = vtk.vtkWarpScalar()<br>
warp.SetInputConnection(plane.GetOutputPort())<br>
warp.UseNormalOn()<br>
warp.SetNormal(.0, 0.0, 1.0)<br>
warp.SetScaleFactor(2.5)<br>
<br>
normals = vtk.vtkPolyDataNormals()<br>
normals.SetInput(warp.GetPolyDataOutput())<br>
normals.SetFeatureAngle(60)<br>
<br>
planeMapper = vtk.vtkPolyDataMapper()<br>
planeMapper.SetInputConnection(normals.GetOutputPort())<br>
planeMapper.SetScalarRange(Vsg.GetScalarRange())<br>
<br>
planeActor = vtk.vtkActor()<br>
planeActor.SetMapper(planeMapper)<br>
<br>
outline = vtk.vtkStructuredGridOutlineFilter()<br>
outline.SetInputConnection(Vsg.GetProducerPort())<br>
outlineMapper = vtk.vtkPolyDataMapper()<br>
outlineMapper.SetInputConnection(outline.GetOutputPort())<br>
outlineActor = vtk.vtkActor()<br>
outlineActor.SetMapper(outlineMapper)<br>
outlineActor.GetProperty().SetColor(0, 0, 0)<br>
<br>
<br>
ren = vtk.vtkRenderer()<br>
ren.AddActor(outlineActor)<br>
ren.AddActor(planeActor)<br>
<br>
renWin = vtk.vtkRenderWindow()<br>
renWin.AddRenderer(ren)<br>
ren.SetBackground(1, 1, 1)<br>
<br>
<br>
iren = vtk.vtkRenderWindowInteractor()<br>
iren.SetRenderWindow(renWin)<br>
<br>
iren.Initialize()<br>
renWin.Render()<br>
iren.Start()<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div></div>