[vtkusers] Problems with vtkClipPolyData and vtkImplicitBoolean

normanius juch at zhaw.ch
Fri Jan 1 08:10:31 EST 2016


Hi VTK-developers

I implemented a hack that solves the above problem for me. See the result
(before and after):

<http://vtk.1045678.n5.nabble.com/file/n5735721/comparison.jpg> 

Below the two patches. The second patch is the important one. The first one
just implements the suggested linear distance metric for vtkCylinder. (I
branched off from the revision git-hash ac7a28f).
patch-001-linear-cylinder-function.diff
<http://vtk.1045678.n5.nabble.com/file/n5735721/patch-001-linear-cylinder-function.diff>  
patch-002-clippolydata-triangle-clipping-fix.diff
<http://vtk.1045678.n5.nabble.com/file/n5735721/patch-002-clippolydata-triangle-clipping-fix.diff>  

Here is what I did roughly: In vtkTriangle::Clip(), use the bisection method
to correctly find the "zero-crossing", as an alternative to the linear
interpolation that is the method of choice in the current release. The
bisection method requires a handle to the implicit function and the
iso-value used in vtkClipPolyData. If in the cell traversal in
vtkClipPolyData::RequestData() the current vtkGenericCell turns out to be of
triangular type, it gets dirty-casted into vtkTriangle and the implicit
function and the iso-value are set. This will trigger the advanced
interpolation scheme in vtkTriangle::Clip().

Obviously, my fix works only for triangular meshes. I haven't spent a
thought on how to generalise and implement this properly. Let me know what
you think. Shall create an issue in your bug-tracker?





--
View this message in context: http://vtk.1045678.n5.nabble.com/Problems-with-vtkClipPolyData-and-vtkImplicitBoolean-tp5735713p5735721.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list