Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Quad Local Axes & Improvements to VTK Contour Rendering #197

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bjhowie
Copy link
Contributor

@bjhowie bjhowie commented May 7, 2024

I'm aware that the VTK rendering in the Visualization module is being deprecated, but I've made some changes for my own project that I think dramatically improve the look of the quad and plate contour plots and would be good to include in PyNite.
Namely, I have added a subdivision layer that improves the resolution of the underlying scalar field, resulting in smoother looking plots. I've also added an option to use banded contours instead of the default continous colour scale. By default, I've also added an edge extraction filter in order to better see the outline of the individual plates.

Following the issue raised previously (#192), I've also implemented user-defined quad local axes via the use of a vector defined for each quad that gets projected onto the quad to form the local x axis. The local y & z axes are defined as before.
There is however a situation where the defined vector is normal to the plane of the quad, in which case another vector needs to be chosen to form the local x axis. I have just defaulted to using the previous definition (the node3 -> node4 vector) in such cases, and also when the local axis vector is set to 'None'. My preference would be to try and align the local y axs with the global y axs when it isn't possible to align the x axes, but this is less backward compatible. By default, the quads now align their local x axis to the global x axis, requiring a slight change to the tank test case telling the quad to use the previous local axis definition.

I have also stored the materal name as an instance attribute for quads and plates to make it consistent with the Member3D class.

All tests are passing.

-Add a subdivision layer to improve the smoothness of the contour plot
-Added option to create banded contour plot
-Added optional edge extraction layer in order to display plate/quad edges in the renderer. This is set as on by default
@bjhowie
Copy link
Contributor Author

bjhowie commented May 7, 2024

Actually, hold fire on this one. I'm getting some odd deflection results on one of my models, but having trouble reproducing.

@bjhowie
Copy link
Contributor Author

bjhowie commented May 12, 2024

Issue seemed to be that I didn't update the Quad T matrix to use the new local axis orientation. Looks to be working much better now.

Below is a comparison of a rectangular vs skewed quad raft footing example. There is a bit of a difference in the peak sagging moment at the point load locations, but I'm thinking this is due to the different meshing, not due to the axis transformation. Away from the point loads, the shape of the plots look pretty similar. Deflections all look good now too.

raftplot_comparison

@connorferster
Copy link
Contributor

@bjhowie and @JWock82

I have been thinking about the visualizations. The VTK is such a great visualization and I think it would be unfortunate to effectively discard all of that effort by deprecating it. My suggestion is to instead to move the visualization engines to separate packages then folks can use the engine most suited to their use case (e.g. VTK is probably best for creating desktop apps).

@SoundsSerious
Copy link
Contributor

@connorferster I dont nessicarily think these changes will be lost by a switch to PyVista since there is inter-operability.

https://tutorial.pyvista.org/tutorial/06_vtk/index.html

I personally haven't delved into VTK development since the API seems somewhat complicated, but pyvistas interface seems easy enough. I think as a strategy it could be useful for lowering the bar for contributions from those who aren't VTK proficient but can handle numpy / matplotlib style functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants