Skip to content

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

Arbitrary polyhedron clipping:

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

Controls:

  • F2 : reset the algorithm with new input data.
  • F3 : cycle between predefined test cases (if available).
  • F4 : load 'algo.in' as the algorithm current state (if available).
  • Space: single-step the current algorithm.
  • Return: finish the current algorithm.
  • Mouse scroll: zoom/dezoom
  • Keypad +/- : zoom/dezoom
  • Keypad arrows : scroll
  • Keypad 5: toggle the 3D view.

About

A visual sandbox for 2D/3D computational geometry algorithms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages