[prev in list] [next in list] [prev in thread] [next in thread] 

List:       paraview
Subject:    Re: [Paraview] Disabling polygon offset (z-fighting prevention) in
From:       pat marion <pat.marion () kitware ! com>
Date:       2010-06-30 17:00:09
Message-ID: AANLkTimgHE6s67YfrQ3Eo1wVBZKgYAIT1A7u1DCvigRb () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@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@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@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@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@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
>
>

[Attachment #5 (text/html)]

It should be:<br><br>from libvtkRenderingPython import vtkMapper<br><br>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.<br><br>For Windows it would be:<br> <br>   from \
vtkRenderingPython import vtkMapper<br><br>Pat<br><br><div class="gmail_quote">On \
Wed, Jun 30, 2010 at 12:53 PM, Paul Edwards <span dir="ltr">&lt;<a \
href="mailto:paul.m.edwards@gmail.com">paul.m.edwards@gmail.com</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>I get the \
following error when calling &quot;from libvtkRendering.so import \
vtkMapper&quot;:</div> <div><br></div><div>     ImportError: dynamic modules does not \
define init function</div><div><br></div><div>Can anyone see what I am doing \
wrong?</div> <div><br></div><div>I&#39;m on linux with an up-to-date development \
version.</div><div><br></div><div>Thanks in advance,<br><font \
color="#888888">Paul</font></div><div><br></div><div>PS I&#39;m having problems with \
contour lines showing through the surface.  Commenting out the lines (199 &amp; 200) \
in vtkProcessModule.cxx but this is for a user who has an existing version...</div> \
<div><div></div><div class="h5"> <div><br><div class="gmail_quote">On 30 October 2009 \
12:04, Utkarsh Ayachit <span dir="ltr">&lt;<a \
href="mailto:utkarsh.ayachit@kitware.com" \
target="_blank">utkarsh.ayachit@kitware.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, \
204, 204); padding-left: 1ex;">

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



_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic