-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.ComputeSharp.Planar.Classes
Represents a two-dimensional coordinate or vector in a planar system.
public readonly struct Coordinate2 : DiGi.ComputeSharp.Planar.Interfaces.IGeometry2, DiGi.ComputeSharp.Core.Interfaces.IGeometryImplements IGeometry2, IGeometry
Initializes a new instance of the Coordinate2 struct with NaN values.
public Coordinate2();Initializes a new instance of the Coordinate2 struct by copying an existing coordinate.
public Coordinate2(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The source coordinate to copy.
Initializes a new instance of the Coordinate2 struct as a vector representing the difference between two points.
public Coordinate2(DiGi.ComputeSharp.Planar.Classes.Coordinate2 start, DiGi.ComputeSharp.Planar.Classes.Coordinate2 end);start Coordinate2
The starting point.
end Coordinate2
The ending point.
Initializes a new instance of the Coordinate2 struct with specified X and Y coordinates.
public Coordinate2(double x, double y);The X-coordinate.
The Y-coordinate.
The X-coordinate of the point or the X-component of the vector.
public readonly double X;The Y-coordinate of the point or the Y-component of the vector.
public readonly double Y;Performs vector addition of this coordinate and another coordinate.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Add(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The coordinate to add.
Coordinate2
A new Coordinate2 representing the sum.
Determines whether this coordinate is approximately equal to another coordinate within a specified tolerance.
public bool AlmostEquals(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate, double tolerance);coordinate Coordinate2
The coordinate to compare.
tolerance System.Double
The maximum allowed difference between coordinates.
System.Boolean
True if the coordinates are within the tolerance; otherwise, false.
Calculates the 2D cross product of this vector and another vector.
public double CrossProduct(DiGi.ComputeSharp.Planar.Classes.Coordinate2 vector);vector Coordinate2
The other vector.
System.Double
The scalar result of the 2D cross product.
Performs component-wise division of this coordinate by another coordinate.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Divide(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The divisor coordinate.
Coordinate2
A new Coordinate2 representing the result of the division.
Divides this coordinate by a scalar factor.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Divide(double factor);factor System.Double
The divisor value.
Coordinate2
A new Coordinate2 representing the result of the division.
Calculates the dot product of this vector and another vector.
public double DotProduct(DiGi.ComputeSharp.Planar.Classes.Coordinate2 vector);vector Coordinate2
The other vector.
System.Double
The scalar result of the dot product.
Determines whether this coordinate is equal to another coordinate based on exact values.
public bool Equals(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The coordinate to compare.
System.Boolean
True if the coordinates are identical or both are NaN; otherwise, false.
Determines whether this instance is equal to a specified object.
public override bool Equals(object? obj);obj System.Object
The object to compare with the current instance.
System.Boolean
True if the object is a Coordinate2 and has identical values; otherwise, false.
Calculates an approximate distance between this point and another point using a fast approximation formula.
public double GetApproximateDistance(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point);point Coordinate2
The target point.
System.Double
An approximated Euclidean distance.
Calculates the approximate length of this vector from the origin (0,0).
public double GetApproximateLength();System.Double
An approximated magnitude of the vector.
Calculates the centroid (midpoint) between this coordinate and the origin.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetCentroid();Coordinate2
A new Coordinate2 representing the midpoint.
Calculates the centroid (midpoint) between this coordinate and another point.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetCentroid(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point);point Coordinate2
The other point.
Coordinate2
A new Coordinate2 representing the midpoint.
Calculates the Euclidean distance between this coordinate and another point.
public double GetDistance(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, double tolerance);point Coordinate2
The target point.
tolerance System.Double
Tolerance used for the square root calculation.
System.Double
The distance between the two points.
Returns a hash code for the current coordinate.
public override int GetHashCode();System.Int32
An integer hash code representing the coordinate's value.
Returns a coordinate with inverted X and Y values.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetInversed();Coordinate2
A new Coordinate2 representing the inverse vector.
Calculates the magnitude (length) of this vector.
public double GetLength(double tolerance);tolerance System.Double
Tolerance used for the square root calculation.
System.Double
The length of the vector.
Translates this coordinate by a given vector.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetMoved(DiGi.ComputeSharp.Planar.Classes.Coordinate2 vector);vector Coordinate2
The translation vector.
Coordinate2
A new Coordinate2 representing the moved position.
Returns a unit vector in the same direction as this coordinate.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetNormalized(double tolerance);tolerance System.Double
Tolerance used for length calculation.
Coordinate2
A normalized Coordinate2 with a magnitude of 1.
Calculates the squared Euclidean distance between this coordinate and another.
public double GetSquaredDistance(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The target coordinate.
System.Double
The squared distance value.
Calculates the squared length of the coordinate vector (X*X + Y*Y).
public double GetSquaredLength();System.Double
The sum of the squares of the X and Y components.
Checks if this point is within the range of the specified line's bounding box expanded by a tolerance.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Line2 line, double tolerance);line Line2
The line to check against.
tolerance System.Double
The distance used to expand the bounding box.
System.Boolean
True if the point is within the expanded bounding box; otherwise, false.
Checks if this point is within the bounding box of the specified triangle expanded by a tolerance.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Triangle2 triangle, double tolerance);triangle Triangle2
The triangle to check against.
tolerance System.Double
The distance used to expand the bounding box.
System.Boolean
True if the point is within the expanded bounding box; otherwise, false.
Determines whether either the X or Y component of this coordinate is Not-a-Number (NaN).
public bool IsNaN();System.Boolean
True if X or Y is NaN; otherwise, false.
Performs a component-wise multiplication of this coordinate with another coordinate.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Multiply(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The coordinate to multiply by.
Coordinate2
A new Coordinate2 resulting from the component-wise multiplication.
Performs scalar multiplication of this coordinate by a specified factor.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Multiply(double factor);factor System.Double
The scalar value to multiply by.
Coordinate2
A new Coordinate2 resulting from the scalar multiplication.
Projects the specified coordinate onto this vector.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Project(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The coordinate to project.
Coordinate2
A new Coordinate2 representing the projection of the given coordinate onto this vector.
Subtracts another coordinate from this coordinate.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Substract(DiGi.ComputeSharp.Planar.Classes.Coordinate2 coordinate);coordinate Coordinate2
The coordinate to subtract.
Coordinate2
A new Coordinate2 representing the result of the subtraction.
Returns a string representation of the current coordinate.
public override string ToString();System.String
A formatted string containing the X and Y components.
Determines whether two Coordinate2 objects are equal.
public static bool operator ==(DiGi.ComputeSharp.Planar.Classes.Coordinate2 left, DiGi.ComputeSharp.Planar.Classes.Coordinate2 right);left Coordinate2
The first coordinate to compare.
right Coordinate2
The second coordinate to compare.
System.Boolean
True if the coordinates are equal; otherwise, false.
Determines whether two Coordinate2 objects are not equal.
public static bool operator !=(DiGi.ComputeSharp.Planar.Classes.Coordinate2 left, DiGi.ComputeSharp.Planar.Classes.Coordinate2 right);left Coordinate2
The first coordinate to compare.
right Coordinate2
The second coordinate to compare.
System.Boolean
True if the coordinates are not equal; otherwise, false.
Represents a 2D line segment or an infinite line in a planar coordinate system.
public readonly struct Line2 : DiGi.ComputeSharp.Planar.Interfaces.IGeometry2, DiGi.ComputeSharp.Core.Interfaces.IGeometryImplements IGeometry2, IGeometry
Initializes a new instance of the Line2 struct with default NaN values and unbounded flag.
public Line2();Initializes a new instance of the Line2 struct with specified boundedness and coordinate objects.
public Line2(DiGi.ComputeSharp.Core.Classes.Bool bounded, DiGi.ComputeSharp.Planar.Classes.Coordinate2 start, DiGi.ComputeSharp.Planar.Classes.Coordinate2 end);bounded Bool
Whether the line is bounded.
start Coordinate2
The starting coordinate.
end Coordinate2
The ending coordinate.
Initializes a new instance of the Line2 struct with specified boundedness and coordinates.
public Line2(DiGi.ComputeSharp.Core.Classes.Bool bounded, double x_1, double y_1, double x_2, double y_2);bounded Bool
Whether the line is bounded.
x_1 System.Double
The X coordinate of the first point.
y_1 System.Double
The Y coordinate of the first point.
x_2 System.Double
The X coordinate of the second point.
y_2 System.Double
The Y coordinate of the second point.
Initializes a new instance of the Line2 struct as a bounded line using start and end coordinates.
public Line2(DiGi.ComputeSharp.Planar.Classes.Coordinate2 start, DiGi.ComputeSharp.Planar.Classes.Coordinate2 end);start Coordinate2
The starting coordinate.
end Coordinate2
The ending coordinate.
Initializes a new instance of the Line2 struct as a bounded line using specific coordinates.
public Line2(double x_1, double y_1, double x_2, double y_2);x_1 System.Double
The X coordinate of the first point.
y_1 System.Double
The Y coordinate of the first point.
x_2 System.Double
The X coordinate of the second point.
y_2 System.Double
The Y coordinate of the second point.
Indicates whether the line is bounded (a segment) or unbounded (an infinite line).
public readonly Bool Bounded;The end coordinate of the line.
public readonly Coordinate2 End;The start coordinate of the line.
public readonly Coordinate2 Start;Calculates the approximate distance from a given point to the line.
public double GetApproximateDistance(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point);point Coordinate2
The point to measure distance from.
System.Double
The approximate distance as a double.
Calculates the approximate length of the line.
public double GetApproximateLength();System.Double
The distance between start and end, or positive infinity if the line is unbounded.
Calculates the centroid of the line.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetCentroid();Coordinate2
The coordinate representing the center point of the line.
Finds the closest point on the line to a specified target point.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetClosestPoint(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point);point Coordinate2
The target point.
Coordinate2
The coordinate on the line closest to the provided point.
Gets the normalized direction vector of the line.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetDirection(double tolerance);tolerance System.Double
The tolerance used for normalization.
Coordinate2
A normalized coordinate representing the direction.
Creates a new line that is the inverse of the current line (swapping start and end points).
public DiGi.ComputeSharp.Planar.Classes.Line2 GetInversed();Line2
A new Line2 instance with inverted coordinates.
Calculates the actual length of the line using a specified tolerance for the square root operation.
public double GetLength(double tolerance);tolerance System.Double
The precision tolerance.
System.Double
The length of the line as a double.
Gets the maximum coordinate (top-right corner) of the line's axis-aligned bounding box.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetMax();Coordinate2
The maximum X and Y coordinates as a Coordinate2.
Gets the minimum coordinate (bottom-left corner) of the line's axis-aligned bounding box.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetMin();Coordinate2
The minimum X and Y coordinates as a Coordinate2.
Moves the line by a specified translation vector.
public DiGi.ComputeSharp.Planar.Classes.Line2 GetMoved(DiGi.ComputeSharp.Planar.Classes.Coordinate2 vector);vector Coordinate2
The translation vector.
Line2
A new Line2 instance shifted by the provided vector.
Calculates the squared distance from a given point to the closest point on the line.
public double GetSquaredDistance(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point);point Coordinate2
The point to measure distance from.
System.Double
The squared distance as a double.
Calculates the squared length of the line.
public double GetSquaredLength();System.Double
The squared distance between start and end, or positive infinity if the line is unbounded.
Gets the vector representing the direction and magnitude from the start to the end of the line.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetVector();Coordinate2
A Coordinate2 representing the direction and magnitude of the line.
Determines whether a given point is within the range of this line's bounding box.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, double tolerance);point Coordinate2
The point to check.
tolerance System.Double
The overlap tolerance.
System.Boolean
True if the point is in range; otherwise, false.
Determines whether this line's bounding box overlaps with another line's bounding box within a given tolerance.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Line2 line, double tolerance);line Line2
The other line to check.
tolerance System.Double
The overlap tolerance.
System.Boolean
True if the lines are in range; otherwise, false.
Determines whether this line's bounding box overlaps with a triangle's bounding box within a given tolerance.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Triangle2 triangle, double tolerance);triangle Triangle2
The triangle to check.
tolerance System.Double
The overlap tolerance.
System.Boolean
True if the line and triangle are in range; otherwise, false.
Checks if either the start or end coordinates of the line are Not-a-Number (NaN).
public bool IsNaN();System.Boolean
True if any coordinate is NaN; otherwise, false.
Determines whether a point lies on the line within a specified squared distance tolerance.
public bool On(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, double tolerance);point Coordinate2
The point to check.
tolerance System.Double
The squared distance tolerance.
System.Boolean
True if the point is on the line; otherwise, false.
Projects a given point onto the line, returning the closest point on the line.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Project(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point);point Coordinate2
The point to project.
Coordinate2
The closest Coordinate2 on this line to the given point.
Projects another line onto this line by finding the closest points for the start and end of the given line.
public DiGi.ComputeSharp.Planar.Classes.Line2 Project(DiGi.ComputeSharp.Planar.Classes.Line2 line);line Line2
The line to project onto this line.
Line2
A new Line2 representing the projected line, or a default Line2 if the projection collapses to a point.
Returns a string representation of the line showing start and end coordinates.
public override string ToString();System.String
A formatted string containing the start and end coordinates.
public readonly struct Line2IntersectComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Planar.Classes.Line2IntersectComputeShader>Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Line2IntersectComputeShader>
Line2IntersectComputeShader(GraphicsDevice, IEnumerable<Line2>, IEnumerable<Triangle2>, bool, bool) Constructor
Initializes a new instance of the Line2IntersectComputeShader struct.
public Line2IntersectComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Planar.Classes.Line2> lines, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Planar.Classes.Triangle2> triangles, bool includeStart, bool includeEnd);graphicsDevice ComputeSharp.GraphicsDevice
The graphics device to use for allocating resources.
lines System.Collections.Generic.IEnumerable<Line2>
The collection of 2D lines to check for intersections.
triangles System.Collections.Generic.IEnumerable<Triangle2>
The collection of 2D triangles to test against.
includeStart System.Boolean
A value indicating whether to include the start point of each line in the intersection tests.
includeEnd System.Boolean
A value indicating whether to include the end point of each line in the intersection tests.
Line2IntersectComputeShader(GraphicsDevice, IEnumerable<Line2>, IEnumerable<Triangle2>, bool, bool, double) Constructor
Initializes a new instance of the Line2IntersectComputeShader struct with a custom tolerance.
public Line2IntersectComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Planar.Classes.Line2> lines, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Planar.Classes.Triangle2> triangles, bool includeStart, bool includeEnd, double tolerance);graphicsDevice ComputeSharp.GraphicsDevice
The graphics device to use for allocating resources.
lines System.Collections.Generic.IEnumerable<Line2>
The collection of 2D lines to check for intersections.
triangles System.Collections.Generic.IEnumerable<Triangle2>
The collection of 2D triangles to test against.
includeStart System.Boolean
A value indicating whether to include the start point of each line in the intersection tests.
includeEnd System.Boolean
A value indicating whether to include the end point of each line in the intersection tests.
tolerance System.Double
The tolerance value used for geometric comparison.
Line2IntersectComputeShader(ReadOnlyBuffer<Line2>, ReadOnlyBuffer<Triangle2>, ReadWriteBuffer<int>, bool, bool) Constructor
Initializes a new instance of the Line2IntersectComputeShader struct using pre-allocated buffers.
public Line2IntersectComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Line2> lines, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Triangle2> triangles, ComputeSharp.ReadWriteBuffer<int> result, bool includeStart, bool includeEnd);lines ComputeSharp.ReadOnlyBuffer<Line2>
The read-only buffer of 2D lines.
triangles ComputeSharp.ReadOnlyBuffer<Triangle2>
The read-only buffer of 2D triangles.
result ComputeSharp.ReadWriteBuffer<System.Int32>
The read-write buffer for storing the intersection results.
includeStart System.Boolean
A value indicating whether to include the start point of each line in the intersection tests.
includeEnd System.Boolean
A value indicating whether to include the end point of each line in the intersection tests.
Line2IntersectComputeShader(ReadOnlyBuffer<Line2>, ReadOnlyBuffer<Triangle2>, ReadWriteBuffer<int>, double, bool, bool) Constructor
Initializes a new instance of the Line2IntersectComputeShader struct using pre-allocated buffers and a custom tolerance.
public Line2IntersectComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Line2> lines, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Triangle2> triangles, ComputeSharp.ReadWriteBuffer<int> result, double tolerance, bool includeStart, bool includeEnd);lines ComputeSharp.ReadOnlyBuffer<Line2>
The read-only buffer of 2D lines.
triangles ComputeSharp.ReadOnlyBuffer<Triangle2>
The read-only buffer of 2D triangles.
result ComputeSharp.ReadWriteBuffer<System.Int32>
The read-write buffer for storing the intersection results.
tolerance System.Double
The tolerance value used for geometric comparison.
includeStart System.Boolean
A value indicating whether to include the start point of each line in the intersection tests.
includeEnd System.Boolean
A value indicating whether to include the end point of each line in the intersection tests.
Gets the writeable buffer containing the index of the first intersecting triangle for each line, or -1 if no intersection is found.
public readonly ReadWriteBuffer<int> Result;ComputeSharp.ReadWriteBuffer<System.Int32>
Represents the result of an intersection operation in 2D space, which can be a single point, two points, or a line segment.
public readonly struct Line2Intersection : DiGi.ComputeSharp.Planar.Interfaces.IIntersection2, DiGi.ComputeSharp.Core.Interfaces.IIntersection, DiGi.ComputeSharp.Core.Interfaces.IResultImplements IIntersection2, IIntersection, IResult
Initializes a new instance of the Line2Intersection struct with default values.
public Line2Intersection();Initializes a new instance of the Line2Intersection struct with specified solidity and the first point.
public Line2Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_1);solid Bool
The solidity flag for the intersection.
point_1 Coordinate2
The first coordinate point.
Initializes a new instance of the Line2Intersection struct with specified solidity and two coordinate points.
public Line2Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_1, DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_2);solid Bool
The solidity flag for the intersection.
point_1 Coordinate2
The first coordinate point.
point_2 Coordinate2
The second coordinate point.
Initializes a new instance of the Line2Intersection struct with the first point.
public Line2Intersection(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_1);point_1 Coordinate2
The first coordinate point.
Initializes a new instance of the Line2Intersection struct with two coordinate points.
public Line2Intersection(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_1, DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_2);point_1 Coordinate2
The first coordinate point.
point_2 Coordinate2
The second coordinate point.
Initializes a new instance of the Line2Intersection struct from an existing line.
public Line2Intersection(DiGi.ComputeSharp.Planar.Classes.Line2 line);line Line2
The line to use for initialization.
The first coordinate point of the intersection.
public readonly Coordinate2 Point_1;The second coordinate point of the intersection, used when the result is a line segment.
public readonly Coordinate2 Point_2;Indicates whether the intersection result is a solid line segment rather than discrete points.
public readonly Bool Solid;Retrieves the geometries resulting from the intersection, optionally overriding the solidity of the result.
public DiGi.ComputeSharp.Planar.Interfaces.IGeometry2[]? GetIntersectionGeometries(System.Nullable<bool> solid=null);solid System.Nullable<System.Boolean>
An optional override for whether the result should be treated as a solid geometry.
Implements GetIntersectionGeometries(Nullable<bool>)
IGeometry2[]
An array of IGeometry2 objects representing the intersection, or null if the primary point is NaN.
Converts the intersection result into a line segment if it is marked as solid and contains valid points.
public DiGi.ComputeSharp.Planar.Classes.Line2 GetLine();Line2
A Line2 representing the intersection line, or an empty line if not applicable.
Determines whether the intersection result is Not-a-Number (NaN).
public bool IsNaN();System.Boolean
True if the first point is NaN; otherwise, false.
public readonly struct Line2IntersectionComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Planar.Classes.Line2IntersectionComputeShader>Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Line2IntersectionComputeShader>
Initializes a new instance of the Line2IntersectionComputeShader struct.
public Line2IntersectionComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, DiGi.ComputeSharp.Planar.Classes.Line2 line, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Planar.Classes.Line2> lines);graphicsDevice ComputeSharp.GraphicsDevice
The graphics device to use for allocating resources.
line Line2
The primary 2D line to intersect with other lines.
lines System.Collections.Generic.IEnumerable<Line2>
The collection of 2D lines to check against the primary line.
Initializes a new instance of the Line2IntersectionComputeShader struct with a custom tolerance.
public Line2IntersectionComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, DiGi.ComputeSharp.Planar.Classes.Line2 line, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Planar.Classes.Line2> lines, double tolerance);graphicsDevice ComputeSharp.GraphicsDevice
The graphics device to use for allocating resources.
line Line2
The primary 2D line to intersect with other lines.
lines System.Collections.Generic.IEnumerable<Line2>
The collection of 2D lines to check against the primary line.
tolerance System.Double
The tolerance value used for geometric comparison.
Line2IntersectionComputeShader(Line2, ReadOnlyBuffer<Line2>, ReadWriteBuffer<Line2Intersection>) Constructor
Initializes a new instance of the Line2IntersectionComputeShader struct using pre-allocated buffers.
public Line2IntersectionComputeShader(DiGi.ComputeSharp.Planar.Classes.Line2 line, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Line2> lines, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Planar.Classes.Line2Intersection> lineIntersections);line Line2
The primary 2D line to intersect with other lines.
lines ComputeSharp.ReadOnlyBuffer<Line2>
The read-only buffer of 2D lines to check against.
lineIntersections ComputeSharp.ReadWriteBuffer<Line2Intersection>
The read-write buffer for storing the intersection results.
Line2IntersectionComputeShader(Line2, ReadOnlyBuffer<Line2>, ReadWriteBuffer<Line2Intersection>, double) Constructor
Initializes a new instance of the Line2IntersectionComputeShader struct using pre-allocated buffers and a custom tolerance.
public Line2IntersectionComputeShader(DiGi.ComputeSharp.Planar.Classes.Line2 line, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Line2> lines, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Planar.Classes.Line2Intersection> lineIntersections, double tolerance);line Line2
The primary 2D line to intersect with other lines.
lines ComputeSharp.ReadOnlyBuffer<Line2>
The read-only buffer of 2D lines to check against.
lineIntersections ComputeSharp.ReadWriteBuffer<Line2Intersection>
The read-write buffer for storing the intersection results.
tolerance System.Double
The tolerance value used for geometric comparison.
Gets the writeable buffer containing the line intersection results.
public readonly ReadWriteBuffer<Line2Intersection> LineIntersections;ComputeSharp.ReadWriteBuffer<Line2Intersection>
Executes the compute shader operation over the designated range of threads.
public void Execute();Implements Execute()
public readonly struct Line2IntersectionsComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Planar.Classes.Line2IntersectionsComputeShader>Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Line2IntersectionsComputeShader>
Line2IntersectionsComputeShader(ReadOnlyBuffer<Line2>, ReadOnlyBuffer<Triangle2>, ReadWriteBuffer<Line2Intersection>) Constructor
Initializes a new instance of the Line2IntersectionsComputeShader struct.
public Line2IntersectionsComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Line2> lines, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Triangle2> triangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Planar.Classes.Line2Intersection> lineIntersections);lines ComputeSharp.ReadOnlyBuffer<Line2>
The read-only buffer of 2D lines.
triangles ComputeSharp.ReadOnlyBuffer<Triangle2>
The read-only buffer of 2D triangles.
lineIntersections ComputeSharp.ReadWriteBuffer<Line2Intersection>
The read-write buffer for storing the intersection results.
Line2IntersectionsComputeShader(ReadOnlyBuffer<Line2>, ReadOnlyBuffer<Triangle2>, ReadWriteBuffer<Line2Intersection>, double) Constructor
Initializes a new instance of the Line2IntersectionsComputeShader struct with a custom tolerance.
public Line2IntersectionsComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Line2> lines, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Planar.Classes.Triangle2> triangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Planar.Classes.Line2Intersection> lineIntersections, double tolerance);lines ComputeSharp.ReadOnlyBuffer<Line2>
The read-only buffer of 2D lines.
triangles ComputeSharp.ReadOnlyBuffer<Triangle2>
The read-only buffer of 2D triangles.
lineIntersections ComputeSharp.ReadWriteBuffer<Line2Intersection>
The read-write buffer for storing the intersection results.
tolerance System.Double
The tolerance value used for geometric comparison.
Gets the writeable buffer containing the line-to-triangle intersection results.
public readonly ReadWriteBuffer<Line2Intersection> LineIntersections;ComputeSharp.ReadWriteBuffer<Line2Intersection>
Executes the compute shader operation over the designated range of threads.
public void Execute();Implements Execute()
Represents a two-dimensional triangle in a planar coordinate system.
public readonly struct Triangle2 : DiGi.ComputeSharp.Planar.Interfaces.IGeometry2, DiGi.ComputeSharp.Core.Interfaces.IGeometryImplements IGeometry2, IGeometry
Initializes a new instance of the Triangle2 struct with default values (NaN coordinates and not solid).
public Triangle2();Initializes a new instance of the Triangle2 struct with the specified solid state and vertices.
public Triangle2(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_1, DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_2, DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_3);solid Bool
A value indicating whether the triangle is solid.
point_1 Coordinate2
The first vertex.
point_2 Coordinate2
The second vertex.
point_3 Coordinate2
The third vertex.
The first vertex of the triangle.
public readonly Coordinate2 Point_1;The second vertex of the triangle.
public readonly Coordinate2 Point_2;The third vertex of the triangle.
public readonly Coordinate2 Point_3;A value indicating whether the triangle is solid (filled) or boundary-only.
public readonly Bool Solid;Calculates the approximate perimeter of the triangle using fast distance calculations.
public double GetApproximatePerimeter();System.Double
The approximate perimeter of the triangle.
Calculates the signed area of the triangle.
public double GetArea();System.Double
The area of the triangle.
Gets the centroid (geometric center) of the triangle.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetCentroid();Coordinate2
A Coordinate2 representing the centroid of the triangle.
Gets a new triangle with inverted vertex order (reversing winding direction).
public DiGi.ComputeSharp.Planar.Classes.Triangle2 GetInversed();Triangle2
An inverted Triangle2.
Gets one of the boundary lines of the triangle by index.
public DiGi.ComputeSharp.Planar.Classes.Line2 GetLine(int index);index System.Int32
The line index (0, 1, or 2).
Line2
The boundary Line2 at the specified index.
Gets all boundary lines of the triangle.
public DiGi.ComputeSharp.Planar.Classes.Line2[] GetLines();Line2[]
An array of three Line2 objects representing the boundary lines.
Gets the maximum coordinate bounds of the triangle.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetMax();Coordinate2
A Coordinate2 representing the maximum X and Y coordinates.
Gets the minimum coordinate bounds of the triangle.
public DiGi.ComputeSharp.Planar.Classes.Coordinate2 GetMin();Coordinate2
A Coordinate2 representing the minimum X and Y coordinates.
Translates the triangle by the specified offset vector.
public DiGi.ComputeSharp.Planar.Classes.Triangle2 GetMoved(DiGi.ComputeSharp.Planar.Classes.Coordinate2 vector);vector Coordinate2
The translation vector.
Triangle2
A translated Triangle2.
Calculates the perimeter of the triangle with the specified tolerance.
public double GetPerimeter(double tolerance);tolerance System.Double
The tolerance used for distance calculations.
System.Double
The perimeter of the triangle.
Checks if a point is within the bounding range of the triangle.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, double tolerance);point Coordinate2
The point to check.
tolerance System.Double
The distance tolerance.
System.Boolean
True if the point is within range; otherwise, false.
Checks if a line is within the bounding range of the triangle.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Line2 line, double tolerance);line Line2
The line to check.
tolerance System.Double
The distance tolerance.
System.Boolean
True if the line is within range; otherwise, false.
Checks if another triangle is within the bounding range of this triangle.
public bool InRange(DiGi.ComputeSharp.Planar.Classes.Triangle2 triangle, double tolerance);triangle Triangle2
The other triangle to check.
tolerance System.Double
The distance tolerance.
System.Boolean
True if the triangles' bounding boxes overlap; otherwise, false.
Determines whether a point lies inside the triangle using barycentric coordinates.
public bool Inside(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, double tolerance);point Coordinate2
The point to test.
tolerance System.Double
The numerical tolerance value.
System.Boolean
True if the point lies inside or on the boundary of the triangle; otherwise, false.
Checks if any of the triangle's vertices contain NaN coordinates.
public bool IsNaN();System.Boolean
True if any vertex is NaN; otherwise, false.
Determines whether a point lies on the triangle (inside if solid, or on boundary lines if not).
public bool On(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, double tolerance);point Coordinate2
The point to test.
tolerance System.Double
The tolerance value.
System.Boolean
True if the point lies on the triangle; otherwise, false.
Returns a string representation of the current triangle.
public override string ToString();System.String
A formatted string describing the triangle vertices.