[vtkusers] Decimation of a very large surface
Randall Hand
randall.hand at gmail.com
Wed Jun 8 09:23:24 EDT 2005
I have a about 15 datasets varying from 40k to 60million triangles, that I'm
trying to decimate down to 3.5million for use in our applications (3ds Max,
Maya, custom stuff, etc). vtkQuadricClustering will decimate it, but it goes
waaay too far, down to under 100k triangles, and I don't seem to have the
memory required for over 2000bins on each axis.
So I've taken to using vtkDecimatePro & vtkQuadricDecimate, but I'm having
problems. vtkDecimatePro starts off just fine, but eventually dies with a
"Bus Error" at 43.87% (This particular dataset has 51M triangles). The core
dump shows the following:
[8:05:34am]% dbx decimate
dbx version 7.3.4 (86441_Nov11 MR) Nov 11 2002 11:31:55
where
Core from signal SIGBUS: Bus error
(dbx)
Thread 0x10000
> 0 vtkCellLinks::RemoveCellReference(long long,long long)(this =
0x83f519a8, cellId = 39154371, ptId = -1)
["/viz/home/rhand/src/ezViz/Utilities/VTK/Filtering/vtkCellLinks.h":183,
0x4fae524]
(dbx)
My Code:
printf("PLY Reader...\n");
vtkPLYReader *input = vtkPLYReader::New();
input->SetFileName(argv[1]);
input->Update();
printf("Decimation...\n");
size = input->GetOutput()->GetNumberOfCells();
if (size < 4000000) {
printf("Already under 4mil\n");
return;
}
vtkDecimatePro *decimate = vtkDecimatePro::New();
reduction = (float)3500000/(float)size;
reduction = 1.0 - reduction;
printf("\tReducing by %.3f%%\n", (reduction * 100.0));
decimate->SetInputConnection(input->GetOutputPort());
decimate->AddObserver(vtkCommand::ProgressEvent, progress);
decimate->SetTargetReduction(reduction);
printf("PLY Writer...\n");
vtkPLYWriter *output = vtkPLYWriter::New();
ptr = strrchr(argv[1], '.');
*ptr = '\0';
sprintf(filename, "%s-decimated", argv[1], subdiv);
printf("-> %s\n", filename);
output->SetFileName(filename);
output->SetInputConnection(decimate->GetOutputPort());
output->Write();
Is there some way I can get past this roadblock?
--
Randall Hand
http://www.yeraze.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050608/4af27a7e/attachment.htm>
More information about the vtkusers
mailing list