vtkBooleanOperationPolyDataFilter confusing error/warnings
Given the following reduced test case of two intersecting cubes and a boolean operation:
#!/usr/bin/env python2
import vtk
cube1 = vtk.vtkCubeSource()
cube1.SetBounds(-4.48000001907, 402.402008057, -2.56699991226, 178.229995728, -0.273999989033, 14.1300001144)
cube1.Update()
print cube1.GetOutput()
cube2 = vtk.vtkCubeSource()
cube2.SetBounds(0, 20, 0, 20, -1, 15)
cube2.Update()
print cube2.GetOutput()
bo = vtk.vtkBooleanOperationPolyDataFilter()
bo.SetInputConnection(0, cube1.GetOutputPort())
bo.SetInputConnection(1, cube2.GetOutputPort())
bo.SetOperationToIntersection()
bo.Update()
print bo.GetOutput()
The output under 8.0.1 is quite confusing in this case, as it reports:
ERROR: In /tmp/pma44/VTK/8.0.1/intel-2016b-Python-2.7.12-id32/VTK-8.0.1/Common/DataModel/vtkPointLocator.cxx, line 875
vtkPointLocator (0x1166b00): No points to subdivide
Generic Warning: In /tmp/pma44/VTK/8.0.1/intel-2016b-Python-2.7.12-id32/VTK-8.0.1/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 2507
No Intersection between objects
ERROR: In /tmp/pma44/VTK/8.0.1/intel-2016b-Python-2.7.12-id32/VTK-8.0.1/Filters/General/vtkDistancePolyDataFilter.cxx, line 80
vtkDistancePolyDataFilter (0x1162e20): No points/cells to operate on
ERROR: In /tmp/pma44/VTK/8.0.1/intel-2016b-Python-2.7.12-id32/VTK-8.0.1/Filters/General/vtkDistancePolyDataFilter.cxx, line 80
vtkDistancePolyDataFilter (0x1162e20): No points/cells to operate on
Apparently the issue is that vtkBooleanOperationPolyDataFilter
(or one of the sub-filters it uses) only works on triangle meshes, something which 6.0.1 reports quite clearly:
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
Generic Warning: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkIntersectionPolyDataFilter.cxx, line 351
vtkIntersectionPolyDataFilter only works with triangle meshes.
ERROR: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkDistancePolyDataFilter.cxx, line 97
vtkDistancePolyDataFilter (0xcb5360): No points/cells to operate on
ERROR: In /sara/sw/build/compiles/VTK-6.1.0/Filters/General/vtkDistancePolyDataFilter.cxx, line 97
vtkDistancePolyDataFilter (0xcb5360): No points/cells to operate on
Indeed, adding vtkTriangleFilter
s on the input datasets seems to fix the warnings and produces correct output. However, the docs for vtkBooleanOperationPolyDataFilter
don't mention that the input datasets must contain triangles only, so perhaps something else is going on.