<div dir="ltr">If you could use VTK 7+ Your approach 3 would be the best way to do it. Be aware<div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> vtkPolyDataMapper::</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">SetResolveCoincidentTopologyLi</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">neOffsetParameters(-2,.2);</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">In calls like that the two parameters should have the same sign for best results.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Using an old version of VTK I think you can do option 3 but with the following calls</span></div><div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();</span></div><div><div>vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(-2.0,-5.0);</div><div><br></div></div></div><div>play with the -2.0 and -10.0 to get the best results.</div><div><br></div><div><span style="font-size:12.8px">Thanks</span></div><div><span style="font-size:12.8px">Ken</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 22, 2016 at 5:54 PM, Greg Schussman <span dir="ltr"><<a href="mailto:greg.schussman@gmail.com" target="_blank">greg.schussman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, again.<div><br></div><div>I got the following advice directly from Jason:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I’ve gotten decent results using approach 3 as described below (although in VTK 7) with the following options:<br> <br>   vtkPolyDataMapper::<wbr>SetResolveCoincidentTopologyTo<wbr>PolygonOffset();<br>   vtkPolyDataMapper::<wbr>SetResolveCoincidentTopologyPo<wbr>lygonOffsetParameters(0,0);<br>   vtkPolyDataMapper::<wbr>SetResolveCoincidentTopologyLi<wbr>neOffsetParameters(-2,.2);</blockquote><div><br></div><div>As far as I can tell, SetResolveCoincidentTopologyLi<wbr>neOffsetParameters is not available before vtk-7. I tried building vtk-7, but that turned out to be problematic...</div><div><br></div><div>The root of that problem is that I have to support an industry that still commonly uses RHEL5 machines, which means I'm stuck with the GCC-4.1.2 that comes with RHEL5.  But vtk-7 requires at least GCC-4.2.  I looked around a bit online, and didn't see a technical reason why vtk-7 *had* to have gcc-4.2, so I disabled the two tests and built it with gcc-4.1, with no compile/link errors.</div><div><br></div><div>Sadly, at runtime, I got a complaint about the mesa version, and a segfault.   I tried building the requested version of mesa, but that turned out to be problematic. I had gotten a previous version to work by rewriting small parts of mesa's install scripts to not use the python ternary operator.  But the requested version had a lot of other problems and some new dependencies.</div></div><div><br></div><div>So approach 3 is out.  Does anyone see a way to make approach 1 (vtk edge flags), or approach 2 ("surface with edges", but without the surface), or something else work?</div><div><br></div><div>My original problem is to show "surface with edges" where the "edges" are from an original set of geometry, but the "surface" consists of subdivided geometry.   For example, if the original geometry was just one triangle, I'd introduce 4 new vertices (one for the triangle center, and 1 for each edge midpoint).  The subdivided geometry would be 3 quads using those vertices.   So I need both the original edges and thet new texture mapped quads (without z fighting).</div><div><br></div><div>Thanks in advance for any help.</div><div><br></div><div>Greg</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 5:29 PM, Greg Schussman <span dir="ltr"><<a href="mailto:greg.schussman@gmail.com" target="_blank">greg.schussman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi.<div><br></div><div>I am trying to do a variation on "surface with edges".  I subdivide the surface polygons and put new scalar values at the vertices of the sub-polygons.  This is working just fine.  However, I want to show "surface with edges", but I want the original edges, not the subdivided ones.</div><div>I've tried several approaches, without success.<br></div><div><br></div><div>Approach 1:</div><div><br></div><div>I recall OpenGL having an edge flag that did the kind of thing I'm after: as I'd issue glVertex calls between a glBegin and a glEnd, I could also set the edge flag for whether the edge was to be visible.</div><div><br></div><div>Searching around in VTK, I see that VtkDataSetAttributes has EDGEFLAG as one of its AttributeTypes.  I'm afraid I don't understand, because my use of attributes has been scalar or vector values associated with points, but the edge flag wouldn't be associated with points, but rather with, well, edges.  I haven't been able to find an example that uses this, so I'm questioning whether it's even the same thing.</div><div><br></div><div>Approach 2:</div><div><br></div><div>I have the original polygons (from before the subdivision).  I Figured I could just draw "surface with edges" for those, but set their opacity to 0, and leave the edge opacity at 1.  It appears that the cell opacity applies to both the cell and the edges, and I don't see a way to set them independently.  Although edge visibility can be toggled, I don't see a way to toggle the surface visibility while leaving edges visible.</div><div><br></div><div>Approach 3:</div><div><br></div><div>I extracted the edges from the original polygons, and tried drawing them together with the subdivided polygons (where the subdivided polygon edge visibility is off).  This is resulted in what I was after, except there's z fighting between the original edges and the subdivided surfaces.  I read about the various ResoveCoincidentTopology options, but those appear to be for a polygon with it's own edges, not a polygon with some other edges.  I played with them anyway, just in case, but didn't see anything promising.<br></div><div><br></div><div>So... Am I barking up the wrong trees?  How should I show one set of edges on top of another set of polygons?  I'm using python 2.6, talking to vtk-5.10.</div><div><br></div><div>Thanks in advance for any help.</div><span><font color="#888888"><div><br></div><div>Greg</div><div><br></div></font></span></div>
</blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</div>