Skip to content

Idea: Rendering quad mesh #1

@robbievanleeuwen

Description

@robbievanleeuwen

Hi @connorferster, I saw that one of the limitations of this package is that it currently does not render plates as they are quadrilaterals and plotly only handles triangles.

I have faced a similar problem when I wrote a little 2D plane stress library, planestress (unfinished to date), where I have quad4, quad8 and quad9 elements - matplotlib can also only render contours with a triangular mesh, but I had to make this work for 4-noded, 8-noded and 9-noded quads.

My solution (maybe you've already got a solution but here's my 2 cents 😄 ):

  • Plotting the mesh: each element outline is plotted as a polygon (covers triangles and quads, and their nodes)
  • Plotting results, i.e. contours, vectors etc.: each element has a get_triangulation() method that returns a simple triangular mesh, e.g. a 4-noded quad has two triangles with nodes [[0,1,2],[0,2,3]] (see method for quad4 and quad9). This triangulation is used, in conjunction with the stresses at the nodes, to generate a contour plot which can be overlaid on top of the mesh plot.

Of course this is just one way to do it, thought I'd just put it out there! Also here's a small example, albeit with triangular elements, but it still uses the get_triangulation() method in the background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions