Skip to content

Commit

Permalink
Merge pull request #69 from davidrudlstorfer/add_pyvista_options
Browse files Browse the repository at this point in the history
Add parallel projection and cosys in pyvista
  • Loading branch information
isteinbrecher authored Apr 24, 2024
2 parents c7e2019 + b32cf91 commit 031d25c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions meshpy/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ def display_pyvista(
beam_radius_for_display=0.1,
resolution=20,
is_testing=False,
parallel_projection=False,
**kwargs,
):
"""Display the mesh in pyvista
Expand All @@ -803,11 +804,18 @@ def display_pyvista(
is_testing: bool
Flag if the function is used for testing. If true, the pv.plotter object
will be returned.
parallel_projection: bool
Flag to change camera view to parallel projection.
**kwargs:
Have a look at Mesh().get_vtk_representation
"""

plotter = pv.Plotter()
plotter.renderer.add_axes()

if parallel_projection:
plotter.enable_parallel_projection()

vtk_writer_beam, vtk_writer_solid = self.get_vtk_representation(**kwargs)

if vtk_writer_beam.points.GetNumberOfPoints() > 0:
Expand Down

0 comments on commit 031d25c

Please sign in to comment.