background preloader

Algos

Facebook Twitter

Computational Geometry Code. This page lists "small" pieces of geometric software available on the Internet. Most of the software is available free of charge. Unless otherwise specified, C or C++ source code is available for all programs. Software libraries and collections and programs that can be run interactively over the web are listed on separate web pages. Caveat Surfor! The programs on this page are divided into several categories, some of which are divided into further sub-categories.

Each category also includes links to relevant pages in Nina Amenta's comprehensive Directory of Computational Geometry Software, which I strongly encourage you to visit! Items marked have been recently added or modified. Robust low-level primitives Avoid roundoff and precision errors! Combinatorics and discrete math Geometric optimization Convex hulls and convex polyhedra Most convex hull programs will also compute Voronoi diagrams and Delaunay triangulations. Relevant pages from DCGS: Low-dimensional convex hulls Measure properties. K-d tree. A 3-dimensional k-d tree. The first split (red) cuts the root cell (white) into two subcells, each of which is then split (green) into two subcells.

Finally, each of those four is split (blue) into two subcells. Since there is no more splitting, the final eight are called leaf cells. Informal description[edit] Operations on k-d trees[edit] Construction[edit] Since there are many possible ways to choose axis-aligned splitting planes, there are many different ways to construct k-d trees. This method leads to a balanced k-d tree, in which each leaf node is about the same distance from the root. Note also that it is not required to select the median point. Given a list of n points, the following algorithm uses a median-finding sort to construct a balanced k-d tree containing those points. It is common that points "after" the median include only the ones that are strictly greater than the median.

These guidelines will simplify creation of k-d trees: Adding elements[edit] Removing elements[edit] / - kdtree - A simple C library for working with KD-Trees. Binary space partitioning. Overview[edit] Binary space partitioning is a generic process of recursively dividing a scene into two until the partitioning satisfies one or more requirements. It can be seen as a generalisation of other spatial tree structures such as k-d trees and quadtrees, one where hyperplanes that partition the space may have any orientation, rather than being aligned with the coordinate axes as they are in k-d trees or quadtrees.

When used in computer graphics to render scenes composed of planar polygons, the partitioning planes are frequently (but not always) chosen to coincide with the planes defined by polygons in the scene. The specific choice of partitioning plane and criterion for terminating the partitioning process varies depending on the purpose of the BSP tree. For example, in computer graphics rendering, the scene is divided until each node of the BSP tree contains only polygons that can render in arbitrary order. Generation[edit] Traversal[edit] Brushes[edit] Timeline[edit] CVIPGS - 3D Library BSP Trees.