Skip to content

DiGi.Geometry.Core

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.Geometry.Core Namespace

Classes

Create Class

public static class Create

Inheritance System.Object → Create

Methods

Create.DensityBasedSpatialClusteringResult<T>(this IEnumerable<T>, double, int) Method

Performs density-based spatial clustering on the provided collection of points.

public static DiGi.Geometry.Core.Classes.DensityBasedSpatialClusteringResult<T>? DensityBasedSpatialClusteringResult<T>(this System.Collections.Generic.IEnumerable<T>? points, double tolerance, int pointCount)
    where T : DiGi.Geometry.Core.Interfaces.IPoint<T>;

Type parameters

T

The type of point, which must implement DiGi.Geometry.Core.Interfaces.IPoint<>.

Parameters

points System.Collections.Generic.IEnumerable<T>

The System.Collections.Generic.IEnumerable<> collection of points to be clustered.

tolerance System.Double

The System.Double distance threshold used to determine if two points are neighbors.

pointCount System.Int32

The minimum System.Int32 number of points required to form a dense region.

Returns

DiGi.Geometry.Core.Classes.DensityBasedSpatialClusteringResult<T>
A DensityBasedSpatialClusteringResult<T>(this IEnumerable<T>, double, int) containing the clustering results, or null if the points collection is null.

Query Class

public static class Query

Inheritance System.Object → Query

Methods

Query.AdjacencyIndexes(this IEnumerable<int[]>) Method

Creates an adjacency dictionary from a collection of indexes.

public static System.Collections.Generic.Dictionary<int,System.Collections.Generic.List<int[]>>? AdjacencyIndexes(this System.Collections.Generic.IEnumerable<int[]>? indexes);

Parameters

indexes System.Collections.Generic.IEnumerable<System.Int32[]>

The System.Collections.Generic.IEnumerable<> of int[] representing the indexes to process.

Returns

System.Collections.Generic.Dictionary<System.Int32,System.Collections.Generic.List<System.Int32[]>>
A System.Collections.Generic.Dictionary<> mapping each node index to a System.Collections.Generic.List<> of its adjacent int[] edges, or null if the input is null.

Query.AuxiliaryIndexes(this IEnumerable<int[]>) Method

Computes the auxiliary indexes based on the provided collection of index arrays.

public static System.Collections.Generic.List<int[]>? AuxiliaryIndexes(this System.Collections.Generic.IEnumerable<int[]>? indexes);

Parameters

indexes System.Collections.Generic.IEnumerable<System.Int32[]>

The System.Collections.Generic.IEnumerable<> of int[] containing the original indexes.

Returns

System.Collections.Generic.List<System.Int32[]>
A System.Collections.Generic.List<> of int[] representing the auxiliary indexes, or null if the input is null.

Query.BoundaryIndexes(this IEnumerable<int[]>) Method

Identifies and returns the boundary indexes from the provided collection of integer arrays.

public static System.Collections.Generic.List<int[]>? BoundaryIndexes(this System.Collections.Generic.IEnumerable<int[]>? indexes);

Parameters

indexes System.Collections.Generic.IEnumerable<System.Int32[]>

The System.Collections.Generic.IEnumerable<> of int[] representing the indexes to evaluate.

Returns

System.Collections.Generic.List<System.Int32[]>
A System.Collections.Generic.List<> of int[] containing the boundary indexes, or null if the input collection is null.

Query.BoundaryIndexes(this IEnumerable<int[]>, List<int[]>) Method

Identifies the boundary indexes from a collection of indexes and extracts auxiliary indexes.

public static System.Collections.Generic.List<int[]>? BoundaryIndexes(this System.Collections.Generic.IEnumerable<int[]>? indexes, out System.Collections.Generic.List<int[]>? auxiliaryIndexes);

Parameters

indexes System.Collections.Generic.IEnumerable<System.Int32[]>

The System.Collections.Generic.IEnumerable<> of int[] representing the input indexes.

auxiliaryIndexes System.Collections.Generic.List<System.Int32[]>

When this method returns, contains a System.Collections.Generic.List<> of int[] representing the auxiliary indexes, or null if none were identified.

Returns

System.Collections.Generic.List<System.Int32[]>
A System.Collections.Generic.List<> of int[] containing the boundary indexes, or null if the input System.Collections.Generic.IEnumerable<> is null.

Query.IsNonManifold(this IEnumerable<int[]>) Method

Determines whether the provided collection of indices represents a non-manifold mesh.

public static bool IsNonManifold(this System.Collections.Generic.IEnumerable<int[]>? indexes);

Parameters

indexes System.Collections.Generic.IEnumerable<System.Int32[]>

The System.Collections.Generic.IEnumerable<> of int[] containing the vertex indices for each face.

Returns

System.Boolean
A System.Boolean value indicating true if the mesh is non-manifold; otherwise, false.

Query.IsoperimetricRatio(double, double) Method

the Isoperimetric Ratio (IR) (also called Isoperimetric Quotient, Circular Compactness, or Shape Factor) is a classic geometric measure that describes how close a shape is to a perfect circle.

public static double IsoperimetricRatio(double area, double perimeter);

Parameters

area System.Double

Area of the shape

perimeter System.Double

Perimeter (or boundary length)

Returns

System.Double
Isoperimetric ratio

Query.Opposite(this Alignment) Method

Returns the opposite Alignment value.

public static DiGi.Geometry.Core.Enums.Alignment Opposite(this DiGi.Geometry.Core.Enums.Alignment alignment);

Parameters

alignment Alignment

The Alignment value to invert.

Returns

Alignment
The opposite Alignment value, or Undefined if no opposite is defined.

Query.Opposite(this Orientation) Method

Returns the opposite of the specified Orientation.

public static DiGi.Geometry.Core.Enums.Orientation Opposite(this DiGi.Geometry.Core.Enums.Orientation orientation);

Parameters

orientation Orientation

The Orientation value to invert.

Returns

Orientation
The opposite Orientation value, or Undefined if the input is undefined or collinear.

Query.PointsByDistance<T>(this IEnumerable<T>, T, double) Method

Filters a collection of points to find those within a specified distance from a given point.

public static System.Collections.Generic.List<T>? PointsByDistance<T>(this System.Collections.Generic.IEnumerable<T>? points, T? point, double tolerance=1E-06)
    where T : DiGi.Geometry.Core.Interfaces.IPoint<T>;

Type parameters

T

The type of point, which must implement DiGi.Geometry.Core.Interfaces.IPoint<>.

Parameters

points System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> containing the points to evaluate.

point T

The reference point used for distance comparison.

tolerance System.Double

A System.Double representing the maximum allowable distance between points.

Returns

System.Collections.Generic.List<T>
A System.Collections.Generic.List<> of points within the specified tolerance, or null if either the source collection or the reference point is null.

Query.RectangularThinnessRatio(double, double) Method

The Rectangular Thinness Ratio (RTR) — also sometimes called the Rectangular Compactness Ratio or Rectangular Shape Factor — is a geometric shape descriptor that measures how elongated or “thin” a shape is compared to a rectangle that perfectly fits around it (its minimum bounding rectangle).

public static double RectangularThinnessRatio(double area, double rectangleArea);

Parameters

area System.Double

shape area

rectangleArea System.Double

Minimal rectangle area

Returns

System.Double
Rectangular thinness ratio

Query.SortedBoundaryIndexes(this IEnumerable<int[]>) Method

Returns the sorted boundary indexes derived from the provided collection of int[].

public static System.Collections.Generic.List<System.Collections.Generic.List<int>>? SortedBoundaryIndexes(this System.Collections.Generic.IEnumerable<int[]>? indexes);

Parameters

indexes System.Collections.Generic.IEnumerable<System.Int32[]>

The System.Collections.Generic.IEnumerable<> of int[] representing the input indexes.

Returns

System.Collections.Generic.List<System.Collections.Generic.List<System.Int32>>
A System.Collections.Generic.List<> containing System.Collections.Generic.List<> of System.Int32 if successful; otherwise, null.

Query.SortedBoundaryIndexes(this IEnumerable<int[]>, List<int[]>) Method

Sorts the boundary indexes into continuous loops of vertex indices.

public static System.Collections.Generic.List<System.Collections.Generic.List<int>>? SortedBoundaryIndexes(this System.Collections.Generic.IEnumerable<int[]>? indexes, out System.Collections.Generic.List<int[]>? auxiliaryIndexes);

Parameters

indexes System.Collections.Generic.IEnumerable<System.Int32[]>

The IEnumerable<int[]> containing the mesh index arrays.

auxiliaryIndexes System.Collections.Generic.List<System.Int32[]>

When this method returns, contains a List<int[]> of auxiliary indexes used during boundary detection.

Returns

System.Collections.Generic.List<System.Collections.Generic.List<System.Int32>>
A List<List<int>> where each inner list represents a sorted loop of boundary vertex indices; returns null if the input IEnumerable<int[]> is null.

Query.SquareThinnessRatio(double, double) Method

The Square Thinness Ratio (STR) — also sometimes called the Square Compactness Ratio or Square Shape Factor — is a geometric shape descriptor that measures how elongated or “thin” a shape is compared to a square that perfectly fits around it (its minimum bounding square).

public static double SquareThinnessRatio(double area, double squareArea);

Parameters

area System.Double

shape area

squareArea System.Double

square area

Returns

System.Double
Square thinness ratio

Query.ThinnessRatio(double, double) Method

Calculates the thinness ratio of a shape based on its area and perimeter.

public static double ThinnessRatio(double area, double perimeter);

Parameters

area System.Double

The double value representing the area of the shape.

perimeter System.Double

The double value representing the perimeter of the shape.

Returns

System.Double
A double value representing the thinness ratio, or System.Double.NaN if either input is System.Double.NaN or if the perimeter is zero.

Clone this wiki locally