[vtkusers] vtkQuadraticHexahedron visible edges or wireframe show triangles within the 3D cell faces

Greg Thorwald G.Thorwald at QuestIntegrity.com
Thu Sep 12 12:59:33 EDT 2013


Hi Bill,

Thank you for pointing me to the test example, and thanks for your quick reply.  Your explanation and the test code were very helpful.  I've implemented the vtkExtractedEdges filter and do get the expected edge lines for the vtkQuadraticHexahedron cells; it gives the full wire frame of the mesh without the cells.  

I would like to combine both the hexahedron cells and their extracted edges in the scene.  I've tried using two actors: one actor to add the hex cells, and a second actor to add the edges.  The edge lines appear intermittent in places, possibly due to the coincident topology of the edges and cells.  After some searching I found the vtkCoincidentTopologyResolutionPainter which looks like it has some options to adjust the actor z-sort to help the edges appear correctly in the scene.  It sounds like I need to connect the painter to the mapper.  Here is a bit of C# code that I've tried, but the edge lines are still intermittent, and I don't seem to have access to any of the "resolve coincident topology" methods in the mapper or painter (the unstructured grid was defined earlier in the code):

vtkExtractEdges edgeExtract = new vtkExtractEdges();
edgeExtract.SetInputConnection(unstructuredGrid.GetProducerPort());    // so far so good, cell edges are extracted
// use the painter class to resolve the coincident topology between the extracted edges and cells?
vtkPainterPolyDataMapper mapperEdge = new vtkPainterPolyDataMapper();
mapperEdge.SetInputConnection(edgeExtract.GetOutputPort());
vtkCoincidentTopologyResolutionPainter painter = new vtkCoincidentTopologyResolutionPainter();
mapperEdge.SetPainter(painter);

vtkActor actorEdge = new vtkActor();    // second actor for the edges
actorEdge.SetMapper(mapperEdge);
actorEdge.GetProperty().SetColor(0, 0, 0);  // black color for element edges
actorsList.Add(actorEdge);    // the hex cells were added to the list previously

I'm trying the vtkPainterPolyDataMapper instead of the vtkPolyDataMapper I used with the unstructured grid. 
Suggestions on how I should connect the painter to the mapper and how to access the methods to adjust the edges z-sort for the coincident topology would be very helpful and welcome.
Thank you for the help.

I'm using VTK 5.8 with the C# wrapper through Visual Studio 2012.

Regards,
Greg Thorwald

-----Original Message-----
From: Bill Lorensen [mailto:bill.lorensen at gmail.com] 
Sent: Wednesday, September 11, 2013 12:41 PM
Subject: Re: [vtkusers] vtkQuadraticHexahedron visible edges or wireframe show triangles within the 3D cell faces

When you set EdgeVisibility you will see the edges of the triangles that render the cell. To see the true edges of the cell use the vtkExtractEdges filter. There is a python test:
/Filters/Extraction/Testing/Python/ExtractEdgesQuadraticCells.py that illustrates the usage.

On Wed, Sep 11, 2013 at 2:11 PM, Greg Thorwald <G.Thorwald at questintegrity.com> wrote:
> Hello,
>
> I am using the vtkHexahedron and vtkQuadraticHexahedron to view FEA 
> meshes and results for linear 8-node brick elements and quadratic 
> 20-node brick elements.  I noticed that when using the 
> vtkProperty.SetEdgeVisibility(1) to show the cell edges, the 
> vtkQuadraticHexahedron shows triangles on the cell faces.  The 
> triangle lines on the quadratic cell faces are from a middle edge 
> point across the cell face to the edge points on adjacent face edges, 
> in addition to the edge lines between the corner points.  There is 
> also one straight line across the cell face between two of the middle 
> edge points on opposite edges of the face. The linear vtkHexahedron cell shows only the edge lines between corner points.
>
> I haven't found another option in vtkProperty to change the appearance 
> of the quadratic cell visible edges.  Is there a property, or perhaps 
> a filter that would show only the 12 edge curves between the 8 cell 
> corners and not show the extra triangle lines within the cell face?
>
> If the triangle lines on the cell faces are intrinsic to the 
> vtkQuadraticHexahedron cell, one approach would be to omit the mid 
> side edge points from the data when showing the brick element mesh and 
> just use the vtkHexahedron.  But it would be nice to show curved edges 
> using the mid side point locations if possible.  Or would converting 
> the 3D hex cells to a quadratic quad cells be worthwhile, if that 
> would show just the faces visible on the mesh surfaces?  I've found 
> discussion in vtkusers about adding a second actor to the scene that 
> contains just the edges.  Using two
> actors: one actor would show the 3D cells and another actor would show 
> just the edges and then superimpose both actors.  I would appreciate 
> your insight to possible changes to my approach to improve the 
> appearance of the quadratic hexahedron edges.
>
> Thank you for your help.
>
> Regards,
> Greg Thorwald



More information about the vtkusers mailing list