-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.Geometry.Core.Classes
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.IInvertibleInheritance System.Object → DiGi.Core.Classes.Object → DiGi.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
Initializes a new instance of the Coordinate class using the values from an existing Coordinate instance.
public Coordinate(DiGi.Geometry.Core.Classes.Coordinate? coordinate);coordinate Coordinate
The Coordinate instance to copy values from. This parameter can be null.
Initializes a new instance of the Coordinate class using a variable number of System.Double values.
public Coordinate(params double[]? values);values System.Double[]
An optional array of System.Double values to initialize the coordinate.
Initializes a new instance of the Coordinate class with the specified internal values array length.
protected Coordinate(int length);length System.Int32
The length of the values array.
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);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.
Gets the augmented matrix representation of the current values.
public DiGi.Math.Classes.Matrix? ArgumentedMatrix { get; }DiGi.Math.Classes.Matrix
A DiGi.Math.Classes.Matrix object representing the augmented matrix, or null if the underlying values are null.
Gets or sets the coordinate value at the specified index.
public double this[int index] { get; set; }index System.Int32
The zero-based index of the coordinate value to get or set.
Computes the absolute value for each element in the values array.
public void Abs();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);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.
System.Boolean
A System.Boolean value indicating whether the coordinates are almost equal based on the specified tolerance.
Determines whether the specified System.Object is equal to the current Coordinate.
public override bool Equals(object? @object);object System.Object
The System.Object to compare with the current instance.
System.Boolean
A System.Boolean value indicating whether the specified object is equal to the current instance.
Returns a hash code for the current object based on its internal values.
public override int GetHashCode();System.Int32
An int representing the hash code of the current object.
Inverts the signs of all elements in the values array.
public bool Inverse();Implements Inverse()
System.Boolean
A System.Boolean value indicating whether the inversion was successful.
Rounds each value in the collection using the specified double tolerance.
public void Round(double tolerance);tolerance System.Double
The double value representing the precision used for rounding.
Scales all elements of the values array by the specified multiplier.
public void Scale(double value);value System.Double
The System.Double value to multiply each element by.
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();System.String
A string containing the formatted values, or an empty string if the values are null.
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);coordinate_1 Coordinate
The first coordinate to compare.
coordinate_2 Coordinate
The second coordinate to compare.
System.Boolean
true if the coordinates are equal; otherwise, false.
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);coordinate_1 Coordinate
The first coordinate to compare.
coordinate_2 Coordinate
The second coordinate to compare.
System.Boolean
true if the coordinates are not equal; otherwise, false.
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>T
The type of point, which must implement DiGi.Geometry.Core.Interfaces.IPoint<>.
Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.Core.Classes.SerializableResult → DensityBasedSpatialClusteringResult<T>
Initializes a new instance of the DensityBasedSpatialClusteringResult<T> class using the specified DensityBasedSpatialClusteringResult<T> result.
public DensityBasedSpatialClusteringResult(DiGi.Geometry.Core.Classes.DensityBasedSpatialClusteringResult<T> densityBasedSpatialClusteringResult);densityBasedSpatialClusteringResult DiGi.Geometry.Core.Classes.DensityBasedSpatialClusteringResult<T>
The DensityBasedSpatialClusteringResult<T> object containing the clustering data to be copied.
Initializes a new instance of the DensityBasedSpatialClusteringResult<T> class.
public DensityBasedSpatialClusteringResult(double tolerance, int pointCount, System.Collections.Generic.Dictionary<T,int>? dictionary);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.
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);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the data used to initialize the clustering result.
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; }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.
Creates a clone of the current object.
public override DiGi.Core.Interfaces.ISerializableObject? Clone();Implements Clone()
DiGi.Core.Interfaces.ISerializableObject
An DiGi.Core.Interfaces.ISerializableObject that is a copy of the current instance, or null.
Retrieves a set of all indexes stored in the dictionary.
public System.Collections.Generic.HashSet<int>? GetIndexes();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.
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);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.
T
A cloned instance of T if a point is found; otherwise, the default value of T.
Retrieves a list of points associated with the specified index.
public System.Collections.Generic.List<T>? GetPoints(int index);index System.Int32
The System.Int32 index to search for.
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.
Determines whether the specified index exists within the dictionary values.
public bool HasIndex(int index);index System.Int32
The System.Int32 index to locate.
System.Boolean
A System.Boolean value indicating whether the specified System.Int32 index was found; otherwise, false.
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.ICollectableT
The type of elements in the collection, which must implement DiGi.Geometry.Core.Interfaces.ICollectable.
Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.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
Initializes a new instance of the GeometryCollection<T> class.
public GeometryCollection();Initializes a new instance of the GeometryCollection<T> class using the specified GeometryCollection<T> object.
public GeometryCollection(DiGi.Geometry.Core.Classes.GeometryCollection<T>? geometryCollection);geometryCollection DiGi.Geometry.Core.Classes.GeometryCollection<T>
The GeometryCollection<T> object to copy from. This value can be null.
Initializes a new instance of the GeometryCollection<T> class using the specified collection of items.
public GeometryCollection(System.Collections.Generic.IEnumerable<T>? collectables);collectables System.Collections.Generic.IEnumerable<T>
An System.Collections.Generic.IEnumerable<> containing the items to be added to the geometry collection.
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);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject used to initialize the collection.
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()
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.
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.IGeometryTGeometry
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>
Gets or sets the geometry value of type TGeometry.
public TGeometry? Value { get; set; }Implements Value
Updates the state of the object.
public abstract bool Update();Implements Update()
System.Boolean
A System.Boolean value indicating whether the update was successful.
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.IPointTGeometry
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>
Initializes a new instance of the InternalPointSolver<TGeometry,TPoint> class.
public InternalPointSolver(double tolerance=1E-06);tolerance System.Double
The System.Double value used as the distance tolerance.
Initializes a new instance of the InternalPointSolver<TGeometry,TPoint> class.
public InternalPointSolver(int maxCount, double tolerance=1E-06);maxCount System.Int32
The maximum number of iterations as an System.Int32.
tolerance System.Double
The convergence tolerance as a System.Double.
Gets or sets the input geometry of type TGeometry.
public abstract TGeometry? Input { set; }Implements Input
Gets or sets the maximum count as an System.Int32.
public int MaxCount { get; set; }Gets the last TPoint from the collection of outputs.
public TPoint? Output { get; }TPoint
The cloned last TPoint if any outputs exist; otherwise, the default value for TPoint.
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
System.Collections.Generic.List<TPoint>
A System.Collections.Generic.List<> containing the calculated outputs, or null if no outputs exist.
Attempts to solve the problem defined by the implementation.
public abstract bool Solve();Implements Solve()
System.Boolean
A System.Boolean value indicating whether the solution was successfully found.
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>TPoint
The type of point used in the mesh, which must implement DiGi.Geometry.Core.Interfaces.IPoint<>.
Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Mesh<TPoint>
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
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);mesh DiGi.Geometry.Core.Classes.Mesh<TPoint>
The source Mesh<TPoint> object to clone points from.
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);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.
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);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.
Gets the number of points in the collection. Returns -1 if the point collection is null.
public int PointsCount { get; }System.Int32
An int representing the count of points, or -1 if the collection is null.
Gets the total number of triangles.
public int TrianglesCount { get; }System.Int32
An System.Int32 representing the count of triangles, or -1 if the index collection is null.
Retrieves the set of indexes connected to the specified index.
public System.Collections.Generic.HashSet<int>? GetConnectedIndexes(int index);index System.Int32
The int index for which to find connections.
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.
Retrieves a set of points connected to the point at the specified index.
public System.Collections.Generic.HashSet<TPoint>? GetConnectedPoints(int index);index System.Int32
The System.Int32 index of the point.
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.
Retrieves a list of integer arrays containing the indexes.
public System.Collections.Generic.List<int[]>? GetIndexes();System.Collections.Generic.List<System.Int32[]>
A System.Collections.Generic.List<> of int[] if the indexes are available; otherwise, null.
Retrieves the indices for the element at the specified index.
public int[]? GetIndexes(int index);index System.Int32
The System.Int32 index of the element to retrieve.
System.Int32[]
An int[] containing the indices if available; otherwise, null.
Retrieves a list of cloned TPoint objects.
public System.Collections.Generic.List<TPoint>? GetPoints();System.Collections.Generic.List<TPoint>
A List<TPoint> containing the cloned points, or null if the internal collection is null.
Retrieves the sorted boundary points based on the available indexes and point data.
public System.Collections.Generic.List<System.Collections.Generic.List<TPoint>>? GetSortedBoundaryPoints();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.
Returns the zero-based index of the first occurrence of the specified TPoint object in the collection.
public int IndexOf(TPoint? point);point TPoint
The TPoint object to locate in the collection.
System.Int32
The zero-based index of the first occurrence of the specified TPoint object if found; otherwise, -1.
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();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.
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>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.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → UndirectedSegmentGraph<T,X>
Gets or sets the list of X segments.
public abstract System.Collections.Generic.List<X>? Segments { get; set; }System.Collections.Generic.List<X>
Adds a segment to the collection.
public bool Add(X? segment);segment X
The X segment to be added.
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.
Retrieves the index of the specified point within the vertices of the undirected graph.
public int GetIndex(T? point);point T
The T point to locate.
System.Int32
An System.Int32 representing the zero-based index of the point if it is found; otherwise, -1.