|
Boolean Beta 0.8 |
Boolean The Boolean package consist of few examples that can explain how to create boolean operations with polydata. Boolean operations based on vtkImplicitPolyData. vtkImplicitPolyData was developed by Dave Pont and improved by me. The origin message about it in VTK user list: here You can use The Visualization ToolKit (VTK) with vtkImplicitPolyData the same way like vtkImplicitDataSet from VTK. And you can also get boolean operation betweens polygonal datas or surfaces (triangles). One of the way to do it by using vtkImplicitPolyData and vtkImplicitBoolean. Another way to use vtkClipPolyData and clip function vtkImplicitPolyData. Short example without details (Assume that you are familiar with VTK): #include "vtkImplicitPolyData.h" int main (void) { vtkCylinderSource *Cylinder = vtkCylinderSource::New(); vtkPolyDataMapper *CylinderMapper = vtkPolyDataMapper::New(); CylinderMapper->SetInput( Cylinder->GetOutput() ); vtkImplicitPolyData *ImplicitData = vtkImplicitPolyData::New(); ImplicitData->SetInput(CylinderMapper->GetOutput()); // Cow has been loaded before vtkClipPolyData *clipper = vtkClipPolyData::New(); clipper->SetInput((vtkPolyData *)Cow->GetMapper()->GetInput()); clipper->SetClipFunction(ImplicitData); clipper->InsideOutOff(); clipper->GenerateClipScalarsOn(); vtkPolyDataMapper *NewMapper = vtkPolyDataMapper::New(); NewMapper->SetInput(clipper->GetOutput()); Cow->SetMapper(NewMapper); return 0; } ![]()
Example "Cow with bullet" and "Wireframe version" ![]() ![]() "Getting close..." and example "Sphere minus half of sphere" ![]()
Example "Artery minus Bypass" ![]()
"Getting close to holes..." 1. To have better result use triangulated polydata (Don't use vtkDecimate and staff like that). 2. Try to tune Tolerance setting for vtkImplicitPolyData (Sometimes it is not easy, sometimes it can help). 3. vtkImplicitPolyData is not fully stable. Any patches are really welcome. You can send them to me. Boolean package written by Denis Shamonin, University of Amsterdam. Boolean uses the Visualization Toolkit (VTK). The overall changes have resulted in the following structure of the code: - Boolean specific code is placed in the directory "src" - Examples on how to use Boolean are placed in the directory "examples". You should at least have the following software installed on your system: - VTK, version 4.2.0 Revision: 1.1550 or higher   http://www.vtk.org   VTK, the Visualization Toolkit, is by Will Schroeder, Ken Martin and Bill Lorensen. For more information about VTK, see the VTK Web pages. Denis P. Shamonin dshamoni_at_science.uva.nl Section Computational Science, Faculty of Science, University of Amsterdam, Kruislaan 403, 1098 SJ Amsterdam, the Netherlands. |