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–2018 by Christoph Nahr but available for free download under the MIT license.
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
- 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
The download package includes a JavaFX demo application that allows you to interactively explore many of these algorithms. Screenshots of two demo dialogs appear below.
- 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.
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.
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 and the IntelliJ project in the source package require Oracle JRE 9.0.4 which can be obtained from the Oracle Technology Network. Please 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.
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.
- Binary & Source Package: version 6.2.0, released on 25 March 2018
- User’s Guide: version 2.0.1, released on 08 April 2017
Includes prebuilt JAR files for both the library and the demo application, as well as a Javadoc class reference for the library. The library targets Java SE 8 whereas the demo application requires Java SE 9.
Source Package — TektosyneSource.zip (332 KB)
Includes unit tests for JUnit 4. You need IntelliJ IDEA 2017.3.5 and Oracle JDK 9.0.4 to load the included project files.
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
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 Reference — TektosyneNetClasses.7z (1.72 MB)
User’s Guide — TektosyneNetGuide.pdf (584 KB)
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.