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

Feat/robust visualization #5

Merged
merged 64 commits into from
Oct 15, 2024
Merged

Conversation

HarrisonKramer
Copy link
Owner

No description provided.

…ke plotting generic for any coordinate systems
Add a new class, Mirror3D, to represent a 3D mirror surface in the optiland.visualization module. This class inherits from the Surface3D class and provides methods for configuring the material properties of the mirror surface.

The Mirror3D class takes a mirror surface and an extent as arguments in its constructor. The _configure_material method is used to set the color, ambient, diffuse, specular, and specular power properties of the mirror surface actor.

This commit adds the Mirror3D class to the optiland.visualization.mirror module.
Refactor the Lens3D class in lens.py to improve code organization and readability. The changes include:
- Adding a nested Lens3D class with proper documentation and attributes
- Implementing the is_symmetric method to check if all surfaces in the lens are symmetric
- Refactoring the plot method to handle both symmetric and non-symmetric lenses
- Adding helper methods for plotting single lenses and configuring material properties
- Refactoring the _plot_surfaces method to compute sag values and plot the surfaces
- Adding the _get_edge_surface method to generate VTK actors representing the surface between two circles
- Refactoring the _plot_surface_edges method to calculate the maximum extent of the surfaces and plot circular edges

These changes improve the overall structure and maintainability of the Lens3D class and its visualization methods.
The Surface3D class in surface.py has been refactored to improve the plotting of 3D surfaces. The changes include:
- Moving the initialization of the Surface2D superclass to the Surface3D constructor
- Adding a get_surface() method to retrieve the surface actor based on the symmetry of the surface geometry
- Splitting the plot() method into separate methods for generating symmetric and asymmetric surface actors
- Adding a _configure_material() method to configure the material properties of the surface actor
- Converting the surface actor to global coordinates after generating it

These changes enhance the flexibility and readability of the Surface3D class, making it easier to plot both symmetric and asymmetric surfaces.
…nteractor

This commit updates the OpticViewer3D class in the visualization module. It adds instance variables for the render window and interactor, and modifies the view method to use these variables. This change improves the code organization and makes it easier to manage the rendering window and interactor in the 3D viewer.

Refactor the OpticViewer3D class to handle the rendering window and interactor.
@HarrisonKramer HarrisonKramer merged commit 3cb337a into master Oct 15, 2024
3 checks passed
@HarrisonKramer HarrisonKramer deleted the feat/robust_visualization branch October 15, 2024 09:26
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 80.36437% with 97 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
optiland/visualization/lens.py 58.19% 51 Missing ⚠️
optiland/visualization/surface.py 64.86% 26 Missing ⚠️
optiland/surfaces/standard_surface.py 14.28% 6 Missing ⚠️
optiland/coordinate_system.py 75.00% 4 Missing ⚠️
optiland/visualization/system.py 93.61% 3 Missing ⚠️
optiland/visualization/utils.py 93.75% 3 Missing ⚠️
optiland/optic.py 33.33% 2 Missing ⚠️
optiland/visualization/visualization.py 97.77% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
unittests 94.66% <80.36%> (-1.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
optiland/geometries/chebyshev.py 97.67% <100.00%> (+0.05%) ⬆️
optiland/geometries/even_asphere.py 100.00% <100.00%> (ø)
optiland/geometries/plane.py 100.00% <100.00%> (ø)
optiland/geometries/polynomial.py 100.00% <100.00%> (ø)
optiland/geometries/standard.py 100.00% <100.00%> (ø)
optiland/surfaces/surface_factory.py 79.20% <100.00%> (ø)
optiland/visualization/__init__.py 100.00% <100.00%> (ø)
optiland/visualization/mirror.py 100.00% <100.00%> (ø)
optiland/visualization/rays.py 100.00% <100.00%> (ø)
optiland/optic.py 78.26% <33.33%> (-0.55%) ⬇️
... and 7 more

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.

2 participants