Tektosyne Library for Java

Tektosyne 6.0 is now available for download, its first release in Java. You can download the code package itself, with complete source code and prebuilt JAR files, as well as an extensive PDF User’s Guide. This is a partial port of the previous version which was written in C# for the Windows .NET Framework. The home page still offers the final .NET release, too, but all future development will be in Java.

Feature Overview

Tektosyne provides algorithms for computational geometry and graph-based pathfinding, along with supporting mathematical utilities and specialized collections. The library is designed to be independent of any specific environment or GUI framework, and accordingly only requires the Java SE 8 Compact 1 profile. There is also an included demo application which is based on JavaFX.

The Tektosyne home page gives a brief feature overview and the User’s Guide a much longer one, but the key components are the following:

  • Geometric primitives (points, lines, etc.) and numerous standard algorithms based on them: line intersection, DCEL planar subdivisions, Voronoi diagrams, etc.
  • Planar graph interface on which several pathfinding algorithms operate: A* path search, path coverage, predicate-based flood fill, line-of-sight visibility
  • Geometric structures implementing this graph interface: grids of regular polygons, subdivisions, Voronoi diagrams and Delaunay triangulations (via subdivision)

As you might guess, Tektosyne was created for the implementation of computer strategy games and simulations. However, this should not limit the library’s usefulness for other applications such as mapping. All general algorithms are textbook implementations with no built-in restrictions to any particular use case.

The simplest way to explore what the library has to offer is to run the included demo application. Below are two screenshots that are also reproduced on the home page.

  • Planar Subdivision Test: visualization and interactive manipulation of a randomly generated planar subdivision. The highlighted half-edge and vertex are nearest the (hidden) mouse cursor.
  • Graph Algorithms Test: shows A* pathfinding along the edges of a Delaunay triangulation (yellow dashes) of a random Voronoi diagram whose regions were assigned random step costs.

Tektosyne Demo Dialogs

Notes on .NET

Tektosyne for Java has shed quite a few classes compared to the .NET version. That’s partly because it started out as a general-purpose toolbox library and accumulated a lot of dubious cruft over the years, and partly because the .NET base class library is less comprehensive than the Java standard class library, and so required some extras that Java doesn’t. These classes gone, a clear focus on computational geometry and pathfinding emerged.

For those who are interested, the included ReadMe file goes into some detail on the differences between the .NET and Java releases, and the User’s Guide traces the historical development of the .NET version since its first release in 2002 when it was simply called “Toolbox.”

The User’s Guide also contains a new chapter on benchmark results. These are samples extracted from the demo application’s benchmark dialog, for both the Java release and the final .NET release on the same machine. As usual the 64-bit Java Server VM is at least as fast as the 64-bit Windows .NET Framework, and quite often much faster.

Note: Also as usual, Windows users must ensure they are actually running the 64-bit Java Server VM. The obsolete 32-bit Client VM with its far inferior optimizer is the sad default on Windows. Please see Java Client VM for details. I’ll eventually update that page with benchmark results for Tektosyne; they once again showed a 2x speedup for the 64-bit Server VM over the 32-bit Client VM.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.