Skip to content

DiGi.Geometry.Planar

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

DiGi.Geometry.Planar Namespace

Classes

Convert Class

public static class Convert

Inheritance System.Object → Convert

Methods

Convert.ToDiGi(this Coordinate) Method

Converts a NetTopologySuite.Geometries.Coordinate to a Point2D.

public static DiGi.Geometry.Planar.Classes.Point2D ToDiGi(this Coordinate coordinate);

Parameters

coordinate NetTopologySuite.Geometries.Coordinate

The NetTopologySuite.Geometries.Coordinate instance to convert.

Returns

Point2D
A new Point2D object created from the coordinate values.

Convert.ToDiGi(this Geometry) Method

Converts a NetTopologySuite.Geometries.Geometry to an DiGi.Geometry.Planar.Interfaces.IGeometry2D.

public static DiGi.Geometry.Planar.Interfaces.IGeometry2D? ToDiGi(this Geometry? geometry);

Parameters

geometry NetTopologySuite.Geometries.Geometry

The NetTopologySuite.Geometries.Geometry instance to convert.

Returns

DiGi.Geometry.Planar.Interfaces.IGeometry2D
An DiGi.Geometry.Planar.Interfaces.IGeometry2D representation of the geometry, or null if the provided NetTopologySuite.Geometries.Geometry is null.

Convert.ToDiGi(this GeometryCollection) Method

Converts the specified NetTopologySuite.Geometries.GeometryCollection to a GeometryCollection2D.

public static DiGi.Geometry.Planar.Classes.GeometryCollection2D? ToDiGi(this GeometryCollection? geometryCollection);

Parameters

geometryCollection NetTopologySuite.Geometries.GeometryCollection

The NetTopologySuite.Geometries.GeometryCollection instance to convert.

Returns

GeometryCollection2D
A GeometryCollection2D containing the converted elements, or null if the provided NetTopologySuite.Geometries.GeometryCollection is null.

Convert.ToDiGi(this LinearRing) Method

Converts a NetTopologySuite.Geometries.LinearRing to a Polygon2D.

public static DiGi.Geometry.Planar.Classes.Polygon2D? ToDiGi(this LinearRing? linearRing);

Parameters

linearRing NetTopologySuite.Geometries.LinearRing

The NetTopologySuite.Geometries.LinearRing instance to convert.

Returns

Polygon2D
A Polygon2D instance if the conversion is successful; otherwise, null.

Convert.ToDiGi(this LineSegment) Method

Converts a NetTopologySuite.Geometries.LineSegment instance to a Segment2D instance.

public static DiGi.Geometry.Planar.Classes.Segment2D? ToDiGi(this LineSegment? lineSegment);

Parameters

lineSegment NetTopologySuite.Geometries.LineSegment

The NetTopologySuite.Geometries.LineSegment instance to convert.

Returns

Segment2D
A Segment2D instance if the conversion is successful; otherwise, null.

Convert.ToDiGi(this LineString) Method

Converts a NetTopologySuite.Geometries.LineString to a Polyline2D.

public static DiGi.Geometry.Planar.Classes.Polyline2D? ToDiGi(this LineString? linearString);

Parameters

linearString NetTopologySuite.Geometries.LineString

The NetTopologySuite.Geometries.LineString instance to convert.

Returns

Polyline2D
A Polyline2D instance if the conversion is successful and contains at least 3 points; otherwise, null.

Convert.ToDiGi(this Point) Method

Converts a NetTopologySuite.Geometries.Point to a Point2D.

public static DiGi.Geometry.Planar.Classes.Point2D ToDiGi(this Point point);

Parameters

point NetTopologySuite.Geometries.Point

The NetTopologySuite.Geometries.Point instance to convert.

Returns

Point2D
A new Point2D object created from the coordinates of the provided point.

Convert.ToDiGi(this Polygon) Method

Converts the specified NetTopologySuite.Geometries.Polygon to a PolygonalFace2D.

public static DiGi.Geometry.Planar.Classes.PolygonalFace2D? ToDiGi(this Polygon? polygon);

Parameters

polygon NetTopologySuite.Geometries.Polygon

The NetTopologySuite.Geometries.Polygon instance to convert.

Returns

PolygonalFace2D
A PolygonalFace2D representation of the polygon, or null if the NetTopologySuite.Geometries.Polygon is null, empty, or cannot be converted.

Convert.ToDiGi(this IEnumerable<Coordinate>) Method

Converts a collection of NetTopologySuite.Geometries.Coordinate objects to a list of Point2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? ToDiGi(this System.Collections.Generic.IEnumerable<Coordinate>? coordinates);

Parameters

coordinates System.Collections.Generic.IEnumerable<NetTopologySuite.Geometries.Coordinate>

The IEnumerable<NetTopologySuite.Geometries.Coordinate> containing the coordinates to convert.

Returns

System.Collections.Generic.List<Point2D>
A List<Point2D> containing the converted points, or null if the input IEnumerable<NetTopologySuite.Geometries.Coordinate> is null.

Convert.ToDiGi(this Point) Method

Converts a System.Drawing.Point instance to a Point2D instance.

public static DiGi.Geometry.Planar.Classes.Point2D ToDiGi(this System.Drawing.Point point);

Parameters

point System.Drawing.Point

The System.Drawing.Point instance to convert.

Returns

Point2D
A new Point2D instance created from the provided System.Drawing.Point.

Convert.ToDiGi(this PointF) Method

Converts a System.Drawing.PointF instance to a Point2D instance.

public static DiGi.Geometry.Planar.Classes.Point2D ToDiGi(this System.Drawing.PointF pointF);

Parameters

pointF System.Drawing.PointF

The System.Drawing.PointF instance to convert.

Returns

Point2D
A new Point2D instance created from the provided System.Drawing.PointF.

Convert.ToDiGi(this Rectangle) Method

Converts a System.Drawing.Rectangle to a BoundingBox2D.

public static DiGi.Geometry.Planar.Classes.BoundingBox2D ToDiGi(this System.Drawing.Rectangle rectangle);

Parameters

rectangle System.Drawing.Rectangle

The System.Drawing.Rectangle instance to convert.

Returns

BoundingBox2D
A new BoundingBox2D created from the provided System.Drawing.Rectangle.

Convert.ToDiGi(this RectangleF) Method

Converts a System.Drawing.RectangleF to a BoundingBox2D.

public static DiGi.Geometry.Planar.Classes.BoundingBox2D ToDiGi(this System.Drawing.RectangleF rectangleF);

Parameters

rectangleF System.Drawing.RectangleF

The System.Drawing.RectangleF instance to convert.

Returns

BoundingBox2D
A new BoundingBox2D instance created from the provided System.Drawing.RectangleF.

Convert.ToDiGi(this Size) Method

Converts a System.Drawing.Size object to a Vector2D.

public static DiGi.Geometry.Planar.Classes.Vector2D ToDiGi(this System.Drawing.Size size);

Parameters

size System.Drawing.Size

The System.Drawing.Size instance to convert.

Returns

Vector2D
A new Vector2D representing the dimensions of the provided System.Drawing.Size.

Convert.ToDiGi(this SizeF) Method

Converts a System.Drawing.SizeF instance to a Vector2D.

public static DiGi.Geometry.Planar.Classes.Vector2D ToDiGi(this System.Drawing.SizeF sizeF);

Parameters

sizeF System.Drawing.SizeF

The System.Drawing.SizeF instance to convert.

Returns

Vector2D
A new Vector2D created from the width and height of the System.Drawing.SizeF instance.

Convert.ToDiGi_Geometry2Ds(this Geometry) Method

Converts a NetTopologySuite.Geometries.Geometry of any dimension to a flat list of DiGi.Geometry.Planar.Interfaces.IGeometry2D objects.

Nested NetTopologySuite.Geometries.GeometryCollection instances (including NetTopologySuite.Geometries.MultiPolygon, NetTopologySuite.Geometries.MultiLineString and NetTopologySuite.Geometries.MultiPoint) are flattened. Polygons convert to PolygonalFace2D, linear rings to Polygon2D, two-point line strings to Segment2D, longer line strings to Polyline2D and points to Point2D. Empty components are skipped.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Interfaces.IGeometry2D>? ToDiGi_Geometry2Ds(this Geometry? geometry);

Parameters

geometry NetTopologySuite.Geometries.Geometry

The NetTopologySuite.Geometries.Geometry instance to convert.

Returns

System.Collections.Generic.List<DiGi.Geometry.Planar.Interfaces.IGeometry2D>
A list of DiGi.Geometry.Planar.Interfaces.IGeometry2D objects (possibly empty), or null if the provided geometry is null.

Convert.ToDiGi_Polygon2Ds(this Polygon) Method

Converts a NetTopologySuite.Geometries.Polygon to a list of Polygon2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? ToDiGi_Polygon2Ds(this Polygon? polygon);

Parameters

polygon NetTopologySuite.Geometries.Polygon

The NetTopologySuite.Geometries.Polygon instance to convert.

Returns

System.Collections.Generic.List<Polygon2D>
A System.Collections.Generic.List<> containing the converted polygons, or null if the provided NetTopologySuite.Geometries.Polygon is null or has no exterior ring.

Convert.ToDiGi_PolygonalFace2Ds(this MultiPolygon) Method

Converts a NetTopologySuite.Geometries.MultiPolygon instance to a System.Collections.Generic.List<> of PolygonalFace2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.PolygonalFace2D>? ToDiGi_PolygonalFace2Ds(this MultiPolygon? multiPolygon);

Parameters

multiPolygon NetTopologySuite.Geometries.MultiPolygon

The NetTopologySuite.Geometries.MultiPolygon instance to convert.

Returns

System.Collections.Generic.List<PolygonalFace2D>
A System.Collections.Generic.List<> containing the converted PolygonalFace2D objects, or null if the input is null or cannot be processed.

Convert.ToDrawing(this BoundingBox2D) Method

Converts the specified BoundingBox2D to a System.Drawing.RectangleF.

public static System.Nullable<System.Drawing.RectangleF> ToDrawing(this DiGi.Geometry.Planar.Classes.BoundingBox2D boundingBox2D);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D instance to convert.

Returns

System.Nullable<System.Drawing.RectangleF>
A System.Drawing.RectangleF representing the bounding box, or null if the BoundingBox2D is null or its minimum point is null.

Convert.ToDrawing(this Point2D) Method

Converts a Point2D? to a PointF? for drawing purposes.

public static System.Nullable<System.Drawing.PointF> ToDrawing(this DiGi.Geometry.Planar.Classes.Point2D? point2D);

Parameters

point2D Point2D

The Point2D instance to convert.

Returns

System.Nullable<System.Drawing.PointF>
A PointF? representation of the point, or null if the provided Point2D? is null.

Convert.ToDrawing(this Vector2D) Method

Converts a Vector2D instance to a System.Drawing.SizeF object.

public static System.Nullable<System.Drawing.SizeF> ToDrawing(this DiGi.Geometry.Planar.Classes.Vector2D vector2D);

Parameters

vector2D Vector2D

The Vector2D instance to convert.

Returns

System.Nullable<System.Drawing.SizeF>
A System.Drawing.SizeF representation of the Vector2D, or null if the provided Vector2D is null.

Convert.ToDrawing_Point(this Point2D, RoundingMethod) Method

Converts a Point2D to a System.Drawing.Point using the specified rounding method.

public static System.Nullable<System.Drawing.Point> ToDrawing_Point(this DiGi.Geometry.Planar.Classes.Point2D point2D, DiGi.Core.Enums.RoundingMethod roundingMethod=DiGi.Core.Enums.RoundingMethod.Nearest);

Parameters

point2D Point2D

The Point2D instance to convert.

roundingMethod DiGi.Core.Enums.RoundingMethod

The DiGi.Core.Enums.RoundingMethod used to round the coordinates. Defaults to DiGi.Core.Enums.RoundingMethod.Nearest.

Returns

System.Nullable<System.Drawing.Point>
A System.Drawing.Point object if the conversion is successful and the rounding method is not undefined; otherwise, null.

Convert.ToDrawing_Rectangle(this BoundingBox2D, RoundingMethod) Method

Converts a BoundingBox2D to a System.Drawing.Rectangle using the specified rounding method.

public static System.Nullable<System.Drawing.Rectangle> ToDrawing_Rectangle(this DiGi.Geometry.Planar.Classes.BoundingBox2D boundingBox2D, DiGi.Core.Enums.RoundingMethod roundingMethod=DiGi.Core.Enums.RoundingMethod.Nearest);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D instance to convert.

roundingMethod DiGi.Core.Enums.RoundingMethod

The DiGi.Core.Enums.RoundingMethod used to round the coordinates. Defaults to DiGi.Core.Enums.RoundingMethod.Nearest.

Returns

System.Nullable<System.Drawing.Rectangle>
A System.Drawing.Rectangle if the conversion is successful; otherwise, null if the roundingMethod is DiGi.Core.Enums.RoundingMethod.Undefined or the internal conversion fails.

Convert.ToDrawing_Size(this Vector2D, RoundingMethod) Method

Converts a Vector2D to a System.Drawing.Size using the specified rounding method.

public static System.Nullable<System.Drawing.Size> ToDrawing_Size(this DiGi.Geometry.Planar.Classes.Vector2D vector2D, DiGi.Core.Enums.RoundingMethod roundingMethod=DiGi.Core.Enums.RoundingMethod.Nearest);

Parameters

vector2D Vector2D

The Vector2D instance to convert.

roundingMethod DiGi.Core.Enums.RoundingMethod

The DiGi.Core.Enums.RoundingMethod used to round the values. Defaults to DiGi.Core.Enums.RoundingMethod.Nearest.

Returns

System.Nullable<System.Drawing.Size>
A System.Drawing.Size object if the conversion is successful and the rounding method is not DiGi.Core.Enums.RoundingMethod.Undefined; otherwise, null.

Convert.ToNTS(this Point2D) Method

Converts a Point2D instance to an NTS NetTopologySuite.Geometries.Coordinate.

public static Coordinate? ToNTS(this DiGi.Geometry.Planar.Classes.Point2D? point2D);

Parameters

point2D Point2D

The Point2D instance to convert.

Returns

NetTopologySuite.Geometries.Coordinate
A NetTopologySuite.Geometries.Coordinate instance if the provided Point2D is not null; otherwise, null.

Convert.ToNTS(this Point2D, double) Method

Converts a Point2D to an NTS NetTopologySuite.Geometries.Coordinate, rounding the coordinates using the specified tolerance.

public static Coordinate? ToNTS(this DiGi.Geometry.Planar.Classes.Point2D? point2D, double tolerance);

Parameters

point2D Point2D

The Point2D instance to convert.

tolerance System.Double

The System.Double value used for rounding the X and Y coordinates.

Returns

NetTopologySuite.Geometries.Coordinate
A NetTopologySuite.Geometries.Coordinate object if the provided Point2D is not null; otherwise, returns null.

Convert.ToNTS(this Polyline2D) Method

Converts the specified Polyline2D to an NTS NetTopologySuite.Geometries.LineString.

public static LineString? ToNTS(this DiGi.Geometry.Planar.Classes.Polyline2D? polyline2D);

Parameters

polyline2D Polyline2D

The Polyline2D instance to convert.

Returns

NetTopologySuite.Geometries.LineString
An NTS NetTopologySuite.Geometries.LineString if the conversion is successful; otherwise, null.

Convert.ToNTS(this Segment2D) Method

Converts the specified Segment2D to an NTS NetTopologySuite.Geometries.LineSegment.

public static LineSegment? ToNTS(this DiGi.Geometry.Planar.Classes.Segment2D? segment2D);

Parameters

segment2D Segment2D

The Segment2D instance to convert.

Returns

NetTopologySuite.Geometries.LineSegment
A NetTopologySuite.Geometries.LineSegment if the Segment2D and its start and end points are not null; otherwise, null.

Convert.ToNTS(this IGeometry2D) Method

Converts an DiGi.Geometry.Planar.Interfaces.IGeometry2D instance to a NetTopologySuite.Geometries.Geometry object.

public static Geometry? ToNTS(this DiGi.Geometry.Planar.Interfaces.IGeometry2D? sAMGeometry2D);

Parameters

sAMGeometry2D DiGi.Geometry.Planar.Interfaces.IGeometry2D

The DiGi.Geometry.Planar.Interfaces.IGeometry2D geometry to convert.

Returns

NetTopologySuite.Geometries.Geometry
A NetTopologySuite.Geometries.Geometry representation of the input geometry, or null if the provided DiGi.Geometry.Planar.Interfaces.IGeometry2D is null.

Convert.ToNTS(this IPolygonal2D) Method

Converts an IPolygonal2D instance to a NetTopologySuite NetTopologySuite.Geometries.LinearRing.

public static LinearRing? ToNTS(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to convert.

Returns

NetTopologySuite.Geometries.LinearRing
A NetTopologySuite.Geometries.LinearRing if the conversion is successful; otherwise, null.

Convert.ToNTS(this IPolygonalFace2D) Method

Converts an IPolygonalFace2D instance to a NetTopologySuite NetTopologySuite.Geometries.Polygon.

public static Polygon? ToNTS(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D);

Parameters

polygonalFace2D IPolygonalFace2D

The IPolygonalFace2D instance to convert.

Returns

NetTopologySuite.Geometries.Polygon
A NetTopologySuite.Geometries.Polygon representing the polygonal face, or null if the provided IPolygonalFace2D is null or its external edge cannot be converted.

Convert.ToNTS(this IEnumerable<Point2D>) Method

Converts a collection of Point2D objects to a list of Coordinate objects.

public static System.Collections.Generic.List<Coordinate>? ToNTS(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The IEnumerable<Point2D> containing the points to convert.

Returns

System.Collections.Generic.List<NetTopologySuite.Geometries.Coordinate>
A List<Coordinate> containing the converted coordinates, or null if the input collection is null.

Convert.ToNTS_Coordinates(this Segmentable2D, bool) Method

Converts the points of a Segmentable2D to an array of NTS NetTopologySuite.Geometries.Coordinate objects without cloning the points.

public static Coordinate[]? ToNTS_Coordinates(this DiGi.Geometry.Planar.Classes.Segmentable2D? segmentable2D, bool close);

Parameters

segmentable2D Segmentable2D

The Segmentable2D instance to convert.

close System.Boolean

When true, the first coordinate is appended at the end to close the ring.

Returns

NetTopologySuite.Geometries.Coordinate[]
An array of NetTopologySuite.Geometries.Coordinate objects, or null if there are no points.

Convert.ToNTS_LineString(this Segment2D) Method

Converts the specified Segment2D to an NTS NetTopologySuite.Geometries.LineString.

public static LineString? ToNTS_LineString(this DiGi.Geometry.Planar.Classes.Segment2D? segment2D);

Parameters

segment2D Segment2D

The Segment2D instance to convert.

Returns

NetTopologySuite.Geometries.LineString
An NTS NetTopologySuite.Geometries.LineString if the conversion is successful; otherwise, null.

Convert.ToNTS_Polygon(this IPolygonal2D) Method

Converts the specified IPolygonal2D instance to a NetTopologySuite NetTopologySuite.Geometries.Polygon.

public static Polygon? ToNTS_Polygon(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to convert.

Returns

NetTopologySuite.Geometries.Polygon
A NetTopologySuite.Geometries.Polygon object if the provided IPolygonal2D is not null; otherwise, null.

Convert.ToNumerics(this Coordinate2D) Method

Converts a Coordinate2D instance to a nullable System.Numerics.Vector2.

public static System.Nullable<System.Numerics.Vector2> ToNumerics(this DiGi.Geometry.Planar.Classes.Coordinate2D coordinate2D);

Parameters

coordinate2D Coordinate2D

The Coordinate2D instance to convert.

Returns

System.Nullable<System.Numerics.Vector2>
A System.Numerics.Vector2 containing the X and Y coordinates, or null if the coordinate2D is null.

Create Class

public static class Create

Inheritance System.Object → Create

Methods

Create.AddUniqueByDistance(List<Point2D>, Point2D, double) Method

Adds a point to a collection unless a point within the squared tolerance already exists.

private static bool AddUniqueByDistance(System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D> point2Ds, DiGi.Geometry.Planar.Classes.Point2D point2D, double tolerance_Squared);

Parameters

point2Ds System.Collections.Generic.List<Point2D>

The accumulated points.

point2D Point2D

The candidate point.

tolerance_Squared System.Double

The squared distance tolerance used to detect duplicates.

Returns

System.Boolean
True if the point was added; otherwise, false.

Create.AdjacencyGraph(this IEnumerable<ISegmentable2D>, double) Method

Creates an adjacency graph from a collection of segmentable geometries.

public static AdjacencyGraph<DiGi.Geometry.Planar.Classes.Point2D,Edge<DiGi.Geometry.Planar.Classes.Point2D>>? AdjacencyGraph(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.ISegmentable2D>? segmentable2Ds, double tolerance=1E-06);

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<ISegmentable2D>

The collection of segmentable geometries.

tolerance System.Double

The distance tolerance used for rounding points.

Returns

QuikGraph.AdjacencyGraph
An adjacency graph representing the connectivity; otherwise, null if input is null.

Create.BooleanOperationResult2D(this BooleanOpertaionType, IPolygonalFace2D, IPolygonalFace2D) Method

Calculates the 2D boolean operation result between two polygonal faces based on the specified operation type.

public static DiGi.Geometry.Planar.Classes.BooleanOperationResult2D? BooleanOperationResult2D(this DiGi.Geometry.Core.Enums.BooleanOpertaionType booleanOpertaionType, DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_1, DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_2);

Parameters

booleanOpertaionType BooleanOpertaionType

The type of the boolean operation.

polygonalFace2D_1 IPolygonalFace2D

The first polygonal face.

polygonalFace2D_2 IPolygonalFace2D

The second polygonal face.

Returns

BooleanOperationResult2D
A BooleanOperationResult2D containing the result of the operation, or null if the operation type is not supported.

Create.BoundingBox2D(this Point2D, double, double) Method

Creates a bounding box with specified width and height, centered at the given point.

public static DiGi.Geometry.Planar.Classes.BoundingBox2D? BoundingBox2D(this DiGi.Geometry.Planar.Classes.Point2D? center, double width, double height);

Parameters

center Point2D

The center point of the bounding box.

width System.Double

The width of the bounding box.

height System.Double

The height of the bounding box.

Returns

BoundingBox2D
A new BoundingBox2D; otherwise, null if any input is invalid.

Create.BoundingBox2D(this Point2D, double, double, Corner) Method

Creates a bounding box with specified width and height, using the point as a corner.

public static DiGi.Geometry.Planar.Classes.BoundingBox2D? BoundingBox2D(this DiGi.Geometry.Planar.Classes.Point2D? point2D, double width, double height, DiGi.Geometry.Core.Enums.Corner corner);

Parameters

point2D Point2D

The anchor point.

width System.Double

The width of the bounding box.

height System.Double

The height of the bounding box.

corner Corner

The corner that the specified point represents.

Returns

BoundingBox2D
A new BoundingBox2D; otherwise, null if any input is invalid.

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

Creates a bounding box that encompasses all provided boundable geometries.

public static DiGi.Geometry.Planar.Classes.BoundingBox2D? BoundingBox2D<T>(this System.Collections.Generic.IEnumerable<T>? boundable2Ds, double offset=0.0)
    where T : DiGi.Geometry.Planar.Interfaces.IBoundable2D;

Type parameters

T

A type that implements IBoundable2D.

Parameters

boundable2Ds System.Collections.Generic.IEnumerable<T>

The collection of boundable geometries.

offset System.Double

An optional offset to apply to the resulting bounding box.

Returns

BoundingBox2D
A BoundingBox2D that encompasses all inputs; otherwise, null if input is null.

Create.CoordinateSystem2D(this Point2D, Vector2D) Method

Creates a coordinate system based on an origin and a Y-axis vector.

public static DiGi.Geometry.Planar.Classes.CoordinateSystem2D? CoordinateSystem2D(this DiGi.Geometry.Planar.Classes.Point2D? origin, DiGi.Geometry.Planar.Classes.Vector2D? axisY);

Parameters

origin Point2D

The origin point of the coordinate system.

axisY Vector2D

The vector representing the Y-axis.

Returns

CoordinateSystem2D
A new CoordinateSystem2D; otherwise, null if any input is null.

Create.DifferenceResult2D(this IPolygonalFace2D, IPolygonalFace2D) Method

Calculates the 2D boolean difference between two polygonal faces.

public static DiGi.Geometry.Planar.Classes.DifferenceResult2D? DifferenceResult2D(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_1, DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_2);

Parameters

polygonalFace2D_1 IPolygonalFace2D

The first polygonal face (from which to subtract).

polygonalFace2D_2 IPolygonalFace2D

The second polygonal face (to subtract).

Returns

DifferenceResult2D
A DifferenceResult2D containing the difference geometry, or null if polygonalFace2D_1 is null or the computation fails.

Remarks

Invalid (self-intersecting) inputs are repaired before the overlay is computed.

If the first face is degenerate (zero area, collapsing under repair), the difference is lower-dimensional: the parts of the face boundary linework lying outside the second face are returned as Segment2D(this Line2D, IPolygonal2D, double)/Polyline2D/Point2D elements.

Create.Geometry2Ds(IEnumerable<IGeometry2D>, double) Method

Simplifies a collection of geometries by merging similar ones and decomposing them into basic primitives (points, segments, polylines, polygons, etc.).

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Interfaces.IGeometry2D>? Geometry2Ds(System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.IGeometry2D>? geometry2Ds, double tolerance=1E-06);

Parameters

geometry2Ds System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.IGeometry2D>

The collection of geometries to simplify.

tolerance System.Double

The distance tolerance used for similarity and intersection checks.

Returns

System.Collections.Generic.List<DiGi.Geometry.Planar.Interfaces.IGeometry2D>
A simplified list of unique geometries; otherwise, null if input is null.

Create.IntersectionGeometry2D(Line2D, Segment2D, double) Method

Computes the raw intersection geometry between a line and a segment without allocating an IntersectionResult2D or cloning redundantly.

private static DiGi.Geometry.Planar.Interfaces.IGeometry2D? IntersectionGeometry2D(DiGi.Geometry.Planar.Classes.Line2D line2D, DiGi.Geometry.Planar.Classes.Segment2D segment2D, double tolerance);

Parameters

line2D Line2D

The line (must be non-null).

segment2D Segment2D

The segment (must be non-null).

tolerance System.Double

The distance tolerance.

Returns

DiGi.Geometry.Planar.Interfaces.IGeometry2D
A freshly owned Segment2D(this Line2D, IPolygonal2D, double) when the segment lies on the line, a Point2D when they cross, or null when they do not intersect.

Create.IntersectionGeometry2D(Segment2D, Segment2D, double, bool) Method

Computes the raw intersection geometry between two segments without allocating an IntersectionResult2D or cloning redundantly.

private static DiGi.Geometry.Planar.Interfaces.IGeometry2D? IntersectionGeometry2D(DiGi.Geometry.Planar.Classes.Segment2D segment2D_1, DiGi.Geometry.Planar.Classes.Segment2D segment2D_2, double tolerance, out bool handled);

Parameters

segment2D_1 Segment2D

The first segment (must be non-null).

segment2D_2 Segment2D

The second segment (must be non-null).

tolerance System.Double

The distance tolerance.

handled System.Boolean

Set to false only for the degenerate fall-through case where no intersection topology could be resolved; otherwise true.

Returns

DiGi.Geometry.Planar.Interfaces.IGeometry2D
A freshly owned Point2D or Segment2D(this Line2D, IPolygonal2D, double), or null when the segments do not intersect.

Create.IntersectionResult2D(this Line2D, Line2D, double) Method

Calculates the intersection result of two lines.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Classes.Line2D? line2D_1, DiGi.Geometry.Planar.Classes.Line2D? line2D_2, double tolerance=1E-06);

Parameters

line2D_1 Line2D

The first line.

line2D_2 Line2D

The second line.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the intersection geometry; otherwise, null if either input is null.

Create.IntersectionResult2D(this Line2D, Segment2D, double) Method

Calculates the intersection result of a line and a segment.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Classes.Line2D? line2D, DiGi.Geometry.Planar.Classes.Segment2D? segment2D, double tolerance=1E-06);

Parameters

line2D Line2D

The line.

segment2D Segment2D

The segment.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the intersection geometry; otherwise, null if either input is null.

Create.IntersectionResult2D(this Line2D, IEnumerable<Segment2D>, double) Method

Calculates the intersection result of a line and a collection of segments.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Classes.Line2D? line2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, double tolerance=1E-06);

Parameters

line2D Line2D

The line.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

The collection of segments.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing all unique intersection geometries; otherwise, null if either input is null.

Create.IntersectionResult2D(this Segment2D, Segment2D, double) Method

Calculates the intersection result of two segments.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Classes.Segment2D? segment2D_1, DiGi.Geometry.Planar.Classes.Segment2D? segment2D_2, double tolerance=1E-06);

Parameters

segment2D_1 Segment2D

The first segment.

segment2D_2 Segment2D

The second segment.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the intersection geometry; otherwise, null if either input is null.

Create.IntersectionResult2D(this Segment2D, IEnumerable<Segment2D>, double) Method

Calculates the intersection result of a segment and a collection of segments.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Classes.Segment2D? segment2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, double tolerance=1E-06);

Parameters

segment2D Segment2D

The segment to check.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

The collection of segments to intersect with.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing all unique intersection geometries; otherwise, null if either input is null.

Create.IntersectionResult2D(this IPolygonalFace2D, ILinear2D, double) Method

Calculates the intersection result of a polygonal face and a linear geometry.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D, DiGi.Geometry.Planar.Interfaces.ILinear2D? linear2D, double tolerance=1E-06);

Parameters

polygonalFace2D IPolygonalFace2D

The polygonal face.

linear2D ILinear2D

The linear geometry.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the intersection geometry; otherwise, null if either input is null.

Create.IntersectionResult2D(this IPolygonalFace2D, IPolygonalFace2D) Method

Calculates the intersection result of two polygonal faces.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_1, DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_2);

Parameters

polygonalFace2D_1 IPolygonalFace2D

The first polygonal face.

polygonalFace2D_2 IPolygonalFace2D

The second polygonal face.

Returns

IntersectionResult2D
An IntersectionResult2D containing the intersection geometry; otherwise, null if either input is null or the computation fails.

Remarks

Invalid (self-intersecting) inputs are repaired before the overlay is computed.

Boundary-only intersections are lower-dimensional: shared edges are returned as Segment2D(this Line2D, IPolygonal2D, double)/Polyline2D elements and touching vertices as Point2D elements.

Create.IntersectionResult2D(this ISegmentable2D, Line2D, double) Method

Calculates the intersection result of a segmentable geometry and a line.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, DiGi.Geometry.Planar.Classes.Line2D? line2D, double tolerance=1E-06);

Parameters

segmentable2D ISegmentable2D

The segmentable geometry.

line2D Line2D

The line.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the intersection geometry; otherwise, null if either input is null.

Create.IntersectionResult2D(this ISegmentable2D, ISegmentable2D, double) Method

Calculates the intersection result of two segmentable geometries.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_1, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_2, double tolerance=1E-06);

Parameters

segmentable2D_1 ISegmentable2D

The first segmentable geometry.

segmentable2D_2 ISegmentable2D

The second segmentable geometry.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the intersection geometry; otherwise, null if either input is null.

Create.IntersectionResult2D(this ISegmentable2D, double) Method

Calculates the intersection result of a segmentable geometry with itself or other segments within it.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, double tolerance=1E-06);

Parameters

segmentable2D ISegmentable2D

The segmentable geometry.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the self-intersection geometries; otherwise, null if input is null.

Create.IntersectionResult2D(this ISegmentable2D, int, double) Method

Calculates the intersection result of a segmentable geometry with itself or other segments within it, up to a maximum number of intersections.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, int maxCount, double tolerance=1E-06);

Parameters

segmentable2D ISegmentable2D

The segmentable geometry.

maxCount System.Int32

The maximum number of intersections to find.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing the self-intersection geometries; otherwise, null if input is null.

Create.IntersectionResult2D(this IEnumerable<Segment2D>, IEnumerable<Segment2D>, double) Method

Calculates the intersection result between two collections of segments.

public static DiGi.Geometry.Planar.Classes.IntersectionResult2D? IntersectionResult2D(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds_1, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds_2, double tolerance=1E-06);

Parameters

segment2Ds_1 System.Collections.Generic.IEnumerable<Segment2D>

The first collection of segments.

segment2Ds_2 System.Collections.Generic.IEnumerable<Segment2D>

The second collection of segments.

tolerance System.Double

The distance tolerance.

Returns

IntersectionResult2D
An IntersectionResult2D containing all unique intersection geometries; otherwise, null if either input is null.

Create.Line2D(this Point2D, double) Method

Creates a line with the specified origin and angle.

public static DiGi.Geometry.Planar.Classes.Line2D? Line2D(this DiGi.Geometry.Planar.Classes.Point2D? origin, double angle);

Parameters

origin Point2D

The origin point of the line.

angle System.Double

The angle of the line in radians.

Returns

Line2D
A new Line2D; otherwise, null if origin is null or angle is invalid.

Create.LinearEquation(this Line2D) Method

Creates a linear equation from a line.

public static DiGi.Math.Classes.LinearEquation? LinearEquation(this DiGi.Geometry.Planar.Classes.Line2D? line2D);

Parameters

line2D Line2D

The line.

Returns

DiGi.Math.Classes.LinearEquation
A LinearEquation; otherwise, null if the line is null or has no origin.

Create.LinearEquation(this Point2D, Point2D) Method

Creates a linear equation from two points.

public static DiGi.Math.Classes.LinearEquation? LinearEquation(this DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2);

Parameters

point2D_1 Point2D

The first point.

point2D_2 Point2D

The second point.

Returns

DiGi.Math.Classes.LinearEquation
A LinearEquation; otherwise, null if points are identical or either is null.

Create.LinearEquation(this Segment2D) Method

Creates a linear equation from a segment.

public static DiGi.Math.Classes.LinearEquation? LinearEquation(this DiGi.Geometry.Planar.Classes.Segment2D? segment2D);

Parameters

segment2D Segment2D

The segment.

Returns

DiGi.Math.Classes.LinearEquation
A LinearEquation; otherwise, null if the segment is null or has missing endpoints.

Create.Mesh2D(this IPolygonalFace2D, double) Method

Converts an IPolygonalFace2D to a Mesh2D.

public static DiGi.Geometry.Planar.Classes.Mesh2D? Mesh2D(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D, double tolerance=1E-06);

Parameters

polygonalFace2D IPolygonalFace2D

The IPolygonalFace2D instance to convert.

tolerance System.Double

The System.Double tolerance value used for the conversion.

Returns

Mesh2D
A Mesh2D object if the conversion is successful; otherwise, null.

Create.Mesh2D(this IEnumerable<Triangle2D>, double) Method

Creates a Mesh2D from a collection of Triangle2D objects.

public static DiGi.Geometry.Planar.Classes.Mesh2D? Mesh2D(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Triangle2D>? triangle2Ds, double tolerance=1E-06);

Parameters

triangle2Ds System.Collections.Generic.IEnumerable<Triangle2D>

The System.Collections.Generic.IEnumerable<> of Triangle2D objects to be converted into a mesh.

tolerance System.Double

A System.Double value representing the minimum area threshold; triangles with an area smaller than this value are ignored.

Returns

Mesh2D
A Mesh2D object if valid triangles are provided; otherwise, null.

Create.Point2Ds(double, double, double, double, int) Method

Generates a list of random points within the specified coordinate range.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? Point2Ds(double x_min, double y_min, double x_max, double y_max, int count);

Parameters

x_min System.Double

The minimum X coordinate.

y_min System.Double

The minimum Y coordinate.

x_max System.Double

The maximum X coordinate.

y_max System.Double

The maximum Y coordinate.

count System.Int32

The number of points to generate; -1 returns null.

Returns

System.Collections.Generic.List<Point2D>
A list of random Point2D objects, or null if count is -1.

Create.Point2Ds(double[]) Method

Creates a list of points from an array of coordinates.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? Point2Ds(params double[]? values);

Parameters

values System.Double[]

An array of X and Y coordinates (must have an even length).

Returns

System.Collections.Generic.List<Point2D>
A list of Point2D objects, or null if the input is null or has an invalid length.

Create.Point2Ds(this BoundingBox2D, Point2D, double, double, double) Method

Generates the nodes of a grid anchored at origin that fall within the specified bounding box.

Unlike Point2Ds(this BoundingBox2D, double, double, double), which starts at the minimum corner of the box, this places every node at origin plus a whole number of steps. Boxes that are not aligned to each other therefore still yield nodes of one shared lattice, which is what lets separately generated areas be joined without a seam and lets the same area be regenerated without shifting.

An origin of (0, 0) with a whole-number grid size puts every coordinate at a whole multiple of that size, which is exact in binary floating point over any coordinate range in practical use - two areas generated separately produce identical values for a shared node rather than merely close ones.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? Point2Ds(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Classes.Point2D? origin, double gridSize_X, double gridSize_Y, double tolerance=1E-06);

Parameters

boundingBox2D BoundingBox2D

The bounding box the nodes have to fall within.

origin Point2D

The point the lattice is anchored at. Null falls back to anchoring at the minimum corner of the bounding box.

gridSize_X System.Double

The grid spacing along the X axis; has to be greater than zero.

gridSize_Y System.Double

The grid spacing along the Y axis; has to be greater than zero.

tolerance System.Double

The distance tolerance used when deciding whether a node lying on the boundary of the bounding box still falls within it.

Returns

System.Collections.Generic.List<Point2D>
A list of Point2D objects ordered column by column, empty when the bounding box holds no node of the lattice, or null if the parameters are invalid or the grid does not fit in a single list.

Create.Point2Ds(this BoundingBox2D, double, double, double) Method

Generates a regular grid of points covering the specified bounding box.

The first point sits on the minimum corner of the bounding box and the grid steps by gridSize_X and gridSize_Y towards the maximum corner. A row or column landing on the maximum corner within tolerance is still included, so a bounding box whose extents are exact multiples of the grid size yields points on both corners.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? Point2Ds(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, double gridSize_X, double gridSize_Y, double tolerance=1E-06);

Parameters

boundingBox2D BoundingBox2D

The bounding box defining the area.

gridSize_X System.Double

The grid spacing along the X axis; has to be greater than zero.

gridSize_Y System.Double

The grid spacing along the Y axis; has to be greater than zero.

tolerance System.Double

The distance tolerance used when deciding whether the last row or column still fits within the bounding box.

Returns

System.Collections.Generic.List<Point2D>
A list of Point2D objects ordered column by column, or null if the parameters are invalid or the grid does not fit in a single list.

Create.Point2Ds(this BoundingBox2D, int) Method

Generates a list of random points within the specified bounding box.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? Point2Ds(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, int count);

Parameters

boundingBox2D BoundingBox2D

The bounding box defining the area.

count System.Int32

The number of points to generate; -1 returns null.

Returns

System.Collections.Generic.List<Point2D>
A list of random Point2D objects, or null if parameters are invalid.

Create.Polygon2D(this IPolygonal2D, double) Method

Creates a Polygon2D from another polygonal geometry, dropping any point which repeats the one before it.

public static DiGi.Geometry.Planar.Classes.Polygon2D? Polygon2D(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D, double tolerance=1E-06);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D whose points define the polygon.

tolerance System.Double

The System.Double distance within which two points are treated as one.

Returns

Polygon2D
A Polygon2D object if a valid polygon can be created; otherwise, null.

Create.Polygon2D(this IEnumerable<Point2D>, double) Method

Creates a Polygon2D from a collection of Point2D objects, dropping any point which repeats the one before it.

Use this rather than the constructor whenever the points come from outside the library - a file, a service, a user - and are not already known to form an open ring. A polygon holds its ring open, because GetSegments() adds the closing segment itself, so a ring which repeats its first point as its last would otherwise carry a segment of no length. Such a segment has no direction, makes the ring report as self intersecting, and pushes a triangle onto the four point branch of triangulation where it produces a second, degenerate triangle.

The constructor stays a plain assignment and does none of this, so a caller who already holds clean points pays nothing.

public static DiGi.Geometry.Planar.Classes.Polygon2D? Polygon2D(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D?>? point2Ds, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects used to define the polygon.

tolerance System.Double

The System.Double distance within which two points are treated as one.

Returns

Polygon2D
A Polygon2D object if a valid polygon can be created; otherwise, null.

Create.Polygon2Ds(this ISegmentable2D, double) Method

Creates a list of polygons from a segmentable geometry.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? Polygon2Ds(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, double tolerance=1E-06);

Parameters

segmentable2D ISegmentable2D

The segmentable geometry.

tolerance System.Double

The distance tolerance for identifying loops.

Returns

System.Collections.Generic.List<Polygon2D>
A list of Polygon2D objects; otherwise, null if input is null.

Create.Polygon2Ds(this IEnumerable<Segment2D>, double) Method

Creates a list of polygons from a collection of segments.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? Polygon2Ds(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, double tolerance=1E-06);

Parameters

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

The collection of segments.

tolerance System.Double

The distance tolerance for connecting segments into loops.

Returns

System.Collections.Generic.List<Polygon2D>
A list of Polygon2D objects; otherwise, null if inputs are invalid or no polygons can be formed.

Create.Polygonal2D(this IPolygonal2D, double) Method

Simplifies or recreates the IPolygonal2D instance using a specified distance tolerance.

public static DiGi.Geometry.Planar.Interfaces.IPolygonal2D? Polygonal2D(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D, double tolerance=1E-06);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to be processed.

tolerance System.Double

A System.Double value specifying the distance tolerance.

Returns

IPolygonal2D
An IPolygonal2D instance if the input is not null; otherwise, null.

Create.Polygonal2D(this IEnumerable<Point2D>, double) Method

Creates an IPolygonal2D instance from a collection of Point2D points.

public static DiGi.Geometry.Planar.Interfaces.IPolygonal2D? Polygonal2D(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects used to define the polygon.

tolerance System.Double

The System.Double tolerance value used for distance calculations.

Returns

IPolygonal2D
An IPolygonal2D instance if the collection is not null and contains at least three points; otherwise, null.

Create.PolygonalFace2D(Point2D[]) Method

Creates a PolygonalFace2D from the specified array of Point2D points.

public static DiGi.Geometry.Planar.Classes.PolygonalFace2D? PolygonalFace2D(params DiGi.Geometry.Planar.Classes.Point2D[]? points);

Parameters

points Point2D[]

An array of Point2D objects that define the vertices of the polygonal face.

Returns

PolygonalFace2D
A PolygonalFace2D instance if the provided Point2D array contains at least three points; otherwise, null.

Create.PolygonalFace2D(this IPolygonal2D, IEnumerable<IPolygonal2D>, double) Method

Creates a PolygonalFace2D using the specified external boundary and optional internal boundaries.

public static DiGi.Geometry.Planar.Classes.PolygonalFace2D? PolygonalFace2D(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? externalEdge, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.IPolygonal2D>? internalEdges=null, double tolerace=1E-06);

Parameters

externalEdge IPolygonal2D

The IPolygonal2D that defines the external boundary of the face.

internalEdges System.Collections.Generic.IEnumerable<IPolygonal2D>

An optional System.Collections.Generic.IEnumerable<> containing the internal boundaries (holes) of the face.

tolerace System.Double

The System.Double tolerance used to determine if an internal boundary is inside the external boundary.

Returns

PolygonalFace2D
A PolygonalFace2D instance if the externalEdge is not null; otherwise, null.

Create.PolygonalFace2Ds(this IEnumerable<Segment2D>, double) Method

Creates a list of PolygonalFace2D objects from a collection of Segment2D(this Line2D, IPolygonal2D, double) segments.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.PolygonalFace2D>? PolygonalFace2Ds(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, double tolerance=1E-06);

Parameters

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

The System.Collections.Generic.IEnumerable<> of Segment2D(this Line2D, IPolygonal2D, double) segments to process.

tolerance System.Double

The System.Double tolerance value used for distance calculations.

Returns

System.Collections.Generic.List<PolygonalFace2D>
A System.Collections.Generic.List<> of PolygonalFace2D objects if successful; otherwise, null.

Create.PolygonalFace2Ds(this IEnumerable<IPolygonal2D>, double) Method

Converts a collection of IPolygonal2D objects to a list of PolygonalFace2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.PolygonalFace2D>? PolygonalFace2Ds(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.IPolygonal2D>? polygonal2Ds, double tolerace=1E-06);

Parameters

polygonal2Ds System.Collections.Generic.IEnumerable<IPolygonal2D>

The System.Collections.Generic.IEnumerable<> of IPolygonal2D objects to convert.

tolerace System.Double

The System.Double distance tolerance used for the conversion.

Returns

System.Collections.Generic.List<PolygonalFace2D>
A System.Collections.Generic.List<> of PolygonalFace2D objects, or null if the input collection is null.

Create.Polygons(this MultiPolygon) Method

Extracts a list of polygons from an NTS MultiPolygon.

public static System.Collections.Generic.List<Polygon>? Polygons(this MultiPolygon? multiPolygon);

Parameters

multiPolygon NetTopologySuite.Geometries.MultiPolygon

The MultiPolygon to extract polygons from.

Returns

System.Collections.Generic.List<NetTopologySuite.Geometries.Polygon>
A list of NetTopologySuite Polygons; otherwise, null if input is null.

Create.Polygons(this IEnumerable<Segment2D>, double) Method

Creates a list of NTS polygons from a collection of segments.

public static System.Collections.Generic.List<Polygon>? Polygons(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, double tolerance=1E-06);

Parameters

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

The collection of segments.

tolerance System.Double

The distance tolerance for connecting segments into loops.

Returns

System.Collections.Generic.List<NetTopologySuite.Geometries.Polygon>
A list of NetTopologySuite Polygons; otherwise, null if input is null.

Create.Polygons(this IEnumerable<Geometry>, double) Method

Creates a list of NTS polygons from a collection of geometries by nodalizing and polygonizing them.

public static System.Collections.Generic.List<Polygon>? Polygons(this System.Collections.Generic.IEnumerable<Geometry>? geometries, double tolerance=1E-06);

Parameters

geometries System.Collections.Generic.IEnumerable<NetTopologySuite.Geometries.Geometry>

The collection of geometries (lines, rings, etc.).

tolerance System.Double

The precision tolerance used for nodalization.

Returns

System.Collections.Generic.List<NetTopologySuite.Geometries.Polygon>
A list of NetTopologySuite Polygons; otherwise, null if input is null.

Create.Polyline2Ds<T>(this IEnumerable<T>, Point2D, bool, double) Method

Creates a list of polylines from a collection of segmentable geometries.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polyline2D>? Polyline2Ds<T>(this System.Collections.Generic.IEnumerable<T>? segmentable2Ds, DiGi.Geometry.Planar.Classes.Point2D? point2D_Start=null, bool split=true, double tolerance=1E-06)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

A type that implements ISegmentable2D.

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<T>

The collection of segmentable geometries to convert into polylines.

point2D_Start Point2D

Optional starting point for the first polyline.

split System.Boolean

Whether to split segmentable geometries into basic segments before processing.

tolerance System.Double

The distance tolerance for connecting segments.

Returns

System.Collections.Generic.List<Polyline2D>
A list of Polyline2D objects; otherwise, null if the input is empty or invalid.

Create.PolynomialEquation(this IEnumerable<Point2D>, int) Method

Fits a polynomial equation to the specified collection of Point2D points.

public static DiGi.Math.Classes.PolynomialEquation? PolynomialEquation(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, int order=-1);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects used for the fit.

order System.Int32

The System.Int32 order of the polynomial equation to be created.

Returns

DiGi.Math.Classes.PolynomialEquation
A PolynomialEquation(this IEnumerable<Point2D>, int) if the input collection is not null and contains at least two points; otherwise, null.

Create.Rectangle2D(this Rectangle2D, Rectangle2D, double) Method

Creates the minimum area bounding rectangle that encompasses two existing rectangles.

public static DiGi.Geometry.Planar.Classes.Rectangle2D? Rectangle2D(this DiGi.Geometry.Planar.Classes.Rectangle2D? rectangle2D_1, DiGi.Geometry.Planar.Classes.Rectangle2D? rectangle2D_2, double tolerance=1E-06);

Parameters

rectangle2D_1 Rectangle2D

The first rectangle.

rectangle2D_2 Rectangle2D

The second rectangle.

tolerance System.Double

The distance tolerance.

Returns

Rectangle2D
A Rectangle2D that bounds both inputs; otherwise, null if either is null.

Create.Rectangle2D(this IPolygonalFace2D, double) Method

Creates the minimum area bounding rectangle for a polygonal face's external edge.

public static DiGi.Geometry.Planar.Classes.Rectangle2D? Rectangle2D(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D, double tolerance=1E-06);

Parameters

polygonalFace2D IPolygonalFace2D

The polygonal face.

tolerance System.Double

The distance tolerance.

Returns

Rectangle2D
A Rectangle2D that bounds the outer boundary; otherwise, null if no external edge exists.

Create.Rectangle2D(this ISegmentable2D, double) Method

Creates the minimum area bounding rectangle for a single segmentable geometry.

public static DiGi.Geometry.Planar.Classes.Rectangle2D? Rectangle2D(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, double tolerance=1E-06);

Parameters

segmentable2D ISegmentable2D

The segmentable geometry.

tolerance System.Double

The distance tolerance.

Returns

Rectangle2D
A Rectangle2D that bounds the geometry; otherwise, null if points cannot be extracted.

Create.Rectangle2D(this IEnumerable<Point2D>, Vector2D) Method

Creates a rectangle that bounds the given points along the specified direction.

public static DiGi.Geometry.Planar.Classes.Rectangle2D? Rectangle2D(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, DiGi.Geometry.Planar.Classes.Vector2D? direction);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The collection of points to bound.

direction Vector2D

The primary orientation vector for the rectangle's height.

Returns

Rectangle2D
A Rectangle2D that bounds the points; otherwise, null if inputs are invalid.

Create.Rectangle2D(this IEnumerable<Point2D>, double) Method

Creates the minimum area bounding rectangle for a set of points.

public static DiGi.Geometry.Planar.Classes.Rectangle2D? Rectangle2D(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The collection of points.

tolerance System.Double

The distance tolerance for calculations.

Returns

Rectangle2D
The smallest Rectangle2D that contains all points; otherwise, null if too few points are provided.

Create.Rectangle2D(this IEnumerable<ISegmentable2D>, double) Method

Creates the minimum area bounding rectangle for a set of segmentable geometries.

public static DiGi.Geometry.Planar.Classes.Rectangle2D? Rectangle2D(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.ISegmentable2D>? segmentable2Ds, double tolerance=1E-06);

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<ISegmentable2D>

The collection of segmentable geometries.

tolerance System.Double

The distance tolerance.

Returns

Rectangle2D
A Rectangle2D that bounds all points in the geometries; otherwise, null if no points are found.

Create.Segment2D(this Line2D, IPolygonal2D, double) Method

Creates a segment from the intersection of a line and a polygonal geometry.

public static DiGi.Geometry.Planar.Classes.Segment2D? Segment2D(this DiGi.Geometry.Planar.Classes.Line2D? line2D, DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D, double tolerance=1E-06);

Parameters

line2D Line2D

The line to intersect.

polygonal2D IPolygonal2D

The polygonal geometry to intersect with.

tolerance System.Double

The distance tolerance for intersection detection.

Returns

Segment2D
A Segment2D resulting from the intersection; otherwise, null.

Create.Segment2Ds(this IEnumerable<Point2D>, bool) Method

Converts a collection of Point2D objects into a list of Segment2D(this Line2D, IPolygonal2D, double) objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Segment2D>? Segment2Ds(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, bool closed=false);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D points to process.

closed System.Boolean

A System.Boolean value indicating whether the sequence should be closed by connecting the last point back to the first point.

Returns

System.Collections.Generic.List<Segment2D>
A System.Collections.Generic.List<> of Segment2D(this Line2D, IPolygonal2D, double) objects, or null if the provided System.Collections.Generic.IEnumerable<> is null.

Create.SegmentableTraceResult2D(this Point2D, Vector2D, IEnumerable<Segment2D>, double) Method

Performs a segmentable trace operation and returns the first result found.

public static DiGi.Geometry.Planar.Classes.SegmentableTraceResult2D? SegmentableTraceResult2D(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Classes.Vector2D? vector2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, double tolerance=1E-06);

Parameters

point2D Point2D

The starting Point2D for the trace.

vector2D Vector2D

The direction Vector2D of the trace.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

An System.Collections.Generic.IEnumerable<> containing the segments to be traced.

tolerance System.Double

A System.Double representing the distance tolerance for the operation.

Returns

SegmentableTraceResult2D
The first SegmentableTraceResult2D found, or null if no result exists.

Create.SegmentableTraceResult2D(this Point2D, Vector2D, IEnumerable<ISegmentable2D>, double) Method

Traces a ray from a point in a given direction through a collection of segmentable 2D objects and returns the first intersection result.

public static DiGi.Geometry.Planar.Classes.SegmentableTraceResult2D? SegmentableTraceResult2D(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Classes.Vector2D? vector2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.ISegmentable2D>? segmentable2Ds, double tolerance=1E-06);

Parameters

point2D Point2D

The starting Point2D for the trace operation.

vector2D Vector2D

The Vector2D representing the direction of the trace.

segmentable2Ds System.Collections.Generic.IEnumerable<ISegmentable2D>

An System.Collections.Generic.IEnumerable<> containing the objects to be traced.

tolerance System.Double

A System.Double value specifying the distance tolerance for the operation.

Returns

SegmentableTraceResult2D
The first SegmentableTraceResult2D found, or null if no intersection occurs within the specified tolerance.

Create.SegmentableTraceResult2Ds(this Point2D, Vector2D, IEnumerable<Segment2D>, int, double) Method

Traces a path from a starting point in a specified direction through a collection of 2D segments, accounting for bounces and distance tolerance.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.SegmentableTraceResult2D>? SegmentableTraceResult2Ds(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Classes.Vector2D? vector2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, int bounces=0, double tolerance=1E-06);

Parameters

point2D Point2D

The starting Point2D for the trace operation.

vector2D Vector2D

The Vector2D representing the direction of the trace.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

An System.Collections.Generic.IEnumerable<> containing the segments to be traced against.

bounces System.Int32

The System.Int32 number of times the trace may bounce off segments.

tolerance System.Double

The System.Double value representing the distance tolerance for intersection calculations.

Returns

System.Collections.Generic.List<SegmentableTraceResult2D>
A System.Collections.Generic.List<> containing the results of the trace, or null if any of the required inputs are null.

Create.SegmentableTraceResult2Ds(this Point2D, Vector2D, IEnumerable<ISegmentable2D>, int, double) Method

Traces a ray from the specified Point2D in the direction of the provided Vector2D through a collection of ISegmentable2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.SegmentableTraceResult2D>? SegmentableTraceResult2Ds(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Classes.Vector2D? vector2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.ISegmentable2D>? segmentable2Ds, int bounces=0, double tolerance=1E-06);

Parameters

point2D Point2D

The starting Point2D for the trace.

vector2D Vector2D

The direction Vector2D of the trace.

segmentable2Ds System.Collections.Generic.IEnumerable<ISegmentable2D>

An System.Collections.Generic.IEnumerable<> containing the objects to be traced against.

bounces System.Int32

The number of times the trace should bounce off surfaces as an System.Int32.

tolerance System.Double

The distance tolerance used for intersection calculations as a System.Double.

Returns

System.Collections.Generic.List<SegmentableTraceResult2D>
A System.Collections.Generic.List<> containing the results of the trace, or null if any required input is null.

Create.UndirectedGraph(this IEnumerable<ISegmentable2D>, double) Method

Creates an undirected graph from a collection of segmentable 2D objects using a specified distance tolerance.

public static UndirectedGraph<DiGi.Geometry.Planar.Classes.Point2D,Edge<DiGi.Geometry.Planar.Classes.Point2D>>? UndirectedGraph(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.ISegmentable2D>? segmentable2Ds, double tolerance=1E-06);

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<ISegmentable2D>

The System.Collections.Generic.IEnumerable<> collection of objects to be converted into a graph.

tolerance System.Double

The System.Double distance tolerance used for point comparison.

Returns

QuikGraph.UndirectedGraph
An UndirectedGraph<Point2D, Edge<Point2D>> representing the network of points and edges, or null if the segmentable2Ds collection is null.

Create.UnionResult2D(this IPolygonalFace2D, IPolygonalFace2D) Method

Calculates the 2D boolean union between two polygonal faces.

public static DiGi.Geometry.Planar.Classes.UnionResult2D? UnionResult2D(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_1, DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D_2);

Parameters

polygonalFace2D_1 IPolygonalFace2D

The first polygonal face.

polygonalFace2D_2 IPolygonalFace2D

The second polygonal face.

Returns

UnionResult2D
A UnionResult2D containing the union geometry, or null if both inputs are null or the computation fails.

Remarks

Invalid (self-intersecting) inputs are repaired before the overlay is computed. Disjoint inputs produce a result containing both faces.

Create.Vector2D(Alignment) Method

Calculates a unit vector based on the specified alignment.

public static DiGi.Geometry.Planar.Classes.Vector2D? Vector2D(DiGi.Geometry.Core.Enums.Alignment alignment);

Parameters

alignment Alignment

The desired alignment.

Returns

Vector2D
A unit Vector2D corresponding to the alignment; otherwise, null.

Create.Vector2D(double) Method

Calculates unit vector for given angle [rad]

public static DiGi.Geometry.Planar.Classes.Vector2D? Vector2D(double angle);

Parameters

angle System.Double

angle to X axis counted counterclockwise [rad]

Returns

Vector2D
Unit Vector2D

Create.Vector2D(double, double) Method

Calculates a vector for a given angle and length.

public static DiGi.Geometry.Planar.Classes.Vector2D? Vector2D(double angle, double length);

Parameters

angle System.Double

The angle to the X axis counted counterclockwise [rad].

length System.Double

The length of the vector.

Returns

Vector2D
A Vector2D with specified angle and length; otherwise, null.

Create.IntersectionAccumulator Class

Accumulates unique intersection points and segments, deduplicating within a distance tolerance. Points use a linear scan while few, then transparently switch to a uniform spatial-hash grid (cell size equal to the tolerance) so lookups stay near O(1) as the result set grows. First-seen ordering is preserved.

private sealed class Create.IntersectionAccumulator

Inheritance System.Object → IntersectionAccumulator

Constructors

IntersectionAccumulator(double) Constructor

Initializes a new accumulator using the supplied distance tolerance.

public IntersectionAccumulator(double tolerance);

Parameters

tolerance System.Double

The distance tolerance used for deduplication.

Methods

Create.IntersectionAccumulator.Add(IGeometry2D) Method

Adds a candidate intersection geometry unless a similar one is already present.

public bool Add(DiGi.Geometry.Planar.Interfaces.IGeometry2D? geometry2D);

Parameters

geometry2D DiGi.Geometry.Planar.Interfaces.IGeometry2D

The candidate intersection geometry.

Returns

System.Boolean
True if the geometry is a point or a segment (an intersection event); otherwise, false.

Create.IntersectionAccumulator.ToResult() Method

Builds the final result, adopting the accumulated geometries without cloning.

public DiGi.Geometry.Planar.Classes.IntersectionResult2D ToResult();

Returns

IntersectionResult2D
An IntersectionResult2D that owns the accumulated geometries.

Create.Transform2D Class

public static class Create.Transform2D

Inheritance System.Object → Transform2D

Methods

Create.Transform2D.CoordinateSystem2DToCoordinateSystem2D(CoordinateSystem2D, CoordinateSystem2D) Method

Creates a transformation that converts points from one coordinate system to another.

public static DiGi.Geometry.Planar.Classes.Transform2D? CoordinateSystem2DToCoordinateSystem2D(DiGi.Geometry.Planar.Classes.CoordinateSystem2D? coordinateSystem2D_From, DiGi.Geometry.Planar.Classes.CoordinateSystem2D? coordinateSystem2D_To);

Parameters

coordinateSystem2D_From CoordinateSystem2D

The source coordinate system.

coordinateSystem2D_To CoordinateSystem2D

The target coordinate system.

Returns

Transform2D
A transformation that maps the source system to the target system; otherwise, null.

Create.Transform2D.CoordinateSystem2DToOrigin(CoordinateSystem2D) Method

Creates a 2D transformation that maps coordinates from the specified coordinate system back to the origin.

public static DiGi.Geometry.Planar.Classes.Transform2D? CoordinateSystem2DToOrigin(DiGi.Geometry.Planar.Classes.CoordinateSystem2D? coordinateSystem2D);

Parameters

coordinateSystem2D CoordinateSystem2D

The source coordinate system to convert into a transformation.

Returns

Transform2D
A Transform2D object representing the transformation, or null if the provided coordinate system or its origin is null.

Create.Transform2D.Identity() Method

Creates an identity 2D transformation that does not alter the coordinates of any point it is applied to.

public static DiGi.Geometry.Planar.Classes.Transform2D Identity();

Returns

Transform2D
A Transform2D object representing the identity transformation.

Create.Transform2D.MirrorX() Method

Creates a 2D transformation that mirrors across the horizontal axis (X-axis) passing through the origin.

public static DiGi.Geometry.Planar.Classes.Transform2D MirrorX();

Returns

Transform2D
A Transform2D object representing the mirroring transformation.

Create.Transform2D.MirrorX(Point2D) Method

Creates a 2D transformation that mirrors across the horizontal axis (X-axis) passing through the specified point.

public static DiGi.Geometry.Planar.Interfaces.ITransform2D? MirrorX(DiGi.Geometry.Planar.Classes.Point2D? point2D);

Parameters

point2D Point2D

The point that defines the position of the mirroring axis.

Returns

DiGi.Geometry.Planar.Interfaces.ITransform2D
An DiGi.Geometry.Planar.Interfaces.ITransform2D object representing the mirroring transformation, or null if the provided point is null.

Create.Transform2D.MirrorY() Method

Creates a 2D transformation that mirrors across the vertical axis (Y-axis) passing through the origin.

public static DiGi.Geometry.Planar.Classes.Transform2D MirrorY();

Returns

Transform2D
A Transform2D object representing the mirroring transformation.

Create.Transform2D.MirrorY(Point2D) Method

Creates a 2D transformation that mirrors across the vertical axis passing through the specified point.

public static DiGi.Geometry.Planar.Interfaces.ITransform2D? MirrorY(DiGi.Geometry.Planar.Classes.Point2D? point2D);

Parameters

point2D Point2D

The point defining the mirror axis. If null, the method returns null.

Returns

DiGi.Geometry.Planar.Interfaces.ITransform2D
An DiGi.Geometry.Planar.Interfaces.ITransform2D object representing the mirroring transformation, or null if the provided point is null.

Create.Transform2D.OriginToCoordinateSystem2D(CoordinateSystem2D) Method

Creates a 2D transformation that maps the origin to the specified coordinate system.

public static DiGi.Geometry.Planar.Classes.Transform2D? OriginToCoordinateSystem2D(DiGi.Geometry.Planar.Classes.CoordinateSystem2D? coordinateSystem2D);

Parameters

coordinateSystem2D CoordinateSystem2D

The target coordinate system. If null, the method returns null.

Returns

Transform2D
A Transform2D object representing the transformation from the origin to the coordinate system, or null if the provided coordinate system is null.

Create.Transform2D.Rotation(Point2D, double) Method

Creates a 2D rotation transformation around a specified origin point by the given angle.

public static DiGi.Geometry.Planar.Classes.Transform2D? Rotation(DiGi.Geometry.Planar.Classes.Point2D? origin, double angle);

Parameters

origin Point2D

The center point of the rotation. If null, the method returns null.

angle System.Double

The angle of rotation. If NaN, the method returns null.

Returns

Transform2D
A Transform2D object representing the rotation transformation, or null if the origin is null or the angle is NaN.

Create.Transform2D.Rotation(double) Method

Creates a 2D rotation transformation around the origin by the specified angle.

public static DiGi.Geometry.Planar.Classes.Transform2D Rotation(double angle);

Parameters

angle System.Double

The angle of rotation.

Returns

Transform2D
A Transform2D object representing the rotation transformation.

Create.Transform2D.Scale(double) Method

Creates a 2D transformation that scales coordinates uniformly by the specified factor.

public static DiGi.Geometry.Planar.Classes.Transform2D Scale(double factor);

Parameters

factor System.Double

The scale factor to apply to both the X and Y axes.

Returns

Transform2D
A Transform2D object representing the uniform scaling transformation.

Create.Transform2D.Scale(double, double) Method

Creates a 2D transformation that scales coordinates by the specified factors along the X and Y axes.

public static DiGi.Geometry.Planar.Classes.Transform2D Scale(double x, double y);

Parameters

x System.Double

The scale factor for the X-axis.

y System.Double

The scale factor for the Y-axis.

Returns

Transform2D
A Transform2D object representing the scaling transformation.

Create.Transform2D.Translation(Vector2D) Method

Creates a 2D transformation that translates coordinates by the specified vector.

public static DiGi.Geometry.Planar.Classes.Transform2D Translation(DiGi.Geometry.Planar.Classes.Vector2D vector2D);

Parameters

vector2D Vector2D

The translation vector containing the X and Y offsets.

Returns

Transform2D
A Transform2D object representing the translation transformation.

Create.Transform2D.Translation(double, double) Method

Creates a 2D transformation that translates coordinates by the specified x and y offsets.

public static DiGi.Geometry.Planar.Classes.Transform2D Translation(double x, double y);

Parameters

x System.Double

The translation distance along the X-axis.

y System.Double

The translation distance along the Y-axis.

Returns

Transform2D
A Transform2D object representing the translation transformation.

Modify Class

public static class Modify

Inheritance System.Object → Modify

Methods

Modify.Add(this List<Point2D>, Point2D, double) Method

Adds a Point2D? to the List<Point2D?>? if it is not null and does not already exist within the specified tolerance.

public static bool Add(this System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D?>? point2Ds, DiGi.Geometry.Planar.Classes.Point2D? point2D, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.List<Point2D>

The List<Point2D?>? to which the point will be added.

point2D Point2D

The Point2D? object to add to the list.

tolerance System.Double

The System.Double tolerance used to determine if a point is a duplicate.

Returns

System.Boolean
A System.Boolean value indicating whether the point was successfully added to the list.

Modify.Add(this List<Point2D>, double, double) Method

Adds a new Point2D to the specified list of nullable Point2D objects using the provided x and y coordinates.

public static bool Add(this System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D?>? point2Ds, double x, double y);

Parameters

point2Ds System.Collections.Generic.List<Point2D>

The System.Collections.Generic.List<> of nullable Point2D objects to which the point will be added.

x System.Double

The double value for the X coordinate.

y System.Double

The double value for the Y coordinate.

Returns

System.Boolean
A boolean value indicating whether the point was successfully added; returns false if the list is null.

Modify.Connect(this List<Segment2D>, Point2D, PointConnectMethod, double) Method

Connect given Point2D to Segment2Ds. If point2D is on the end of Segment2D then nothing happen. If point2D is on the Segment2D then segment will be split otherwise point2D will be connected to closest Segment2D by adding extra segment.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Segment2D>? Connect(this System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Core.Enums.PointConnectMethod pointConnectMethod=DiGi.Geometry.Core.Enums.PointConnectMethod.Projection, double tolerance=1E-06);

Parameters

segment2Ds System.Collections.Generic.List<Segment2D>

Segment2Ds

point2D Point2D

Point2D to be connected

pointConnectMethod PointConnectMethod

Point Connect Method

tolerance System.Double

Tolerance

Returns

System.Collections.Generic.List<Segment2D>
List of the segments connected to given Point2D

Modify.FindNear(this List<Point2D>, Point2D, double) Method

Finds the first point in the List<Point2D?>? that lies within the specified tolerance of the given point, using the same cached spatial index as Add(this List<Point2D>, Point2D, double).

internal static DiGi.Geometry.Planar.Classes.Point2D? FindNear(this System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D?>? point2Ds, DiGi.Geometry.Planar.Classes.Point2D? point2D, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.List<Point2D>

The List<Point2D?>? to search.

point2D Point2D

The Point2D? to search for.

tolerance System.Double

The System.Double tolerance used to determine a match.

Returns

Point2D
The matching Point2D from the list, or null if none is found.

Modify.GetIndex(List<Point2D>, double) Method

Returns the cached spatial index for the given list, rebuilding it (one O(n) pass) if the list was mutated outside of Add(this List<Point2D>, Point2D, double)/FindNear(this List<Point2D>, Point2D, double) or the tolerance changed; otherwise the cached index is reused as-is.

private static DiGi.Geometry.Planar.Modify.PointIndex2D GetIndex(System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D?> point2Ds, double tolerance);

Parameters

point2Ds System.Collections.Generic.List<Point2D>

tolerance System.Double

Returns

PointIndex2D

Modify.Orient(List<Point2D>, Orientation) Method

Determines if the majority of point sets within the provided list exhibit the specified orientation.

public static bool Orient(System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, DiGi.Geometry.Core.Enums.Orientation orientation);

Parameters

point2Ds System.Collections.Generic.List<Point2D>

The System.Collections.Generic.List<> containing points to analyze.

orientation Orientation

The target Orientation to check for.

Returns

System.Boolean
A System.Boolean value indicating whether the majority of orientations match the specified Orientation.

Modify.Orient(this IPolygonal2D, Orientation, bool) Method

Orients the specified IPolygonal2D to a target Orientation.

public static bool Orient(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D, DiGi.Geometry.Core.Enums.Orientation orientation, bool convexHull=true);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to orient.

orientation Orientation

The desired Orientation.

convexHull System.Boolean

A System.Boolean value indicating whether the convex hull should be used for orientation calculation.

Returns

System.Boolean
A System.Boolean value indicating whether the polygonal object was inverted to match the target orientation.

Modify.RemoveDuplicates(this List<Point2D>, bool, double) Method

Removes every point which coincides with the point before it, so the geometry holds no zero length segment.

A repeated point contributes a segment of no length, which has no direction and no meaning - it makes a ring report as self intersecting, pushes a triangle onto the four point branch of triangulation, and produces an invalid ring once the geometry is handed to NetTopologySuite.

Set closed for a ring, where the last point is the predecessor of the first. That is what strips the repeated closing position a gml:LinearRing carries.

No floor is applied to how many points survive, so a ring which is nothing but repeats of one corner collapses to that single point. That is deliberate - the caller checks the count afterwards, and leaving a degenerate ring padded out to three points would let it pass a check for three corners while holding fewer.

public static bool RemoveDuplicates(this System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, bool closed, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.List<Point2D>

The System.Collections.Generic.List<> to clean up in place.

closed System.Boolean

A System.Boolean value indicating whether the points form a closed ring, in which case the last point is compared against the first.

tolerance System.Double

The System.Double distance within which two points are treated as one.

Returns

System.Boolean
A System.Boolean value indicating whether any point was removed.

Modify.PointIndex2D Class

Caches a tolerance-bucketed spatial hash grid per System.Collections.Generic.List<> instance so repeated Add(this List<Point2D>, Point2D, double) / FindNear(this List<Point2D>, Point2D, double) calls on the same list avoid an O(n) linear scan.

private sealed class Modify.PointIndex2D

Inheritance System.Object → PointIndex2D

Query Class

public static class Query

Inheritance System.Object → Query

Methods

Query.Above(this PolynomialEquation, Point2D, double) Method

Determines whether the specified Point2D is above the curve of the DiGi.Math.Classes.PolynomialEquation, considering a given tolerance.

public static bool Above(this DiGi.Math.Classes.PolynomialEquation? polynomialEquation, DiGi.Geometry.Planar.Classes.Point2D? point2D, double tolerance=0.0);

Parameters

polynomialEquation DiGi.Math.Classes.PolynomialEquation

The DiGi.Math.Classes.PolynomialEquation to evaluate.

point2D Point2D

The Point2D to check against the equation.

tolerance System.Double

A System.Double value representing the tolerance for the comparison. Defaults to 0.

Returns

System.Boolean
A System.Boolean indicating whether the point is above the polynomial curve; returns false if either the DiGi.Math.Classes.PolynomialEquation or Point2D is null.

Query.AdjacentSegments(this ISegmentable2D, ISegmentable2D, double) Method

Retrieves the adjacent Segment2D objects between two ISegmentable2D instances within a specified tolerance.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Segment2D>? AdjacentSegments(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_1, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_2, double tolerance=1E-06);

Parameters

segmentable2D_1 ISegmentable2D

The first ISegmentable2D instance.

segmentable2D_2 ISegmentable2D

The second ISegmentable2D instance.

tolerance System.Double

The System.Double distance tolerance used to determine if the bounding boxes are in range.

Returns

System.Collections.Generic.List<Segment2D>
A System.Collections.Generic.List<> containing the adjacent segments, or null if either input is null or no adjacency is found.

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

Identifies and returns a list of adjacent 2D segments from a collection of segmentable objects based on a specified distance tolerance.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Segment2D>? AdjacentSegments<T>(this System.Collections.Generic.IEnumerable<T?>? segmentable2Ds, double tolerance=1E-06)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

The type of the segmentable objects, which must implement ISegmentable2D.

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> containing the segmentable objects to evaluate for adjacency.

tolerance System.Double

A System.Double value representing the distance tolerance used to determine if segments are adjacent.

Returns

System.Collections.Generic.List<Segment2D>
A System.Collections.Generic.List<> of adjacent segments, or null if the input collection is null.

Query.AlmostEquals(this Point2D, Point2D, double) Method

Determines whether two Point2D? points are approximately equal based on a specified distance tolerance.

public static bool AlmostEquals(this DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2, double tolerance=1E-06);

Parameters

point2D_1 Point2D

The first Point2D? point to compare.

point2D_2 Point2D

The second Point2D? point to compare.

tolerance System.Double

The System.Double tolerance value used to determine if the points are almost equal.

Returns

System.Boolean
A System.Boolean value indicating whether the two points are considered equal within the given tolerance.

Query.AlmostEquals(this ISegmentable2D, ISegmentable2D, double) Method

Determines whether two ISegmentable2D instances are approximately equal based on a specified tolerance.

public static bool AlmostEquals(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_1, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_2, double tolerance=1E-06);

Parameters

segmentable2D_1 ISegmentable2D

The first ISegmentable2D instance to compare.

segmentable2D_2 ISegmentable2D

The second ISegmentable2D instance to compare.

tolerance System.Double

A System.Double value specifying the tolerance for the equality check.

Returns

System.Boolean
A System.Boolean value indicating whether the two instances are almost equal.

Query.Angle(this Point2D, Point2D, Point2D) Method

Calculates the angle formed by three Point2D points, where the second point is the vertex of the angle.

public static double Angle(this DiGi.Geometry.Planar.Classes.Point2D point2D_Previous, DiGi.Geometry.Planar.Classes.Point2D point2D, DiGi.Geometry.Planar.Classes.Point2D point2D_Next);

Parameters

point2D_Previous Point2D

The first Point2D point.

point2D Point2D

The Point2D point that serves as the vertex of the angle.

point2D_Next Point2D

The third Point2D point.

Returns

System.Double
A System.Double representing the angle between the vectors, or System.Double.NaN if any of the Point2D parameters are null.

Query.Area(this IEnumerable<Point2D>) Method

Calculates the area of a polygon defined by a collection of Point2D points.

public static double Area(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D> point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

An System.Collections.Generic.IEnumerable<> of Point2D objects representing the vertices of the polygon.

Returns

System.Double
The calculated area as a System.Double. Returns System.Double.NaN if the System.Collections.Generic.IEnumerable<> is null or contains any null elements; returns 0 if there are fewer than three points.

Query.AspectRatio(this BoundingBox2D, bool) Method

Calculates the aspect ratio of the specified BoundingBox2D.

public static double AspectRatio(this DiGi.Geometry.Planar.Classes.BoundingBox2D boundingBox2D, bool normalized=true);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D to calculate the aspect ratio for.

normalized System.Boolean

A System.Boolean value indicating whether the result should be normalized. Defaults to true.

Returns

System.Double
A System.Double representing the aspect ratio, or System.Double.NaN if the BoundingBox2D is null.

Query.AspectRatio(this Rectangle2D, bool) Method

Calculates the aspect ratio of the specified Rectangle2D.

public static double AspectRatio(this DiGi.Geometry.Planar.Classes.Rectangle2D rectangle2D, bool normalized=true);

Parameters

rectangle2D Rectangle2D

The Rectangle2D instance to calculate the aspect ratio for.

normalized System.Boolean

A System.Boolean value indicating whether the result should be normalized. Defaults to true.

Returns

System.Double
A System.Double representing the aspect ratio, or System.Double.NaN if the rectangle2D is null.

Query.Average(this IEnumerable<Point2D>) Method

Calculates the average position of a collection of Point2D objects.

public static DiGi.Geometry.Planar.Classes.Point2D? Average(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of points to average.

Returns

Point2D
A Point2D representing the average coordinates, or null if the System.Collections.Generic.IEnumerable<> is null or empty.

Query.Bounce(this Vector2D, Segment2D, double, double) Method

Calculates the bounce vector of a given Vector2D against a Segment2D, accounting for friction and restitution.

public static DiGi.Geometry.Planar.Classes.Vector2D? Bounce(this DiGi.Geometry.Planar.Classes.Vector2D? vector2D_ToBeBounced, DiGi.Geometry.Planar.Classes.Segment2D? segment2D, double friction=1.0, double restitution=1.0);

Parameters

vector2D_ToBeBounced Vector2D

The Vector2D? representing the velocity or direction to be bounced.

segment2D Segment2D

The Segment2D representing the surface to bounce off of.

friction System.Double

A System.Double value representing the friction coefficient applied during the bounce.

restitution System.Double

A System.Double value representing the restitution coefficient applied during the bounce.

Returns

Vector2D
The resulting Vector2D? after the bounce calculation, or null if either the input vector or segment is null.

Query.Bounce(this Vector2D, Vector2D, double, double) Method

Calculates the reflection of a Vector2D against another Vector2D, applying friction and restitution coefficients.

public static DiGi.Geometry.Planar.Classes.Vector2D? Bounce(this DiGi.Geometry.Planar.Classes.Vector2D? vector2D_ToBeBounced, DiGi.Geometry.Planar.Classes.Vector2D? vector2D, double friction=1.0, double restitution=1.0);

Parameters

vector2D_ToBeBounced Vector2D

The Vector2D that is to be bounced.

vector2D Vector2D

The Vector2D representing the surface normal or reflection axis.

friction System.Double

A System.Double value representing the friction coefficient applied to the tangential component of the bounce.

restitution System.Double

A System.Double value representing the restitution coefficient applied to the normal component of the bounce.

Returns

Vector2D
The resulting bounced Vector2D, or null if either input vector is null.

Query.Centroid(this IPolygonal2D) Method

Calculates the centroid of the specified IPolygonal2D.

public static DiGi.Geometry.Planar.Classes.Point2D? Centroid(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to calculate the centroid for.

Returns

Point2D
A Point2D representing the centroid, or null if the IPolygonal2D is null.

Query.Centroid(this IPolygonalFace2D) Method

Calculates the centroid of the specified IPolygonalFace2D.

public static DiGi.Geometry.Planar.Classes.Point2D? Centroid(this DiGi.Geometry.Planar.Interfaces.IPolygonalFace2D? polygonalFace2D);

Parameters

polygonalFace2D IPolygonalFace2D

The IPolygonalFace2D for which to calculate the centroid.

Returns

Point2D
A Point2D representing the centroid, or null if the IPolygonalFace2D is null or has no external edge.

Query.Centroid(this IEnumerable<Point2D>) Method

Calculates the centroid of a collection of Point2D objects.

public static DiGi.Geometry.Planar.Classes.Point2D? Centroid(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The collection of Point2D objects to process.

Returns

Point2D
A Point2D representing the centroid, or null if the input collection is null or empty.

Query.ClosestPoint(this Point2D, Point2D, Point2D, bool) Method

Calculates the closest point on a line or line segment defined by two points relative to a target point.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2, bool bounded);

Parameters

point2D Point2D

The target Point2D? point.

point2D_1 Point2D

The first Point2D? point defining the line or segment.

point2D_2 Point2D

The second Point2D? point defining the line or segment.

bounded System.Boolean

A System.Boolean value indicating whether the result should be bounded to the line segment between the two points.

Returns

Point2D
The closest Point2D? point on the line or segment, or null if any of the input points are null.

Query.ClosestPoint(this Point2D, Point2D, Point2D, bool, bool) Method

Calculates the closest point on a line or line segment defined by two points relative to a target point.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2, bool bounded_1, bool bounded_2);

Parameters

point2D Point2D

The Point2D? target point.

point2D_1 Point2D

The Point2D? first point defining the line or segment.

point2D_2 Point2D

The Point2D? second point defining the line or segment.

bounded_1 System.Boolean

A System.Boolean value indicating whether the result is bounded by the first point.

bounded_2 System.Boolean

A System.Boolean value indicating whether the result is bounded by the second point.

Returns

Point2D
The closest Point2D? on the line or segment, or null if any of the input points are null.

Query.ClosestPoint(this Point2D, ISegmentable2D) Method

Calculates the closest point on an ISegmentable2D object to a given Point2D.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Interfaces.ISegmentable2D segmentable2D);

Parameters

point2D Point2D

The Point2D for which the closest point is being sought.

segmentable2D ISegmentable2D

The ISegmentable2D object to find the closest point on.

Returns

Point2D
The closest Point2D found, or null if no point could be determined.

Query.ClosestPoint(this Point2D, ISegmentable2D, double) Method

Calculates the closest point on an ISegmentable2D object to a given Point2D.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, out double distance);

Parameters

point2D Point2D

The Point2D from which the distance is measured.

segmentable2D ISegmentable2D

The ISegmentable2D object to find the closest point on.

distance System.Double

When this method returns, contains the distance between the input Point2D and the resulting closest Point2D.

Returns

Point2D
The closest Point2D found on the ISegmentable2D object, or null if no point could be determined.

Query.ClosestPoint(this Point2D, IEnumerable<Point2D>) Method

Finds the closest Point2D in a collection of points to the specified Point2D.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2D Point2D

The source Point2D for which the closest point is sought.

point2Ds System.Collections.Generic.IEnumerable<Point2D>

An System.Collections.Generic.IEnumerable<> of Point2D objects to search through.

Returns

Point2D
The closest Point2D found in the collection, or null if no point is found.

Query.ClosestPoint(this Point2D, IEnumerable<Point2D>, double) Method

Finds the closest Point2D in a collection of points relative to a specified source point.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, out double distance);

Parameters

point2D Point2D

The source Point2D used as the reference for distance calculations.

point2Ds System.Collections.Generic.IEnumerable<Point2D>

An System.Collections.Generic.IEnumerable<> of Point2D objects to search through.

distance System.Double

When this method returns, contains the minimum System.Double distance found; otherwise, System.Double.NaN.

Returns

Point2D
The closest Point2D from the collection, or null if no point is found or if either input parameter is null.

Query.ClosestPoint(this Point2D, IEnumerable<Segment2D>) Method

Finds the closest point on a collection of Segment2D objects to the specified Point2D.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds);

Parameters

point2D Point2D

The Point2D for which the closest point is being sought.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

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

Returns

Point2D
The closest Point2D found on any of the provided segments, or null if the point is null, the collection is null, or the collection contains no elements.

Query.ClosestPoint(this Point2D, IEnumerable<Segment2D>, double) Method

Finds the closest point among a collection of line segments to a given point.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, out double distance);

Parameters

point2D Point2D

The source Point2D point.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

An System.Collections.Generic.IEnumerable<> of Segment2D objects to search.

distance System.Double

When this method returns, contains the distance between the source Point2D and the closest point found; otherwise, System.Double.NaN.

Returns

Point2D
The closest Point2D found across all segments, or null if no valid point is found or inputs are null.

Query.ClosestPoint<T>(this Point2D, IEnumerable<T>) Method

Finds the closest Point2D to the specified reference point from a collection of segmentable 2D objects.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint<T>(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<T>? segmentable2Ds)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

A type that implements the ISegmentable2D interface.

Parameters

point2D Point2D

The reference Point2D to calculate distance from.

segmentable2Ds System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> of objects that implement the ISegmentable2D interface.

Returns

Point2D
The closest Point2D found, or null if the reference point or the collection is null.

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

Finds the closest point to a given point from a collection of segmentable 2D objects.

public static DiGi.Geometry.Planar.Classes.Point2D? ClosestPoint<T>(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<T>? segmentable2Ds, out double distance)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

A type that implements ISegmentable2D.

Parameters

point2D Point2D

The source Point2D to calculate the distance from.

segmentable2Ds System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> of objects implementing ISegmentable2D.

distance System.Double

When this method returns, contains the System.Double distance to the closest point found; otherwise, System.Double.NaN.

Returns

Point2D
The closest Point2D found, or null if no points are available or inputs are null.

Query.Collinear(this Point2D, Point2D, Point2D, double) Method

Determines whether three Point2D points are collinear within a specified tolerance.

public static bool Collinear(this DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2, DiGi.Geometry.Planar.Classes.Point2D? point2D_3, double tolerance=1E-06);

Parameters

point2D_1 Point2D

The first Point2D point.

point2D_2 Point2D

The second Point2D point.

point2D_3 Point2D

The third Point2D point.

tolerance System.Double

The System.Double tolerance value used to determine collinearity.

Returns

System.Boolean
A System.Boolean value indicating whether the points are collinear; returns false if any of the provided points are null.

Query.Collinear(this ILinear2D, ILinear2D, double) Method

Determines whether two ILinear2D objects are collinear within a specified tolerance.

public static bool Collinear(this DiGi.Geometry.Planar.Interfaces.ILinear2D? linear2D_1, DiGi.Geometry.Planar.Interfaces.ILinear2D? linear2D_2, double tolerance=1E-06);

Parameters

linear2D_1 ILinear2D

The first ILinear2D object.

linear2D_2 ILinear2D

The second ILinear2D object.

tolerance System.Double

A System.Double value representing the tolerance for collinearity.

Returns

System.Boolean
A System.Boolean value indicating whether the two objects are collinear.

Query.Collinear(this IEnumerable<Point2D>, double) Method

Determines whether a collection of points are collinear within a specified tolerance.

public static bool Collinear(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D?>? point2Ds, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The IEnumerable<Point2D?> collection of points to evaluate.

tolerance System.Double

The System.Double distance tolerance used to determine if the points lie on the same line.

Returns

System.Boolean
A System.Boolean value indicating whether the points are collinear; returns false if the input collection is null.

Query.Concave(this PolygonalFace2D, bool, bool) Method

Determines whether the specified PolygonalFace2D is concave.

public static bool Concave(this DiGi.Geometry.Planar.Classes.PolygonalFace2D? polygonalFace2D, bool externalEdge=true, bool internalEdges=true);

Parameters

polygonalFace2D PolygonalFace2D

The PolygonalFace2D instance to evaluate.

externalEdge System.Boolean

A System.Boolean value indicating whether the external edge should be checked for concavity.

internalEdges System.Boolean

A System.Boolean value indicating whether internal edges should be checked for concavity.

Returns

System.Boolean
A System.Boolean value that is true if the polygonal face is concave; otherwise, false.

Query.Concave(this IPolygonal2D) Method

Determines whether the specified IPolygonal2D instance is concave.

public static bool Concave(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to evaluate.

Returns

System.Boolean
A System.Boolean value indicating whether the polygonal object is concave; otherwise, false if the IPolygonal2D instance is null.

Query.Concave(this IEnumerable<Point2D>) Method

Determines whether the provided collection of Point2D points forms a concave polygon.

public static bool Concave(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects representing the vertices of the polygon.

Returns

System.Boolean
A System.Boolean value indicating whether the polygon is concave; returns false if the collection is null or contains fewer than three points.

Query.Contains(this IEnumerable<Point2D>, Point2D, double) Method

Determines whether the collection of Point2D objects contains a specific Point2D within the specified tolerance.

public static bool Contains(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D> point2Ds, DiGi.Geometry.Planar.Classes.Point2D point2D, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects to search.

point2D Point2D

The Point2D object to locate in the collection.

tolerance System.Double

The System.Double value representing the distance tolerance for equality comparison.

Returns

System.Boolean
A System.Boolean value indicating whether the specified Point2D was found within the given tolerance; otherwise, false.

Query.Convex(this PolygonalFace2D, bool, bool) Method

Determines whether the specified PolygonalFace2D is convex.

public static bool Convex(this DiGi.Geometry.Planar.Classes.PolygonalFace2D? polygonalFace2D, bool externalEdge=true, bool internalEdges=true);

Parameters

polygonalFace2D PolygonalFace2D

The PolygonalFace2D instance to evaluate.

externalEdge System.Boolean

A System.Boolean value indicating whether the external edge should be included in the convexity check.

internalEdges System.Boolean

A System.Boolean value indicating whether internal edges should be included in the convexity check.

Returns

System.Boolean
A System.Boolean value that is true if the face is convex; otherwise, false.

Query.Convex(this IPolygonal2D) Method

Determines whether the specified IPolygonal2D is convex.

public static bool Convex(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to evaluate.

Returns

System.Boolean
A System.Boolean value indicating whether the polygon is convex; returns false if the input is null.

Query.Convex(this IEnumerable<Point2D>) Method

Determines whether the specified collection of Point2D objects forms a convex polygon.

public static bool Convex(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects to evaluate.

Returns

System.Boolean
A System.Boolean value indicating whether the points form a convex polygon; returns false if the collection is null or contains fewer than three points.

Query.ConvexHull(this ISegmentable2D) Method

Computes the convex hull for the specified ISegmentable2D instance.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? ConvexHull(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D);

Parameters

segmentable2D ISegmentable2D

The ISegmentable2D instance to calculate the convex hull for.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the points of the convex hull, or null if the segmentable2D is null.

Query.ConvexHull(this IEnumerable<Point2D>) Method

Computes the convex hull for a given collection of Point2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? ConvexHull(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

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

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> representing the vertices of the convex hull, or null if the input collection is null.

Query.ConvexHull(this IEnumerable<Point2D>, bool) Method

Computes the convex hull for a collection of Point2D points.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? ConvexHull(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, bool keepOrder);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects to process.

keepOrder System.Boolean

A System.Boolean value indicating whether the original order of the points should be preserved in the resulting list.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> of Point2D objects forming the convex hull, or null if the input collection is null.

Query.ConvexHull(this IEnumerable<Segment2D>) Method

Computes the convex hull for a collection of Segment2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? ConvexHull(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds);

Parameters

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

The System.Collections.Generic.IEnumerable<> of Segment2D objects used to derive points for the convex hull.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> of Point2D vertices forming the convex hull, or null if the input is null.

Query.Determinant(this Point2D, Point2D, Point2D) Method

Calculates the determinant of three 2D points.

public static double Determinant(this DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2, DiGi.Geometry.Planar.Classes.Point2D? point2D_3);

Parameters

point2D_1 Point2D

The first Point2D point.

point2D_2 Point2D

The second Point2D point.

point2D_3 Point2D

The third Point2D point.

Returns

System.Double
The calculated System.Double determinant, or System.Double.NaN if any of the provided points are null.

Query.Determinant(this Vector2D, Vector2D) Method

Calculates the determinant of two 2D vectors.

public static double Determinant(this DiGi.Geometry.Planar.Classes.Vector2D? vector2D_1, DiGi.Geometry.Planar.Classes.Vector2D? vector2D_2);

Parameters

vector2D_1 Vector2D

The first Vector2D instance.

vector2D_2 Vector2D

The second Vector2D instance.

Returns

System.Double
A System.Double representing the determinant, or System.Double.NaN if either Vector2D is null.

Query.Determinants(this IPolygonal2D) Method

Calculates the determinants for the specified IPolygonal2D object.

public static System.Collections.Generic.List<double>? Determinants(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D);

Parameters

polygonal2D IPolygonal2D

The IPolygonal2D instance to process.

Returns

System.Collections.Generic.List<System.Double>
A System.Collections.Generic.List<> of System.Double values representing the determinants, or null if the input is null or contains fewer than three points.

Query.Determinants(this IEnumerable<Point2D>) Method

Calculates the determinants for a sequence of Point2D objects by treating them as a closed loop.

public static System.Collections.Generic.List<double>? Determinants(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The IEnumerable<Point2D> collection of points to process.

Returns

System.Collections.Generic.List<System.Double>
A List<double> containing the calculated determinants, or null if the input is null or contains fewer than 3 Point2D elements.

Query.DiagonalLength(this BoundingBox2D) Method

Calculates the length of the diagonal for the specified BoundingBox2D.

public static double DiagonalLength(this DiGi.Geometry.Planar.Classes.BoundingBox2D boundingBox2D);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D instance to calculate the diagonal length for.

Returns

System.Double
A System.Double representing the length of the diagonal, or System.Double.NaN if the BoundingBox2D is null or contains no diagonals.

Query.Difference(this PolygonalFace2D, PolygonalFace2D) Method

Calculates the difference between two PolygonalFace2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.PolygonalFace2D>? Difference(this DiGi.Geometry.Planar.Classes.PolygonalFace2D? polygonalFace2D_1, DiGi.Geometry.Planar.Classes.PolygonalFace2D? polygonalFace2D_2);

Parameters

polygonalFace2D_1 PolygonalFace2D

The first PolygonalFace2D object from which the second is subtracted.

polygonalFace2D_2 PolygonalFace2D

The second PolygonalFace2D object to subtract from the first.

Returns

System.Collections.Generic.List<PolygonalFace2D>
A System.Collections.Generic.List<> containing the resulting faces of the difference operation, or null if either input is null or conversion fails.

Remarks

The computation is delegated to DifferenceResult2D(this IPolygonalFace2D, IPolygonalFace2D); only the polygonal faces of the result are returned. Use the result object directly to access lower-dimensional (segment/point) difference geometries.

Query.Difference(this IPolygonal2D, IPolygonal2D) Method

Calculates the difference between two 2D polygonal shapes.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Interfaces.IPolygonal2D>? Difference(this DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D_1, DiGi.Geometry.Planar.Interfaces.IPolygonal2D? polygonal2D_2);

Parameters

polygonal2D_1 IPolygonal2D

The first IPolygonal2D object.

polygonal2D_2 IPolygonal2D

The second IPolygonal2D object to subtract from the first.

Returns

System.Collections.Generic.List<IPolygonal2D>
A System.Collections.Generic.List<> of IPolygonal2D objects representing the resulting difference, or null if either input is null.

Query.Difference(this Polygon, Polygon) Method

Calculates the geometric difference between two NetTopologySuite.Geometries.Polygon objects.

public static System.Collections.Generic.List<Polygon>? Difference(this Polygon? polygon_1, Polygon? polygon_2);

Parameters

polygon_1 NetTopologySuite.Geometries.Polygon

The first NetTopologySuite.Geometries.Polygon from which the second polygon is subtracted.

polygon_2 NetTopologySuite.Geometries.Polygon

The second NetTopologySuite.Geometries.Polygon to be subtracted from the first.

Returns

System.Collections.Generic.List<NetTopologySuite.Geometries.Polygon>
A System.Collections.Generic.List<> containing the resulting polygons of the difference operation, or null if either input polygon is null.

Query.Directions(this Corner, Vector2D, Vector2D) Method

Calculates the height and width direction vectors based on the specified corner.

public static void Directions(this DiGi.Geometry.Core.Enums.Corner corner, out DiGi.Geometry.Planar.Classes.Vector2D? heightDirection, out DiGi.Geometry.Planar.Classes.Vector2D? widthDirection);

Parameters

corner Corner

The Corner value used to determine the directions.

heightDirection Vector2D

When this method returns, contains a Vector2D? representing the height direction vector, or null if not applicable.

widthDirection Vector2D

When this method returns, contains a Vector2D? representing the width direction vector, or null if not applicable.

Query.Directions(this IEnumerable<ISegmentable2D>) Method

Calculates the directions for a collection of segmentable 2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Vector2D>? Directions(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.ISegmentable2D>? segmentable2Ds);

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<ISegmentable2D>

The System.Collections.Generic.IEnumerable<> of ISegmentable2D objects to process.

Returns

System.Collections.Generic.List<Vector2D>
A System.Collections.Generic.List<> containing the calculated directions, or null if the segmentable2Ds collection is null.

Query.Distance(BoundingBox2D, ISegmentable2D, Point2D, Point2D, double) Method

Calculates the distance between a BoundingBox2D and an ISegmentable2D.

public static double Distance(DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest1, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest2, double tolerance=1E-06);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D to measure the distance from.

segmentable2D ISegmentable2D

The ISegmentable2D to measure the distance to.

point2D_Closest1 Point2D

When this method returns, contains the Point2D on the BoundingBox2D closest to the ISegmentable2D, or null if not found.

point2D_Closest2 Point2D

When this method returns, contains the Point2D on the ISegmentable2D closest to the BoundingBox2D, or null if not found.

tolerance System.Double

The System.Double tolerance value used for distance calculations.

Returns

System.Double
The System.Double distance between the two objects, or System.Double.NaN if either input is null.

Query.Distance(ISegmentable2D, BoundingBox2D, Point2D, Point2D, double) Method

Calculates the shortest distance between an ISegmentable2D and a BoundingBox2D.

public static double Distance(DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest1, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest2, double tolerance=1E-06);

Parameters

segmentable2D ISegmentable2D

The ISegmentable2D object.

boundingBox2D BoundingBox2D

The BoundingBox2D object.

point2D_Closest1 Point2D

When this method returns, contains the Point2D that is closest to the other object on the ISegmentable2D.

point2D_Closest2 Point2D

When this method returns, contains the Point2D that is closest to the other object on the BoundingBox2D.

tolerance System.Double

The System.Double tolerance value used for distance calculations.

Returns

System.Double
The shortest distance as a System.Double between the two objects.

Query.Distance(ISegmentable2D, ISegmentable2D, Point2D, Point2D, double) Method

Calculates the shortest distance between two segmentable 2D objects.

public static double Distance(DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_1, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_2, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest1, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest2, double tolerance=1E-06);

Parameters

segmentable2D_1 ISegmentable2D

The first ISegmentable2D object.

segmentable2D_2 ISegmentable2D

The second ISegmentable2D object.

point2D_Closest1 Point2D

When this method returns, contains the Point2D on the first segmentable object that is closest to the second segmentable object, or null if no distance could be calculated.

point2D_Closest2 Point2D

When this method returns, contains the Point2D on the second segmentable object that is closest to the first segmentable object, or null if no distance could be calculated.

tolerance System.Double

The System.Double tolerance value used for calculations.

Returns

System.Double
The shortest distance as a System.Double between the two objects, or System.Double.NaN if either object is null or contains no segments.

Query.Distance(this Point2D, ISegmentable2D) Method

Calculates the shortest distance between a Point2D and an ISegmentable2D.

public static double Distance(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D);

Parameters

point2D Point2D

The Point2D from which to calculate the distance.

segmentable2D ISegmentable2D

The ISegmentable2D object to measure the distance to.

Returns

System.Double
The shortest distance as a System.Double.

Query.Distance(this Point2D, IEnumerable<Segment2D>) Method

Calculates the shortest distance between a specified Point2D and a collection of Segment2D objects.

public static double Distance(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds);

Parameters

point2D Point2D

The Point2D from which to calculate the distance.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

An System.Collections.Generic.IEnumerable<> of Segment2D objects to measure the distance against.

Returns

System.Double
The shortest distance as a System.Double. Returns System.Double.NaN if the point or the collection is null or empty.

Query.Distance(this Point2D, IEnumerable<Segment2D>, Point2D) Method

Calculates the shortest distance from a Point2D to a collection of Segment2D objects.

public static double Distance(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, out DiGi.Geometry.Planar.Classes.Point2D? closetPoint2D);

Parameters

point2D Point2D

The Point2D instance to measure the distance from.

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

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

closetPoint2D Point2D

When this method returns, contains the Point2D that is closest to the source point; otherwise, null.

Returns

System.Double
The minimum distance as a System.Double.

Query.Distance<T>(this Point2D, IEnumerable<T>) Method

Calculates the shortest distance between a specified Point2D and a collection of objects that implement ISegmentable2D.

public static double Distance<T>(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<T>? segmentable2Ds)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

A type that implements the ISegmentable2D interface.

Parameters

point2D Point2D

The Point2D from which the distance is measured.

segmentable2Ds System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> collection of objects implementing ISegmentable2D to measure the distance against.

Returns

System.Double
The shortest distance as a System.Double.

Query.Distance<T>(this Point2D, IEnumerable<T>, Point2D) Method

Calculates the shortest distance from a Point2D to a collection of objects that implement ISegmentable2D.

public static double Distance<T>(this DiGi.Geometry.Planar.Classes.Point2D? point2D, System.Collections.Generic.IEnumerable<T>? segmentable2Ds, out DiGi.Geometry.Planar.Classes.Point2D? closetPoint2D)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

A type that implements ISegmentable2D.

Parameters

point2D Point2D

The source Point2D to measure the distance from.

segmentable2Ds System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> of objects that implement ISegmentable2D.

closetPoint2D Point2D

When this method returns, contains the closest Point2D found on the segmentable objects; otherwise, null.

Returns

System.Double
The minimum distance as a System.Double, or System.Double.NaN if the source point is null, the collection is null, or the collection contains no elements.

Query.EqualsTopologically(this ISegmentable2D, ISegmentable2D) Method

Determines whether two ISegmentable2D objects are topologically equal.

public static bool EqualsTopologically(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_1, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D_2);

Parameters

segmentable2D_1 ISegmentable2D

The first ISegmentable2D object to compare.

segmentable2D_2 ISegmentable2D

The second ISegmentable2D object to compare.

Returns

System.Boolean
A System.Boolean value indicating whether the two objects are topologically equal.

Query.Evaluate(this PolynomialEquation, double) Method

Evaluates the specified DiGi.Math.Classes.PolynomialEquation at a given x-coordinate and returns the result as a Point2D.

public static DiGi.Geometry.Planar.Classes.Point2D? Evaluate(this DiGi.Math.Classes.PolynomialEquation? polynominalEquation, double x);

Parameters

polynominalEquation DiGi.Math.Classes.PolynomialEquation

The DiGi.Math.Classes.PolynomialEquation instance to evaluate.

x System.Double

The double value representing the x-coordinate.

Returns

Point2D
A Point2D containing the x and y coordinates if the evaluation is successful; otherwise, null if the DiGi.Math.Classes.PolynomialEquation is null or if either the input x or the resulting y value is NaN.

Query.Extend(this Segment2D, double, bool, bool) Method

Extends a 2D line segment by a specified distance at the start and/or end points.

public static DiGi.Geometry.Planar.Classes.Segment2D? Extend(this DiGi.Geometry.Planar.Classes.Segment2D? segment2D, double distance, bool extendStart=true, bool extendEnd=true);

Parameters

segment2D Segment2D

The Segment2D instance to be extended.

distance System.Double

The System.Double distance to extend the segment by.

extendStart System.Boolean

A System.Boolean value indicating whether the start of the segment should be extended. Defaults to true.

extendEnd System.Boolean

A System.Boolean value indicating whether the end of the segment should be extended. Defaults to true.

Returns

Segment2D
A new Segment2D instance representing the extended segment, or null if the input Segment2D or its endpoints are null.

Query.ExternalPolygons(this IEnumerable<Segment2D>, double) Method

Extracts the external polygons from a collection of 2D segments using a specified distance tolerance.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? ExternalPolygons(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Segment2D>? segment2Ds, double tolerance=1E-06);

Parameters

segment2Ds System.Collections.Generic.IEnumerable<Segment2D>

The System.Collections.Generic.IEnumerable<> collection of segments to process.

tolerance System.Double

The System.Double distance tolerance used for calculations.

Returns

System.Collections.Generic.List<Polygon2D>
A System.Collections.Generic.List<> containing the external polygons, or null if the input collection is null.

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

Extracts the external polygons from a collection of segmentable 2D objects using a specified distance tolerance.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? ExternalPolygons<T>(this System.Collections.Generic.IEnumerable<T>? segmentable2Ds, double tolerance=1E-06)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

The type of the segmentable 2D objects, which must implement ISegmentable2D.

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<T>

The System.Collections.Generic.IEnumerable<> collection of segmentable 2D objects to process.

tolerance System.Double

The System.Double distance tolerance used for calculations.

Returns

System.Collections.Generic.List<Polygon2D>
A System.Collections.Generic.List<> containing the external polygons, or null if the input collection is null.

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

Extracts and identifies external polygons from a collection of segmentable 2D objects, optionally extending the segments by a specified distance.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? ExternalPolygons<T>(this System.Collections.Generic.IEnumerable<T>? segmentable2Ds, double maxDistance, double tolerance=1E-06)
    where T : DiGi.Geometry.Planar.Interfaces.ISegmentable2D;

Type parameters

T

The type of the segmentable 2D objects, which must implement ISegmentable2D.

Parameters

segmentable2Ds System.Collections.Generic.IEnumerable<T>

An System.Collections.Generic.IEnumerable<> of segmentable 2D objects to process.

maxDistance System.Double

A System.Double representing the distance by which each segment should be extended.

tolerance System.Double

A System.Double specifying the tolerance used for distance calculations.

Returns

System.Collections.Generic.List<Polygon2D>
A System.Collections.Generic.List<> containing the identified external polygons, or null if the input collection is null or contains no segments.

Query.ExtremePoints(this IEnumerable<Point2D>, Point2D, Point2D) Method

Finds the two points within a collection that are furthest apart from each other.

public static void ExtremePoints(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, out DiGi.Geometry.Planar.Classes.Point2D? point2D_1, out DiGi.Geometry.Planar.Classes.Point2D? point2D_2);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D objects to evaluate.

point2D_1 Point2D

When this method returns, contains the first point of the pair with the maximum distance, or null if the collection is null or contains fewer than two points.

point2D_2 Point2D

When this method returns, contains the second point of the pair with the maximum distance, or null if the collection is null or contains fewer than two points.

Query.Fit(this BoundingBox2D, BoundingBox2D, double) Method

Fits a source BoundingBox2D into a target BoundingBox2D with an optional offset.

public static DiGi.Geometry.Planar.Classes.BoundingBox2D? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D_Source, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The target BoundingBox2D to fit into.

boundingBox2D_Source BoundingBox2D

The source BoundingBox2D to be fitted.

offset System.Double

A System.Double value representing the offset applied during fitting.

Returns

BoundingBox2D
The resulting BoundingBox2D if successful; otherwise, null.

Query.Fit(this BoundingBox2D, BoundingBox2D, double, double) Method

Fits a source BoundingBox2D into a target BoundingBox2D.

public static DiGi.Geometry.Planar.Classes.BoundingBox2D? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D_Source, out double scale, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The target BoundingBox2D to fit the source bounding box into.

boundingBox2D_Source BoundingBox2D

The source BoundingBox2D that is being fitted.

scale System.Double

When this method returns, contains the calculated System.Double scale factor used for fitting; otherwise, System.Double.NaN.

offset System.Double

The System.Double offset to apply during the fitting process.

Returns

BoundingBox2D
A BoundingBox2D representing the fitted result, or null if either input bounding box is null or cannot be processed.

Query.Fit(this BoundingBox2D, Polygon2D, double) Method

Fits a Polygon2D into a BoundingBox2D.

public static DiGi.Geometry.Planar.Classes.Polygon2D? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Classes.Polygon2D? polygon2D, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D to fit the polygon into.

polygon2D Polygon2D

The Polygon2D to be fitted.

offset System.Double

A System.Double value representing the offset.

Returns

Polygon2D
A new Polygon2D that fits within the bounding box, or null if the operation fails or any input is null.

Query.Fit(this BoundingBox2D, Polygon2D, double, double) Method

Fits a Polygon2D into a BoundingBox2D.

public static DiGi.Geometry.Planar.Classes.Polygon2D? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Classes.Polygon2D? polygon2D, out double scale, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D that defines the target area for fitting.

polygon2D Polygon2D

The Polygon2D to be fitted into the bounding box.

scale System.Double

When this method returns, contains the System.Double scale factor applied to fit the polygon; otherwise, System.Double.NaN.

offset System.Double

A System.Double value representing the offset used during the fitting process.

Returns

Polygon2D
A new Polygon2D that fits within the specified bounding box, or null if either input is null or the resulting polygon contains fewer than two points.

Query.Fit(this BoundingBox2D, Segment2D, double) Method

Fits a Segment2D into a BoundingBox2D.

public static DiGi.Geometry.Planar.Classes.Segment2D? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Classes.Segment2D? segment2D, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The target BoundingBox2D to fit the segment into.

segment2D Segment2D

The source Segment2D to be fitted.

offset System.Double

A System.Double value representing the offset.

Returns

Segment2D
A Segment2D that fits within the bounding box, or null if either input is null.

Query.Fit(this BoundingBox2D, Segment2D, double, double) Method

Fits a Segment2D into a BoundingBox2D.

public static DiGi.Geometry.Planar.Classes.Segment2D? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, DiGi.Geometry.Planar.Classes.Segment2D? segment2D, out double scale, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D to fit the segment into.

segment2D Segment2D

The Segment2D to be fitted.

scale System.Double

When this method returns, contains the calculated System.Double scale factor; otherwise, System.Double.NaN.

offset System.Double

The System.Double offset value used during the fitting process.

Returns

Segment2D
A new Segment2D that fits within the bounding box, or null if the input parameters are null or the segment cannot be fitted.

Query.Fit(this BoundingBox2D, IEnumerable<Point2D>, double) Method

Fits a collection of Point2D objects within the specified BoundingBox2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D to fit the points into.

point2Ds System.Collections.Generic.IEnumerable<Point2D>

An System.Collections.Generic.IEnumerable<> of Point2D objects to be fitted.

offset System.Double

A System.Double value representing the offset for the fitting process.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> of fitted Point2D objects, or null if the input is invalid.

Query.Fit(this BoundingBox2D, IEnumerable<Point2D>, double, double) Method

Fits a collection of Point2D objects into the specified BoundingBox2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? Fit(this DiGi.Geometry.Planar.Classes.BoundingBox2D? boundingBox2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, out double scale, double offset=0.0);

Parameters

boundingBox2D BoundingBox2D

The BoundingBox2D that defines the target area for fitting.

point2Ds System.Collections.Generic.IEnumerable<Point2D>

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

scale System.Double

When this method returns, contains the System.Double scale factor used to fit the points; otherwise, System.Double.NaN.

offset System.Double

A System.Double value representing the offset applied during fitting.

Returns

System.Collections.Generic.List<Point2D>
A List<Point2D> containing the fitted points if successful; otherwise, null.

Query.InRange(this Geometry, Geometry, double) Method

Determines whether two geometries are within a specified distance tolerance of each other.

public static bool InRange(this Geometry geometry_1, Geometry geometry_2, double tolerance=1E-06);

Parameters

geometry_1 NetTopologySuite.Geometries.Geometry

The first NetTopologySuite.Geometries.Geometry to evaluate.

geometry_2 NetTopologySuite.Geometries.Geometry

The second NetTopologySuite.Geometries.Geometry to evaluate.

tolerance System.Double

A System.Double value representing the maximum distance threshold for proximity.

Returns

System.Boolean
A System.Boolean indicating whether the geometries intersect or are within the specified tolerance; otherwise, false if either geometry is null.

Query.Inside(this Point2D, Point2D, Point2D, Point2D) Method

Checks if point is inside tree points (triangle)

public static bool Inside(this DiGi.Geometry.Planar.Classes.Point2D? point2D, DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2, DiGi.Geometry.Planar.Classes.Point2D? point2D_3);

Parameters

point2D Point2D

Point to be checked

point2D_1 Point2D

Triangle point 1

point2D_2 Point2D

Triangle point 2

point2D_3 Point2D

Triangle point 3

Returns

System.Boolean
True in point2D is inside triangle created by trheer points (point2D_1, point2D_2, point2D_3)

Query.Inside(this IEnumerable<Point2D>, Point2D) Method

Determines whether a specified Point2D is located inside a polygon defined by a collection of Point2D objects.

public static bool Inside(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, DiGi.Geometry.Planar.Classes.Point2D? point2D);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> of Point2D vertices that define the boundary of the polygon.

point2D Point2D

The Point2D to check for containment within the polygon.

Returns

System.Boolean
A System.Boolean value indicating true if the Point2D is inside the polygon; otherwise, false.

Query.InternalPoint(IEnumerable<Point2D>, double) Method

Calculates a point that is strictly internal to the polygon defined by the provided collection of points.

public static DiGi.Geometry.Planar.Classes.Point2D? InternalPoint(System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Point2D>? point2Ds, double tolerance=1E-06);

Parameters

point2Ds System.Collections.Generic.IEnumerable<Point2D>

The System.Collections.Generic.IEnumerable<> collection of points defining the boundary.

tolerance System.Double

The System.Double tolerance value used to determine if a point lies on a segment.

Returns

Point2D
A Point2D representing an internal point, or null if the input is invalid or no internal point can be determined.

Query.InternalVectors(this IPolygon2D) Method

Retrieves the internal vectors of the specified DiGi.Geometry.Planar.Interfaces.IPolygon2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Vector2D?>? InternalVectors(this DiGi.Geometry.Planar.Interfaces.IPolygon2D? polygonal2D);

Parameters

polygonal2D DiGi.Geometry.Planar.Interfaces.IPolygon2D

The DiGi.Geometry.Planar.Interfaces.IPolygon2D instance to extract internal vectors from.

Returns

System.Collections.Generic.List<Vector2D>
A List<Vector2D?> containing the internal vectors, or null if the DiGi.Geometry.Planar.Interfaces.IPolygon2D is null, contains no segments, or has an undefined or collinear orientation.

Query.Intersect(this ILinear2D, ILinear2D, double) Method

Determines whether two linear 2D objects intersect within a specified tolerance.

public static bool Intersect(this DiGi.Geometry.Planar.Interfaces.ILinear2D? linear2D_1, DiGi.Geometry.Planar.Interfaces.ILinear2D? linear_2, double tolerance=1E-06);

Parameters

linear2D_1 ILinear2D

The first ILinear2D object.

linear_2 ILinear2D

The second ILinear2D object.

tolerance System.Double

The System.Double tolerance value used to determine the intersection.

Returns

System.Boolean
A System.Boolean value indicating whether an intersection point exists between the two linear 2D objects within the specified tolerance.

Query.Intersect(this ISegmentable2D, Segment2D, double) Method

Determines whether a Segment2D intersects with an ISegmentable2D object within a specified tolerance.

public static bool Intersect(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, DiGi.Geometry.Planar.Classes.Segment2D? segment2D, double tolerance=1E-06);

Parameters

segmentable2D ISegmentable2D

The ISegmentable2D object to check for intersection.

segment2D Segment2D

The Segment2D segment to intersect with the ISegmentable2D object.

tolerance System.Double

A System.Double value specifying the distance tolerance for the intersection check.

Returns

System.Boolean
A System.Boolean value indicating whether the objects intersect; otherwise, false.

Query.Intersect(this ISegmentable2D, ISegmentable2D, double) Method

Determines whether two ISegmentable2D objects intersect within a specified tolerance.

public static bool Intersect(this DiGi.Geometry.Planar.Interfaces.ISegmentable2D segmentable2D_1, DiGi.Geometry.Planar.Interfaces.ISegmentable2D segmentable2D_2, double tolerance=1E-06);

Parameters

segmentable2D_1 ISegmentable2D

The first ISegmentable2D object to check for intersection.

segmentable2D_2 ISegmentable2D

The second ISegmentable2D object to check for intersection.

tolerance System.Double

The System.Double tolerance value used to determine if the objects are within range of each other.

Returns

System.Boolean
A System.Boolean value indicating whether the two ISegmentable2D objects intersect; otherwise, false.

Query.Intersection(this Polygon2D, Polygon2D, double) Method

Calculates the intersection of two 2D polygons.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? Intersection(this DiGi.Geometry.Planar.Classes.Polygon2D? polygon2D_1, DiGi.Geometry.Planar.Classes.Polygon2D? polygon2D_2, double tolerance=1E-06);

Parameters

polygon2D_1 Polygon2D

The first Polygon2D object to intersect.

polygon2D_2 Polygon2D

The second Polygon2D object to intersect.

tolerance System.Double

The distance tolerance used for geometric calculations.

Returns

System.Collections.Generic.List<Polygon2D>
A list containing the resulting intersection polygons, or null if no intersection exists or either input polygon is null.

Query.Intersection(this PolygonalFace2D, PolygonalFace2D) Method

Calculates the intersection of two polygonal faces in 2D space.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.PolygonalFace2D>? Intersection(this DiGi.Geometry.Planar.Classes.PolygonalFace2D? polygonalFace2D_1, DiGi.Geometry.Planar.Classes.PolygonalFace2D? polygonalFace2D_2);

Parameters

polygonalFace2D_1 PolygonalFace2D

The first polygonal face to intersect.

polygonalFace2D_2 PolygonalFace2D

The second polygonal face to intersect.

Returns

System.Collections.Generic.List<PolygonalFace2D>
A list of PolygonalFace2D objects representing the intersection area, or null if either input is null or cannot be converted for processing.

Query.Intersection(this IEnumerable<Polygon2D>, double) Method

Calculates the intersection of a collection of 2D polygons.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Polygon2D>? Intersection(this System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Classes.Polygon2D>? polygon2Ds, double tolerance=1E-06);

Parameters

polygon2Ds System.Collections.Generic.IEnumerable<Polygon2D>

The collection of Polygon2D objects to intersect.

tolerance System.Double

The distance tolerance used for geometric calculations.

Returns

System.Collections.Generic.List<Polygon2D>
A list containing the resulting intersection polygons, or null if no intersection exists or the input is null.

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

Calculates the intersection of a collection of polygonal geometries.

public static System.Collections.Generic.List<X>? Intersection<X,T>(this System.Collections.Generic.IEnumerable<T>? polygonal2Ds, double tolerance=1E-06)
    where X : DiGi.Geometry.Planar.Interfaces.IPolygonal2D
    where T : DiGi.Geometry.Planar.Interfaces.IPolygonal2D;

Type parameters

X

The type of the resulting polygonal geometries.

T

The type of the input polygonal geometries.

Parameters

polygonal2Ds System.Collections.Generic.IEnumerable<T>

A collection of polygonal geometries to be intersected.

tolerance System.Double

The distance tolerance used for geometric calculations.

Returns

System.Collections.Generic.List<X>
A list containing the resulting intersection polygons, or null if the input collection is null.

Query.IntersectionPoint(Point2D, Point2D, Point2D, Point2D, bool, double) Method

Intersection of two segments/lines represented by four point2Ds with given tolerance.

public static DiGi.Geometry.Planar.Classes.Point2D? IntersectionPoint(DiGi.Geometry.Planar.Classes.Point2D? point2D_1_Start, DiGi.Geometry.Planar.Classes.Point2D? point2D_1_End, DiGi.Geometry.Planar.Classes.Point2D? point2D_2_Start, DiGi.Geometry.Planar.Classes.Point2D? point2D_2_End, bool bounded, double tolerance=1E-06);

Parameters

point2D_1_Start Point2D

Segment 1 start Point2D

point2D_1_End Point2D

Segment 1 end Point2D

point2D_2_Start Point2D

Segment 2 start Point2D

point2D_2_End Point2D

Segment 2 end Point2D

bounded System.Boolean

if bounded set to false then segments will be treated as lines (unlimited)

tolerance System.Double

tolerance

Returns

Point2D
Intersection Point2D

Query.IntersectionPoint(Point2D, Point2D, Point2D, Point2D, Point2D, Point2D, double) Method

Intersection of two segments represented by four point2Ds with given tolerance. Output points point2D_Closest1 and point2D_Closest2 are null if intersection point is on segments

public static DiGi.Geometry.Planar.Classes.Point2D? IntersectionPoint(DiGi.Geometry.Planar.Classes.Point2D? point2D_1_Start, DiGi.Geometry.Planar.Classes.Point2D? point2D_1_End, DiGi.Geometry.Planar.Classes.Point2D? point2D_2_Start, DiGi.Geometry.Planar.Classes.Point2D? point2D_2_End, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest1, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest2, double tolerance=1E-06);

Parameters

point2D_1_Start Point2D

Segment 1 start Point2D

point2D_1_End Point2D

Segment 1 end Point2D

point2D_2_Start Point2D

Segment 2 start Point2D

point2D_2_End Point2D

Segment 2 end Point2D

point2D_Closest1 Point2D

Closest point for Segment 1

point2D_Closest2 Point2D

Closest point for Segment 2

tolerance System.Double

Returns

Point2D

Query.IntersectionPoint(Segment2D, Segment2D, Point2D, Point2D, double) Method

Calculates the intersection point of two Segment2D objects.

public static DiGi.Geometry.Planar.Classes.Point2D? IntersectionPoint(DiGi.Geometry.Planar.Classes.Segment2D? segment2D_1, DiGi.Geometry.Planar.Classes.Segment2D? segment2D_2, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest1, out DiGi.Geometry.Planar.Classes.Point2D? point2D_Closest2, double tolerance=1E-06);

Parameters

segment2D_1 Segment2D

The first Segment2D object.

segment2D_2 Segment2D

The second Segment2D object.

point2D_Closest1 Point2D

When this method returns, contains the Point2D object on the first segment that is closest to the intersection or the other segment.

point2D_Closest2 Point2D

When this method returns, contains the Point2D object on the second segment that is closest to the intersection or the other segment.

tolerance System.Double

The double value used as a distance tolerance for calculating the intersection.

Returns

Point2D
A Point2D object representing the intersection point if one exists within the specified tolerance; otherwise, null.

Query.IntersectionPoint(this ILinear2D, ILinear2D, double) Method

Calculates the intersection point of two linear 2D entities.

public static DiGi.Geometry.Planar.Classes.Point2D? IntersectionPoint(this DiGi.Geometry.Planar.Interfaces.ILinear2D? linear2D_1, DiGi.Geometry.Planar.Interfaces.ILinear2D? linear2D_2, double tolerance=1E-06);

Parameters

linear2D_1 ILinear2D

The first ILinear2D entity.

linear2D_2 ILinear2D

The second ILinear2D entity.

tolerance System.Double

A System.Double value representing the distance tolerance for calculating the intersection.

Returns

Point2D
A Point2D if an intersection point is found; otherwise, null.

Query.IntersectionPoints(double, double, double, Point2D, Point2D, double) Method

Calculates the intersection points between a circle and a line defined by two points.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(double x, double y, double radius, DiGi.Geometry.Planar.Classes.Point2D? point2D_1, DiGi.Geometry.Planar.Classes.Point2D? point2D_2, double tolerance=1E-06);

Parameters

x System.Double

The X-coordinate of the center of the circle as a System.Double.

y System.Double

The Y-coordinate of the center of the circle as a System.Double.

radius System.Double

The radius of the circle as a System.Double.

point2D_1 Point2D

The first point defining the line as a Point2D?

point2D_2 Point2D

The second point defining the line as a Point2D?

tolerance System.Double

The distance tolerance used for calculations as a System.Double.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<>? containing the intersection points, or null if no intersections exist or input points are invalid.

Query.IntersectionPoints(this Circle2D, Line2D, double) Method

Calculates the intersection points between a circle and a line.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Circle2D? circle2D, DiGi.Geometry.Planar.Classes.Line2D? line2D, double tolerance=1E-06);

Parameters

circle2D Circle2D

The Circle2D instance to intersect.

line2D Line2D

The Line2D instance to intersect.

tolerance System.Double

A System.Double value representing the distance tolerance for intersection calculations.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the intersection points, or null if either input is null or required properties are missing.

Query.IntersectionPoints(this Circle2D, Segment2D, double) Method

Calculates the intersection points between a circle and a line segment.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Circle2D? circle2D, DiGi.Geometry.Planar.Classes.Segment2D? segment2D, double tolerance=1E-06);

Parameters

circle2D Circle2D

The Circle2D instance to check for intersections.

segment2D Segment2D

The Segment2D instance to check for intersections.

tolerance System.Double

A System.Double value representing the distance tolerance used for calculations.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the intersection points, or null if either input is null or the circle center is not defined.

Query.IntersectionPoints(this Circle2D, ISegmentable2D, double) Method

Calculates the intersection points between a Circle2D and an ISegmentable2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Circle2D? circle2D, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, double tolerance=1E-06);

Parameters

circle2D Circle2D

The Circle2D to check for intersections.

segmentable2D ISegmentable2D

The ISegmentable2D object to check for intersections.

tolerance System.Double

The System.Double tolerance value used for the intersection calculation.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the intersection points, or null if either input is null or no segments are found.

Query.IntersectionPoints(this Ellipse2D, Line2D, double) Method

Calculates the intersection points between an ellipse and a line.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Ellipse2D? ellipse2D, DiGi.Geometry.Planar.Classes.Line2D? line2D, double tolerance=1E-06);

Parameters

ellipse2D Ellipse2D

The Ellipse2D instance to intersect.

line2D Line2D

The Line2D instance to intersect.

tolerance System.Double

A System.Double value specifying the distance tolerance for the intersection calculation.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the intersection points, or null if either input is null.

Query.IntersectionPoints(this Ellipse2D, Segment2D, double) Method

Calculates the intersection points between an ellipse and a line segment.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Ellipse2D? ellipse2D, DiGi.Geometry.Planar.Classes.Segment2D? segment2D, double tolerance=1E-06);

Parameters

ellipse2D Ellipse2D

The Ellipse2D to intersect.

segment2D Segment2D

The Segment2D to intersect.

tolerance System.Double

The System.Double tolerance used for the intersection calculation.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the intersection points, or null if either input is null or the segment is invalid.

Query.IntersectionPoints(this Ellipse2D, ISegmentable2D, double) Method

Calculates the intersection points between an Ellipse2D and an ISegmentable2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Ellipse2D? ellipse2D, DiGi.Geometry.Planar.Interfaces.ISegmentable2D? segmentable2D, double tolerance=1E-06);

Parameters

ellipse2D Ellipse2D

The Ellipse2D to check for intersections.

segmentable2D ISegmentable2D

The ISegmentable2D object containing segments to check for intersections.

tolerance System.Double

A System.Double value representing the distance tolerance used for intersection calculations.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the intersection points if successful; otherwise, null.

Query.IntersectionPoints(this Line2D, ISegmentable2D, double) Method

Calculates the intersection points between a Line2D and an ISegmentable2D.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Line2D? line2D, DiGi.Geometry.Planar.Interfaces.ISegmentable2D segmentable2D, double tolerance=1E-06);

Parameters

line2D Line2D

The Line2D to check for intersections.

segmentable2D ISegmentable2D

The ISegmentable2D object containing segments to intersect with.

tolerance System.Double

The System.Double tolerance used for the intersection calculation.

Returns

System.Collections.Generic.List<Point2D>
A System.Collections.Generic.List<> containing the intersection points, or null if the Line2D or segmentable object is null.

Query.IntersectionPoints(this Line2D, IEnumerable<ISegmentable2D>, double) Method

Calculates the intersection points between a Line2D and a collection of ISegmentable2D objects.

public static System.Collections.Generic.List<DiGi.Geometry.Planar.Classes.Point2D>? IntersectionPoints(this DiGi.Geometry.Planar.Classes.Line2D? line2D, System.Collections.Generic.IEnumerable<DiGi.Geometry.Planar.Interfaces.ISegmentable2D>? segmentable2Ds, double tolerance=1E-06);

Parameters

line2D Line2D

The Line2D to check for intersections.

segmentable2Ds System.Collections.Generic.IEnumerable<[ISegmentable2D](DiGi.Geometry.Planar.Interfaces.md#DiGi.Geometry.Planar.Interfaces.ISegmentable2D 'DiGi.Geometry.Planar.Interfaces.

Clone this wiki locally