Skip to main content

pynite_plotly: Plotly visualization for PyNiteFEA

Installation

pip install pynite-plotly

Basic Usage

pynite-plotly can be used as a drop-in replacement for PyNite's own PyVista rendering module.

So, simply replace:

from PyNite.Rendering import Renderer

with this:

from pynite_plotly import Renderer

And then visualize your model according to the API for the PyNite renderer:

from PyNite import FEModel3D

model = FEModel3D()

### ... build your model here...

vis = Renderer(model)
vis.render_model()

Additional Features

The Renderer class has a few additional attributes beyond the attributes in the PyNite Renderer. These are useful for modifying colors and line weights of the elements in the plot.

  • .colors - A dict that has keys corresponding to the different elements in the plot
  • .line_widths - A dict that has keys corresponding to the different linear elements in the plot

Change the values of the keys and run .update to see how they affect the plot!

Current Limitations

2024-11-01: I have only implemented rendering frames and loads. I have not implemented plates/quads/area loads. It will take a special effort because plotly renderers meshes (the plates) as triangles but PyNite uses a quad mesh for FEA.

So, to render everything like PyVista will require remeshing the quad mesh as triangles and having the ability to plot the lines of the quad mesh overtop of the triangulated quad mesh which can also have gradient shading according to the results being plotted.

Additionally, I have not implemented plotting of nodes and node labels yet. No real reason but I noticed that they were not implemented in the PyNite Renderer so I just kept chill on it...for now.

Motivation

PyNiteFEA is excellent and has been becoming more so. In v0.0.94 @JWock82 released PyVista visualization to complement the existing VTK visualization. This has been a great improvement in usability since PyVista can run within a Jupyter notebook as opposed to launching a separate operating system window for the visualization (VTK).

To get PyVista running in Jupyter, requires Trame and a load of other dependencies. These dependencies typically lag behind the latest Python version. Additionally, PyVista does not run everywhere on the web yet (like streamlit).

However, plotly has similar 3D plotting capability to PyVista, runs everywhere, and has a light dependency load.

So, using a helper library I created, plotly_3d_primitives, I then copied the original PyNite Rendering module and swapped out the PyVista method names with my new plotly function names. Did a little bit of massaging and...voila! A new rendering module for PyNite!

Metadata

Release files for pynite-plotly 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynite-plotly 0.4.1
File Size Uploaded
pynite_plotly-0.4.1.tar.gz 87.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynite-plotly 0.4.1
File Interpreter ABI Platform
pynite_plotly-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 103.3 kB

Release files / pynite_plotly-0.4.1.tar.gz

Download URL pynite_plotly-0.4.1.tar.gz
Size 87.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2670d7bea95f7d76710fe0f1795016253284d4cafbf2e5f9ff4e9f168ae959f1
BLAKE2b-256 checksum
How to use checksums
9188afaeaaf2ddb3f7518c7f33a07d95c805052a75c727f18efb190138879b96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / pynite_plotly-0.4.1-py3-none-any.whl

Download URL pynite_plotly-0.4.1-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89b724177cfbabe6257579d4c86dc9696cae7750c758db13f8b87b8e27099168
BLAKE2b-256 checksum
How to use checksums
4d088244ccf2008b5698190267bc1c992fc8180be8ffefcaf3fa5104421748e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page