<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Courier New";
panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New",serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Courier;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.msoIns
{mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
color:teal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Ken --<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I've attached a short program that reproduces the problem. It creates a rectilinear grid (gray checkerboard pattern) and an unstructured grid (red tetrahedra). The surfaces of some of the tetrahedra are coincident with the outer surfaces
of the checkerboard. If you rotate the view, the tetrahedra are not drawn correctly.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I've tested this with vtk 8.1.0 on macOS 10.12.6 (using vtk built for cocoa) and on Ubuntu 17.10 (running under VirtualBox on macOS).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for taking a look at it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-- Steve<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Ken Martin <ken.martin@kitware.com><br>
<b>Date: </b>Thursday, January 11, 2018 at 2:41 PM<br>
<b>To: </b>"Langer, Stephen A. (Fed)" <stephen.langer@nist.gov><br>
<b>Cc: </b>"vtkusers@vtk.org" <vtkusers@vtk.org><br>
<b>Subject: </b>Re: [vtkusers] Coincident topology questions<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Yes, that should work and -3, -3 is pretty reasonable for values. Something odd is going on. Can you give a bit more detail or a snippet of code?
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Jan 11, 2018 at 2:30 PM, Langer, Stephen A. (Fed) <<a href="mailto:stephen.langer@nist.gov" target="_blank">stephen.langer@nist.gov</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">So if I use
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">and<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-3,- 3);<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">then polygons drawn with that mapper should obscure coincident polygons drawn with other mappers? That's not happening. What am I missing?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-- Steve<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Ken Martin <<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>><br>
<b>Date: </b>Wednesday, January 10, 2018 at 7:52 PM<br>
<b>To: </b>"Langer, Stephen A. (Fed)" <<a href="mailto:stephen.langer@nist.gov" target="_blank">stephen.langer@nist.gov</a>><br>
<b>Cc: </b>"<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<b>Subject: </b>Re: [vtkusers] Coincident topology questions</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Here is part of an old email that has some description
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">You can use the relative settings if the two coincident polygons are in two different mappers.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<pre style="white-space:pre-wrap"><i><span style="color:black"> On Tue, Dec 1, 2015 at 1:29 PM, Ken Martin <<a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7Ceb611caace3b43fd388508d5588d7ed0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636512287107516935&sdata=MOAz%2BaPGI75IQNOwc551Ke8i2lYFFFyY3aD3E4dq%2BuQ%3D&reserved=0" target="_blank">ken.martin at kitware.com</a>> wrote:</span></i><o:p></o:p></pre>
<pre><span style="color:black">><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> I wanted to take a second to write up a recent change I made to how VTK</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> (on the OpenGL2 backend) can handle coincident geometry. Previously VTK</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> supported global values for specifying a polygonal offset to push surfaces</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> forward or back in the zbuffer. This was often used to draw a surface back</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> a bit in the zbuffer, and then draw the same surface in wireframe mode at</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> the normal z location. The result was a wireframe overlaid on top of the</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> surface. This approach faced a couple limitations. Every surface was offset</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> the same amount and there was no way to offset points from lines. To</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> address this I have added a few methods to vtkMapper to specify global line</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> and point offsets as well as ivars to hold local offsets per mapper. The</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> global methods look like:</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> static void SetResolveCoincidentTopologyLineOffsetParameters(</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> double factor, double units);</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> while the instance methods look like:</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> void SetRelativeCoincidentTopologyLineOffsetParameters(</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> double factor, double units);</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> Both signatures use two parameters which are worth mentioning. The first</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> factor is how much to shift the zbuffer based on how quickly the z values</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> of the surface or line changes. This may seem complicated but it addresses</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> a simple issue. Due to rasterization issues, surfaces and lines with sharp</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> zvalue slopes are more prone to noise in the zvalues they produce. To</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> combat that, we offset them by an amount that is based on their z slope. If</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> the surface is perpendicular to the view direction the factor is</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> irrelevant, but the more the surface is at a sharp angle to the view</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> direction, the more the factor comes into play. A value of 1.0 to 2.0 is</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> fairly typical for the factor. The second parameter is the units, a</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> constant offset to the zbuffer. It is currently specified conservatively in</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> terms of a 16bit zbuffer for the OpenGL backend so a value of 1.0 to 2.0 is</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> a good place to start. For rendering points we do not have a slope so those</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> methods only take the units argument.</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> I have changed the global defaults so that surfaces are offset at</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> 2.0,2.0, lines are offset at 1.0,1.0, and points are at 0.0. There is a new</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> test in OpenGL2/Testing/CXX/TestCoincident.cxx that renders points on top</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> of lines on top of a surface while rendering the points first and the</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> surface last (the opposite order of their visibility).</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> </i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> Thanks</i></span><o:p></o:p></pre>
<pre><span style="color:black">>><i> Ken</i></span><o:p></o:p></pre>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Wed, Jan 10, 2018 at 5:44 PM, Langer, Stephen A. (Fed) <<a href="mailto:stephen.langer@nist.gov" target="_blank">stephen.langer@nist.gov</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt">Hi --<br>
<br>
How does one set the arguments to the various vtkMapper::SetRelativeCoincidentTopology methods? I can't find an explanation for 'factor' and 'units'.<br>
<br>
The attached screenshot shows a surface representation of a grid of rectangular voxels and a wire-frame grid of tetrahedra. Four of the tetrahedral elements are also drawn with a surface representation in red and are supposed to obscure the voxels, but a mix
of tex and voxel is drawn instead. The surfaces of the voxels and the tetrahedral are coplanar. They don't share nodes and edges, but the points on the x=0 face all have x=0 exactly. Is the coincident topology resolution machinery expected to work in this
case?<br>
<br>
I'm using vtk 8.1.0.<br>
<br>
Thanks.<br>
<br>
-- Steve<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com&data=02%7C01%7Cstephen.langer%40nist.gov%7Ceb611caace3b43fd388508d5588d7ed0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636512287107516935&sdata=5QzbWO3Fo9lHhuc2VH8Y7Wlun4i%2BdDk1p%2Fd2zzsQuho%3D&reserved=0" target="_blank">
www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Cstephen.langer%40nist.gov%7Ceb611caace3b43fd388508d5588d7ed0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636512287107516935&sdata=h7DBgY2pmRRUZD6LrmGpIHO1oIOADRTuXF3XffiY%2Fgk%3D&reserved=0" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Cstephen.langer%40nist.gov%7Ceb611caace3b43fd388508d5588d7ed0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636512287107516935&sdata=LbMs8SnnejFm%2BgoK7jbU7Q32nAXIUq6tYfeL1%2FrSVhU%3D&reserved=0" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7Ceb611caace3b43fd388508d5588d7ed0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636512287107516935&sdata=RBVsZcDO3qCqk7Q%2BNWm74dXagCcgvDWKhwPP2fYdBpc%3D&reserved=0" target="_blank">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7Ceb611caace3b43fd388508d5588d7ed0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636512287107516935&sdata=Cigk%2F94r%2BYZdT6qteN4lhfgTn2SnkHc5nqXvzI3pREc%3D&reserved=0" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">--
<o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Ken Martin PhD
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Distinguished Engineer<br>
<span style="font-size:9.5pt">Kitware Inc.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmaps.google.com%2F%3Fq%3D28%2BCorporate%2BDrive%2B%250D%2BClifton%2BPark%2BNY%2B12065%26entry%3Dgmail%26source%3Dg&data=02%7C01%7Cstephen.langer%40nist.gov%7Cf37855aff09d4873915208d5592b52fe%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636512964960094193&sdata=C%2Ftp6ax8hFkI0osmhjEhqtg4x1BoiqxdUimXsDuAOYM%3D&reserved=0">28
Corporate Drive</a><br>
Clifton Park NY 12065<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;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><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Ken Martin PhD <o:p></o:p></p>
<div>
<p class="MsoNormal">Distinguished Engineer<br>
<span style="font-size:9.5pt">Kitware Inc.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">28 Corporate Drive<br>
Clifton Park NY 12065<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;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><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>