[prev in list] [next in list] [prev in thread] [next in thread]
List: vtkusers
Subject: [vtkusers] how to speed up vtkVoxelModeller?
From: Lars Hegenbart <lars.hegenbart () hs ! fzk ! de>
Date: 2007-10-31 12:42:03
Message-ID: C23FF8FF-2C9E-44F0-A254-6D6E8A68FF40 () hs ! fzk ! de
[Download RAW message or body]
Dear VTK-Users,
I am using vtkVoxelModeller (vtk5.0) to voxelise polygonal mesh (e.g.
surface model made out off some ten-thousands quads). The target
voxel dimensions are about 90 x 50 x 300 = 1.35e6.
The problem is, that is very slow. On a WinXP Pentium4, 3.4 GHz
machine it takes days to get one surface model voxelised.
How can I possibly speed up vtkVoxelModeller?
Here comes my code:
vtkPolyData *polyOrgan = vtkPolyData::New();
polyOrgan->SetPoints(points); // points are generated before
points->Delete();
polyOrgan->SetPolys(polys); // polys are generated before
polys->Delete();
vtkCleanPolyData *polyOrganClean = vtkCleanPolyData::New();
polyOrganClean->SetInput(polyOrgan);// get rid of double definitions
vtkVoxelModeller *voxelmacher = vtkVoxelModeller::New();
voxelmacher->SetSampleDimensions(90,50,300);
voxelmacher->SetModelBounds( /* box just around the polydata */ );
voxelmacher->SetInput(polyOrganClean->GetOutput());
vtkDataSetWriter *aWriter = vtkDataSetWriter::New();
aWriter->SetFileName("afile.vtk");
aWriter->SetInputConnection(voxelmacher->GetOutputPort());
A performance check told me the following cpu-time fractions when my
code running:
36.7% vtkQuad::EvaluatePosition(double*, double*, int&, double*,
double&, double*)
19.4% vtkDataArrayTemplate<double>::GetTuple(int, double*)
7.1% vtkPoints::GetPoint(int, double*)
4.5% vtkTriangle::ComputeNormal(double*, double*, double*, double*)
3.5% vtkQuad::InterpolationFunctions(double*, double*)
3.4% vtkQuad::InterpolationDerivs(double*, double*)
Thanks in advance for any hints to speed up vtkVoxelModeller!
Best regards
Lars
_______________________________________________
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic