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

HolePattern creates holes other than specified #429

Open
Bambusbjoern opened this issue Sep 2, 2022 · 5 comments
Open

HolePattern creates holes other than specified #429

Bambusbjoern opened this issue Sep 2, 2022 · 5 comments
Labels

Comments

@florianfesti
Copy link
Owner

@SuksAE Do you want to take look at this?

@SuksAE
Copy link
Contributor

SuksAE commented Sep 10, 2022

My first thought is that maybe this can be reduced to a "lack of documentation" issue.

Maximum hole size is used unfiltered only in "random" mode. In "square" or "hex" mode the default hole size is clalculated to choose an "optimum" size so that an integer number of shapes fit in a row.
The size of the drawn holes is always between the maximum hole size and minimum hole size given in the settings.

see init.py line 1689:

        elif pattern in ("square", "hex"):
            # use 'optimum' hole size
            max_radius = min(max_radius_x, max_radius_y)

I hope this solves the mystery...

@Bambusbjoern
Copy link
Author

Bambusbjoern commented Sep 11, 2022 via email

@SuksAE
Copy link
Contributor

SuksAE commented Sep 11, 2022

You are right.

Minimum hole size is actually only checked if there is an "abnormality" in a line of shapes. In this case the algorythm tries to "squeeze" in smaller holes. But as there are no abnormalities in the given example (shape is rectangle --> all lines of equal length, always the same integer number of holes), minimum hole size is irrelevant here...

For visualization of minimum size usage try:
min radius = max radius
in comparison with
min radius << max radius

Please note that:

  • Red lines in the exampes is debugging information to visualize the shape to be filled ("ellipse" in these cases)
  • If you want try your own parameter set, you can get back to the configuration page if you replace "render=1" with "render=0" in the URL.

@florianfesti
Copy link
Owner

When we take back a step the issue here is that the new hole pattern code is not yet general enough for all use cases. In the medium term it should replace the legacy hexHoles code already in the code base. For that we need a few more knobs. Adjusting the hole size is a feature that is actually even on the todo list of the hexHoles. But many use cases require fixed hole sizes as the holes have other purposes than being decorative or letting air through.

That being said removing the hexholes generator may have been a bit premature. Otoh this highlights nicely that there is still work to be done.

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

No branches or pull requests

3 participants