Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

user27182
Copy link
Contributor

@user27182 user27182 commented Jul 14, 2024

Overview

This class uses the OrthogonalPlanesSource from #6366 to create a new assembly class.

It inherits from XYZAssembly and is similar to the AxesAssembly class with the following main differences:

  1. AxesAssembly uses AxesGeometrySource for its geometry, whereas PlanesAssembly uses OrthogonalPlanesSource
  2. AxesAssembly uses the Label class for its labels, whereas PlanesAssembly uses a customized vtkAxisActor

Here's a preview of this feature using similar a similar example to the AnatomicalOrientation vtk example. Unlike that example, which uses vtkVectorText for the plane labels which remain static and will appear "backwards" if viewed from behind the plane, the labels for this new class instead follow the camera.

import pyvista as pv
from pyvista import examples
human = examples.download_human()
labels = 'Transverse', 'Sagittal', 'Coronal'
planes_assembly = pv.PlanesAssembly(bounds=human.bounds, labels=labels, label_size=25)
plot = pv.Plotter() 
plot.add_mesh(human, color='yellow')
plot.add_actor(planes_assembly) 
planes_assembly.camera = plot.camera 
plot.show()
PlanesAssembly.mov

@user27182 user27182 marked this pull request as draft July 14, 2024 01:44
@pyvista-bot pyvista-bot added documentation Anything related to the documentation/website enhancement Changes that enhance the library labels Jul 14, 2024
@tkoyama010
Copy link
Member

This is awesome! Thanks for working for this :)

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.27%. Comparing base (ecd25c6) to head (ffd6fb9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6379      +/-   ##
==========================================
+ Coverage   97.25%   97.27%   +0.02%     
==========================================
  Files         142      142              
  Lines       26763    26984     +221     
==========================================
+ Hits        26029    26250     +221     
  Misses        734      734              

@pyvista-bot
Copy link
Contributor

pyvista-bot commented Jul 24, 2024

@pyvista-bot pyvista-bot temporarily deployed to pull request July 24, 2024 22:28 Inactive
@pyvista-bot pyvista-bot temporarily deployed to pull request July 26, 2024 22:06 Inactive
@user27182 user27182 marked this pull request as ready for review July 26, 2024 23:48
@user27182
Copy link
Contributor Author

The doc_image_cache still needs to be updated to reflect the fix in 535924d but otherwise this PR is ready

@pyvista-bot pyvista-bot temporarily deployed to pull request July 27, 2024 03:00 Inactive
@pyvista-bot pyvista-bot temporarily deployed to pull request July 27, 2024 06:22 Inactive
@tkoyama010
Copy link
Member

pre-commit.ci autofix

Copy link
Member

@tkoyama010 tkoyama010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

@tkoyama010 tkoyama010 enabled auto-merge (squash) July 30, 2024 23:12
@tkoyama010 tkoyama010 merged commit 1db3231 into main Jul 31, 2024
@tkoyama010 tkoyama010 deleted the feat/planes_assembly branch July 31, 2024 02:05
@pyvista-bot pyvista-bot temporarily deployed to pull request July 31, 2024 02:46 Inactive
@banesullivan banesullivan mentioned this pull request Apr 17, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the documentation/website enhancement Changes that enhance the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants