Skip to content

DiGi.ComputeSharp.Spatial

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

DiGi.ComputeSharp.Spatial Namespace

Classes

Create Class

public static class Create

Inheritance System.Object → Create

Methods

Create.Coordinate3s(Line3, LineAlignment, double, bool, double) Method

Generates a sequence of 3D coordinates along a specified line based on the provided distance and alignment.

public static System.Collections.Generic.List<DiGi.ComputeSharp.Spatial.Classes.Coordinate3>? Coordinate3s(DiGi.ComputeSharp.Spatial.Classes.Line3 line, DiGi.ComputeSharp.Spatial.Enums.LineAlignment lineAlignment, double distance, bool includeShorter, double tolerance);

Parameters

line Line3

The line along which to generate coordinates.

lineAlignment LineAlignment

The alignment used to distribute the points (Start, End, or Centered).

distance System.Double

The distance between each generated coordinate.

includeShorter System.Boolean

Whether to include endpoints when the total length is not a perfect multiple of the distance.

tolerance System.Double

The tolerance value used for geometric calculations and comparisons.

Returns

System.Collections.Generic.List<Coordinate3>
A list of coordinates along the line, or null if the line is shorter than the tolerance and includeShorter is false.

Create.InsertPoint(Triangle3, Coordinate3, double) Method

Splits a single triangle at a point that lies at a vertex (no split), on an edge (two triangles), or strictly inside it (three triangles). Every produced triangle inherits the source triangle's Solid flag and includes the point as a vertex.

private static System.Collections.Generic.List<DiGi.ComputeSharp.Spatial.Classes.Triangle3> InsertPoint(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

triangle Triangle3

point Coordinate3

tolerance System.Double

Returns

System.Collections.Generic.List<Triangle3>

Create.Line3Intersection(Line3, Line3, double) Method

Calculates the intersection of two 3D lines within a specified tolerance.

public static DiGi.ComputeSharp.Spatial.Classes.Line3Intersection Line3Intersection(DiGi.ComputeSharp.Spatial.Classes.Line3 line_1, DiGi.ComputeSharp.Spatial.Classes.Line3 line_2, double tolerance);

Parameters

line_1 Line3

The first 3D line.

line_2 Line3

The second 3D line.

tolerance System.Double

The numerical tolerance used for geometric comparisons and proximity checks.

Returns

Line3Intersection
A Line3Intersection object containing the intersection result, which may be empty, a single point, or a line segment in the case of coincident lines.

Create.Line3Intersection(Line3, Triangle3, double) Method

Calculates the intersection between a line and a triangle in 3D space based on a specified tolerance.

public static DiGi.ComputeSharp.Spatial.Classes.Line3Intersection Line3Intersection(DiGi.ComputeSharp.Spatial.Classes.Line3 line, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, double tolerance);

Parameters

line Line3

The line to test for intersection.

triangle Triangle3

The triangle to test for intersection.

tolerance System.Double

The tolerance value used for floating-point comparisons and proximity checks.

Returns

Line3Intersection
A Line3Intersection object representing the intersection result (e.g., a point, a line segment, or no intersection).

Create.Line3Intersections(Line3, IEnumerable<Line3>, double) Method

Calculates the intersections between a specified line and a collection of other lines using GPU acceleration.

public static System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3Intersection>? Line3Intersections(DiGi.ComputeSharp.Spatial.Classes.Line3 line, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3>? lines, double tolerance);

Parameters

line Line3

The primary line to check for intersections.

lines System.Collections.Generic.IEnumerable<Line3>

The collection of lines to test against the primary line.

tolerance System.Double

The distance tolerance used to determine if two lines are intersecting.

Returns

System.Collections.Generic.IEnumerable<Line3Intersection>
A collection of Line3Intersection results, or null if the input line is invalid, the lines collection is empty/null, or the graphics device is unavailable.

Create.ToTriangulation3(List<Triangle3>) Method

Packs a list of up to five sub-triangles into a Triangulation3.

private static DiGi.ComputeSharp.Spatial.Classes.Triangulation3 ToTriangulation3(System.Collections.Generic.List<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles);

Parameters

triangles System.Collections.Generic.List<Triangle3>

Returns

Triangulation3

Create.Triangle3Intersection(Triangle3, Line3, double) Method

Calculates the intersection between a 3D triangle and a 3D line.

public static DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection Triangle3Intersection(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, DiGi.ComputeSharp.Spatial.Classes.Line3 line, double tolerance);

Parameters

triangle Triangle3

The 3D triangle to intersect.

line Line3

The 3D line to intersect.

tolerance System.Double

The tolerance value used for the intersection calculation.

Returns

Triangle3Intersection
A Triangle3Intersection representing the result of the intersection.

Create.Triangle3Intersection(Triangle3, Triangle3, Coordinate3, bool, bool, double) Method

Calculates the intersection between two 3D triangles based on a projection vector and specific side constraints.

public static DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection Triangle3Intersection(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle_1, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle_2, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, bool frontSide, bool backSide, double tolerance);

Parameters

triangle_1 Triangle3

The first triangle.

triangle_2 Triangle3

The second triangle.

vector Coordinate3

The vector used for projecting the triangles.

frontSide System.Boolean

Whether to consider intersections on the front side.

backSide System.Boolean

Whether to consider intersections on the back side.

tolerance System.Double

The tolerance value used for precision calculations.

Returns

Triangle3Intersection
A Triangle3Intersection object containing the intersection details, or an empty instance if constraints are not met.

Create.Triangle3Intersection(Triangle3, Triangle3, double) Method

Calculates the intersection between two 3D triangles based on a specified tolerance.

public static DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection Triangle3Intersection(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle_1, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle_2, double tolerance);

Parameters

triangle_1 Triangle3

The first triangle.

triangle_2 Triangle3

The second triangle.

tolerance System.Double

The tolerance value used for precision calculations.

Returns

Triangle3Intersection
A Triangle3Intersection object containing the intersection details.

Create.Triangle3Intersections(this GraphicsDevice, IEnumerable<Triangle3>, ReadOnlyBuffer<Triangle3>, double) Method

Calculates the intersections between a collection of triangles and a GPU read-only buffer of triangles.

public static System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection>? Triangle3Intersections(this ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_1, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_2, double tolerance);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The ComputeSharp.GraphicsDevice to be used for the computation.

triangles_1 System.Collections.Generic.IEnumerable<Triangle3>

The first collection of triangles.

triangles_2 ComputeSharp.ReadOnlyBuffer<Triangle3>

A read-only buffer containing the second collection of triangles.

tolerance System.Double

The numerical tolerance used for intersection calculations.

Returns

System.Collections.Generic.IEnumerable<Triangle3Intersection>
A collection of Triangle3Intersection results, or null if any input parameters are null.

Create.Triangle3Intersections(this Triangle3, IEnumerable<Triangle3>, double) Method

Calculates the intersections between a single triangle and a collection of triangles using GPU acceleration.

public static System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection>? Triangle3Intersections(this DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, double tolerance);

Parameters

triangle Triangle3

The source triangle to check for intersections.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of triangles to intersect against.

tolerance System.Double

The numerical tolerance used for intersection calculations.

Returns

System.Collections.Generic.IEnumerable<Triangle3Intersection>
A collection of Triangle3Intersection results, or null if the input is invalid or no graphics device is available.

Create.Triangle3Intersections(this IEnumerable<Triangle3>, IEnumerable<Triangle3>, double) Method

Calculates the intersections between two collections of triangles using GPU acceleration.

public static System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection>? Triangle3Intersections(this System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_1, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_2, double tolerance);

Parameters

triangles_1 System.Collections.Generic.IEnumerable<Triangle3>

The first collection of triangles.

triangles_2 System.Collections.Generic.IEnumerable<Triangle3>

The second collection of triangles.

tolerance System.Double

The numerical tolerance used for intersection calculations.

Returns

System.Collections.Generic.IEnumerable<Triangle3Intersection>
A collection of Triangle3Intersection results, or null if either input collection is null or empty, or no graphics device is available.

Create.Triangulation3(Triangle3, Coordinate3, double) Method

Splits a triangle into smaller triangles based on a provided point and tolerance.

public static DiGi.ComputeSharp.Spatial.Classes.Triangulation3 Triangulation3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

triangle Triangle3

The original triangle to be triangulated.

point Coordinate3

The coordinate point used for splitting the triangle.

tolerance System.Double

The precision tolerance for range, interior, and boundary checks.

Returns

Triangulation3
A Triangulation3 object containing the resulting sub-triangles; returns an empty triangulation if the point is outside the triangle.

Create.Triangulation3(Triangle3, Line3, double) Method

Splits a triangle into smaller triangles based on its intersection with a provided line and tolerance.

public static DiGi.ComputeSharp.Spatial.Classes.Triangulation3 Triangulation3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, DiGi.ComputeSharp.Spatial.Classes.Line3 line, double tolerance);

Parameters

triangle Triangle3

The original triangle to be triangulated.

line Line3

The line segment used for splitting the triangle.

tolerance System.Double

The precision tolerance for intersection and boundary calculations.

Returns

Triangulation3
A Triangulation3 object containing the sub-triangles; returns an empty triangulation if no intersection occurs.

Modify Class

public static class Modify

Inheritance System.Object → Modify

Methods

Modify.Add(Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, double) Method

Adds a coordinate point based on six reference points and a specified tolerance.

public static bool Add(ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_4, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_5, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_6, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point_1 Coordinate3

A reference to the first coordinate point.

point_2 Coordinate3

A reference to the second coordinate point.

point_3 Coordinate3

A reference to the third coordinate point.

point_4 Coordinate3

A reference to the fourth coordinate point.

point_5 Coordinate3

A reference to the fifth coordinate point.

point_6 Coordinate3

A reference to the sixth coordinate point.

point Coordinate3

The coordinate point to be added.

tolerance System.Double

The tolerance value for the operation.

Returns

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

Modify.Add(Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Line3Intersection, double) Method

Adds six coordinate points to calculate a 3D line intersection within the specified tolerance.

public static bool Add(ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_4, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_5, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_6, DiGi.ComputeSharp.Spatial.Classes.Line3Intersection line3Intersection, double tolerance);

Parameters

point_1 Coordinate3

A reference to the first coordinate point.

point_2 Coordinate3

A reference to the second coordinate point.

point_3 Coordinate3

A reference to the third coordinate point.

point_4 Coordinate3

A reference to the fourth coordinate point.

point_5 Coordinate3

A reference to the fifth coordinate point.

point_6 Coordinate3

A reference to the sixth coordinate point.

line3Intersection Line3Intersection

The Line3Intersection object used to store or evaluate the intersection result.

tolerance System.Double

The precision tolerance for the intersection calculation.

Returns

System.Boolean
True if the operation was successful; otherwise, false.

Modify.Add(Coordinate3, Coordinate3, Coordinate3, double) Method

Adds a point to the line segment defined by two points within the specified tolerance.

public static bool Add(ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point_1 Coordinate3

The first endpoint of the line segment.

point_2 Coordinate3

The second endpoint of the line segment.

point Coordinate3

The point to be added.

tolerance System.Double

The tolerance value for the operation.

Returns

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

Query Class

public static class Query

Inheritance System.Object → Query

Methods

Query.Centroid(Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3) Method

Calculates the centroid of up to six 3D coordinates, ignoring any that are NaN.

public static DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Centroid(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_4, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_5, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_6);

Parameters

point_1 Coordinate3

The first coordinate.

point_2 Coordinate3

The second coordinate.

point_3 Coordinate3

The third coordinate.

point_4 Coordinate3

The fourth coordinate.

point_5 Coordinate3

The fifth coordinate.

point_6 Coordinate3

The sixth coordinate.

Returns

Coordinate3
The calculated centroid as a Coordinate3, or a default Coordinate3 if no valid points are provided.

Query.Centroid(Triangle3Intersection) Method

Calculates the centroid of a triangle intersection.

public static DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Centroid(DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection triangle3Intersection);

Parameters

triangle3Intersection Triangle3Intersection

The triangle intersection containing the points to evaluate.

Returns

Coordinate3
The calculated centroid as a Coordinate3, or a default Coordinate3 if the intersection is NaN.

Query.CompareClockwise(Coordinate2, Coordinate2, Coordinate2) Method

Compares two coordinates to determine their clockwise relationship with respect to a center point.

internal static int CompareClockwise(DiGi.ComputeSharp.Planar.Classes.Coordinate2 a, DiGi.ComputeSharp.Planar.Classes.Coordinate2 b, DiGi.ComputeSharp.Planar.Classes.Coordinate2 c);

Parameters

a Coordinate2

The first coordinate.

b Coordinate2

The second coordinate.

c Coordinate2

The center point.

Returns

System.Int32
-1 if a is clockwise from b, 1 if a is counter-clockwise, or 0 if they are collinear.

Query.Coordinate3(Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, int) Method

Returns a specific Coordinate3 from a set of six coordinates based on the provided index.

public static DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Coordinate3(ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate_1, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate_2, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate_3, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate_4, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate_5, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate_6, int index);

Parameters

coordinate_1 Coordinate3

The first coordinate.

coordinate_2 Coordinate3

The second coordinate.

coordinate_3 Coordinate3

The third coordinate.

coordinate_4 Coordinate3

The fourth coordinate.

coordinate_5 Coordinate3

The fifth coordinate.

coordinate_6 Coordinate3

The sixth coordinate.

index System.Int32

The index of the coordinate to retrieve (1-6).

Returns

Coordinate3
The Coordinate3 corresponding to the specified index, or a new default Coordinate3 if the index is out of range.

Query.First(Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3) Method

Returns the first coordinate from a set of six provided points.

public static DiGi.ComputeSharp.Spatial.Classes.Coordinate3 First(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_4, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_5, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_6);

Parameters

point_1 Coordinate3

The first coordinate point.

point_2 Coordinate3

The second coordinate point.

point_3 Coordinate3

The third coordinate point.

point_4 Coordinate3

The fourth coordinate point.

point_5 Coordinate3

The fifth coordinate point.

point_6 Coordinate3

The sixth coordinate point.

Returns

Coordinate3
The resulting Coordinate3 point.

Query.Inside(Coordinate3, IEnumerable<Triangle3>) Method

Determines whether a specified 3D point is located inside a volume defined by a collection of triangles.

public static int Inside(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3>? triangles);

Parameters

point Coordinate3

The coordinate of the point to test.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of triangles that define the boundary of the volume.

Returns

System.Int32
An integer indicating the containment status of the point relative to the volume.

Query.Inside(IEnumerable<Coordinate3>, IEnumerable<Triangle3>) Method

Determines which points from a provided collection are located inside a closed volume defined by a set of triangles.

public static System.Collections.Generic.List<int>? Inside(System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Coordinate3>? points, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3>? triangles);

Parameters

points System.Collections.Generic.IEnumerable<Coordinate3>

The collection of 3D coordinates to be tested for containment.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of triangles defining the boundary of the volume.

Returns

System.Collections.Generic.List<System.Int32>
A list containing the indices of the points that are inside the volume, or null if the operation cannot be performed.

Query.Inside(this GraphicsDevice, Coordinate3, ReadOnlyBuffer<Triangle3>) Method

Determines whether a specified point is located inside the volume defined by the provided triangles.

public static int Inside(this ComputeSharp.GraphicsDevice graphicDevice, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3>? triangles);

Parameters

graphicDevice ComputeSharp.GraphicsDevice

The graphics device used for the operation.

point Coordinate3

The 3D coordinate to test.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

A read-only buffer containing the triangles that define the boundary of the volume.

Returns

System.Int32
An integer indicating the containment status of the point relative to the volume.

Query.Inside(this GraphicsDevice, IEnumerable<Coordinate3>, ReadOnlyBuffer<Triangle3>) Method

Determines which of the specified points are located inside the volume defined by the provided triangle mesh.

public static System.Collections.Generic.List<int>? Inside(this ComputeSharp.GraphicsDevice graphicDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Coordinate3>? points, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3>? triangles);

Parameters

graphicDevice ComputeSharp.GraphicsDevice

The graphics device used to perform the spatial computation.

points System.Collections.Generic.IEnumerable<Coordinate3>

The collection of 3D coordinates to evaluate.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer containing the triangles that define the boundary of the volume.

Returns

System.Collections.Generic.List<System.Int32>
A list of indices of the points that are inside the volume, or null if the operation fails or no points are found.

Query.Intersect(Line3, IEnumerable<Triangle3>, bool, bool) Method

Determines whether a specified line segment intersects with any triangle in the provided collection.

public static bool Intersect(DiGi.ComputeSharp.Spatial.Classes.Line3 line3, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3>? triangle3s, bool includeStart, bool includeEnd);

Parameters

line3 Line3

The line segment to evaluate for intersection.

triangle3s System.Collections.Generic.IEnumerable<Triangle3>

A collection of triangles to check against the line segment.

includeStart System.Boolean

Indicates whether the start point of the line should be included in the intersection test.

includeEnd System.Boolean

Indicates whether the end point of the line should be included in the intersection test.

Returns

System.Boolean
True if an intersection is found; otherwise, false.

Query.Intersect(IEnumerable<Line3>, IEnumerable<Triangle3>, bool, bool) Method

Determines whether each line in the provided collection intersects with any of the specified 3D triangles.

public static System.Collections.Generic.List<bool>? Intersect(System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3>? line3s, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3>? triangle3s, bool includeStart, bool includeEnd);

Parameters

line3s System.Collections.Generic.IEnumerable<Line3>

The collection of 3D lines to evaluate for intersections.

triangle3s System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D triangles to test against.

includeStart System.Boolean

If set to true, the start point of the line is included in the intersection calculation.

includeEnd System.Boolean

If set to true, the end point of the line is included in the intersection calculation.

Returns

System.Collections.Generic.List<System.Boolean>
A list of boolean values indicating the intersection result for each input line, or null if the input collections are null.

Query.Intersect(this GraphicsDevice, Line3, ReadOnlyBuffer<Triangle3>, bool, bool) Method

Determines whether a 3D line intersects any of the triangles contained within the specified read-only buffer.

public static bool Intersect(this ComputeSharp.GraphicsDevice graphicDevice, DiGi.ComputeSharp.Spatial.Classes.Line3 line3, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangle3s, bool includeStart, bool includeEnd);

Parameters

graphicDevice ComputeSharp.GraphicsDevice

The graphics device used to perform the intersection calculation.

line3 Line3

The 3D line to test for intersection.

triangle3s ComputeSharp.ReadOnlyBuffer<Triangle3>

A read-only buffer containing the triangles to be tested against the line.

includeStart System.Boolean

If set to true, includes the start point of the line in the intersection test.

includeEnd System.Boolean

If set to true, includes the end point of the line in the intersection test.

Returns

System.Boolean
True if an intersection is found; otherwise, false.

Query.Intersect(this GraphicsDevice, IEnumerable<Line3>, ReadOnlyBuffer<Triangle3>, bool, bool) Method

Performs an intersection test between a collection of 3D lines and a buffer of 3D triangles using the specified graphics device.

public static System.Collections.Generic.List<bool>? Intersect(this ComputeSharp.GraphicsDevice? graphicDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3>? line3s, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3>? triangle3s, bool includeStart, bool includeEnd);

Parameters

graphicDevice ComputeSharp.GraphicsDevice

The graphics device used to perform the intersection calculations.

line3s System.Collections.Generic.IEnumerable<Line3>

An enumerable collection of 3D lines to be tested for intersections.

triangle3s ComputeSharp.ReadOnlyBuffer<Triangle3>

A read-only buffer containing the 3D triangles to test against.

includeStart System.Boolean

If set to true, includes the start point of each line in the intersection check.

includeEnd System.Boolean

If set to true, includes the end point of each line in the intersection check.

Returns

System.Collections.Generic.List<System.Boolean>
A list of boolean values indicating whether each corresponding line intersects any triangle, or null if the operation failed.

Query.Round(double, double) Method

Rounds a double-precision floating-point number to the nearest multiple of the specified tolerance.

public static double Round(double value, double tolerance);

Parameters

value System.Double

The numeric value to round.

tolerance System.Double

The precision or step size used for rounding.

Returns

System.Double
The rounded double-precision floating-point number.

Query.SameHalf(Coordinate3, Coordinate3, double) Method

Determines whether two vectors are oriented in the same half-space or direction within a specified tolerance.

public static bool SameHalf(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector_2, double tolerance);

Parameters

vector_1 Coordinate3

The first coordinate vector to evaluate.

vector_2 Coordinate3

The second coordinate vector to evaluate.

tolerance System.Double

The precision threshold used for the comparison.

Returns

System.Boolean
True if the vectors are in the same half; otherwise, false.

Query.Shading(this GraphicsDevice, ReadOnlyBuffer<Triangle3>, Coordinate3) Method

Performs shading calculations on a collection of triangles grouped by shading results, using the specified graphics device.

public static System.Collections.Generic.List<System.Collections.Generic.List<DiGi.ComputeSharp.Spatial.Classes.Triangle3>>? Shading(this ComputeSharp.GraphicsDevice graphicDevice, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangle3s, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

graphicDevice ComputeSharp.GraphicsDevice

The graphics device used to execute the shading operations.

triangle3s ComputeSharp.ReadOnlyBuffer<Triangle3>

A read-only buffer containing the triangle data to be shaded.

vector Coordinate3

The vector representing the light or view direction for the shading calculation.

Returns

System.Collections.Generic.List<System.Collections.Generic.List<Triangle3>>
A nested list of triangles grouped by shading results, or null if the operation could not be completed.

Query.Sort(Plane, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, double) Method

Sorts six 3D points clockwise relative to their projected centroid on the specified plane.

internal static void Sort(DiGi.ComputeSharp.Spatial.Classes.Plane plane, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_4, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_5, ref DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_6, double tolerance);

Parameters

plane Plane

The projection plane.

point_1 Coordinate3

The first coordinate reference.

point_2 Coordinate3

The second coordinate reference.

point_3 Coordinate3

The third coordinate reference.

point_4 Coordinate3

The fourth coordinate reference.

point_5 Coordinate3

The fifth coordinate reference.

point_6 Coordinate3

The sixth coordinate reference.

tolerance System.Double

The tolerance used for calculations.

Query.Swap(Coordinate2, Coordinate2, Coordinate2, int, int) Method

Swaps two coordinates and their corresponding indices if they are not in clockwise order with respect to the center point.

internal static void Swap(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, ref DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_1, ref DiGi.ComputeSharp.Planar.Classes.Coordinate2 point_2, ref int index_1, ref int index_2);

Parameters

point Coordinate2

The center point.

point_1 Coordinate2

The first coordinate reference.

point_2 Coordinate2

The second coordinate reference.

index_1 System.Int32

The first index reference.

index_2 System.Int32

The second index reference.

Clone this wiki locally