[vtkusers] Subdivided surface with non-subdivided edges (z fighting)

Greg Schussman greg.schussman at gmail.com
Mon Aug 15 20:29:30 EDT 2016


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.
I've tried several approaches, without success.

Approach 1:

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.

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.

Approach 2:

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.

Approach 3:

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.

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

Thanks in advance for any help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160815/7087751b/attachment.html>

More information about the vtkusers mailing list