PoissonReconstruction

to use PoissonReconstruction in VTK in the examples site, it says to:
Enable the remote module by setting Module_PoissonReconstruction:BOOL=ON.
but where in the building process I should do this setting? it’s not one of the CMake configuration switches that show up during configuration.
the same goes to the PowerCrust surface reconstruction.

2 Likes

I have never used it but in your VTK source there will be a folder called Remote it may already have PoissonReconstruction.remote.cmake and Powercrust.remote.cmake in it. If not, download the files and put them in the Remote folder.

Then go to where you build VTK and run cmake-gui. In the VTK section, you will see a line called VTK_MODULE_ENABLE_VTK_PoissonReconstruction. Set the value to WANT and do the same for for VTK_MODULE_ENABLE_VTK_Powercrust. Then rebuild VTK.

The new names are VTK_MODULE_ENABLE_VTK_* not Module_*. If you get it working, let me know and I’ll update the instructions.

in the Remote folder there exist those two .cmake files.

but when in the vtk/build folder (where I previously cmake built the vtk source) I open cmake-gui, I don’t see any key or line as you said. you mean reconfiguring again? then I did it and there’s till no key containing PoissonReconstruction nor PowerCrust.

I am using VTK 9.0, after you have pressed configure, you should see lines like this in the VTK section of cmake-gui:

2 Likes

@amaclean I downloaded VTK 9.0.1, building with cmake, using visual studio 16 2019 as the generator, then by hitting configure, none of the options are like the ones you showed above, actually even none is having VTK_MODULE_ prefix.
The reomote folder does have the PoissonReconstruction.remote.cmake file in it.
So I wonder if I’m missing some step?

I am assuming you are in your VTK build folder. Make sure that after starting ``cmake-gui` you have checked the Grouped and Advanced boxes. After you do this, this is what you should see when scrolling through the VTK group:


Then set the values to WANT then configure and build.

1 Like

@amaclean checked grouped and advanced, put the VTK_MODULE_ENABLE_VTK_PoissonReconstruction and VTK_MODULE_ENABLE_VTK_Powercrust to WANT
then configure, generate, then opened VTK.sln in visual studio, built the All Build and then built the Install.
both successfull with no failed packages.

then when I want to build the example again it fails with error:
PoissonExtractSurface\PoissonExtractSurface.cxx(11,10): fatal error C1083: Cannot open include file: ‘vtkPoissonReconstruction.h’: No such file or directory

Is there something I should consider?

1 Like

I would suspect that you are missing the requisite VTK module in your find_package(VTK COMPONENTS ...) for your CMakeList.txt for your example.

Perhaps it is called PoissonReconstruction

You could also try running VTK/Utilities/Maintenance/FindNeededModules.py - follow the instructions at the top of this script.

https://kitware.github.io/vtk-examples/site/Cxx/Points/PoissonExtractSurface/

I have a similar issue, when build with make install the vtkPoissonReconstruction.h is not installed in the install directory

Where vtkPoissonReconstruction.h is installed then? at the build directory?

It is not installed anywhre, it stays in the source directory

I can’t add the vtkPoissonReconstruction.h to my project, what do I need to put in the CMakelist of my project?

Thanks in advance.

Is the vtkPoissonReconstruction.h located in the include folder?

for me it is in:
$hamzstlib/Kitware/install/VTK/include/vtk-9.1

If so, then adjust the path to the header (.h files)

Make sure you have VTK path to the right cmake VTK (given you are using Linux OS).
For example I append my path (in .bashrc)

VTK_DIR=“$hamzstlib/Kitware/install/VTK/lib/cmake/vtk-9.1”

It will handle to pointing to the necessary libraries installed and headers files too. Correct me if I am wrong.

The CMakelist for the example usually need least modification except if you are doing major change or modification or experimentation on the VTK example.

I was able to solve the problem using following steps.

  1. Instead of downloading and placing PoissonReconstruction.remote.cmake or Powercrust.remote.cmake in src/remote folder, download the code directly from these github links. PoissonReconstruction and Powercrust.
  2. Extract and place the folders in src/remote directory. Rename the folders, remove “-master” from the end.
  3. Reconfigure using cmake GUI and you should see following messages in the console.
    Powercrust: Building as a Remote VTK module
    PoissonReconstruction: Building as a Remote VTK module
  4. Now you can build and install vtk. You will be able to see install dll and libs in the VTK directory.

The problem is that when we use PoissonReconstruction.remote.cmake or Powercrust.remote.cmake to clone the directory, it fails to download the file named “vtk.module” which seems to be an essential file for configuration for cmake. Manually downloading the code from github solves this problem. Cheers!