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

Support drawing rectangle at an angle or generic polygon #224

Closed
pllim opened this issue May 12, 2021 · 2 comments
Closed

Support drawing rectangle at an angle or generic polygon #224

pllim opened this issue May 12, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@pllim
Copy link
Contributor

pllim commented May 12, 2021

Is your feature request related to a problem? Please describe it:

There is a need to enable user to interactively draw a rectangle rotated at a given angle or just a generic polygon draw tool would also satisfy that requirement. The motivation for this request is for Jdaviz (Imviz) to overlay slit positions over an image.

Over at Jdaviz (Mosviz), there is a programmatic solution, which unfortunately does not satisfy the requirement given in spacetelescope/jdaviz#518 .

https://github.com/spacetelescope/jdaviz/blob/a5c003f4a29e0e48c6e0cee31bad62852ccfbbdc/jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py#L92

                # Create polygon region from the pixel region and set vertices
                pix_rec = pixel_region.to_polygon()

https://github.com/spacetelescope/jdaviz/blob/a5c003f4a29e0e48c6e0cee31bad62852ccfbbdc/jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py#L106

                # Create slit
                patch2 = bqplot.Lines(x=x_coords, y=y_coords, scales=scales,
                                      fill='none', colors=["red"], stroke_width=2,
                                      close_path=True)

Describe the solution you'd like:

We already have the ability to draw rectangles. If there is an easy way to interactively rotate a drawn rectangle, this might be enough.

Or, a new polygon drawing tool. Over at Ginga, there is a mode to start drawing, and user press "v" to change direction, and on mouse-up, the it closes the loop and creates a polygon object.

Describe alternatives you've considered:

Not sure, maybe @eteq et al. can comment.

@dhomeier
Copy link
Contributor

@pllim does #371 resolve this issue?

@pllim
Copy link
Contributor Author

pllim commented Aug 18, 2023

Not really, but... in the last 2 years, we have added Edit Subset tool in Jdaviz, and now recently there is a new Footprints plugin, so I don't think we need this anymore. Thanks for the ping!

@pllim pllim closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants