MIConvexHull
The default plane distance tolerance
The starting delta dot product in simplex
The connector table size
A more lightweight alternative to List of T.
On clear, only resets the count and does not clear the references
=> this works because of the ObjectManager.
Includes a stack functionality.
The capacity
The count
The items
Get the i-th element.
The i.
T.
Size matters.
Adds a vertex to the buffer.
The item.
Pushes the value to the back of the list.
The item.
Pops the last value from the list.
T.
Sets the Count to 0, otherwise does nothing.
Class IndexBuffer.
A fancy name for a list of integers.
A priority based linked list.
The last
Get the first element.
The first.
Adds the element to the beginning.
The face.
Adds a face to the list.
The face.
Removes the element from the list.
The face.
Connector list.
The last
Get the first element.
The first.
Adds the element to the beginning.
The connector.
Adds a face to the list.
The element.
Removes the element from the list.
The connector.
A convex face representation containing adjacency information.
The type of the t vertex.
The type of the t face.
Adjacency. Array of length "dimension".
If F = Adjacency[i] then the vertices shared with F are Vertices[j] where j != i.
In the context of triangulation, can be null (indicates the cell is at boundary).
The adjacency.
The vertices stored in clockwise order for dimensions 2 - 4, in higher dimensions the order is arbitrary.
Unless I accidentally switch some index somewhere in which case the order is CCW. Either way, it is consistent.
3D Normal = (V[1] - V[0]) x (V[2] - V[1]).
The vertices.
The normal vector of the face. Null if used in triangulation.
The normal.
A default convex face representation.
The type of the t vertex.
For deferred face addition.
The faces.
The faces.
The faces.
The indices.
The indices.
A helper class used to connect faces.
The edge to be connected.
The face.
The hash code computed from indices.
Next node in the list.
Prev node in the list.
The vertex indices.
Ctor.
The dimension.
Updates the connector.
The face.
Index of the edge.
The dim.
Can two faces be connected.
a.
The b.
The dim.
true if XXXX, false otherwise.
Connect two faces.
a.
The b.
This internal class manages the faces of the convex hull. It is a
separate class from the desired user class.
Gets or sets the adjacent face data.
The furthest vertex.
Index of the face inside the pool.
Is it present in the list.
Is the normal flipped?
Next node in the list.
Gets or sets the normal vector.
Face plane constant element.
Prev node in the list.
Used to traverse affected faces and create the Delaunay representation.
Gets or sets the vertices.
Gets or sets the vertices beyond.
Initializes a new instance of the class.
The dimension.
The index.
The beyond list.
Factory class for computing convex hulls.
Creates a convex hull of the input data.
The type of the t vertex.
The type of the t face.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
ConvexHull<TVertex, TFace>.
Creates a convex hull of the input data.
The type of the t vertex.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
ConvexHull<TVertex, DefaultConvexFace<TVertex>>.
Creates a convex hull of the input data.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
ConvexHull<DefaultVertex, DefaultConvexFace<DefaultVertex>>.
Representation of a convex hull.
The type of the t vertex.
The type of the t face.
Can only be created using a factory method.
Points of the convex hull.
The points.
Faces of the convex hull.
The faces.
Creates the convex hull.
The data.
The plane distance tolerance.
ConvexHull<TVertex, TFace>.
The supplied data is null.
data
Class ConvexHullAlgorithm.
Class ConvexHullAlgorithm.
Class ConvexHullAlgorithm.
Tags all faces seen from the current vertex with 1.
The current face.
Recursively traverse all the relevant faces.
The current face.
Creates a new deferred face.
The face.
Index of the face.
The pivot.
Index of the pivot.
The old face.
DeferredFace.
Connect faces using a connector.
The connector.
Removes the faces "covered" by the current vertex and adds the newly created ones.
true if XXXX, false otherwise.
Commits a cone and adds a vertex to the convex hull.
Check whether the vertex v is beyond the given face. If so, add it to beyondVertices.
The face.
The beyond vertices.
The v.
Compares the values of two vertices. The return value (-1, 0 or +1) are found
by first checking the first coordinate and then progressing through the rest.
In this way {2, 8} will be a "-1" (less than) {3, 1}.
The base vertex index, u.
The compared vertex index, v.
System.Int32.
Used by update faces.
The face.
The beyond.
The beyond1.
Finds the beyond vertices.
The face.
The beyond.
Recalculates the centroid of the current hull.
Removes the last vertex from the center.
Handles singular vertex.
Get a vertex coordinate. In order to reduce speed, all vertex coordinates
have been placed in a single array.
The vertex index.
The index of the dimension.
System.Double.
Gets the hull vertices.
The type of the t vertex.
The data.
TVertex[].
Finds the convex hull and creates the TFace objects.
The type of the t face.
The type of the t vertex.
TFace[].
For 2D only: Returns the result in counter-clockwise order starting with the element with the lowest X value.
If there are multiple vertices with the same minimum X, then the one with the lowest Y is chosen.
The type of the vertex.
The type of the face.
The data.
The main function for the Convex Hull algorithm. It is static, but it creates
an instantiation of this class in order to allow for parallel execution.
Following this simple function, the constructor and the main function "FindConvexHull" is listed.
The type of the vertices in the data.
The desired type of the faces.
The data is the vertices as a collection of IVertices.
The plane distance tolerance.
MIConvexHull.ConvexHull<TVertex, TFace>.
Initializes a new instance of the class.
The vertices.
if set to true [lift].
The plane distance tolerance.
Dimension of the input must be 2 or greater.
There are too few vertices (m) for the n-dimensional space. (m must be greater +
than the n, but m is + NumberOfVertices + and n is + NumOfDimensions
PointTranslationGenerator cannot be null if PointTranslationType is enabled.
or
Dimension of the input must be 2 or greater.
There are too few vertices (m) for the n-dimensional space. (m must be greater " +
"than the n, but m is " + NumberOfVertices + " and n is " + Dimension
Check the dimensionality of the input data.
System.Int32.
Invalid input data (non-uniform dimension).
Gets/calculates the convex hull. This is
Serializes the vertices into the 1D array, Positions. The 1D array has much quicker access in C#.
Finds the bounding box points.
Shifts and scales the Positions to avoid future errors. This does not alter the original data.
Find the (dimension+1) initial points and create the simplexes.
Creates the initial simplex of n+1 vertices by using points from the bounding box.
Special care is taken to ensure that the vertices chosen do not result in a degenerate shape
where vertices are collinear (co-planar, etc). This would technically be resolved when additional
vertices are checked in the main loop, but: 1) a degenerate simplex would not eliminate any other
vertices (thus no savings there), 2) the creation of the face normal is prone to error.
Finds (dimension + 1) initial points.
List<System.Int32>.
The input data is degenerate. It appears to exist in " + NumOfDimensions +
" dimensions, but it is a " + (NumOfDimensions - 1) + " dimensional set (i.e. the point of collinear,"
+ " coplanar, or co-hyperplanar.)
Check if 2 faces are adjacent and if so, update their AdjacentFaces array.
The l.
The r.
Used in the "initialization" code.
The face.
Corresponds to the dimension of the data.
When the "lifted" hull is computed, Dimension is automatically incremented by one.
Are we on a paraboloid?
Explained in ConvexHullComputationConfig.
The vertices
The positions
The vertex marks
The face pool
The affected face flags
Used to track the size of the current hull in the Update/RollbackCenter functions.
A list of faces that that are not a part of the final convex hull and still need to be processed.
A list of faces that form the convex hull.
The vertex that is currently being processed.
A helper variable to determine the furthest vertex for a particular convex face.
A helper variable to help determine the index of the vertex that is furthest from the face that is currently being
processed.
The centroid of the currently computed hull.
The update buffer
The update indices
Used to determine which faces need to be updated at each step of the algorithm.
Used for VerticesBeyond for faces that are on the convex hull.
Used to determine which vertices are "above" (or "beyond") a face
Stores faces that are visible from the current vertex.
Stores faces that form a "cone" created by adding new vertex.
Stores a list of "singular" (or "generate", "planar", etc.) vertices that cannot be part of the hull.
The connector table helps to determine the adjacency of convex faces.
Hashing is used instead of pairwise comparison. This significantly speeds up the computations,
especially for higher dimensions.
Manages the memory allocations and storage of unused objects.
Saves the garbage collector a lot of work.
Helper class for handling math related stuff.
Computes the Delaunay triangulation.
The type of the t vertex.
The type of the t cell.
The data.
The plane distance tolerance.
TCell[].
Removes up facing Tetrahedrons from the triangulation.
An interface for a structure with nD position.
Position of the vertex.
The position.
"Default" vertex.
Position of the vertex.
The position.
A helper class mostly for normal computation. If convex hulls are computed
in higher dimensions, it might be a good idea to add a specific
FindNormalVectorND function.
The dimension
The matrix pivots
The n d matrix
The n d normal helper vector
The nt x
The nt y
The nt z
The position data
Initializes a new instance of the class.
The dimension.
The positions.
Calculates the normal and offset of the hyper-plane given by the face's vertices.
The face.
The center.
true if XXXX, false otherwise.
Check if the vertex is "visible" from the face.
The vertex is "over face" if the return value is > Constants.PlaneDistanceTolerance.
The v.
The f.
The vertex is "over face" if the result is positive.
Returns the vector the between vertices.
To index.
From index.
System.Double[].
Returns the vector the between vertices.
From index.
To index.
The target.
Finds normal vector of a hyper-plane given by vertices.
Stores the results to normalData.
The vertices.
The normal data.
Finds 2D normal vector.
The vertices.
The normal.
Finds 3D normal vector.
The vertices.
The normal.
Finds 4D normal vector.
The vertices.
The normal.
Finds the normal vector nd.
The vertices.
The normal.
Gets the simplex volume. Prior to having enough edge vectors, the method pads the remaining with all
"other numbers". So, yes, this method is not really finding the volume. But a relative volume-like measure. It
uses the magnitude of the determinant as the volume stand-in following the Cayley-Menger theorem.
The edge vectors.
The last index.
The big number.
System.Double.
Determinants the destructive.
a.
System.Double.
Lus the factor.
The data.
The order.
The ipiv.
The vec l ucolj.
A helper class for object allocation/storage.
This helps the GC a lot as it prevents the creation of about 75% of
new face objects (in the case of ConvexFaceInternal). In the case of
FaceConnectors and DefferedFaces, the difference is even higher (in most
cases O(1) vs O(number of created faces)).
The dimension
The connector stack
The deferred face stack
The empty buffer stack
The face pool
The face pool size
The face pool capacity
The free face indices
The hull
Create the manager.
The hull.
Return the face to the pool for later use.
Index of the face.
Reallocate the face pool, including the AffectedFaceFlags
Create a new face and put it in the pool.
System.Int32.
Return index of an unused face or creates a new one.
System.Int32.
Store a face connector in the "embedded" linked list.
The connector.
Get an unused face connector. If none is available, create it.
FaceConnector.
Deposit the index buffer.
The buffer.
Get a store index buffer or create a new instance.
IndexBuffer.
Deposit the deferred face.
The face.
Get the deferred face.
DeferredFace.
Calculation and representation of Delaunay triangulation.
The type of the t vertex.
The type of the t cell.
Can only be created using a factory method.
Cells of the triangulation.
The cells.
Creates the Delaunay triangulation of the input data.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
DelaunayTriangulation<TVertex, TCell>.
data
data
Simple interface to unify different types of triangulations in the future.
The type of the t vertex.
The type of the t cell.
Triangulation simplexes. For 2D - triangles, 3D - tetrahedrons, etc ...
The cells.
Factory class for creating triangulations.
Creates the Delaunay triangulation of the input data.
The type of the t vertex.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
ITriangulation<TVertex, DefaultTriangulationCell<TVertex>>.
Creates the Delaunay triangulation of the input data.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
ITriangulation<DefaultVertex, DefaultTriangulationCell<DefaultVertex>>.
Creates the Delaunay triangulation of the input data.
The type of the t vertex.
The type of the t face.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
ITriangulation<TVertex, TFace>.
Create the voronoi mesh.
The type of the t vertex.
The type of the t cell.
The type of the t edge.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
VoronoiMesh<TVertex, TCell, TEdge>.
Create the voronoi mesh.
The type of the t vertex.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
VoronoiMesh<TVertex, DefaultTriangulationCell<TVertex>, VoronoiEdge<TVertex, DefaultTriangulationCell<TVertex>>>.
Create the voronoi mesh.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
VoronoiMesh<DefaultVertex, DefaultTriangulationCell<DefaultVertex>, VoronoiEdge<DefaultVertex, DefaultTriangulationCell<DefaultVertex>>>.
Create the voronoi mesh.
The type of the t vertex.
The type of the t cell.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
VoronoiMesh<TVertex, TCell, VoronoiEdge<TVertex, TCell>>.
Representation of the triangulation cell. Pretty much the same as ConvexFace,
just wanted to distinguish the two.
To declare your own face type, use class Face : DelaunayFace(of Vertex, of Face)
The type of the t vertex.
The type of the t cell.
Default triangulation cell.
The type of the t vertex.
A class representing an (undirected) edge of the Voronoi graph.
The type of the t vertex.
The type of the t cell.
Create an instance of the edge.
Create an instance of the edge.
The source.
The target.
Source of the edge.
The source.
Target of the edge.
The target.
...
The object to compare with the current object.
true if the specified is equal to this instance; otherwise, false.
...
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
A factory class for creating a Voronoi mesh.
Create the voronoi mesh.
The type of the t vertex.
The type of the t cell.
The type of the t edge.
The data.
VoronoiMesh<TVertex, TCell, TEdge>.
Create the voronoi mesh.
The type of the t vertex.
The data.
VoronoiMesh<TVertex, DefaultTriangulationCell<TVertex>, VoronoiEdge<TVertex, DefaultTriangulationCell<TVertex>>>.
Create the voronoi mesh.
The data.
VoronoiMesh<DefaultVertex, DefaultTriangulationCell<DefaultVertex>, VoronoiEdge<DefaultVertex, DefaultTriangulationCell<DefaultVertex>>>.
Create the voronoi mesh.
The type of the t vertex.
The type of the t cell.
The data.
VoronoiMesh<TVertex, TCell, VoronoiEdge<TVertex, TCell>>.
A representation of a voronoi mesh.
The type of the t edge.
The type of the t vertex.
The type of the t cell.
Can only be created using a factory method.
Vertices of the diagram.
The vertices.
Edges connecting the cells.
The same information can be retrieved Cells' Adjacency.
The edges.
Create a Voronoi diagram of the input data.
The data.
The plane distance tolerance (default is 1e-10). If too high, points
will be missed. If too low, the algorithm may break. Only adjust if you notice problems.
VoronoiMesh<TVertex, TCell, TEdge>.
data
data
This is probably not needed, but might make things a tiny bit faster.
Equals the specified x.
The x.
The y.
System.Boolean.
Returns a hash code for this instance.
The for which a hash code is to be returned.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.