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

At Polygon creation, allow Points names that are not single letters #3

Open
nicolashainaux opened this issue Nov 19, 2017 · 0 comments

Comments

@nicolashainaux
Copy link
Owner

nicolashainaux commented Nov 19, 2017

So far, only single letters are supported at Polygon creation:

p = Polygon(*vertices, name='ABCD')

It's always possible to reset some of the names, like: p.vertices[1] = 'B_{1}', if desired, but it would be practical to be able to set them all at creation.

The idea, if not only letters are used, is to provide the name with pipes separating the points' names:

p = Polygon(*vertices, name='A|B_{1}|C|D')

At creation, check if at least a pipe is in the string, if yes, then split the string using | as sep, check it has as many names as len(vertices) and use them to set the Point's names.

Add the relevant tests and update the docstring of __init__() (of Polygon and other polygons like Rectangle).

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

No branches or pull requests

1 participant