MantisBT - VTK
View Issue Details
0015582VTK(No Category)public2015-07-15 02:072015-08-26 16:40
Andreas Buykx 
T.J. Corona 
normalminorhave not tried
closedfixed 
 
6.3.0 
TBD
incorrect functionality
0015582: vtkCutter produces incorrect polygons when cutting non-linear cells
vtkCutter can be set to generate polygons instead of triangles. It produces incorrect polygons when cutting through non-linear cells. Linear cells seem to be cut ok.

I include a python script and a vtu file that demonstrate the issue, the result of which is shown in the image file.
No tags attached.
png image.png (12,304) 2015-07-15 02:07
https://www.vtk.org/Bug/file/9848/image.png
png

? input.vtu (7,446) 2015-07-15 02:08
https://www.vtk.org/Bug/file/9849/input.vtu
? cutter.py (1,719) 2015-07-15 02:08
https://www.vtk.org/Bug/file/9850/cutter.py
? cutPolygons.py (2,885) 2015-08-17 10:19
https://www.vtk.org/Bug/file/9872/cutPolygons.py
Issue History
2015-07-15 02:07Andreas BuykxNew Issue
2015-07-15 02:07Andreas BuykxFile Added: image.png
2015-07-15 02:08Andreas BuykxFile Added: input.vtu
2015-07-15 02:08Andreas BuykxFile Added: cutter.py
2015-08-13 03:59Andreas BuykxNote Added: 0034981
2015-08-13 17:30T.J. CoronaAssigned To => T.J. Corona
2015-08-17 04:27Andreas BuykxNote Added: 0035000
2015-08-17 06:23T.J. CoronaNote Added: 0035001
2015-08-17 06:42Andreas BuykxNote Added: 0035002
2015-08-17 07:16T.J. CoronaNote Edited: 0035001bug_revision_view_page.php?bugnote_id=35001#r1227
2015-08-17 07:19T.J. CoronaNote Added: 0035003
2015-08-17 10:19Andreas BuykxFile Added: cutPolygons.py
2015-08-17 10:23Andreas BuykxNote Added: 0035004
2015-08-26 16:40T.J. CoronaNote Added: 0035071
2015-08-26 16:40T.J. CoronaStatusbacklog => closed
2015-08-26 16:40T.J. CoronaResolutionopen => fixed
2015-08-26 16:40T.J. CoronaFixed in Version => 6.3.0

Notes
(0034981)
Andreas Buykx   
2015-08-13 03:59   
From code inspection in vtkContourHelper.cxx:
The Tris and TriOutCd members are initialized (lines 50-51) when GenerateTriangles evaluates to true, but they are used (lines 70-70) when GenerateTriangles evaluates to false.
(0035000)
Andreas Buykx   
2015-08-17 04:27   
Hi,

I found out that the vtkPolygonBuilder is not capable of generating polygons from a triangle mesh with inner nodes. I have modified it to generate a proper polygon also from a triangle mesh with inner nodes. How do you want me to proceed with this? I can upload a diff, I suppose, or try and push it myself. I don't know what is the preferred or faster way (I'm not very familiar with git myself). Is it possible to get this fix included in 6.3?
(0035001)
T.J. Corona   
2015-08-17 06:23   
(edited on: 2015-08-17 07:16)
Hi Andreas,

I also came to the same conclusion, and have rewritten vtkPolygonBuilder to accept triangle meshes with inner nodes (see the following merge request: https://gitlab.kitware.com/vtk/vtk/merge_requests/541 [^]). The update is currently under review, and will hopefully be accepted before the end of the week.

-T.J.

(0035002)
Andreas Buykx   
2015-08-17 06:42   
OK. Does your implementation also address the situation where cutting a non-linear cell produces multiple unconnected polygons?
(0035003)
T.J. Corona   
2015-08-17 07:19   
No, it does not (but I suppose it could). Can you come up with an instance (or, better yet, a test case) where cutting a single nonlinear cell would result in requiring this functionality?
(0035004)
Andreas Buykx   
2015-08-17 10:23   
I uploaded a python script which has a linear hexahedron, and a quadratic hexahedron with concave top surface. The viewer window contains these on the left side. On the right side are vtkCutter outputs with GenerateTrianglesOn (top) and GenerateTrianglesOff (bottom). When I cut through the quadratic hexahedron, close to the top surface, I would expect disconnected cuts (like you see in the triangles output.
(0035071)
T.J. Corona   
2015-08-26 16:40   
The fix can be found in the following commit:
https://gitlab.kitware.com/vtk/vtk/commit/7ed37e9603105db4da600e2d2a65c7b18a50bf2a [^]
Thanks for your help with this issue!