Tektosyne Library for Java

The Tektosyne Library for Java provides algorithms for computational geometry and graph-based pathfinding, along with supporting mathematical utilities and specialized collections. Tektosyne is © 2002–2021 by Christoph Nahr but available for free download under the MIT license.

Overview

The following list gives a summary of Tektosyne’s main features. See the User’s Guide and the included Javadoc class reference for more details.

  • Geometric primitives: points (doubling as vectors), sizes, line segments, and rectangles, all available with int and double coordinates
  • Geometric algorithms: convex hull, point in polygon, intersections of two or more line segments, point location relative to line segments and rectangles, etc.
  • Lexicographic point ordering preferring x- or y-coordinates, with efficient nearest point and range search in sorted standard collections
  • Graph algorithms: A* pathfinding, path coverage, flood fill, line of sight, all performed on interfaces that can be implemented by arbitrary concrete geometric structures
  • Planar subdivision represented as doubly-connected edge list (DCEL), with support for graph algorithms, dynamic modification, and fast point location
  • Regular polygons and rectangular grids of squares or hexagons, with support for graph algorithms, mapping between grid & display coordinates, and conversion to DCEL subdivision
  • Voronoi diagram and Delaunay triangulation, with conversion to DCEL subdivision and consequently support for graph algorithms
  • Collections: generic linked list and generic quadrant tree, both with exposed node structure
  • Mathematical helper methods, including a library of Fortran 90 functions

Samples

The download package includes a Java Swing demo application that allows you to interactively explore many of these algorithms. Screenshots of two demo dialogs appear below. They date from the older JavaFX version of the demo application, so the visual style is slightly different today.

  • 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

As for other samples, Myriarch utilizes geometric primitives and quadrant trees. There are currently no Java projects that employ the pathfinding algorithms, but Hexkit relies on the older Tektosyne for .NET for pathfinding on a polygon grid.

System Requirements

The Tektosyne library itself requires only the Java SE 8 Compact 1 profile, or the module java.base on Java SE 9 and later. The included GUI demo application requires Java SE 8 or later with Java AWT/Swing. Users of high DPI displays should note that Java SE 9 or later is required for high DPI scaling. See the following for more information:

  • The ReadMe file contains usage information, the copyright notice, and a feature comparison with the original .NET edition.
  • The WhatsNew file contains the annotated version history of the project, including links to weblog posts with further details on each release.

GitHub Mirror

Tektosyne is mirrored on GitHub, courtesy of Giancarlo Dessena who owns and manages the project there. The GitHub mirror supports Gradle via JCenter and Maven via Maven Central, so you might prefer it over the download below if you rely on these build systems. The library itself is identical, although the GitHub mirror may be outdated relative to the current version here.

Download Files

  • Binary & Source Package: version 6.3.2, released on 18 July 2021
  • User’s Guide: version 2.0.2, released on 10 April 2019

Binary PackageTektosyne.zip (1.25 MB, ZIP archive)

Includes prebuilt JAR files for both the library and the demo application, as well as a Javadoc class reference for the library.

Source PackageTektosyneSource.zip (338 KB)

Includes unit tests for JUnit 4. You need IntelliJ IDEA 2021.1.3 and Oracle JDK 10.0.2 to load the included project files.

User’s GuideTektosyneGuide.pdf (2.60 MB) with LaTeX sources (2.45 MB)

Presents an overview of all public library classes and a set of sample benchmark results. Unusual features such as graph algorithms are covered in greater depth. Includes UML diagrams created with Class Diagrammer, as described in the ReadMe file.

Tektosyne for .NET

Tektosyne originally targeted the .NET Framework, hence the version number 6.0.0 for the initial Java release. I no longer maintain the .NET edition but you can download the final version here. The current User’s Guide for the Java version summarizes the library’s historical development.

In addition to the classes present in Tektosyne for Java 6.0.0, Tektosyne for .NET featured several enhanced collections, a variety of general helper classes, and utilities for Windows Presentation Foundation (WPF) and Simple MAPI messaging. See the User’s Guide below for an overview.

  • Code Package & Class Reference: version 5.6.6, released on 30 September 2015
  • User’s Guide: version 1.2.0, released on 09 June 2012

Code PackageTektosyneNet.zip (1.20 MB, ZIP archive)

Includes complete source code as well as precompiled (in release mode) library, demo application, and unit tests. Also contains the XML documentation file generated by the C# compiler.

Class ReferenceTektosyneNetClasses.7z (1.72 MB)

Created from XML source code comments using the free Sandcastle Help File Builder. The class reference is a 7-Zip package of loose HTML pages.

User’s GuideTektosyneNetGuide.pdf (584 KB)

System Requirements

Tektosyne for .NET requires the Microsoft .NET Framework 4 Client Profile or any newer .NET 4.x running on a compatible Microsoft Windows version. .NET Core is not supported, although you should be able to extract system-independent classes for use with .NET Core. You will also need the free NUnit unit testing framework to run the included test suite.

Note: Tektosyne produces IL code that not verifiable. The library is compiled in “unsafe” mode to facilitate efficient hash code generation and various other tasks (e.g. Win32 interoperation). If you require verifiable IL code for security reasons, you must pull out the stuff you need and recompile without the “unsafe” flag. Several classes are also not CLS compliant due to the use of unsigned integers.