Adds some extra options to eggbot_hatch.#57
Open
javl wants to merge 1 commit intoevil-mad:masterfrom
javl:master
Open
Adds some extra options to eggbot_hatch.#57javl wants to merge 1 commit intoevil-mad:masterfrom javl:master
javl wants to merge 1 commit intoevil-mad:masterfrom
javl:master
Conversation
usefull when working with generated content that has a lot of elements you don't want to have to alter one-by-one. First is the option to delete the original object that was hatched. This allows you to only plot the newly made hatched fill, not the outline of the original object. Second is an option to use ranges for the hatchAngle and hatchSpacing variables. For each element it's brightness is calculated (0.1-1.0, where 0.0 is a black element and 1.0 is a white one) and this brightness is then mapped to the range. So if you select 0 to 30 for your angle range, black elements will use 0 degrees, white elements will use 30 and gray elements can use any value in between. This allows for the creation of some nice effects.
Contributor
|
I think that it's a clever idea to have an option like this. I don't think that I've ever seen a suggestion to do something quite like this. I do have some concerns:
On note 1: If you have any whitespace edits or other "small random changes" (that are improvements) to contribute, please separate these out and submit a separate pull request for them. On note 2: Yup. That's python. |
Author
|
Sorry, I guess this should have been more of a 'check out this beta feature' thing than a pull request. To respond to your points
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Please see the additional notes below
These changes are especially useful when working with generated content that has a lot of elements you don't want to have to alter one-by-one.
First is the option to delete the original object that was hatched. This allows you to only plot the newly made hatched fill, not the outline of the original object.
Second is an option to use ranges for the hatchAngle and hatchSpacing variables. For each element it's brightness is calculated (0.1-1.0, where 0.0 is a black element and 1.0 is a white one) and this brightness is then mapped to the range. So if you select 0 to 30 for your angle range, black elements will use 0 degrees, white elements will use 30 degrees and gray elements can use any value in between. This allows for the creation of some nice effects.
The hatches in the attached image were created in a single pass (instead of 6).
Note 1: The small random changes changes here and there are because of my text editor automatically removing trailing spaces. These changes shouldn't give any problems.
Note 2: Github shows a lot of changes because of the indent needed to move a lot of existing code into in
for...inloop. Basically the only change has been made at the top of theeffect()function.For each element its brightness is calculated and its id gets moved into a dict with all other elements that have the same brightness. Then, instead of applying the hatch code to all elements, it is applied to each group of elements so the angle and spacing can be changed based on the needed value. The hatching itself has not been changed (everything below line
1233: # Build a grid of possible hatch linesis the same, just indented).