Skip to content

A visual sandbox for 2D computational geometry algorithms

License

Notifications You must be signed in to change notification settings

Ace17/GeomSandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeomSandbox

Authors: Sebastien Alaiwan, Vivien Bonnet

Description

This is a sandbox for prototyping computational geometry algorithms. It uses fibers to allow visual single-stepping through algorithms, while keeping intrusivity minimal.

Design Guidelines

The goal here is to be able to easily copy prototyped algorithm code to other projects, where it won't be as easy to experiment with.

So we don't want the algorithm implementations to depend too much on this project.

This is why the core sandbox only provides the absolute minimum data structures: Vec2, which is used for communication between the algorithm and the sandbox, and span, whose implementation leaves not much room for choice anyway.

More advanced geometric data structures are expected to be provided by the specific algorithm implementations.

Gallery

Triangulation using the Bowyer-Watson algorithm:

Voronoi diagram using the Fortune algorithm:

Polyline simplification using the Douglas-Peucker algorithm:

Continuous collision detection using the separating-axis-theorem:

Convex space partitionning using BSP:

Build

Requirements:

* libsdl2-dev

It can be compiled to native code using your native compiler (gcc or clang):

$ make

The binaries will be generated to a 'bin' directory (This can be overriden using the BIN makefile variable).

Run the sandbox

Just run the following command:

$ bin/GeomSandbox.exe <appName>

For example:

$ bin/GeomSandbox.exe Example

Keys:

  • F2 : reset the algorithm with new input data.
  • Space: single-step the current algorithm.
  • Return: finish the current algorithm.
  • Keypad +/- : zoom/dezoom
  • Keypad arrows : scroll

About

A visual sandbox for 2D computational geometry algorithms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages