VTK port of the powercrust algorithm: vtkPowerCrustSurfaceReconstruction

I made a port of the powercrust surface reconstruction algorithm to VTK. The original code can be found at http://www.cs.utexas.edu/users/amenta/powercrust/welcome.html and was released under the GNU public licence (GPL). As a modified version of this code, my port must therefore also fall under the GPL, which at the moment prohibits it becoming part of the main VTK distribution, which is sad.

The source code is therefore here for anyone to use:

vtkPowerCrustSurfaceReconstruction.h

vtkPowerCrustSurfaceReconstruction.cxx

TestPowerCrust.tcl

TestPowerCrust.png

To build this code, simply include the .h and .cxx files in your project. (Your project must already be using VTK 4.2 or greater.)

Depending on what version of VTK you have, you may need to comment out the VTK_GRAPHICS_EXPORT modifier in vtkPowerCrustSurfaceReconstruction.h, like this:

class /*VTK_GRAPHICS_EXPORT*/ vtkPowerCrustSurfaceReconstruction : public vtkDataSetToPolyDataFilter

The file TestPowerCrust.tcl shows how to use the class. The .png shows the output that should be produced.

Contact me if you have any problems!

Tim
tim.hutton@gmail.com


For MSVC 7.1 users: (thanks Andrew!)

From: "Andrew Maclean" 
To: Tim
Subject: VTK port of the powercrust algorithm: vtkPowerCrustSurfaceReconstruction 

I just built it under VC7.1, you need to modify the line: 

// exact_bits = (int)(DBL_MANT_DIG*log(FLT_RADIX)/log(2.0)); // cast to int added by TJH // EPRO added 

To: 

exact_bits = (int)(DBL_MANT_DIG*log((double)FLT_RADIX)/log(2.0)); // cast to int added by TJH // EPRO added

VC7.1 is fussy about types in templated functions such as log.

Andrew

Updates:

Many thanks to everyone who has helped to improve this code! Any more corrections or improvements will be greatly appreciated by the community of users.