Skip to content

feat: add Plotly 3D WebGL viewer, close CylindricalLens sides, resolve Eigen3 via eigency, and add CI - #195

Open
hstarmans wants to merge 1 commit into
cihologramas:masterfrom
hstarmans:master
Open

feat: add Plotly 3D WebGL viewer, close CylindricalLens sides, resolve Eigen3 via eigency, and add CI#195
hstarmans wants to merge 1 commit into
cihologramas:masterfrom
hstarmans:master

Conversation

@hstarmans

@hstarmans hstarmans commented Sep 6, 2026

Copy link
Copy Markdown

Hey @ramezquitao,

Great to see you still maintaining and updating the repository!

I've been working on upgrades to my open-source laser scanner project and needed pyoptools once again. While integrating it, I addressed a few practical pain points, which are consolidated here in a two commits.
The second contains much more, there was a small issue in shading with this commit which I addressed later.
All in all, I just want it to work and the code be decent. I looked at what the agent changed and it seems good..

The following is all created by Gemini 3.8.

Simplified the Eigen3 dependency so it builds out of the box with modern package managers (uv / pip) without requiring manual header installations or root access.
Closed the lateral sides of CylindricalLens so it behaves as a true watertight optical solid.
Added a Plotly-based 3D WebGL viewer compatible with modern reactive notebook environments like Marimo, JupyterLab 4, and VS Code (gracefully falling back when pythreejs is missing).
Added a cross-platform GitHub Actions CI matrix (ubuntu, macos, windows across Python 3.10–3.12) to ensure ongoing stability (all 9 checks currently pass green).
(Much of the scaffolding and testing was pair-programmed with Gemini.)

I have a few other smaller improvements and fixes that I'll submit in separate, focused pull requests once this is reviewed. Hope this helps the project!

Summary of Changes

  1. Native Eigen3 Dependency Resolution via eigency:

    • Declared "eigency" in [build-system] requires in pyproject.toml and detect headers via eigency.get_includes() in setup.py.
    • Resolves Eigen3 headers automatically in isolated build environments via uv or pip without needing root access, system packages, or hardcoded include paths.
  2. Watertight CylindricalLens:

    • Added physical lateral closing surfaces S3 (top), S4 (bottom), S5 (left), and S6 (right) with exact analytical sag matching.
    • Resolves the upstream TODO: Falta cerrar la lente por los lados so ray propagation and 3D visualization treat cylindrical lenses as closed physical bodies.
  3. Universal 3D WebGL Viewer (pyoptools.gui.plotly_viewer):

    • Added an interactive 3D WebGL viewer using Plotly (pyoptools.gui.plotly_viewer.plot_system_plotly), compatible with modern browser notebooks (Marimo, JupyterLab 4, VS Code, and standalone HTML).
    • Updated pyoptools.gui.ipywidgets.Plot3D with backend="auto", defaulting gracefully to Plotly without breaking if pythreejs is not installed.
  4. Cross-Platform GitHub Actions CI (.github/workflows/test.yaml):

    • Added automated test matrix across Linux (ubuntu-latest), macOS (macos-latest), and Windows (windows-latest) on Python 3.10, 3.11, and 3.12 using astral-sh/setup-uv@v5.
    • Fixed Windows-specific file locking in tests/raytrace/library/test_library.py and specified encoding="utf-8" on data loading.
    • All 9 matrix jobs pass 100% green.

…e Eigen3, and add CI

- Add `pyoptools.gui.plotly_viewer` providing interactive 3D WebGL optical
  visualization compatible with Marimo, JupyterLab 4, and VS Code.
- Update `pyoptools.gui.ipywidgets.Plot3D` with `backend="auto"`, defaulting
  to Plotly without crashing if pythreejs is missing.
- Complete `CylindricalLens` by adding lateral closing surfaces S3..S6 for
  watertight optical geometry and ray propagation.
- Declare `eigency` in `[build-system] requires` in `pyproject.toml` and detect
  via `eigency.get_includes()` in `setup.py`, allowing native build via uv/pip
  without requiring root or system package managers for Eigen3 headers.
- Add GitHub Actions CI workflow in `.github/workflows/test.yaml` running the
  test suite across Linux, macOS, and Windows on Python 3.10, 3.11, and 3.12.
- Add comprehensive unit tests in `tests/gui/test_plotly_viewer.py` and
  `tests/raytrace/component/test_component.py`.
- Make `tests/test_coding_standards.py` robust against missing linter tools.
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.

1 participant