[vtkusers] Strange behaviour when using vtkSTLReader

Marek.Wasilewski at dnv.com Marek.Wasilewski at dnv.com
Fri Jul 16 05:43:04 EDT 2004


Hi
I'm just experimenting with vtkSTLReader (using C++) and the following
code results in an interesting collage of black and white triangles.
Does anyone know what might be wrong?

Thanks for any help you can give.

Marek

  CString strFileName;
  strFileName.Format(_T("%s%s"), VTK_DATA_ROOT, "42400-IDGH.stl");

  vtkSTLReader* part = vtkSTLReader::New();
  part->SetFileName(strFileName);

  vtkPolyDataMapper* partMapper = vtkPolyDataMapper::New();
  partMapper->SetInput(part->GetOutput());

  vtkLODActor* partActor = vtkLODActor::New();
  partActor->SetMapper(partMapper);
    
  partActor->GetProperty()->SetColor(0.8,0.8,0.8);
  partActor->RotateX(30.0);
  partActor->RotateY(-45.0);

  vtkRenderer* ren1 = vtkRenderer::New();
  vtkRenderWindow* renWin = vtkRenderWindow::New();
  renWin->AddRenderer(ren1);

  vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New();
  iren->SetRenderWindow(renWin);

  ren1->AddActor(partActor);
  ren1->SetBackground(0.1, 0.2, 0.4);

  renWin->Render();
  ren1->GetActiveCamera()->Zoom(1.5);

  iren->Initialize();
  iren->Start();

  part->Delete();
  partMapper->Delete();
  partActor->Delete();
  ren1->Delete();
  renWin->Delete();
  iren->Delete();

**************************************************************
Neither the confidentiality nor the integrity of this message can be guaranteed following transmission on the Internet. 
All messages sent to a DNV email addressee are swept by Sybari Antigen for the presence of computer viruses. 
DNV acknowledges that SPAM email represents a potential security risk, and DNVs filters to block unwanted emails are therefore continuously adjusted. DNV has disabled "out of office" replies to the Internet 
************************************************************** 




More information about the vtkusers mailing list