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

How to close polygon/add points to last boundary? #9

Open
rsignell-usgs opened this issue Dec 31, 2020 · 7 comments
Open

How to close polygon/add points to last boundary? #9

rsignell-usgs opened this issue Dec 31, 2020 · 7 comments

Comments

@rsignell-usgs
Copy link
Member

rsignell-usgs commented Dec 31, 2020

I've got corner 4 points and I can generate a mesh, but how can I add more points to the "4th" boundary (indicated in the figure below by the dashed line I drew in a paint program):
2020-12-31_8-00-12

@jlstevens Is there a way to "complete the polygon" or something so that "last" side gets drawn?

@rsignell-usgs
Copy link
Member Author

rsignell-usgs commented Jan 10, 2021

@jlstevens post-holiday ping. 😸

@jlstevens
Copy link
Collaborator

@rsignell-usgs Happy New Year! I'll try to have a look at this tomorrow.

@rsignell-usgs rsignell-usgs changed the title How to add points to last boundary? How to close polygon/add points to last boundary? Jan 12, 2021
@rsignell-usgs
Copy link
Member Author

rsignell-usgs commented Jan 12, 2021

@jlstevens I understand you guys had a big deadline, so no rush, but I still haven't been able to figure this out, so help requested! This is blocker for me creating a realistic grid for ROMS, which of course is the point of this tool!

@jlstevens
Copy link
Collaborator

I understand you guys had a big deadline...

Yup! That ended yesterday so now I have more time.

This is blocker for me creating a realistic grid for ROMS, which of course is the point of this tool!

Understood - I'll get back to you later today.

@jlstevens
Copy link
Collaborator

jlstevens commented Jan 12, 2021

After installing from conda-forge, I drew an approximate version of the shape above and meshed it:

Here is what the boundary looks like with the mesh hidden:

Would this not be the mesh topology you are trying to generate above? Can you not extend what you drew with an extra node and set the polarity (or insert a node into the last segment and rearrange)?

@rsignell-usgs
Copy link
Member Author

rsignell-usgs commented Jan 13, 2021

@jlstevens, okay, I see this is not a blocker, that I can continue to add more points along that "last boundary".

I guess I was confused because the way I usually operate is to draw a box, and then go and start adding points to each side. And I didn't see how to add a point to the side that wasn't drawn. So it would be nice to draw that side. It would make it more intuitive, IMHO. Thanks for looking at this.

@jlstevens
Copy link
Collaborator

okay, I see this is not a blocker...

Glad to hear it!

When working on hologridgen, I think we discussed whether we should keep the drawn polygon open (implicit last edge) or closed and we opted for the former. This issue raises one problem with the implicit approach, namely that you can't add a node in the middle of the last edge if it not drawn (due to being implicit).

I did have an earlier prototype which did allow optional closing of the polygon but in the end, I stripped that out to simplify things. That code is probably in the git history somewhere and I'm sure I could resurrect it (i.e add a checkbox to optionally close the polygon, allowing people to choose their preference for how they work). I estimate it would be a day of work to bring that back, test it and make it robust (I seem to remember that the prototype didn't always work the way I wanted).

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

No branches or pull requests

2 participants