[vtkusers] Coincident topology questions

Ken Martin ken.martin at kitware.com
Wed Jan 10 19:51:46 EST 2018


Here is part of an old email that has some description

You can use the relative settings if the two coincident polygons are in two
different mappers.

* On Tue, Dec 1, 2015 at 1:29 PM, Ken Martin <ken.martin at
kitware.com <http://public.kitware.com/mailman/listinfo/vtkusers>>
wrote:
*>>>>>* I wanted to take a second to write up a recent change I made to how VTK
*>>* (on the OpenGL2 backend) can handle coincident geometry.  Previously VTK
*>>* supported global values for specifying a polygonal offset to push surfaces
*>>* forward or back in the zbuffer. This was often used to draw a surface back
*>>* a bit in the zbuffer, and then draw the same surface in wireframe mode at
*>>* the normal z location. The result was a wireframe overlaid on top of the
*>>* surface. This approach faced a couple limitations. Every surface was offset
*>>* the same amount and there was no way to offset points from lines.  To
*>>* address this I have added a few methods to vtkMapper to specify global line
*>>* and point offsets as well as ivars to hold local offsets per mapper. The
*>>* global methods look like:
*>>>>*   static void SetResolveCoincidentTopologyLineOffsetParameters(
*>>*     double factor, double units);
*>>>>* while the instance methods look like:
*>>>>*   void SetRelativeCoincidentTopologyLineOffsetParameters(
*>>*     double factor, double units);
*>>>>* Both signatures use two parameters which are worth mentioning. The first
*>>* factor is how much to shift the zbuffer based on how quickly the z values
*>>* of the surface or line changes. This may seem complicated but it addresses
*>>* a simple issue.  Due to rasterization issues, surfaces and lines with sharp
*>>* zvalue slopes are more prone to noise in the zvalues they produce. To
*>>* combat that, we offset them by an amount that is based on their z slope. If
*>>* the surface is perpendicular to the view direction the factor is
*>>* irrelevant, but the more the surface is at a sharp angle to the view
*>>* direction, the more the factor comes into play. A value of 1.0 to 2.0 is
*>>* fairly typical for the factor. The second parameter is the units, a
*>>* constant offset to the zbuffer. It is currently specified conservatively in
*>>* terms of a 16bit zbuffer for the OpenGL backend so a value of 1.0 to 2.0 is
*>>* a good place to start. For rendering points we do not have a slope so those
*>>* methods only take the units argument.
*>>>>* I have changed the global defaults so that surfaces are offset at
*>>* 2.0,2.0, lines are offset at 1.0,1.0, and points are at 0.0. There is a new
*>>* test in OpenGL2/Testing/CXX/TestCoincident.cxx that renders points on top
*>>* of lines on top of a surface while rendering the points first and the
*>>* surface last (the opposite order of their visibility).
*>>>>* Thanks
*>>* Ken*



On Wed, Jan 10, 2018 at 5:44 PM, Langer, Stephen A. (Fed) <
stephen.langer at nist.gov> wrote:

> Hi --
>
> How does one set the arguments to the various vtkMapper::SetRelativeCoincidentTopology
> methods?  I can't find an explanation for 'factor' and 'units'.
>
> 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?
>
> I'm using vtk 8.1.0.
>
> Thanks.
>
>       -- Steve
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180110/cc2d0e3d/attachment.html>


More information about the vtkusers mailing list