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

Tile polygon clipping vs "the smudge" #3

Open
gordonwoodhull opened this issue Sep 29, 2023 · 1 comment
Open

Tile polygon clipping vs "the smudge" #3

gordonwoodhull opened this issue Sep 29, 2023 · 1 comment

Comments

@gordonwoodhull
Copy link
Owner

This fork of hexapipes implements clipping of pipes to the tile polygon. Additionally, the arms are drawn 20% longer to compensate for iOS line cap rendering issues. The idea is, draw past the edge of the tile and then clip.

This was originally proposed as gereleth#101

Base hexapipes instead uses stroke-linejoin: round and extends the colored part out past the edge of the tile in order to "smudge" the subpixel line that will appear otherwise.

The smudge works better where it works, on the non-Penrose tiles and on operating systems besides iOS. The jury is still out on which is better for the cube grid.

Tile polygon clipping should be optional, and only enabled for Penrose and for iOS.

@gordonwoodhull
Copy link
Owner Author

gordonwoodhull commented Oct 6, 2023

Rats! Switching between the two drawing modes works fine, but there doesn't seem to be a good way to find out whether the Svelte page is running on iOS, partly because Svelte uses server-side rendering and so navigator.platform is unavailable.

Best solution I've found so far is svelte-device-detector, but it seems bulky to use for one bit of information, and it requires a lot of setup.

I'm also not happy with the effects of propagating this flag everywhere. I implemented getGridFlag() as a static method on the grid because the polygon needs to know whether polygon clipping is active. But now the polygons need to be initialized after the grids... yuck. At this point I wonder if it would be better to implement flags as a global function taking the grid type and flag.

(It's also debatable whether a whole flag mechanism is needed. I needed two of them, and think there may be future need for rendering flags. This is orthogonal and a smaller problem than the others.)

For these reasons, I've put this work on the clip-tile-polygon-flag branch, and I'm delaying this until PR time. Tile polygon clipping is always active on the p3 branch (and it's nice to see iOS rendering without glitches for all grids).

@gordonwoodhull gordonwoodhull modified the milestones: release, merge upstream Oct 7, 2023
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

No branches or pull requests

1 participant