[vtkusers] vtkDecimatePro difference between c and tcl
Will Schroeder
will.schroeder at kitware.com
Tue Feb 5 07:29:50 EST 2002
Hi Uwe-
You have MergingOff in one of the STL readers. This means that points are
not merged and decimate can do much with it.
Will
At 11:46 AM 2/5/2002 +0100, Uwe Sick wrote:
>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
More information about the vtkusers
mailing list