Skip to content

DiGi.Geometry.Core.Classes

github-actions[bot] edited this page Aug 21, 2026 · 3 revisions

DiGi.Geometry.Core.Classes Namespace

Classes

Coordinate Class

Represents an abstract base class for a coordinate system that is serializable, geometric, and invertible.

public abstract class Coordinate : DiGi.Core.Classes.SerializableObject, DiGi.Geometry.Core.Interfaces.IGeometry, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject, DiGi.Geometry.Core.Interfaces.IInvertible

Inheritance System.ObjectDiGi.Core.Classes.ObjectDiGi.Core.Classes.SerializableObject → Coordinate

Derived
Coordinate2D
Coordinate3D

Implements DiGi.Geometry.Core.Interfaces.IGeometry, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject, DiGi.Geometry.Core.Interfaces.IInvertible

Constructors

Coordinate(Coordinate) Constructor

Initializes a new instance of the Coordinate class using the values from an existing Coordinate instance.

public Coordinate(DiGi.Geometry.Core.Classes.Coordinate? coordinate);

Parameters

coordinate Coordinate

The Coordinate instance to copy values from. This parameter can be null.

Coordinate(double[]) Constructor

Initializes a new instance of the Coordinate class using a variable number of System.Double values.

public Coordinate(params double[]? values);

Parameters

values System.Double[]

An optional array of System.Double values to initialize the coordinate.

Coordinate(int) Constructor

Initializes a new instance of the Coordinate class with the specified internal values array length.

protected Coordinate(int length);

Parameters

length System.Int32

The length of the values array.

Coordinate(JsonObject, int) Constructor

Initializes a new instance of the Coordinate class using a System.Text.Json.Nodes.JsonObject and a specified length.

public Coordinate(System.Text.Json.Nodes.JsonObject? jsonObject, int length);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing coordinate data, or null if no data is provided.

length System.Int32

The System.Int32 specifying the number of elements for the internal values array.

Properties

Coordinate.ArgumentedMatrix Property

Gets the augmented matrix representation of the current values.

public DiGi.Math.Classes.Matrix? ArgumentedMatrix { get; }

Property Value

DiGi.Math.Classes.Matrix
A DiGi.Math.Classes.Matrix object representing the augmented matrix, or null if the underlying values are null.

Coordinate.this[int] Property

Gets or sets the coordinate value at the specified index.

public double this[int index] { get; set; }

Parameters

index System.Int32

The zero-based index of the coordinate value to get or set.

Property Value

System.Double

Methods

Coordinate.Abs() Method

Computes the absolute value for each element in the values array.

public void Abs();

Coordinate.AlmostEquals(Coordinate, double) Method

Determines whether the current instance is approximately equal to the specified Coordinate.

public bool AlmostEquals(DiGi.Geometry.Core.Classes.Coordinate? coordinate, double tolerance=1E-06);

Parameters

coordinate Coordinate

The Coordinate instance to compare with the current instance.

tolerance System.Double

A System.Double value representing the maximum allowed difference for two coordinates to be considered equal.

Returns

System.Boolean
A System.Boolean value indicating whether the coordinates are almost equal based on the specified tolerance.

Coordinate.Equals(object) Method

Determines whether the specified System.Object is equal to the current Coordinate.

public override bool Equals(object? @object);

Parameters

object System.Object

The System.Object to compare with the current instance.

Returns

System.Boolean
A System.Boolean value indicating whether the specified object is equal to the current instance.

Coordinate.GetHashCode() Method

Returns a hash code for the current object based on its internal values.

public override int GetHashCode();

Returns

System.Int32
An int representing the hash code of the current object.

Coordinate.Inverse() Method

Inverts the signs of all elements in the values array.

public bool Inverse();

Implements Inverse()

Returns

System.Boolean
A System.Boolean value indicating whether the inversion was successful.

Coordinate.Round(double) Method

Rounds each value in the collection using the specified double tolerance.

public void Round(double tolerance);

Parameters

tolerance System.Double

The double value representing the precision used for rounding.

Coordinate.Scale(double) Method

Scales all elements of the values array by the specified multiplier.

public void Scale(double value);

Parameters

value System.Double

The System.Double value to multiply each element by.

Coordinate.ToString() Method

Returns a string representation of the current object, formatting the internal values as a semicolon-separated list enclosed in square brackets.

public override string ToString();

Returns

System.String
A string containing the formatted values, or an empty string if the values are null.

Operators

Coordinate.operator ==(Coordinate, Coordinate) Operator

Compares two Coordinate instances for equality based on their types and the values they contain.

public static bool operator ==(DiGi.Geometry.Core.Classes.Coordinate? coordinate_1, DiGi.Geometry.Core.Classes.Coordinate? coordinate_2);

Parameters

coordinate_1 Coordinate

The first coordinate to compare.

coordinate_2 Coordinate

The second coordinate to compare.

Returns

System.Boolean
true if the coordinates are equal; otherwise, false.

Coordinate.operator !=(Coordinate, Coordinate) Operator

Compares two Coordinate instances to determine if they are not equal based on their types and the values they contain.

public static bool operator !=(DiGi.Geometry.Core.Classes.Coordinate? coordinate_1, DiGi.Geometry.Core.Classes.Coordinate? coordinate_2);

Parameters

coordinate_1 Coordinate

The first coordinate to compare.

coordinate_2 Coordinate

The second coordinate to compare.

Returns

System.Boolean
true if the coordinates are not equal; otherwise, false.

DensityBasedSpatialClusteringResult<T> Class

Represents the result of a density-based spatial clustering operation.

public class DensityBasedSpatialClusteringResult<T> : DiGi.Core.Classes.SerializableResult
    where T : DiGi.Geometry.Core.Interfaces.IPoint<T>

Type parameters

T

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

Inheritance System.ObjectDiGi.Core.Classes.ObjectDiGi.Core.Classes.SerializableObjectDiGi.Core.Classes.SerializableResult → DensityBasedSpatialClusteringResult<T>

Constructors

DensityBasedSpatialClusteringResult(DensityBasedSpatialClusteringResult<T>) Constructor

Initializes a new instance of the DensityBasedSpatialClusteringResult<T> class using the specified DensityBasedSpatialClusteringResult<T> result.

public DensityBasedSpatialClusteringResult(DiGi.Geometry.Core.Classes.DensityBasedSpatialClusteringResult<T> densityBasedSpatialClusteringResult);

Parameters

densityBasedSpatialClusteringResult DiGi.Geometry.Core.Classes.DensityBasedSpatialClusteringResult<T>

The DensityBasedSpatialClusteringResult<T> object containing the clustering data to be copied.

DensityBasedSpatialClusteringResult(double, int, Dictionary<T,int>) Constructor

Initializes a new instance of the DensityBasedSpatialClusteringResult<T> class.

public DensityBasedSpatialClusteringResult(double tolerance, int pointCount, System.Collections.Generic.Dictionary<T,int>? dictionary);

Parameters

tolerance System.Double

The System.Double tolerance value used for spatial clustering.

pointCount System.Int32

The System.Int32 number of points processed in the clustering operation.

dictionary System.Collections.Generic.Dictionary<T,System.Int32>

An optional Dictionary<T, int>/> containing the mapping of elements to their respective cluster indices.

DensityBasedSpatialClusteringResult(JsonObject) Constructor

Initializes a new instance of the DensityBasedSpatialClusteringResult<T> class using the specified System.Text.Json.Nodes.JsonObject.

public DensityBasedSpatialClusteringResult(System.Text.Json.Nodes.JsonObject jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the data used to initialize the clustering result.

Properties

DensityBasedSpatialClusteringResult<T>.Dictionary Property

Gets a Dictionary<T, int>/> containing mappings from keys of type T to values of type System.Int32.

public System.Collections.Generic.Dictionary<T,int>? Dictionary { get; private set; }

Property Value

System.Collections.Generic.Dictionary<T,System.Int32>
A Dictionary<T, int>/> where each key is a clone of the original key, or null if the underlying dictionary is null.

Methods

DensityBasedSpatialClusteringResult<T>.Clone() Method

Creates a clone of the current object.

public override DiGi.Core.Interfaces.ISerializableObject? Clone();

Implements Clone()

Returns

DiGi.Core.Interfaces.ISerializableObject
An DiGi.Core.Interfaces.ISerializableObject that is a copy of the current instance, or null.

DensityBasedSpatialClusteringResult<T>.GetIndexes() Method

Retrieves a set of all indexes stored in the dictionary.

public System.Collections.Generic.HashSet<int>? GetIndexes();

Returns

System.Collections.Generic.HashSet<System.Int32>
A System.Collections.Generic.HashSet<> of System.Int32 containing the indexes, or null if the internal dictionary is null.

DensityBasedSpatialClusteringResult<T>.GetPoint(int, Func<IEnumerable<T>,T>) Method

Retrieves a single point at the specified index. If multiple points are available, they can be processed by the provided function; otherwise, the first point is returned.

public T? GetPoint(int index, System.Func<System.Collections.Generic.IEnumerable<T>,T>? func=null);

Parameters

index System.Int32

The index of the point to retrieve.

func System.Func<System.Collections.Generic.IEnumerable<T>,T>

An optional Func<IEnumerable<T>, T> used to select a single T from the collection of points.

Returns

T
A cloned instance of T if a point is found; otherwise, the default value of T.

DensityBasedSpatialClusteringResult<T>.GetPoints(int) Method

Retrieves a list of points associated with the specified index.

public System.Collections.Generic.List<T>? GetPoints(int index);

Parameters

index System.Int32

The System.Int32 index to search for.

Returns

System.Collections.Generic.List<T>
A System.Collections.Generic.List<> containing the points that match the provided index, or null if the dictionary is null.

DensityBasedSpatialClusteringResult<T>.HasIndex(int) Method

Determines whether the specified index exists within the dictionary values.

public bool HasIndex(int index);

Parameters

index System.Int32

The System.Int32 index to locate.

Returns

System.Boolean
A System.Boolean value indicating whether the specified System.Int32 index was found; otherwise, false.

GeometryCollection<T> Class

Represents an abstract collection of geometry objects that implements the DiGi.Geometry.Core.Interfaces.IGeometryCollection<> interface.

public abstract class GeometryCollection<T> : DiGi.Core.Classes.SerializableObjectCollection<T>, DiGi.Geometry.Core.Interfaces.IGeometryCollection<T>, DiGi.Geometry.Core.Interfaces.IGeometryCollection, DiGi.Geometry.Core.Interfaces.IGeometry, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject, System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
    where T : DiGi.Geometry.Core.Interfaces.ICollectable

Type parameters

T

The type of elements in the collection, which must implement DiGi.Geometry.Core.Interfaces.ICollectable.

Inheritance System.ObjectDiGi.Core.Classes.ObjectDiGi.Core.Classes.SerializableObjectDiGi.Core.Classes.SerializableObjectCollection<T> → GeometryCollection<T>

Derived
GeometryCollection2D

Implements DiGi.Geometry.Core.Interfaces.IGeometryCollection<T>, DiGi.Geometry.Core.Interfaces.IGeometryCollection, DiGi.Geometry.Core.Interfaces.IGeometry, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject, System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable

Constructors

GeometryCollection() Constructor

Initializes a new instance of the GeometryCollection<T> class.

public GeometryCollection();

GeometryCollection(GeometryCollection<T>) Constructor

Initializes a new instance of the GeometryCollection<T> class using the specified GeometryCollection<T> object.

public GeometryCollection(DiGi.Geometry.Core.Classes.GeometryCollection<T>? geometryCollection);

Parameters

geometryCollection DiGi.Geometry.Core.Classes.GeometryCollection<T>

The GeometryCollection<T> object to copy from. This value can be null.

GeometryCollection(IEnumerable<T>) Constructor

Initializes a new instance of the GeometryCollection<T> class using the specified collection of items.

public GeometryCollection(System.Collections.Generic.IEnumerable<T>? collectables);

Parameters

collectables System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> containing the items to be added to the geometry collection.

GeometryCollection(JsonObject) Constructor

Initializes a new instance of the GeometryCollection<T> class using the specified System.Text.Json.Nodes.JsonObject.

public GeometryCollection(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject used to initialize the collection.

Methods

GeometryCollection<T>.Clone() Method

Creates a deep copy of the current object by converting it to a System.Text.Json.Nodes.JsonObject and recreating it as an DiGi.Core.Interfaces.ISerializableObject.

public override DiGi.Core.Interfaces.ISerializableObject? Clone();

Implements Clone()

Returns

DiGi.Core.Interfaces.ISerializableObject
A new DiGi.Core.Interfaces.ISerializableObject instance that is a clone of the current object, or null if the conversion to System.Text.Json.Nodes.JsonObject fails.

GeometryUpdater<TGeometry> Class

Provides an abstract base class for updating a geometry object of type TGeometry.

public abstract class GeometryUpdater<TGeometry> : DiGi.Geometry.Core.Interfaces.IGeometryUpdater<TGeometry>, DiGi.Geometry.Core.Interfaces.IGeometryUpdater, DiGi.Core.Interfaces.IUpdater, DiGi.Core.Interfaces.IEvaluator, DiGi.Core.Interfaces.IUpdater<TGeometry>
    where TGeometry : DiGi.Geometry.Core.Interfaces.IGeometry

Type parameters

TGeometry

The type of geometry to be updated, which must implement the DiGi.Geometry.Core.Interfaces.IGeometry.

Inheritance System.Object → GeometryUpdater<TGeometry>

Derived
DouglasPeuckerUpdater
Polygonal2DNormalizationUpdater
PolygonalFace2DNormalizationUpdater
Polygonal3DNormalizationUpdater
PolygonalFace3DNormalizationUpdater
PolyhedronNormalizationUpdater<TPolyhedron>

Implements DiGi.Geometry.Core.Interfaces.IGeometryUpdater<TGeometry>, DiGi.Geometry.Core.Interfaces.IGeometryUpdater, DiGi.Core.Interfaces.IUpdater, DiGi.Core.Interfaces.IEvaluator, DiGi.Core.Interfaces.IUpdater<TGeometry>

Properties

GeometryUpdater<TGeometry>.Value Property

Gets or sets the geometry value of type TGeometry.

public TGeometry? Value { get; set; }

Implements Value

Property Value

TGeometry

Methods

GeometryUpdater<TGeometry>.Update() Method

Updates the state of the object.

public abstract bool Update();

Implements Update()

Returns

System.Boolean
A System.Boolean value indicating whether the update was successful.

InternalPointSolver<TGeometry,TPoint> Class

Provides a base implementation for solvers that calculate internal points within a specific geometry.

public abstract class InternalPointSolver<TGeometry,TPoint> : DiGi.Geometry.Core.Interfaces.IOneToManyGeometrySolver<TGeometry, TPoint>, DiGi.Geometry.Core.Interfaces.IGeometrySolver, DiGi.Core.Interfaces.ISolver, DiGi.Core.Interfaces.IEvaluator, DiGi.Core.Interfaces.IOneToManySolver<TGeometry, TPoint>
    where TGeometry : DiGi.Geometry.Core.Interfaces.IGeometry
    where TPoint : DiGi.Geometry.Core.Interfaces.IPoint

Type parameters

TGeometry

The type of geometry, which must implement DiGi.Geometry.Core.Interfaces.IGeometry.

TPoint

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

Inheritance System.Object → InternalPointSolver<TGeometry,TPoint>

Derived
PolygonalFace2DInternalPointSolver
PolyhedronInternalPointSolver<TPolyhedron>

Implements DiGi.Geometry.Core.Interfaces.IOneToManyGeometrySolver<TGeometry,TPoint>, DiGi.Geometry.Core.Interfaces.IGeometrySolver, DiGi.Core.Interfaces.ISolver, DiGi.Core.Interfaces.IEvaluator, DiGi.Core.Interfaces.IOneToManySolver<TGeometry,TPoint>

Constructors

InternalPointSolver(double) Constructor

Initializes a new instance of the InternalPointSolver<TGeometry,TPoint> class.

public InternalPointSolver(double tolerance=1E-06);

Parameters

tolerance System.Double

The System.Double value used as the distance tolerance.

InternalPointSolver(int, double) Constructor

Initializes a new instance of the InternalPointSolver<TGeometry,TPoint> class.

public InternalPointSolver(int maxCount, double tolerance=1E-06);

Parameters

maxCount System.Int32

The maximum number of iterations as an System.Int32.

tolerance System.Double

The convergence tolerance as a System.Double.

Properties

InternalPointSolver<TGeometry,TPoint>.Input Property

Gets or sets the input geometry of type TGeometry.

public abstract TGeometry? Input { set; }

Implements Input

Property Value

TGeometry

InternalPointSolver<TGeometry,TPoint>.MaxCount Property

Gets or sets the maximum count as an System.Int32.

public int MaxCount { get; set; }

Property Value

System.Int32

InternalPointSolver<TGeometry,TPoint>.Output Property

Gets the last TPoint from the collection of outputs.

public TPoint? Output { get; }

Property Value

TPoint
The cloned last TPoint if any outputs exist; otherwise, the default value for TPoint.

InternalPointSolver<TGeometry,TPoint>.Outputs Property

Gets a System.Collections.Generic.List<> of the resulting output points, filtered to remove any null values.

public System.Collections.Generic.List<TPoint>? Outputs { get; }

Implements Outputs

Property Value

System.Collections.Generic.List<TPoint>
A System.Collections.Generic.List<> containing the calculated outputs, or null if no outputs exist.

Methods

InternalPointSolver<TGeometry,TPoint>.Solve() Method

Attempts to solve the problem defined by the implementation.

public abstract bool Solve();

Implements Solve()

Returns

System.Boolean
A System.Boolean value indicating whether the solution was successfully found.

Mesh<TPoint> Class

Represents an abstract base class for a mesh structure consisting of points and indices.

public abstract class Mesh<TPoint> : DiGi.Core.Classes.SerializableObject, DiGi.Geometry.Core.Interfaces.IMesh, DiGi.Geometry.Core.Interfaces.IGeometry, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject
    where TPoint : DiGi.Geometry.Core.Interfaces.IPoint<TPoint>

Type parameters

TPoint

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

Inheritance System.ObjectDiGi.Core.Classes.ObjectDiGi.Core.Classes.SerializableObject → Mesh<TPoint>

Derived
Mesh2D
Mesh3D

Implements DiGi.Geometry.Core.Interfaces.IMesh, DiGi.Geometry.Core.Interfaces.IGeometry, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject

Constructors

Mesh(Mesh<TPoint>) Constructor

Initializes a new instance of the Mesh<TPoint> class by cloning points from an existing Mesh<TPoint> object.

public Mesh(DiGi.Geometry.Core.Classes.Mesh<TPoint>? mesh);

Parameters

mesh DiGi.Geometry.Core.Classes.Mesh<TPoint>

The source Mesh<TPoint> object to clone points from.

Mesh(IEnumerable<TPoint>, IEnumerable<int[]>) Constructor

Initializes a new instance of the Mesh<TPoint> class with the specified points and indexes.

public Mesh(System.Collections.Generic.IEnumerable<TPoint>? points, System.Collections.Generic.IEnumerable<int[]>? indexes);

Parameters

points System.Collections.Generic.IEnumerable<TPoint>

An System.Collections.Generic.IEnumerable<> containing the vertices of the mesh. This value can be null.

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

An System.Collections.Generic.IEnumerable<> of integer arrays defining the indices for the mesh faces. This value can be null.

Mesh(JsonObject) Constructor

Initializes a new instance of the Mesh<TPoint> class using the provided System.Text.Json.Nodes.JsonObject.

public Mesh(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the data used to initialize the mesh. This value can be null.

Properties

Mesh<TPoint>.PointsCount Property

Gets the number of points in the collection. Returns -1 if the point collection is null.

public int PointsCount { get; }

Property Value

System.Int32
An int representing the count of points, or -1 if the collection is null.

Mesh<TPoint>.TrianglesCount Property

Gets the total number of triangles.

public int TrianglesCount { get; }

Property Value

System.Int32
An System.Int32 representing the count of triangles, or -1 if the index collection is null.

Methods

Mesh<TPoint>.GetConnectedIndexes(int) Method

Retrieves the set of indexes connected to the specified index.

public System.Collections.Generic.HashSet<int>? GetConnectedIndexes(int index);

Parameters

index System.Int32

The int index for which to find connections.

Returns

System.Collections.Generic.HashSet<System.Int32>
A HashSet<int> containing all connected indexes, or null if the internal collection is null or the provided int index is negative.

Mesh<TPoint>.GetConnectedPoints(int) Method

Retrieves a set of points connected to the point at the specified index.

public System.Collections.Generic.HashSet<TPoint>? GetConnectedPoints(int index);

Parameters

index System.Int32

The System.Int32 index of the point.

Returns

System.Collections.Generic.HashSet<TPoint>
A System.Collections.Generic.HashSet<> containing the connected points, or null if the internal points collection is null or no connected indexes are found.

Mesh<TPoint>.GetIndexes() Method

Retrieves a list of integer arrays containing the indexes.

public System.Collections.Generic.List<int[]>? GetIndexes();

Returns

System.Collections.Generic.List<System.Int32[]>
A System.Collections.Generic.List<> of int[] if the indexes are available; otherwise, null.

Mesh<TPoint>.GetIndexes(int) Method

Retrieves the indices for the element at the specified index.

public int[]? GetIndexes(int index);

Parameters

index System.Int32

The System.Int32 index of the element to retrieve.

Returns

System.Int32[]
An int[] containing the indices if available; otherwise, null.

Mesh<TPoint>.GetPoints() Method

Retrieves a list of cloned TPoint objects.

public System.Collections.Generic.List<TPoint>? GetPoints();

Returns

System.Collections.Generic.List<TPoint>
A List<TPoint> containing the cloned points, or null if the internal collection is null.

Mesh<TPoint>.GetSortedBoundaryPoints() Method

Retrieves the sorted boundary points based on the available indexes and point data.

public System.Collections.Generic.List<System.Collections.Generic.List<TPoint>>? GetSortedBoundaryPoints();

Returns

System.Collections.Generic.List<System.Collections.Generic.List<TPoint>>
A System.Collections.Generic.List<> of System.Collections.Generic.List<> containing TPoint objects representing the sorted boundaries, or null if the internal indexes or points are null, or if the boundary index query fails.

Mesh<TPoint>.IndexOf(TPoint) Method

Returns the zero-based index of the first occurrence of the specified TPoint object in the collection.

public int IndexOf(TPoint? point);

Parameters

point TPoint

The TPoint object to locate in the collection.

Returns

System.Int32
The zero-based index of the first occurrence of the specified TPoint object if found; otherwise, -1.

Mesh<TPoint>.IsClosed() Method

Determines whether the mesh forms a closed (watertight, manifold) surface, i.e. every edge is shared by exactly two triangles.

Runs in a single pass over the triangles, keying each edge on its ordered pair of vertex indices, and exits early when a non-manifold edge (shared by more than two triangles) or a degenerate triangle is found.

This is the index-based counterpart of DiGi.Geometry.Spatial.Query.IsClosed for a polyhedron, which has no shared vertex table and so must weld coincident vertices within a tolerance before it can count edges the same way.

public bool IsClosed();

Returns

System.Boolean
true if every edge of the mesh is shared by exactly two triangles; otherwise, false. Returns false if the indexes are unavailable or the mesh has fewer than four triangles.

UndirectedSegmentGraph<T,X> Class

Represents an abstract base class for an undirected graph composed of segments.

public abstract class UndirectedSegmentGraph<T,X> : DiGi.Core.Classes.SerializableObject
    where T : DiGi.Geometry.Core.Interfaces.IPoint<T>
    where X : DiGi.Geometry.Core.Interfaces.ISegment<T>

Type parameters

T

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

X

The type of segment in the graph, which must implement DiGi.Geometry.Core.Interfaces.ISegment<>.

Inheritance System.ObjectDiGi.Core.Classes.ObjectDiGi.Core.Classes.SerializableObject → UndirectedSegmentGraph<T,X>

Properties

UndirectedSegmentGraph<T,X>.Segments Property

Gets or sets the list of X segments.

public abstract System.Collections.Generic.List<X>? Segments { get; set; }

Property Value

System.Collections.Generic.List<X>

Methods

UndirectedSegmentGraph<T,X>.Add(X) Method

Adds a segment to the collection.

public bool Add(X? segment);

Parameters

segment X

The X segment to be added.

Returns

System.Boolean
A System.Boolean value indicating whether the segment was successfully added; returns false if the X segment is null or if its start or end points are null.

UndirectedSegmentGraph<T,X>.GetIndex(T) Method

Retrieves the index of the specified point within the vertices of the undirected graph.

public int GetIndex(T? point);

Parameters

point T

The T point to locate.

Returns

System.Int32
An System.Int32 representing the zero-based index of the point if it is found; otherwise, -1.

Clone this wiki locally