[Paraview] Disabling polygon offset (z-fighting prevention) in Paraview

Paul Edwards paul.m.edwards at gmail.com
Thu Jul 1 13:11:17 EDT 2010


Thanks Pat - it works :)

Is there any change we could change line 198 in vtkProcessModule.cxx to set
the Z shift value to 2.0e-4 instead of 2.0e-3?  That fixes my cases.  If
this is remove altogether I get dotted lines when drawing contour lines on a
surface.

Regards,
Paul

On 30 June 2010 18:00, pat marion <pat.marion at kitware.com> wrote:

> It should be:
>
> from libvtkRenderingPython import vtkMapper
>
> This should work, but if it does not then you may need to set your
> LD_LIBRARY_PATH to include the directory with the .so.
>
> For Windows it would be:
>
>    from vtkRenderingPython import vtkMapper
>
> Pat
>
>
> On Wed, Jun 30, 2010 at 12:53 PM, Paul Edwards <paul.m.edwards at gmail.com>wrote:
>
>> I get the following error when calling "from libvtkRendering.so import
>> vtkMapper":
>>
>>      ImportError: dynamic modules does not define init function
>>
>> Can anyone see what I am doing wrong?
>>
>> I'm on linux with an up-to-date development version.
>>
>> Thanks in advance,
>> Paul
>>
>> PS I'm having problems with contour lines showing through the surface.
>>  Commenting out the lines (199 & 200) in vtkProcessModule.cxx but this is
>> for a user who has an existing version...
>>
>> On 30 October 2009 12:04, Utkarsh Ayachit <utkarsh.ayachit at kitware.com>wrote:
>>
>>> Oluminde,
>>>
>>> It makes sense to provide an option in the "Settings" dialog to
>>> tweak/disable offsetting for resolving z-fighting. I've added a
>>> feature request to the bug tracker:
>>> http://paraview.org/Bug/view.php?id=9801
>>>
>>> To fix this without recompiling, here's a crazy hack to overcome this
>>> issue in builtin mode (i.e. when not connected to server):
>>> Before loading any datasets
>>> * open python shell
>>> * Run the following commands:
>>>  > import os
>>>  > if os.name == "posix":
>>>  >      from libvtkRendering.so import vtkMapper
>>>  > else:
>>>  >      from vtkRenderingPython import vtkMapper
>>>  > vtkMapper.SetResolveCoincidentTopologyToOff()
>>>
>>> If connected to a server, you can run the same python commands as part
>>> of the python script for a programmable source or filter.
>>>
>>> Utkarsh
>>>
>>>
>>> On Fri, Oct 30, 2009 at 6:48 AM, Utkarsh Ayachit
>>> <utkarsh.ayachit at kitware.com> wrote:
>>> > Ken,
>>> >
>>> > Offsetting the points/lines handles the cases when people try to
>>> > render two overlapping datasets: one as surface and other as
>>> > wireframe, and they don't necessarily want to show surface with edges
>>> > (say they want scalar coloring for both surface and the wireframe). I
>>> > believe Jean Favre has several such use cases.
>>> >
>>> > Utkarsh
>>> >
>>> > On Mon, Oct 26, 2009 at 1:18 PM, Moreland, Kenneth <kmorel at sandia.gov>
>>> wrote:
>>> >> Utkarsh,
>>> >>
>>> >> After reading this question from Olumide, I noticed that ParaView now
>>> turns
>>> >> on ZShift for lines and points (vtkProcessModule.cxx, 198-199).  I
>>> don’t
>>> >> know why this is.  This effect is turned off when drawing
>>> surface+edges
>>> >> (vtkOpenGLCoincidentTopologyResolutionPainter.cxx, 56-58) because it
>>> >> automatically switches to offsetting the polygons the polygons back
>>> >> (vtkOpenGLRepresentationPainter.cxx, 79-85).  Should we remove those
>>> two
>>> >> lines from vtkProcessModule.cxx?
>>> >>
>>> >> -Ken
>>> >>
>>> >>
>>> >> On 10/26/09 12:53 AM, "Olumide" <50295 at web.de> wrote:
>>> >>
>>> >> Hi -
>>> >>
>>> >> I use Paraview not for visualizing datasets, but for inspecting
>>> >> polygonal meshes and the operations I perform on them. My work
>>> involves
>>> >> computing various points and line segments on meshes, and I use
>>> >> VTK/Paraview to see if the points and line segments are where they
>>> ought
>>> >> to be (if not, I conclude that there's a bug in my code and then
>>> proceed
>>> >> to hunt it down).
>>> >>
>>> >> <Digression>
>>> >> Why I use VTK for this task: VTK is the the only publicly available 3d
>>> >> graphics file format I'm aware of that explicitly supports and points,
>>> >> lines, and meshes, and has a viewer for viewing these entities. Most
>>> >> other 3d graphics file formats either support surfaces alone or have
>>> no
>>> >> ready-made viewers.
>>> >> </Digression>
>>> >>
>>> >> Lately however, upon closer inspection, I've noticed that many of the
>>> >> points and line segments that I compute appear to hover above the mesh
>>> >> they are computed from and never quite touch it, and points never seem
>>> >> to lie on the line segments they are supposed to. For example, see:
>>> >> http://i17.photobucket.com/albums/b52/videohead/SurfaceError.png
>>> >> (note that the yellow line segment hover above the blue surface in the
>>> >> horizon)
>>> >>
>>> >> After much experimentation, debugging and consultation, I now suspect
>>> >> that this is caused by polygon offset in Paraview, designed to prevent
>>> >> z-fighting. I would therefore like to know:
>>> >>
>>> >> (i.) if my suspicion is correct i.e. Paraview implement polygon offset
>>> >> for preventing z-fighting in this case
>>> >>
>>> >> (ii.) if the above is true, how polygon offset can be disabled without
>>> >> recompiling the source
>>> >>
>>> >> Thanks,
>>> >>
>>> >> - Olumide
>>> >>
>>> >> _______________________________________________
>>> >> Powered by www.kitware.com
>>> >>
>>> >> Visit other Kitware open-source projects at
>>> >> http://www.kitware.com/opensource/opensource.html
>>> >>
>>> >> Please keep messages on-topic and check the ParaView Wiki at:
>>> >> http://paraview.org/Wiki/ParaView
>>> >>
>>> >> Follow this link to subscribe/unsubscribe:
>>> >> http://www.paraview.org/mailman/listinfo/paraview
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>    ****      Kenneth Moreland
>>> >>     ***      Sandia National Laboratories
>>> >> ***********
>>> >> *** *** ***  email: kmorel at sandia.gov
>>> >> **  ***  **  phone: (505) 844-8919
>>> >>     ***      web:   http://www.cs.unm.edu/~kmorel<http://www.cs.unm.edu/%7Ekmorel>
>>> >>
>>> >>
>>> >
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ParaView Wiki at:
>>> http://paraview.org/Wiki/ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.paraview.org/mailman/listinfo/paraview
>>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100701/4a9b3032/attachment.htm>


More information about the ParaView mailing list