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

Added functionality: Being able to set regions on the rotate mode where nothing is drawn. #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

goncaloMgomes
Copy link

Let me start by thanking you for this amazing tool and for making it open source.
I don´t know if you are interested in others making contributions and so I would understand if you don't want this added to the source code.
With this said let me explain what I did.

The current rotate mode lets the user draw an image on multiple angles within a certain interval, however for some use cases we might want to only draw within some areas but not others. This is true if we are creating a custom font for letters on the edge of a circle display, and want only to display on some parts of the circle.

This image shows the result I am talking about:

Screenshot_25

one solution could be to have 3 different starting points and then running this tool 3 times within the angle we want to draw, this can get quite tiresome.
The other solution could be using only one source image with one character and define where we want to draw it and where we want to skip drawing.
The source image for this example is this one (scaled down to fit here):

1

So what I did was, I added two new parameters to the command line where we can specify where we want to draw and where we want to not draw.
This image shows this better:
Screenshot_26

By specifying these two parameters this result is automatically achieved.

To prevent users from having to type too many arguments when the users only want the normal use of the rotate mode they can still type only the current three commands and everything works fine.

However if this is the result they want then they must specify -w for the angle where the image is going to be drawn and -p for the angle where it is not.
For better results the sum of these two angles whould be a divider of the whole angle between the begin and end angles.

Extra:
Removed three semicolons(probably habits from other languages :)) and on the rotate function the for loop would perform one cycle too much due to the fact that you added the angle step to the angle stop on the range function. I tested this with the image above for 360 degrees and every character was printed.

Cheers,
Gonçalo Gomes

@goncaloMgomes
Copy link
Author

Hi, have you considered adding this feature?

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.

1 participant