Skip to content

Implemented Mollweide projection #4330

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

Merged
merged 12 commits into from
May 30, 2025

Conversation

dusan-prascevic
Copy link
Contributor

Implementation of Mollweide projection (requested in #3095)

Description

Implemented Mollweide projection following the standard mathematical formulation (solving for auxiliary angle via Newton-Raphson iteration). I tried to stick to the same approach as for other projections (e.g. handling out of bounds points etc.)

Fixes # (issue) #3095

Screenshots (if appropriate):

image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • Housekeeping

How Has This Been Tested?

Tested the projection visually and via added test functions in testStelProjector.cpp (kept the same approach as for testing the other projections)

Test Configuration:

  • Operating system: Ubuntu 24.04.2 LTS
  • Graphics Card: Intel Iris Xe

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

Files matching guide/**:

  • Did you remember to update screenshots to match new updates?
  • Did you remember to grammar check in changed part of documentation?

This is an automatically generated QA checklist based on modified files.

@github-project-automation github-project-automation bot moved this to Backlog in Projections May 18, 2025
@alex-w alex-w moved this from Backlog to In review in Projections May 18, 2025
Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Please remove temporary testing data from git

@alex-w alex-w added this to the 25.2 milestone May 18, 2025
@Atque
Copy link
Contributor

Atque commented May 19, 2025

Hmm, the angular distortions normally expected only far from the center of projection do not seem to change with FOV. Is this intentional?

Hmmm again, I might be misunderstanding the projection.

Ah nevermind. The center of projection is supposed to look like this. See this image with Tissot ellipses:
image

@gzotti
Copy link
Member

gzotti commented May 19, 2025

For me it looks (mostly) good!

Two things:

  • You need to include StelUtils.hpp in StelProjectorClasses.hpp to reach M_PIf.
  • Sometimes there are border lines escaping from the map. (See north pole.)
    image

Maybe this relates to #4328, so it would add to "small/harmless gitches" if there is no trivial solution.

@alex-w
Copy link
Member

alex-w commented May 20, 2025

Please check artefacts, like this:
stellarium-002

@10110111
Copy link
Contributor

10110111 commented May 20, 2025 via email

@gzotti gzotti linked an issue May 20, 2025 that may be closed by this pull request
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the has conflicts The pull request has conflicts label May 20, 2025
@dusan-prascevic
Copy link
Contributor Author

Thanks to everyone for valuable feedback!

@gzotti The visual glitches for constellation borders are indeed very annoying. I attempted to account for them with more specialized intersectViewportDiscontinuityInternal method in the Mollweide Projector class or by implementing a clippingCap for the top and bottom edges of the ellipse (where glitches commonly appear), but unfortunately without success...

I tried handling this region specifically in the fIter in StelPainter.cpp (e.g. adjusting tesselation settings, which seemed to make the issue better but not go away completely). But overall I am very unfamiliar with this part of the codebase and the logic behind fIter, drawSmallCircleArc etc.

@alex-w
Copy link
Member

alex-w commented May 26, 2025

@dusan-prascevic please rebase the PR

@alex-w
Copy link
Member

alex-w commented May 28, 2025

A screenshot from the macOS (retina display):
stellarium-003

My previous screenshot was taken in Linux with HiDPI monitor - please see left and right sides of the screenshot and compare it to your or Georg's one - looks like wrong clipping of the screen.

Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the has conflicts The pull request has conflicts label May 28, 2025
@dusan-prascevic
Copy link
Contributor Author

@alex-w so if I understand you correctly, on MacOS the projection ellipse is getting clipped (even at full FOV)?
That's strange, I'll look into it!

@10110111
Copy link
Contributor

please see left and right sides of the screenshot and compare it to your or Georg's one - looks like wrong clipping of the screen

Doesn't sinusoidal projection behave the same way? I think it's inevitable when we limit the vertical FoV instead of the horizontal one, so changing aspect ratio of Stellarium window will clip the sides.

@alex-w
Copy link
Member

alex-w commented May 28, 2025

Doesn't sinusoidal projection behave the same way? I think it's inevitable when we limit the vertical FoV instead of the horizontal one, so changing aspect ratio of Stellarium window will clip the sides.

Yes, of course! Thanks for pointing the source of "issue"

@alex-w
Copy link
Member

alex-w commented May 28, 2025

@alex-w so if I understand you correctly, on MacOS the projection ellipse is getting clipped (even at full FOV)? That's strange, I'll look into it!

Yes, but don't worry - this is not a bug in the projection

Copy link
Member

@gzotti gzotti left a comment

Choose a reason for hiding this comment

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

Comparing this to Hammer-Aitoff and Sinusoidal, the glitches made by border lines at the poles also appear there. A general solution would be nice, but is not a blocker here.

The rest just works nicely, it's fine for me. A squash into one commit seems OK for me.

@alex-w alex-w self-requested a review May 30, 2025 16:17
@alex-w
Copy link
Member

alex-w commented May 30, 2025

Why the maximum FOV is 185 degrees?

@gzotti
Copy link
Member

gzotti commented May 30, 2025

Compare with Hammer-Aitoff and Sinusoidal. Both have 185°, meaning it just exceeds the from-pole-to-pole vertical fov. The three behave very similar in this respect.

@Atque
Copy link
Contributor

Atque commented May 30, 2025

Wouldn't 180 degrees be more intuitive? Or is it intentionally limited to just above 180, to get both the poles visible at max FOV?

@10110111
Copy link
Contributor

Wouldn't 180 degrees be more intuitive? Or is it intentionally limited to just above 180, to get both the poles visible at max FOV?

I think it was a tradeoff that enabled a bit more of the sides to be included at some typical screen/window aspect ratios used by the person who decided on these limits. Ideally the limit should be based on horizontal FoV, or maybe on some kind of minimum or maximum of the two.

@alex-w alex-w marked this pull request as ready for review May 30, 2025 17:29
@github-actions github-actions bot requested review from alex-w and gzotti May 30, 2025 17:30
@alex-w alex-w merged commit 39ba549 into Stellarium:master May 30, 2025
18 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Projections May 30, 2025
@gzotti
Copy link
Member

gzotti commented May 30, 2025

I think the point of 185 for Hammer/Sinusoidal was having the bottom not interact with the bottom status/button bar. But it's another task to rebalance all projections for whatever new demands arise.

@lf0k0nle
Copy link

Thank you everybody!

@dusan-prascevic
Copy link
Contributor Author

Thanks to everyone for taking the time to review the PR and provide feedback

@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Jun 16, 2025
Copy link

Hello @dusan-prascevic!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Jun 22, 2025
Copy link

Hello @dusan-prascevic!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

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

Successfully merging this pull request may close these issues.

Mollweide Projection
6 participants