6

I was wondering if anyone knows a good library for tessellating a hyperbolic plane with polygons (my main interest lies in {8,3} tessellation). I found some applets here and there but the separation of logic from view is horrendous in all of them. It would be perfect if there's a library that doesn't deal with graphics at all (since I'm NOT planning on using Swing or creating my own applet), just takes in parameters: {p,q} and layer count, then returns an array of lines or points (or polygon objects). If worst comes to worst, I'll have to implement my own library, so it might also be helpful if someone knows of some paper that describes in detail the algorithm for tessellation.

EDIT

By the way, I should've mentioned that I found a cool-looking hyperbolic tessellations applet by Don Hatch and got excited at first. Then I looked at what he claims to be the source code. Inside the JAR I discovered files with a .prejava extension and had absolutely no idea what I was looking at - it seemed to be some awful hybrid of Java and C code. Upon an attempt at a closer inspection I was immediately rewarded with a headache. Apparently he was trying to optimize the Java compiler... or at least that's what I gathered from looking at the contents of javacpp. Needless to say, I'm extremely hesitant to spend my time on following his instructions in order to generate the Java source files using the C compiler, wow...

Andrey
  • 8,882
  • 10
  • 58
  • 82
  • 1
    First, thanks for this question - I have a similar need. Also, I know this post is old, but I wanted to point out to future readers that getting Don Hatch's source code to compile is not that hard. `javacpp` is just a perl script that runs the C preprocessor on the .prejava files to produce normal .java files. All he's doing is enabling the use of C #defines, #ifdefs, etc., which are nice features to have. (Nothing to do with optimization.) If you have `make`, `perl`, and `cpp`, you just run `make` and it all compiles seamlessly. – LarsH Mar 29 '12 at 08:16
  • However I will add that the separation between logic and view may not correspond to what you need. Hatch does everything in terms of line segments, which are half-edges of the tiled polygons. These line segments are not grouped into polygons, or even into whole polygon edges. So if you need to do things in terms of polygons, or replicated "motifs" (e.g. Escher's fish), you may find it hard to get from Hatch's code to what you need. However his code seems the most efficient. – LarsH Mar 29 '12 at 10:14

3 Answers3

3

There's an applet at http://aleph0.clarku.edu/~djoyce/poincare/PoincareApplet.html . Perhaps you can read the code.

lhf
  • 70,581
  • 9
  • 108
  • 149
  • 1
    I saw this one and have the source for it. But as it's not a library and lacks example usage and documentation I don't quite want to delve into its inner working just yet. My plan is to start looking at the source of this applet only if I don't find a better alternative. – Andrey Jan 30 '11 at 19:30
  • The inner workings of this applet code are pretty clear... much easier to work with, IMO, than Hatch's. – LarsH Mar 29 '12 at 10:16
2

it might be a bit off topic, I'm also looking for a clean, loosely coupled implementaion of hyperbolic tesselations. I found this straight-forward implementation of the poincaré disk model http://haishibai.blogspot.com/2010/07/draw-hyperbolic-geometry-poincare-disc.html

I also found this paper that has some pseudo code http://www.d.umn.edu/cs/thesis/ajit_datar_ms.pdf

they talk about available source code: hyperart http://sourceforge.net/projects/hyperart/ but it's a compiled exe with no source.

nicoptere
  • 1,067
  • 6
  • 9
  • Duuuuude! Awesome! I'll have to take a closer look but it looks like it's going to be immensely helpful! – Andrey Feb 08 '11 at 17:04
  • Why do you say hyperart has no source? Here it is: http://hyperart.cvs.sourceforge.net/viewvc/hyperart/ Want it all in one archive? Click on "Download GNU tarball". – LarsH Mar 29 '12 at 08:19
0

Also check out the Tyler applet that Don and I wrote. Click the "Hyperbolic" check-box, then enter "8,8,8" in the "Curvature based on" field. You'll also want to select the '8' radio button on the right so that each click will add an octagon to the edge nearest your mouse pointer. You can also click a number key to insert polygons with that number of sides. Read the instructions and you'll quickly be able to construct just about any sort of tiling you can imagine. This may be all you need, but the full source is available on that page as well, and without the pre-processing stuff.

stafusa
  • 195
  • 1
  • 15
Melinda Green
  • 2,100
  • 1
  • 21
  • 32