[vtkusers] vtkDecimatePro difference between c and tcl

Uwe Sick uwe.sick at teraport.de
Tue Feb 5 05:46:33 EST 2002


Dear vtk User,

I evaluate some functionality of vtk. I implement vtkDecimatePro in a C
main or in a tcl script the results are significant different. Can
anybody tell me why the quality of tcl / vtkDecimatePro is higher ?

My Environment :

  VTK Version : 4.0

  DecimatePro : $Date: 2002/01/15 14:14:34 $Revision: 1.1
$                                                                                                                                   

  BSY : Suse 7.2

  TCL/TK Version : 8.3

The Code :

=> the C code example output_c.jpg

   // read in the stl ascii file
  cout << "reading STL ASCII file ..." << endl;
  vtkSTLReader* stlReader = vtkSTLReader::New();
  stlReader->SetFileName(infile);
  stlReader->MergingOff();
  stlReader->Update();
  vtkPolyData* polyData = stlReader->GetOutput();
 
   vtkDecimatePro* decimate = vtkDecimatePro::New();
 
   decimate->SetInput(polyData);
   decimate->SetTargetReduction(0.35);
   decimate->SetPreserveTopology(1);
   decimate->Update();
 
   // write stl ascii file
   cout << "writing STL ASCII file ..." << endl;
   vtkSTLWriter* stlWriter = vtkSTLWriter::New();
   stlWriter->SetInput(decimate->GetOutput());
   stlWriter->SetFileName(outfile);
   stlWriter->Write();
 
  // deallocation(s)
  stlWriter->Delete(); stlWriter = NULL;
  decimate->Delete(); decimate = NULL;
  stlReader->Delete(); stlReader = NULL;
 

=> the tcl code example output_tcl.jpg
 
  vtkSTLReader sr
    sr SetFileName infile.stl
 
  vtkDecimatePro deci
    deci SetInput [sr GetOutput]
    deci SetTargetReduction 0.35
    deci SetPreserveTopology 1
  
  wm title . [deci GetTargetReductionMaxValue]
 
  vtkSTLWriter sw
    sw SetFileName outfile.stl
    sw SetInput [deci GetOutput]
    sw
Write                                                                                                                              


Thank´s for your answer


Uwe Sick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output_c.jpg
Type: image/jpeg
Size: 7755 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020205/92893112/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output_tcl.jpg
Type: image/jpeg
Size: 6220 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020205/92893112/attachment-0001.jpg>


More information about the vtkusers mailing list