Looking at the documentation for vtkRectilinearGrid it makes it sound like vtkRectilinearGrid should be able to generate 1D and 0D grids: "Also, you must supply coordinates in all three directions, even if the dataset topology is 2D, 1D, or 0D."<div>
<br></div><div>However... when I try to use this capability... nothing is getting rendered. 3D and 2D grids with vtkRectilinear grid are just fine... but 1D and 0D aren't coming out at all.</div><div><br></div><div>Why would I want to use vtkRectilinearGrid for 1D and 0D? It's because I have some nice general code to draw cubes/squares/lines/points depending on user input... and it relies on vtkRectilinearGrid. Of course I could specialize 1D and 0D to do something else... but I like the generic algorithm I have now...</div>
<div><br></div><div>Here's some (python) code along the lines of what I am using:</div><div><br></div><div><div> x_coord = vtk.vtkFloatArray()</div><div> x_coord.InsertNextValue(0.0)</div><div><div><div> x_coord.InsertNextValue(1.0)</div>
</div></div><div><div> x_coord.InsertNextValue(2.0)</div></div><div><br></div><div> y_coord = vtk.vtkFloatArray()</div><div> y_coord.InsertNextValue(0.0)</div><div><br></div><div> z_coord = vtk.vtkFloatArray()</div>
<div> z_coord.InsertNextValue(0.0)</div><div><br></div><div> grid = vtk.vtkRectilinearGrid()</div><div> grid.SetDimensions(3,1,1)</div><div> grid.SetXCoordinates(x_coord)</div><div> grid.SetYCoordinates(y_coord)</div>
<div> grid.SetZCoordinates(z_coord)</div></div><div><br></div><div><div> self.mapper = vtk.vtkDataSetMapper();</div><div> self.mapper.SetInput(grid);</div><div><br></div><div> self.actor = vtk.vtkActor();</div>
<div> self.actor.SetMapper(self.mapper);</div><div> self.actor.GetProperty().SetPointSize(4)</div><div> self.actor.GetProperty().SetEdgeColor(0,0,0)</div><div> self.actor.GetProperty().SetAmbient(0.3);</div></div>
<div><br></div><div>And then adding that actor to the renderer, etc...</div><div><br></div><div>Thanks for any help!</div><div><br></div><div>Derek</div><div><br></div>