[vtkusers] problem with vtkVoxelModeller

Sylvain Jaume sylvainjaume at gmail.com
Thu Apr 24 13:56:15 EDT 2008


Bonjour Audrey,

Have you tried :

double modelBounds[6];
holePolyData->GetBounds( modelBounds );

HTH,
Sylvain

On Thu, Apr 24, 2008 at 10:54 AM, Audrey Lemoussu <audrey.lemoussu at nist.gov>
wrote:

> Hi
>
> I have started to work with vtk for 2 weeks, and I need some help from vtk
> Users. I saw on the Internet that other people had had the same problem, but
> I didn't find any answer. In fact, when I write the output of my
> vtkVoxelModeller Object, I only get zeros.
> I don't know where it comes from!
>
> This is a part of my program :
>  vtkPolyDataReader *holeReader = vtkPolyDataReader::New();
>  holeReader->SetFileName( holeFileName );
>  holeReader->Update();
>
>  vtkPolyData *holePolyData = vtkPolyData::New();
>  holePolyData->SetPoints( holeReader->GetOutput()->GetPoints() );
>  holePolyData->SetPolys( holeReader->GetOutput()->GetLines() );
>
>  int sampleDimensions[3] = { 10, 10, 10 };
>  double modelBounds[6] = { 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 };
>
>  vtkVoxelModeller *voxelModeller = vtkVoxelModeller::New();
>  voxelModeller->SetInput( holePolyData );
>  //voxelModeller->SetSampleDimensions( sampleDimensions );
>  // voxelModeller->SetModelBounds( modelBounds );
>  voxelModeller->Update();
>
>  vtkDataSetWriter *writer = vtkDataSetWriter::New();
>  writer->SetFileName( outputFileName );
>  writer->SetInputConnection (voxelModeller->GetOutputPort() );
>  writer->Write();
>
>  holeReader->Delete();
>  holePolyData->Delete();
>  voxelModeller->Delete();
>  writer->Delete();
>
> Can anyone tell me if I have done some mistakes in my program or where my
> problem comes from ?
>
> Audrey Lemoussu
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080424/b03439f4/attachment.htm>


More information about the vtkusers mailing list