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

More subdivisions for the polygons? #10

Open
creaktive opened this issue Aug 1, 2022 · 2 comments
Open

More subdivisions for the polygons? #10

creaktive opened this issue Aug 1, 2022 · 2 comments

Comments

@creaktive
Copy link
Contributor

In the current implementation, the arcs do not look very smooth on the closer inspection. Eyeballing, I'd assume that every tile is divided in 4 faces. Is there any reason for not subdividing further?
Ideally, the biggest tiles (the ones closest to the center) could have many subdivisions and the smaller they get (closer to the edge), the less divided they are.
I'm volunteering myself to make this happen, yet would appreciate any sort of guidance/directions :)

@looeee
Copy link
Owner

looeee commented Aug 2, 2022

This is a great idea, and I will give you some help if I can. It is something like 8 years since I wrote the code though so I don't fully remember how this bit was implemented.

But I think if you start here:

https://github.com/looeee/hyperbolic-tiling/blob/main/src/main.js#L204

And then trace back to here:

https://github.com/looeee/hyperbolic-tiling/blob/main/src/utilities/createGeometries.js#L176

You can try logging the number of divisions. It might work to add a multiplier to it.

If you do add this feature, can you also add a way to control it? Best would be a new menu option (something like "quality" to go beside the P and Q values in the UI) but you could also put it as a setting on Main, something like self.quality = 1 which would be the current quality.

@creaktive
Copy link
Contributor Author

Thanks, @looeee!
Finally got around to it... Unfortunately it is more complicated than I initially expected; simply increasing numDivisions causes a multitude of errors. I fixed the most obvious ones in #11, but it still does not produce the correct result (see the picture attached in the PR). My guess is that either subdivideHyperbolicArc() or subdivideLine() needs to be patched to support >2 subdivisions.

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

2 participants