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 for generating a line loop for a polygonal shape from a list of coordinates #13

Merged
merged 11 commits into from Jan 11, 2016
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 6, 2016

PyGmsh can create a Plane Surface quite easily for a polygonal shape using add_polygon. However, for a polygon with holes you need to create a Plane Surface from a set of Line Loop's. These additions facilitate the generation of the line loops.

@nschloe
Copy link
Owner

nschloe commented Jan 7, 2016

Thanks for the PR!

Some suggestions:

  • A bit of code is now duplicated between add_polygon and add_polygon_lineloop & friends. You could just call add_polygon_lineloop from add_polygon. The latter then shrinks down to only adding the plane surface.
  • A bunch of methods already have the optional argument holes. Perhaps that would be useful for add_polygon, add_rectangle etc. too.

@ghost
Copy link
Author

ghost commented Jan 7, 2016

I was thinking along the exact same line. However, before hacking & slashing all your code I wanted confirmation whether the additions were valuable.

I'll try to extend add_polygon (next week or so) to also have the holes capability and remove add_polygon_loop afterwards.

@nschloe
Copy link
Owner

nschloe commented Jan 7, 2016

No need to remove the add_polygon_loop, we still need it to be used as holes.

@ghost
Copy link
Author

ghost commented Jan 11, 2016

Hi @nschloe, I refactored add_polygon to remove the duplicity I created by implementing add_polygon_loop. Also, I added the optional argument holes in add_polygon to facilitate the generation of holes in a polygonal shape.

@nschloe
Copy link
Owner

nschloe commented Jan 11, 2016

Looks good. Can you do the same thing for the rectangle as well?

@ghost
Copy link
Author

ghost commented Jan 11, 2016 via email

@ghost
Copy link
Author

ghost commented Jan 11, 2016

Done

nschloe added a commit that referenced this pull request Jan 11, 2016
Support for generating a line loop for a polygonal shape from a list of coordinates
@nschloe nschloe merged commit d4632cb into nschloe:master Jan 11, 2016
@nschloe
Copy link
Owner

nschloe commented Jan 11, 2016

Merged, thanks!

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.

None yet

1 participant