Menu

vtk_patch

Help
alex
2005-07-31
2013-04-22
  • alex

    alex - 2005-07-31

    Hi folks,

    I'm  writing a vtk_patch function, that draws filled polygones. I could need a little help, since it does not work as expected. Convex patched are drawn ok (http://ocgmod1.marine.usf.edu/Octaviz/convex_patch.png) with the command:
    vtk_patch([0 1 2 2.2 2 1 0 -.2 0],[0 -0.2 0 1 2 2.2 2 1 0 ],'g')

    But concave patches (http://ocgmod1.marine.usf.edu/Octaviz/concave_patch.png) are problematic:
    vtk_patch([0 1 2 1.8 2 1 0 0.2 0],[0 0.2 0 1 2 1.8 2 1 0 ],'b')
    The right black triangle, should be gray (the background color) and in the lower part should be a transparent zone too.

    The source of vtk_patch is at:
    http://ocgmod1.marine.usf.edu/Octaviz/vtk_patch.m

    Any help is appreciated.
    Alex

     
    • Jonathan Stickel

      I've been meaning to take a careful look at your suggested function, but I just haven't had the time yet.   The key is to be very careful with the formation of the triangle cells.  The problem you report is typical of misformed cells.   I wonder if you can use the existing vtk_surf or vtk_trisurf within vtk_patch to perform the rendering.  You should be able to send a carefully ordered set of points to vtk_surf to get what you want.

      Jonathan

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.