hyperbolic-tiling icon indicating copy to clipboard operation
hyperbolic-tiling copied to clipboard

More subdivisions for the polygons?

Open creaktive opened this issue 3 years ago • 2 comments

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 :)

creaktive avatar Aug 01 '22 12:08 creaktive

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.

looeee avatar Aug 02 '22 00:08 looeee

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.

creaktive avatar Aug 07 '22 10:08 creaktive