Skip to content

DiGi.ComputeSharp.Spatial.Classes

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

DiGi.ComputeSharp.Spatial.Classes Namespace

Structs

Coordinate3 Struct

Represents a three-dimensional coordinate or vector in a spatial coordinate system.

public readonly struct Coordinate3 : DiGi.ComputeSharp.Spatial.Interfaces.IGeometry3, DiGi.ComputeSharp.Core.Interfaces.IGeometry

Implements IGeometry3, IGeometry

Constructors

Coordinate3() Constructor

Initializes a new instance of the Coordinate3 struct with NaN coordinates.

public Coordinate3();

Coordinate3(Coordinate3) Constructor

Initializes a new instance of the Coordinate3 struct by copying an existing coordinate.

public Coordinate3(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The source coordinate to copy.

Coordinate3(Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Coordinate3 struct as a vector representing the difference between two points.

public Coordinate3(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 start, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 end);

Parameters

start Coordinate3

The starting point.

end Coordinate3

The ending point.

Coordinate3(double, double, double) Constructor

Initializes a new instance of the Coordinate3 struct with the specified X, Y, and Z components.

public Coordinate3(double x, double y, double z);

Parameters

x System.Double

The X component.

y System.Double

The Y component.

z System.Double

The Z component.

Coordinate3(double, double, double, double, double, double) Constructor

Initializes a new instance of the Coordinate3 struct as a vector representing the difference between two sets of coordinates.

public Coordinate3(double x_1, double y_1, double z_1, double x_2, double y_2, double z_2);

Parameters

x_1 System.Double

The starting X component.

y_1 System.Double

The starting Y component.

z_1 System.Double

The starting Z component.

x_2 System.Double

The ending X component.

y_2 System.Double

The ending Y component.

z_2 System.Double

The ending Z component.

Fields

Coordinate3.X Field

The X-coordinate of the point or the X-component of the vector.

public readonly double X;

Field Value

System.Double

Coordinate3.Y Field

The Y-coordinate of the point or the Y-component of the vector.

public readonly double Y;

Field Value

System.Double

Coordinate3.Z Field

The Z-coordinate of the point or the Z-component of the vector.

public readonly double Z;

Field Value

System.Double

Methods

Coordinate3.Add(Coordinate3) Method

Performs vector addition of this coordinate and another coordinate.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Add(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The coordinate to add.

Returns

Coordinate3
A new Coordinate3 representing the sum.

Coordinate3.AlmostEquals(Coordinate3, double) Method

Determines whether this coordinate is approximately equal to another coordinate within a specified tolerance.

public bool AlmostEquals(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate, double tolerance);

Parameters

coordinate Coordinate3

The coordinate to compare.

tolerance System.Double

The maximum allowed difference between components.

Returns

System.Boolean
True if the coordinates are within the tolerance; otherwise, false.

Coordinate3.CrossProduct(Coordinate3) Method

Calculates the cross product of this vector and another vector.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 CrossProduct(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

vector Coordinate3

The other vector.

Returns

Coordinate3
A new Coordinate3 representing the cross product vector.

Coordinate3.Divide(Coordinate3) Method

Performs component-wise division of this coordinate by another coordinate.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Divide(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The divisor coordinate.

Returns

Coordinate3
A new Coordinate3 representing the component-wise quotient.

Coordinate3.Divide(double) Method

Divides this coordinate by a scalar factor.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Divide(double factor);

Parameters

factor System.Double

The divisor value.

Returns

Coordinate3
A new Coordinate3 representing the quotient.

Coordinate3.DotProduct(Coordinate3) Method

Calculates the dot product of this vector and another vector.

public double DotProduct(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

vector Coordinate3

The other vector.

Returns

System.Double
The scalar result of the dot product.

Coordinate3.DotProduct(double, double, double) Method

Calculates the dot product of this vector and specified components.

public double DotProduct(double x, double y, double z);

Parameters

x System.Double

The X component of the other vector.

y System.Double

The Y component of the other vector.

z System.Double

The Z component of the other vector.

Returns

System.Double
The scalar result of the dot product.

Coordinate3.Equals(Coordinate3) Method

Determines whether this coordinate is exactly equal to another coordinate.

public bool Equals(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The coordinate to compare.

Returns

System.Boolean
True if the coordinates are identical or both are NaN; otherwise, false.

Coordinate3.Equals(object) Method

Determines whether this coordinate is equal to the specified object.

public override bool Equals(object? obj);

Parameters

obj System.Object

The object to compare with.

Returns

System.Boolean
True if the object is a Coordinate3 and has identical values; otherwise, false.

Coordinate3.GetApproximateDistance(Coordinate3) Method

Calculates an approximate distance between this point and another point using a fast approximation formula.

public double GetApproximateDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The target point.

Returns

System.Double
An approximated Euclidean distance.

Coordinate3.GetApproximateLength() Method

Calculates the approximate length of this vector from the origin (0,0,0).

public double GetApproximateLength();

Returns

System.Double
An approximated magnitude of the vector.

Coordinate3.GetCentroid() Method

Calculates the centroid (midpoint) between this coordinate and the origin.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetCentroid();

Returns

Coordinate3
A new Coordinate3 representing the midpoint.

Coordinate3.GetCentroid(Coordinate3) Method

Calculates the centroid (midpoint) between this coordinate and another point.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetCentroid(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The other point.

Returns

Coordinate3
A new Coordinate3 representing the midpoint.

Coordinate3.GetDistance(Coordinate3, double) Method

Calculates the Euclidean distance between this coordinate and another point.

public double GetDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The target point.

tolerance System.Double

Tolerance used for square root calculation.

Returns

System.Double
The distance value.

Coordinate3.GetHashCode() Method

Returns a hash code for the current coordinate.

public override int GetHashCode();

Returns

System.Int32
An integer hash code.

Coordinate3.GetInversed() Method

Returns a coordinate with inverted X, Y, and Z values.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetInversed();

Returns

Coordinate3
A new Coordinate3 representing the inverted vector.

Coordinate3.GetLength(double) Method

Calculates the magnitude (length) of this vector.

public double GetLength(double tolerance);

Parameters

tolerance System.Double

Tolerance used for square root calculation.

Returns

System.Double
The length value.

Coordinate3.GetMoved(Coordinate3) Method

Translates this coordinate by a given vector.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetMoved(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

vector Coordinate3

The translation vector.

Returns

Coordinate3
A new Coordinate3 representing the moved position.

Coordinate3.GetNormalized(double) Method

Returns a unit vector in the same direction as this coordinate.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetNormalized(double tolerance);

Parameters

tolerance System.Double

Tolerance used for length calculation.

Returns

Coordinate3
A normalized Coordinate3 with a magnitude of 1.

Coordinate3.GetSquaredDistance(Coordinate3) Method

Calculates the squared Euclidean distance between this coordinate and another.

public double GetSquaredDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The target coordinate.

Returns

System.Double
The squared distance value.

Coordinate3.GetSquaredLength() Method

Calculates the squared length of the coordinate vector (X*X + Y*Y + Z*Z).

public double GetSquaredLength();

Returns

System.Double
The sum of the squares of the components.

Coordinate3.InRange(Line3, double) Method

Checks if this point is within the range of the specified line's bounding box expanded by a tolerance.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Line3 line, double tolerance);

Parameters

line Line3

The line to check against.

tolerance System.Double

The distance tolerance used to expand the bounding box.

Returns

System.Boolean
True if the point is within range; otherwise, false.

Coordinate3.InRange(Triangle3, double) Method

Checks if this point is within the range of the specified triangle's bounding box expanded by a tolerance.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, double tolerance);

Parameters

triangle Triangle3

The triangle to check against.

tolerance System.Double

The distance tolerance used to expand the bounding box.

Returns

System.Boolean
True if the point is within range; otherwise, false.

Coordinate3.IsNaN() Method

Determines whether any component of this coordinate is Not-a-Number (NaN).

public bool IsNaN();

Returns

System.Boolean
True if X, Y, or Z is NaN; otherwise, false.

Coordinate3.Multiply(Coordinate3) Method

Performs component-wise multiplication of this coordinate with another coordinate.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Multiply(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The coordinate to multiply by.

Returns

Coordinate3
A new Coordinate3 resulting from the component-wise multiplication.

Coordinate3.Multiply(double) Method

Performs scalar multiplication of this coordinate by a specified factor.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Multiply(double factor);

Parameters

factor System.Double

The scalar value to multiply by.

Returns

Coordinate3
A new Coordinate3 resulting from the scalar multiplication.

Coordinate3.Project(Coordinate3) Method

Projects the specified coordinate onto this vector.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Project(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The coordinate to project.

Returns

Coordinate3
A new Coordinate3 representing the projection of the coordinate onto this vector.

Coordinate3.Substract(Coordinate3) Method

Subtracts another coordinate from this coordinate.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Substract(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 coordinate);

Parameters

coordinate Coordinate3

The coordinate to subtract.

Returns

Coordinate3
A new Coordinate3 representing the result of the subtraction.

Coordinate3.ToString() Method

Returns a string representation of the current coordinate.

public override string ToString();

Returns

System.String
A formatted string containing the X, Y, and Z components.

Operators

Coordinate3.operator ==(Coordinate3, Coordinate3) Operator

Determines whether two Coordinate3 objects are equal.

public static bool operator ==(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 left, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 right);

Parameters

left Coordinate3

The first coordinate to compare.

right Coordinate3

The second coordinate to compare.

Returns

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

Coordinate3.operator !=(Coordinate3, Coordinate3) Operator

Determines whether two Coordinate3 objects are not equal.

public static bool operator !=(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 left, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 right);

Parameters

left Coordinate3

The first coordinate to compare.

right Coordinate3

The second coordinate to compare.

Returns

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

Coordinate3InsideComputeShader Struct

Represents a compute shader used to determine if a 3D coordinate is inside a set of triangles.

public readonly struct Coordinate3InsideComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Spatial.Classes.Coordinate3InsideComputeShader>

Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Coordinate3InsideComputeShader>

Constructors

Coordinate3InsideComputeShader(GraphicsDevice, IEnumerable<Coordinate3>, IEnumerable<Triangle3>) Constructor

Initializes a new instance of the Coordinate3InsideComputeShader struct.

public Coordinate3InsideComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Coordinate3> points, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

points System.Collections.Generic.IEnumerable<Coordinate3>

The collection of 3D points to test.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D triangles to test against.

Coordinate3InsideComputeShader(GraphicsDevice, IEnumerable<Coordinate3>, IEnumerable<Triangle3>, double) Constructor

Initializes a new instance of the Coordinate3InsideComputeShader struct with a custom tolerance.

public Coordinate3InsideComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Coordinate3> points, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, double tolerance);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

points System.Collections.Generic.IEnumerable<Coordinate3>

The collection of 3D points to test.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D triangles to test against.

tolerance System.Double

The tolerance value used for geometric comparison.

Coordinate3InsideComputeShader(ReadOnlyBuffer<Coordinate3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<int>) Constructor

Initializes a new instance of the Coordinate3InsideComputeShader struct using pre-allocated buffers.

public Coordinate3InsideComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Coordinate3> points, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<int> result);

Parameters

points ComputeSharp.ReadOnlyBuffer<Coordinate3>

The read-only buffer of 3D points.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D triangles.

result ComputeSharp.ReadWriteBuffer<System.Int32>

The read-write buffer for storing results.

Coordinate3InsideComputeShader(ReadOnlyBuffer<Coordinate3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<int>, double) Constructor

Initializes a new instance of the Coordinate3InsideComputeShader struct using pre-allocated buffers and a custom tolerance.

public Coordinate3InsideComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Coordinate3> points, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<int> result, double tolerance);

Parameters

points ComputeSharp.ReadOnlyBuffer<Coordinate3>

The read-only buffer of 3D points.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D triangles.

result ComputeSharp.ReadWriteBuffer<System.Int32>

The read-write buffer for storing results.

tolerance System.Double

The tolerance value used for geometric comparison.

Fields

Coordinate3InsideComputeShader.Result Field

Gets the writeable buffer containing the index of the first containing triangle for each point, or -1 if the point is outside all triangles.

public readonly ReadWriteBuffer<int> Result;

Field Value

ComputeSharp.ReadWriteBuffer<System.Int32>

Line3 Struct

Represents a three-dimensional line or line segment in a spatial coordinate system.

public readonly struct Line3 : DiGi.ComputeSharp.Spatial.Interfaces.IGeometry3, DiGi.ComputeSharp.Core.Interfaces.IGeometry

Implements IGeometry3, IGeometry

Constructors

Line3() Constructor

Initializes a new instance of the Line3 struct with default values (NaN coordinates and not bounded).

public Line3();

Line3(Bool, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Line3 struct with specified boundedness between two points.

public Line3(DiGi.ComputeSharp.Core.Classes.Bool bounded, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 start, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 end);

Parameters

bounded Bool

A value indicating whether the line is bounded.

start Coordinate3

The start point.

end Coordinate3

The end point.

Line3(Bool, double, double, double, double, double, double) Constructor

Initializes a new instance of the Line3 struct with specified boundedness and coordinates.

public Line3(DiGi.ComputeSharp.Core.Classes.Bool bounded, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2);

Parameters

bounded Bool

A value indicating whether the line is bounded.

x_1 System.Double

The X component of the end point.

y_1 System.Double

The Y component of the end point.

z_1 System.Double

The Z component of the end point.

x_2 System.Double

The X component of the start point.

y_2 System.Double

The Y component of the start point.

z_2 System.Double

The Z component of the start point.

Line3(Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Line3 struct as a bounded segment between two points.

public Line3(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 start, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 end);

Parameters

start Coordinate3

The start point.

end Coordinate3

The end point.

Line3(double, double, double, double, double, double) Constructor

Initializes a new instance of the Line3 struct as a bounded segment with specified start and end coordinates.

public Line3(double x_1, double y_1, double z_1, double x_2, double y_2, double z_2);

Parameters

x_1 System.Double

The X component of the end point.

y_1 System.Double

The Y component of the end point.

z_1 System.Double

The Z component of the end point.

x_2 System.Double

The X component of the start point.

y_2 System.Double

The Y component of the start point.

z_2 System.Double

The Z component of the start point.

Fields

Line3.Bounded Field

A value indicating whether this line is bounded (representing a finite segment) or unbounded (an infinite line).

public readonly Bool Bounded;

Field Value

Bool

Line3.End Field

The end point of the line segment.

public readonly Coordinate3 End;

Field Value

Coordinate3

Line3.Start Field

The start point of the line segment.

public readonly Coordinate3 Start;

Field Value

Coordinate3

Methods

Line3.GetApproximateDistance(Coordinate3) Method

Calculates the approximate distance from a point to this line.

public double GetApproximateDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The target point.

Returns

System.Double
The approximate distance value.

Line3.GetApproximateLength() Method

Calculates the approximate length of this line.

public double GetApproximateLength();

Returns

System.Double
The approximate length of the segment, or positive infinity if the line is unbounded.

Line3.GetCentroid() Method

Gets the centroid (midpoint) of the line segment.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetCentroid();

Returns

Coordinate3
A Coordinate3 representing the centroid.

Line3.GetClosestPoint(Coordinate3) Method

Finds the point on this line that is closest to the specified point.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetClosestPoint(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The point to project onto the line.

Returns

Coordinate3
The closest Coordinate3 on this line.

Line3.GetDirection(double) Method

Calculates the unit direction vector of this line.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetDirection(double tolerance);

Parameters

tolerance System.Double

The tolerance value used for length calculation.

Returns

Coordinate3
The normalized direction Coordinate3.

Line3.GetDistance(Coordinate3, double) Method

Calculates the distance from a point to this line with a specified tolerance.

public double GetDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The target point.

tolerance System.Double

The tolerance value used for distance calculations.

Returns

System.Double
The distance value.

Line3.GetInversed() Method

Returns a new line with reversed direction.

public DiGi.ComputeSharp.Spatial.Classes.Line3 GetInversed();

Returns

Line3
A new Line3 with start and end swapped.

Line3.GetLength(double) Method

Calculates the length of this line segment.

public double GetLength(double tolerance);

Parameters

tolerance System.Double

The tolerance value used for square root calculation.

Returns

System.Double
The length of the line segment, or positive infinity if the line is unbounded.

Line3.GetMax() Method

Gets the maximum coordinate bounds of the line segment.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetMax();

Returns

Coordinate3
A Coordinate3 representing the maximum coordinates.

Line3.GetMin() Method

Gets the minimum coordinate bounds of the line segment.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetMin();

Returns

Coordinate3
A Coordinate3 representing the minimum coordinates.

Line3.GetMoved(Coordinate3) Method

Translates the line by the specified offset vector.

public DiGi.ComputeSharp.Spatial.Classes.Line3 GetMoved(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

vector Coordinate3

The translation vector.

Returns

Line3
A translated Line3.

Line3.GetSquaredDistance(Coordinate3) Method

Calculates the squared distance from a point to this line.

public double GetSquaredDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The target point.

Returns

System.Double
The squared distance value.

Line3.GetSquaredLength() Method

Calculates the squared length of the line segment.

public double GetSquaredLength();

Returns

System.Double
The squared length, or positive infinity if the line is unbounded.

Line3.GetVector() Method

Gets the vector representing this line (from start to end).

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetVector();

Returns

Coordinate3
A Coordinate3 representing the line vector.

Line3.InRange(Coordinate3, double) Method

Checks if a point is within the bounding range of the line.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The point to check.

tolerance System.Double

The tolerance value.

Returns

System.Boolean
True if the point is within range; otherwise, false.

Line3.InRange(Line3, double) Method

Checks if another line is within the bounding range of this line.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Line3 line3, double tolerance);

Parameters

line3 Line3

The other line to check.

tolerance System.Double

The tolerance value.

Returns

System.Boolean
True if the lines' bounding boxes overlap; otherwise, false.

Line3.InRange(Triangle3, double) Method

Checks if a triangle is within the bounding range of the line.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3, double tolerance);

Parameters

triangle3 Triangle3

The triangle to check.

tolerance System.Double

The tolerance value.

Returns

System.Boolean
True if the bounding boxes overlap; otherwise, false.

Line3.IsNaN() Method

Checks if either start or end point of this line is NaN.

public bool IsNaN();

Returns

System.Boolean
True if any component is NaN; otherwise, false.

Line3.On(Coordinate3, double) Method

Determines whether a point lies on the line within the specified tolerance.

public bool On(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The point to test.

tolerance System.Double

The tolerance value.

Returns

System.Boolean
True if the point lies on the line; otherwise, false.

Line3.Project(Coordinate3) Method

Projects a point onto the line.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Project(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The point to project.

Returns

Coordinate3
The projected Coordinate3 on the line.

Line3.Project(Line3) Method

Projects another line onto this line.

public DiGi.ComputeSharp.Spatial.Classes.Line3 Project(DiGi.ComputeSharp.Spatial.Classes.Line3 line);

Parameters

line Line3

The line to project.

Returns

Line3
A projected Line3, or a default line if the projection degenerates to a point.

Line3.ToString() Method

Returns a string representation of the current line.

public override string ToString();

Returns

System.String
A formatted string containing the start and end coordinates.

Line3IntersectComputeShader Struct

public readonly struct Line3IntersectComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Spatial.Classes.Line3IntersectComputeShader>

Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Line3IntersectComputeShader>

Constructors

Line3IntersectComputeShader(GraphicsDevice, IEnumerable<Line3>, IEnumerable<Triangle3>, bool, bool) Constructor

Initializes a new instance of the Line3IntersectComputeShader struct.

public Line3IntersectComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3> lines, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, bool includeStart, bool includeEnd);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

lines System.Collections.Generic.IEnumerable<Line3>

The collection of 3D lines to check for intersections.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D 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.

Line3IntersectComputeShader(GraphicsDevice, IEnumerable<Line3>, IEnumerable<Triangle3>, bool, bool, double) Constructor

Initializes a new instance of the Line3IntersectComputeShader struct with a custom tolerance.

public Line3IntersectComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3> lines, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, bool includeStart, bool includeEnd, double tolerance);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

lines System.Collections.Generic.IEnumerable<Line3>

The collection of 3D lines to check for intersections.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D 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.

Line3IntersectComputeShader(ReadOnlyBuffer<Line3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<int>, bool, bool) Constructor

Initializes a new instance of the Line3IntersectComputeShader struct using pre-allocated buffers.

public Line3IntersectComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Line3> lines, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<int> result, bool includeStart, bool includeEnd);

Parameters

lines ComputeSharp.ReadOnlyBuffer<Line3>

The read-only buffer of 3D lines.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D 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.

Line3IntersectComputeShader(ReadOnlyBuffer<Line3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<int>, double, bool, bool) Constructor

Initializes a new instance of the Line3IntersectComputeShader struct using pre-allocated buffers and a custom tolerance.

public Line3IntersectComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Line3> lines, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<int> result, double tolerance, bool includeStart, bool includeEnd);

Parameters

lines ComputeSharp.ReadOnlyBuffer<Line3>

The read-only buffer of 3D lines.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D 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.

Fields

Line3IntersectComputeShader.Result Field

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;

Field Value

ComputeSharp.ReadWriteBuffer<System.Int32>

Line3Intersection Struct

Represents the result of an intersection operation in 3D space, which can be a single point, two points, or a line segment.

public readonly struct Line3Intersection : DiGi.ComputeSharp.Spatial.Interfaces.IIntersection3, DiGi.ComputeSharp.Core.Interfaces.IIntersection, DiGi.ComputeSharp.Core.Interfaces.IResult

Implements IIntersection3, IIntersection, IResult

Constructors

Line3Intersection() Constructor

Initializes a new instance of the Line3Intersection struct with default values.

public Line3Intersection();

Line3Intersection(Bool, Coordinate3) Constructor

Initializes a new instance of the Line3Intersection struct with specified solidity and the first point.

public Line3Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1);

Parameters

solid Bool

The solidity flag for the intersection.

point_1 Coordinate3

The first coordinate point.

Line3Intersection(Bool, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Line3Intersection struct with specified solidity and two coordinate points.

public Line3Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2);

Parameters

solid Bool

The solidity flag for the intersection.

point_1 Coordinate3

The first coordinate point.

point_2 Coordinate3

The second coordinate point.

Line3Intersection(Coordinate3) Constructor

Initializes a new instance of the Line3Intersection struct with the first point.

public Line3Intersection(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1);

Parameters

point_1 Coordinate3

The first coordinate point.

Line3Intersection(Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Line3Intersection struct with two coordinate points.

public Line3Intersection(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2);

Parameters

point_1 Coordinate3

The first coordinate point.

point_2 Coordinate3

The second coordinate point.

Line3Intersection(Line3) Constructor

Initializes a new instance of the Line3Intersection struct from an existing line.

public Line3Intersection(DiGi.ComputeSharp.Spatial.Classes.Line3 line);

Parameters

line Line3

The line to use for initialization.

Fields

Line3Intersection.Point_1 Field

The first coordinate point of the intersection.

public readonly Coordinate3 Point_1;

Field Value

Coordinate3

Line3Intersection.Point_2 Field

The second coordinate point of the intersection, used when the result is a line segment.

public readonly Coordinate3 Point_2;

Field Value

Coordinate3

Line3Intersection.Solid Field

Indicates whether the intersection result is a solid line segment rather than discrete points.

public readonly Bool Solid;

Field Value

Bool

Methods

Line3Intersection.GetIntersectionGeometries(Nullable<bool>) Method

Retrieves the geometries resulting from the intersection, optionally overriding the solidity of the result.

public DiGi.ComputeSharp.Spatial.Interfaces.IGeometry3[]? GetIntersectionGeometries(System.Nullable<bool> solid=null);

Parameters

solid System.Nullable<System.Boolean>

An optional override for whether the result should be treated as a solid geometry.

Implements GetIntersectionGeometries(Nullable<bool>)

Returns

IGeometry3[]
An array of IGeometry3 objects representing the intersection, or null if the primary point is NaN.

Line3Intersection.GetLine() Method

Converts the intersection result into a line segment if it is marked as solid and contains valid points.

public DiGi.ComputeSharp.Spatial.Classes.Line3 GetLine();

Returns

Line3
A Line3 representing the intersection line, or an empty line if not applicable.

Line3Intersection.IsNaN() Method

Determines whether the intersection result is Not-a-Number (NaN).

public bool IsNaN();

Returns

System.Boolean
True if the first point is NaN; otherwise, false.

Line3IntersectionComputeShader Struct

public readonly struct Line3IntersectionComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Spatial.Classes.Line3IntersectionComputeShader>

Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Line3IntersectionComputeShader>

Constructors

Line3IntersectionComputeShader(GraphicsDevice, Line3, IEnumerable<Line3>) Constructor

Initializes a new instance of the Line3IntersectionComputeShader struct.

public Line3IntersectionComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, DiGi.ComputeSharp.Spatial.Classes.Line3 line, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3> lines);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

line Line3

The primary 3D line to intersect with other lines.

lines System.Collections.Generic.IEnumerable<Line3>

The collection of 3D lines to check against the primary line.

Line3IntersectionComputeShader(GraphicsDevice, Line3, IEnumerable<Line3>, double) Constructor

Initializes a new instance of the Line3IntersectionComputeShader struct with a custom tolerance.

public Line3IntersectionComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, DiGi.ComputeSharp.Spatial.Classes.Line3 line, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Line3> lines, double tolerance);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

line Line3

The primary 3D line to intersect with other lines.

lines System.Collections.Generic.IEnumerable<Line3>

The collection of 3D lines to check against the primary line.

tolerance System.Double

The tolerance value used for geometric comparison.

Line3IntersectionComputeShader(Line3, ReadOnlyBuffer<Line3>, ReadWriteBuffer<Line3Intersection>) Constructor

Initializes a new instance of the Line3IntersectionComputeShader struct using pre-allocated buffers.

public Line3IntersectionComputeShader(DiGi.ComputeSharp.Spatial.Classes.Line3 line, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Line3> lines, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Line3Intersection> lineIntersections);

Parameters

line Line3

The primary 3D line to intersect with other lines.

lines ComputeSharp.ReadOnlyBuffer<Line3>

The read-only buffer of 3D lines to check against.

lineIntersections ComputeSharp.ReadWriteBuffer<Line3Intersection>

The read-write buffer for storing the intersection results.

Line3IntersectionComputeShader(Line3, ReadOnlyBuffer<Line3>, ReadWriteBuffer<Line3Intersection>, double) Constructor

Initializes a new instance of the Line3IntersectionComputeShader struct using pre-allocated buffers and a custom tolerance.

public Line3IntersectionComputeShader(DiGi.ComputeSharp.Spatial.Classes.Line3 line, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Line3> lines, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Line3Intersection> lineIntersections, double tolerance);

Parameters

line Line3

The primary 3D line to intersect with other lines.

lines ComputeSharp.ReadOnlyBuffer<Line3>

The read-only buffer of 3D lines to check against.

lineIntersections ComputeSharp.ReadWriteBuffer<Line3Intersection>

The read-write buffer for storing the intersection results.

tolerance System.Double

The tolerance value used for geometric comparison.

Fields

Line3IntersectionComputeShader.LineIntersections Field

Gets the writeable buffer containing the line intersection results.

public readonly ReadWriteBuffer<Line3Intersection> LineIntersections;

Field Value

ComputeSharp.ReadWriteBuffer<Line3Intersection>

Methods

Line3IntersectionComputeShader.Execute() Method

Executes the compute shader operation over the designated range of threads.

public void Execute();

Implements Execute()

Plane Struct

Represents a three-dimensional plane defined by an origin, a normal vector, and a local Y-axis.

public readonly struct Plane : DiGi.ComputeSharp.Spatial.Interfaces.IGeometry3, DiGi.ComputeSharp.Core.Interfaces.IGeometry

Implements IGeometry3, IGeometry

Constructors

Plane() Constructor

Initializes a new instance of the Plane struct with default values (NaN coordinates).

public Plane();

Plane(Coordinate3, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Plane struct with specified origin, normal, and local Y-axis.

public Plane(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 origin, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 normal, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 axisY);

Parameters

origin Coordinate3

The origin point.

normal Coordinate3

The normal vector.

axisY Coordinate3

The local Y-axis direction vector.

Plane(Coordinate3, Coordinate3, double) Constructor

Initializes a new instance of the Plane struct with specified origin and normal, automatically deriving the local Y-axis.

public Plane(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 origin, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 normal, double tolerance);

Parameters

origin Coordinate3

The origin point.

normal Coordinate3

The normal vector.

tolerance System.Double

The tolerance value used for normalizations.

Fields

Plane.AxisY Field

The local Y-axis direction vector of the plane.

public readonly Coordinate3 AxisY;

Field Value

Coordinate3

Plane.Normal Field

The normal vector of the plane.

public readonly Coordinate3 Normal;

Field Value

Coordinate3

Plane.Origin Field

The origin point of the plane.

public readonly Coordinate3 Origin;

Field Value

Coordinate3

Methods

Plane.Convert_Line(Line2, double) Method

Transforms a 2D line on the plane back to a 3D line in space.

public DiGi.ComputeSharp.Spatial.Classes.Line3 Convert_Line(DiGi.ComputeSharp.Planar.Classes.Line2 line, double tolerance);

Parameters

line Line2

The 2D line on the plane.

tolerance System.Double

The tolerance used for calculations.

Returns

Line3
A 3D Line3 in space.

Plane.Convert_Line(Line3, double) Method

Projects a 3D line onto the plane and converts it to a local 2D line representation.

public DiGi.ComputeSharp.Planar.Classes.Line2 Convert_Line(DiGi.ComputeSharp.Spatial.Classes.Line3 line, double tolerance);

Parameters

line Line3

The 3D line in space.

tolerance System.Double

The tolerance used for calculations.

Returns

Line2
A local 2D Line2 on the plane.

Plane.Convert_Point(Coordinate2, double) Method

Converts local 2D coordinates on the plane back to a 3D point in space.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Convert_Point(DiGi.ComputeSharp.Planar.Classes.Coordinate2 point, double tolerance);

Parameters

point Coordinate2

The local 2D point on the plane.

tolerance System.Double

The tolerance used for calculations.

Returns

Coordinate3
A 3D Coordinate3 in space.

Plane.Convert_Point(Coordinate3, double) Method

Projects a 3D point onto the plane and converts it to local 2D coordinates.

public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Convert_Point(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The 3D point in space.

tolerance System.Double

The tolerance used for calculations.

Returns

Coordinate2
A local Coordinate2 representation on the plane.

Plane.Convert_Triangle(Triangle2, double) Method

Converts a local 2D triangle on the plane back to a 3D triangle in space.

public DiGi.ComputeSharp.Spatial.Classes.Triangle3 Convert_Triangle(DiGi.ComputeSharp.Planar.Classes.Triangle2 triangle, double tolerance);

Parameters

triangle Triangle2

The local 2D triangle on the plane.

tolerance System.Double

The tolerance used for calculations.

Returns

Triangle3
A 3D Triangle3 in space.

Plane.Convert_Triangle(Triangle3, double) Method

Projects a 3D triangle onto the plane and converts it to a local 2D triangle representation.

public DiGi.ComputeSharp.Planar.Classes.Triangle2 Convert_Triangle(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, double tolerance);

Parameters

triangle Triangle3

The 3D triangle in space.

tolerance System.Double

The tolerance used for calculations.

Returns

Triangle2
A local 2D Triangle2 on the plane.

Plane.Convert_Vector(Coordinate2, double) Method

Converts local 2D coordinates representing a vector on the plane back to a 3D vector.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Convert_Vector(DiGi.ComputeSharp.Planar.Classes.Coordinate2 vector, double tolerance);

Parameters

vector Coordinate2

The local 2D vector on the plane.

tolerance System.Double

The tolerance used for calculations.

Returns

Coordinate3
A 3D Coordinate3 vector in space.

Plane.Convert_Vector(Coordinate3, double) Method

Projects a 3D vector onto the plane and converts it to local 2D coordinates.

public DiGi.ComputeSharp.Planar.Classes.Coordinate2 Convert_Vector(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

vector Coordinate3

The 3D vector.

tolerance System.Double

The tolerance used for calculations.

Returns

Coordinate2
A local 2D Coordinate2 representation of the vector.

Plane.GetApproximateDistance(Coordinate3) Method

Calculates the approximate distance from a point to this plane.

public double GetApproximateDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The target point.

Returns

System.Double
The approximate distance value.

Plane.GetAxisX(double) Method

Derives the local X-axis vector of the plane.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetAxisX(double tolerance);

Parameters

tolerance System.Double

The tolerance used for normalization.

Returns

Coordinate3
The derived local X-axis Coordinate3 vector.

Plane.GetClosestPoint(Coordinate3) Method

Finds the point on this plane that is closest to the specified point.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetClosestPoint(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The point to project onto the plane.

Returns

Coordinate3
The closest Coordinate3 on this plane.

Plane.GetDistance(Coordinate3, double) Method

Calculates the distance from a point to this plane with a specified tolerance.

public double GetDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The target point.

tolerance System.Double

The tolerance value used for calculations.

Returns

System.Double
The distance value.

Plane.GetInversed() Method

Returns a new plane with inverted normal and Y-axis directions.

public DiGi.ComputeSharp.Spatial.Classes.Plane GetInversed();

Returns

Plane
An inverted Plane.

Plane.GetMoved(Coordinate3) Method

Translates the plane by the specified offset vector.

public DiGi.ComputeSharp.Spatial.Classes.Plane GetMoved(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

vector Coordinate3

The translation vector.

Returns

Plane
A translated Plane.

Plane.GetSquaredDistance(Coordinate3) Method

Calculates the squared distance from a point to this plane.

public double GetSquaredDistance(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The target point.

Returns

System.Double
The squared distance value.

Plane.IsNaN() Method

Checks if any vector or origin defining this plane is NaN.

public bool IsNaN();

Returns

System.Boolean
True if AxisY, Normal, or Origin is NaN; otherwise, false.

Plane.On(Coordinate3, double) Method

Checks if a point lies on the plane within the specified tolerance.

public bool On(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The point to test.

tolerance System.Double

The tolerance value.

Returns

System.Boolean
True if the point lies on the plane; otherwise, false.

Plane.Project(Coordinate3) Method

Orthogonally projects a point onto the plane.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Project(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point);

Parameters

point Coordinate3

The point to project.

Returns

Coordinate3
The closest 3D Coordinate3 point on the plane.

Plane.Project(Coordinate3, Coordinate3, double) Method

Projects a point onto the plane along a specified direction vector.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 Project(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

point Coordinate3

The point to project.

vector Coordinate3

The projection direction vector.

tolerance System.Double

The tolerance used for comparison checks.

Returns

Coordinate3
The projected 3D Coordinate3 point, or NaN if the projection is parallel to the plane.

Plane.Project(Line3) Method

Orthogonally projects a line onto the plane.

public DiGi.ComputeSharp.Spatial.Classes.Line3 Project(DiGi.ComputeSharp.Spatial.Classes.Line3 line);

Parameters

line Line3

The line to project.

Returns

Line3
The projected Line3.

Plane.Project(Line3, Coordinate3, double) Method

Projects a line onto the plane along a specified direction vector.

public DiGi.ComputeSharp.Spatial.Classes.Line3 Project(DiGi.ComputeSharp.Spatial.Classes.Line3 line, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

line Line3

The line to project.

vector Coordinate3

The projection direction vector.

tolerance System.Double

The tolerance value.

Returns

Line3
The projected Line3, or NaN if any point cannot be projected.

Plane.Project(Plane, Coordinate3, double) Method

Projects another plane onto this plane along a specified direction vector.

public DiGi.ComputeSharp.Spatial.Classes.Plane Project(DiGi.ComputeSharp.Spatial.Classes.Plane plane, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

plane Plane

The plane to project.

vector Coordinate3

The projection direction vector.

tolerance System.Double

The tolerance value.

Returns

Plane
The projected Plane.

Plane.Project(Plane, double) Method

Orthogonally projects another plane onto this plane.

public DiGi.ComputeSharp.Spatial.Classes.Plane Project(DiGi.ComputeSharp.Spatial.Classes.Plane plane, double tolerance);

Parameters

plane Plane

The plane to project.

tolerance System.Double

The tolerance value.

Returns

Plane
The projected Plane.

Plane.Project(Triangle3) Method

Orthogonally projects a triangle onto the plane.

public DiGi.ComputeSharp.Spatial.Classes.Triangle3 Project(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3);

Parameters

triangle3 Triangle3

The triangle to project.

Returns

Triangle3
The projected Triangle3.

Plane.Project(Triangle3, Coordinate3, double) Method

Projects a triangle onto the plane along a specified direction vector.

public DiGi.ComputeSharp.Spatial.Classes.Triangle3 Project(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

triangle Triangle3

The triangle to project.

vector Coordinate3

The projection direction vector.

tolerance System.Double

The tolerance value.

Returns

Triangle3
The projected Triangle3, or NaN if any point cannot be projected.

Plane.ToString() Method

Returns a string representation of the current plane.

public override string ToString();

Returns

System.String
A formatted string containing the origin, normal, and local Y-axis coordinates.

Triangle3 Struct

Represents a three-dimensional triangle in a spatial coordinate system.

public readonly struct Triangle3 : DiGi.ComputeSharp.Spatial.Interfaces.IGeometry3, DiGi.ComputeSharp.Core.Interfaces.IGeometry

Implements IGeometry3, IGeometry

Constructors

Triangle3() Constructor

Initializes a new instance of the Triangle3 struct with default values (NaN coordinates and not solid).

public Triangle3();

Triangle3(Bool, Coordinate3, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Triangle3 struct with specified solid state and vertices.

public Triangle3(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3);

Parameters

solid Bool

A value indicating whether the triangle is solid.

point_1 Coordinate3

The first vertex.

point_2 Coordinate3

The second vertex.

point_3 Coordinate3

The third vertex.

Triangle3(Bool, double, double, double, double, double, double, double, double, double) Constructor

Initializes a new instance of the Triangle3 struct with specified solid state and coordinates.

public Triangle3(DiGi.ComputeSharp.Core.Classes.Bool solid, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2, double x_3, double y_3, double z_3);

Parameters

solid Bool

A value indicating whether the triangle is solid.

x_1 System.Double

The X component of the first point.

y_1 System.Double

The Y component of the first point.

z_1 System.Double

The Z component of the first point.

x_2 System.Double

The X component of the second point.

y_2 System.Double

The Y component of the second point.

z_2 System.Double

The Z component of the second point.

x_3 System.Double

The X component of the third point.

y_3 System.Double

The Y component of the third point.

z_3 System.Double

The Z component of the third point.

Triangle3(Coordinate3, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Triangle3 struct with the specified vertices.

public Triangle3(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3);

Parameters

point_1 Coordinate3

The first vertex.

point_2 Coordinate3

The second vertex.

point_3 Coordinate3

The third vertex.

Triangle3(Triangle3) Constructor

Initializes a new instance of the Triangle3 struct by copying an existing triangle.

public Triangle3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3);

Parameters

triangle3 Triangle3

The source triangle to copy.

Fields

Triangle3.Point_1 Field

The first vertex of the triangle.

public readonly Coordinate3 Point_1;

Field Value

Coordinate3

Triangle3.Point_2 Field

The second vertex of the triangle.

public readonly Coordinate3 Point_2;

Field Value

Coordinate3

Triangle3.Point_3 Field

The third vertex of the triangle.

public readonly Coordinate3 Point_3;

Field Value

Coordinate3

Triangle3.Solid Field

A value indicating whether the triangle is solid (filled) or boundary-only.

public readonly Bool Solid;

Field Value

Bool

Methods

Triangle3.GetApproximatePerimeter() Method

Calculates the approximate perimeter of the triangle using fast distance calculations.

public double GetApproximatePerimeter();

Returns

System.Double
The approximate perimeter of the triangle.

Triangle3.GetArea(double) Method

Calculates the area of the 3D triangle with the specified tolerance.

public double GetArea(double tolerance);

Parameters

tolerance System.Double

The tolerance used for distance and projection calculations.

Returns

System.Double
The area of the triangle, or NaN if any component is NaN.

Triangle3.GetCentroid() Method

Gets the centroid (geometric center) of the 3D triangle.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetCentroid();

Returns

Coordinate3
A Coordinate3 representing the centroid of the triangle.

Triangle3.GetEquilateralityFactor() Method

Calculates the equilaterality factor of the triangle, indicating how close it is to an equilateral triangle.

public double GetEquilateralityFactor();

Returns

System.Double
The equilaterality factor (0 to 1, where 1 is perfectly equilateral).

Triangle3.GetInversed() Method

Gets a new triangle with inverted winding order (reversing normal direction).

public DiGi.ComputeSharp.Spatial.Classes.Triangle3 GetInversed();

Returns

Triangle3
An inverted Triangle3.

Triangle3.GetLine(int) Method

Gets one of the boundary lines of the triangle by index.

public DiGi.ComputeSharp.Spatial.Classes.Line3 GetLine(int index);

Parameters

index System.Int32

The line index (0, 1, or 2).

Returns

Line3
The boundary Line3 at the specified index.

Triangle3.GetLines() Method

Gets all boundary lines of the triangle.

public DiGi.ComputeSharp.Spatial.Classes.Line3[] GetLines();

Returns

Line3[]
An array of three Line3 objects representing the boundary lines.

Triangle3.GetMax() Method

Gets the maximum coordinate bounds of the triangle.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetMax();

Returns

Coordinate3
A Coordinate3 representing the maximum X, Y, and Z coordinates.

Triangle3.GetMin() Method

Gets the minimum coordinate bounds of the triangle.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetMin();

Returns

Coordinate3
A Coordinate3 representing the minimum X, Y, and Z coordinates.

Triangle3.GetMoved(Coordinate3) Method

Translates the triangle by the specified offset vector.

public DiGi.ComputeSharp.Spatial.Classes.Triangle3 GetMoved(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

vector Coordinate3

The translation vector.

Returns

Triangle3
A translated Triangle3.

Triangle3.GetNormal(double) Method

Calculates the normal vector of the triangle.

public DiGi.ComputeSharp.Spatial.Classes.Coordinate3 GetNormal(double tolerance);

Parameters

tolerance System.Double

The tolerance value used for vector normalization.

Returns

Coordinate3
The normalized normal vector.

Triangle3.GetPerimeter(double) Method

Calculates the perimeter of the triangle with the specified tolerance.

public double GetPerimeter(double tolerance);

Parameters

tolerance System.Double

The tolerance used for distance calculations.

Returns

System.Double
The perimeter of the triangle.

Triangle3.GetPlane(double) Method

Gets the plane defined by the triangle's vertices and its normal vector.

public DiGi.ComputeSharp.Spatial.Classes.Plane GetPlane(double tolerance);

Parameters

tolerance System.Double

The tolerance value used for normal calculation.

Returns

Plane
The Plane on which the triangle lies.

Triangle3.InRange(Coordinate3, double) Method

Checks if a point is within the range of the triangle's bounding box expanded by a tolerance.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The point to check.

tolerance System.Double

The distance used to expand the bounding box.

Returns

System.Boolean
True if the point is within range; otherwise, false.

Triangle3.InRange(Line3, double) Method

Checks if a line is within the bounding range of the triangle.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Line3 line3, double tolerance);

Parameters

line3 Line3

The line to check.

tolerance System.Double

The tolerance value.

Returns

System.Boolean
True if the bounding boxes overlap; otherwise, false.

Triangle3.InRange(Triangle3, double) Method

Checks if another triangle is within the bounding range of this triangle.

public bool InRange(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3, double tolerance);

Parameters

triangle3 Triangle3

The other triangle to check.

tolerance System.Double

The distance tolerance.

Returns

System.Boolean
True if the triangles' bounding boxes overlap; otherwise, false.

Triangle3.InRange(double, double, double, double) Method

Checks if a set of coordinates is within the bounding box of the triangle expanded by a tolerance.

public bool InRange(double x, double y, double z, double tolerance);

Parameters

x System.Double

The X component of the point.

y System.Double

The Y component of the point.

z System.Double

The Z component of the point.

tolerance System.Double

The distance used to expand the bounding box.

Returns

System.Boolean
True if the coordinates are within the expanded bounding box; otherwise, false.

Triangle3.Inside(Coordinate3, double) Method

Determines whether a point lies inside the triangle using barycentric coordinates in 3D.

public bool Inside(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The point to test.

tolerance System.Double

The numerical tolerance value.

Returns

System.Boolean
True if the point lies inside or on the boundary of the triangle; otherwise, false.

Triangle3.IsNaN() Method

Checks if any of the triangle's vertices contain NaN coordinates.

public bool IsNaN();

Returns

System.Boolean
True if any vertex is NaN; otherwise, false.

Triangle3.On(Coordinate3, double) Method

Determines whether a point lies on the triangle (inside if solid, or on boundary lines if not).

public bool On(DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point, double tolerance);

Parameters

point Coordinate3

The point to test.

tolerance System.Double

The tolerance value.

Returns

System.Boolean
True if the point lies on the triangle; otherwise, false.

Triangle3.ToString() Method

Returns a string representation of the current triangle.

public override string ToString();

Returns

System.String
A formatted string describing the triangle vertices.

Triangle3ExternalShadingComputeShader Struct

public readonly struct Triangle3ExternalShadingComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Spatial.Classes.Triangle3ExternalShadingComputeShader>

Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Triangle3ExternalShadingComputeShader>

Constructors

Triangle3ExternalShadingComputeShader(GraphicsDevice, IEnumerable<Triangle3>, IEnumerable<Triangle3>, Coordinate3) Constructor

Initializes a new instance of the Triangle3ExternalShadingComputeShader struct.

public Triangle3ExternalShadingComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> externalTriangles, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of target 3D triangles.

externalTriangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of external 3D shading/blocking triangles.

vector Coordinate3

The direction vector for the shading calculation.

Triangle3ExternalShadingComputeShader(GraphicsDevice, IEnumerable<Triangle3>, IEnumerable<Triangle3>, Coordinate3, double) Constructor

Initializes a new instance of the Triangle3ExternalShadingComputeShader struct with a custom tolerance.

public Triangle3ExternalShadingComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> externalTriangles, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of target 3D triangles.

externalTriangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of external 3D shading/blocking triangles.

vector Coordinate3

The direction vector for the shading calculation.

tolerance System.Double

The tolerance value used for geometric comparison.

Triangle3ExternalShadingComputeShader(ReadOnlyBuffer<Triangle3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>, Coordinate3) Constructor

Initializes a new instance of the Triangle3ExternalShadingComputeShader struct using pre-allocated buffers.

public Triangle3ExternalShadingComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> externalTriangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of target 3D triangles.

externalTriangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of external 3D shading triangles.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing intersection results.

vector Coordinate3

The direction vector for the shading calculation.

Triangle3ExternalShadingComputeShader(ReadOnlyBuffer<Triangle3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>, Coordinate3, double) Constructor

Initializes a new instance of the Triangle3ExternalShadingComputeShader struct using pre-allocated buffers and a custom tolerance.

public Triangle3ExternalShadingComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> externalTriangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of target 3D triangles.

externalTriangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of external 3D shading triangles.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing intersection results.

vector Coordinate3

The direction vector for the shading calculation.

tolerance System.Double

The tolerance value used for geometric comparison.

Fields

Triangle3ExternalShadingComputeShader.TriangleIntersections Field

Gets the writeable buffer containing the triangle intersection results.

public readonly ReadWriteBuffer<Triangle3Intersection> TriangleIntersections;

Field Value

ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

Methods

Triangle3ExternalShadingComputeShader.Execute() Method

Executes the compute shader operation over the designated range of threads.

public void Execute();

Implements Execute()

Triangle3Intersection Struct

Represents a 3D triangle intersection result containing up to six coordinates and a solidity flag.

public struct Triangle3Intersection : DiGi.ComputeSharp.Spatial.Interfaces.IIntersection3, DiGi.ComputeSharp.Core.Interfaces.IIntersection, DiGi.ComputeSharp.Core.Interfaces.IResult

Implements IIntersection3, IIntersection, IResult

Constructors

Triangle3Intersection() Constructor

Initializes a new instance of the Triangle3Intersection struct with default values.

public Triangle3Intersection();

Triangle3Intersection(Bool, Coordinate3) Constructor

Initializes a new instance of the Triangle3Intersection struct with a solidity flag and one point.

public Triangle3Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1);

Parameters

solid Bool

Whether the geometry is solid.

point_1 Coordinate3

The first coordinate.

Triangle3Intersection(Bool, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Triangle3Intersection struct with a solidity flag and two points.

public Triangle3Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2);

Parameters

solid Bool

Whether the geometry is solid.

point_1 Coordinate3

The first coordinate.

point_2 Coordinate3

The second coordinate.

Triangle3Intersection(Bool, Coordinate3, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Triangle3Intersection struct with a solidity flag and three points.

public Triangle3Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_1, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_2, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 point_3);

Parameters

solid Bool

Whether the geometry is solid.

point_1 Coordinate3

The first coordinate.

point_2 Coordinate3

The second coordinate.

point_3 Coordinate3

The third coordinate.

Triangle3Intersection(Bool, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3, Coordinate3) Constructor

Initializes a new instance of the Triangle3Intersection struct with a solidity flag and six points.

public Triangle3Intersection(DiGi.ComputeSharp.Core.Classes.Bool solid, 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

solid Bool

Whether the geometry is solid.

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.

Triangle3Intersection(Line3) Constructor

Initializes a new instance of the Triangle3Intersection struct from a Line3.

public Triangle3Intersection(DiGi.ComputeSharp.Spatial.Classes.Line3 line);

Parameters

line Line3

The line used to initialize the intersection points.

Triangle3Intersection(Line3Intersection) Constructor

Initializes a new instance of the Triangle3Intersection struct from a Line3Intersection.

public Triangle3Intersection(DiGi.ComputeSharp.Spatial.Classes.Line3Intersection line3Intersection);

Parameters

line3Intersection Line3Intersection

The line intersection to convert from.

Fields

Triangle3Intersection.Point_1 Field

The first coordinate of the intersection.

public readonly Coordinate3 Point_1;

Field Value

Coordinate3

Triangle3Intersection.Point_2 Field

The second coordinate of the intersection.

public readonly Coordinate3 Point_2;

Field Value

Coordinate3

Triangle3Intersection.Point_3 Field

The third coordinate of the intersection.

public readonly Coordinate3 Point_3;

Field Value

Coordinate3

Triangle3Intersection.Point_4 Field

The fourth coordinate of the intersection.

public readonly Coordinate3 Point_4;

Field Value

Coordinate3

Triangle3Intersection.Point_5 Field

The fifth coordinate of the intersection.

public readonly Coordinate3 Point_5;

Field Value

Coordinate3

Triangle3Intersection.Point_6 Field

The sixth coordinate of the intersection.

public readonly Coordinate3 Point_6;

Field Value

Coordinate3

Triangle3Intersection.Solid Field

Indicates whether the intersection is considered a solid geometry.

public readonly Bool Solid;

Field Value

Bool

Methods

Triangle3Intersection.GetIntersectionGeometries(Nullable<bool>) Method

Retrieves the intersection geometries based on the available points and solidity.

public DiGi.ComputeSharp.Spatial.Interfaces.IGeometry3[]? GetIntersectionGeometries(System.Nullable<bool> solid=null);

Parameters

solid System.Nullable<System.Boolean>

Optional override for the solidity flag.

Implements GetIntersectionGeometries(Nullable<bool>)

Returns

IGeometry3[]
An array of 3D geometries, or null if no valid points exist.

Triangle3Intersection.IsNaN() Method

Determines whether the intersection is not a number (NaN), indicating it is invalid or empty.

public bool IsNaN();

Returns

System.Boolean
True if the first point is NaN; otherwise, false.

Triangle3IntersectionComputeShader Struct

public readonly struct Triangle3IntersectionComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Spatial.Classes.Triangle3IntersectionComputeShader>

Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Triangle3IntersectionComputeShader>

Constructors

Triangle3IntersectionComputeShader(GraphicsDevice, Triangle3, IEnumerable<Triangle3>) Constructor

Initializes a new instance of the Triangle3IntersectionComputeShader struct.

public Triangle3IntersectionComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

triangle Triangle3

The primary 3D triangle to intersect with other triangles.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D triangles to check against the primary triangle.

Triangle3IntersectionComputeShader(GraphicsDevice, Triangle3, IEnumerable<Triangle3>, double) Constructor

Initializes a new instance of the Triangle3IntersectionComputeShader struct with a custom tolerance.

public Triangle3IntersectionComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, double tolerance);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

triangle Triangle3

The primary 3D triangle to intersect with other triangles.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D triangles to check against the primary triangle.

tolerance System.Double

The tolerance value used for geometric comparison.

Triangle3IntersectionComputeShader(Triangle3, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>) Constructor

Initializes a new instance of the Triangle3IntersectionComputeShader struct using pre-allocated buffers.

public Triangle3IntersectionComputeShader(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections);

Parameters

triangle Triangle3

The primary 3D triangle to intersect with other triangles.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D triangles to check against.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing intersection results.

Triangle3IntersectionComputeShader(Triangle3, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>, double) Constructor

Initializes a new instance of the Triangle3IntersectionComputeShader struct using pre-allocated buffers and a custom tolerance.

public Triangle3IntersectionComputeShader(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections, double tolerance);

Parameters

triangle Triangle3

The primary 3D triangle to intersect with other triangles.

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D triangles to check against.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing intersection results.

tolerance System.Double

The tolerance value used for geometric comparison.

Fields

Triangle3IntersectionComputeShader.TriangleIntersections Field

Gets the writeable buffer containing the triangle intersection results.

public readonly ReadWriteBuffer<Triangle3Intersection> TriangleIntersections;

Field Value

ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

Methods

Triangle3IntersectionComputeShader.Execute() Method

Executes the compute shader operation over the designated range of threads.

public void Execute();

Implements Execute()

Triangle3IntersectionsComputeShader Struct

public readonly struct Triangle3IntersectionsComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Spatial.Classes.Triangle3IntersectionsComputeShader>

Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Triangle3IntersectionsComputeShader>

Constructors

Triangle3IntersectionsComputeShader(ReadOnlyBuffer<Triangle3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>) Constructor

Initializes a new instance of the Triangle3IntersectionsComputeShader struct.

public Triangle3IntersectionsComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_1, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_2, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections);

Parameters

triangles_1 ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of the first collection of 3D triangles.

triangles_2 ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of the second collection of 3D triangles.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing intersection results.

Triangle3IntersectionsComputeShader(ReadOnlyBuffer<Triangle3>, ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>, double) Constructor

Initializes a new instance of the Triangle3IntersectionsComputeShader struct with a custom tolerance.

public Triangle3IntersectionsComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_1, ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles_2, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections, double tolerance);

Parameters

triangles_1 ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of the first collection of 3D triangles.

triangles_2 ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of the second collection of 3D triangles.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing intersection results.

tolerance System.Double

The tolerance value used for geometric comparison.

Fields

Triangle3IntersectionsComputeShader.TriangleIntersections Field

Gets the writeable buffer containing the triangle-to-triangle intersection results.

public readonly ReadWriteBuffer<Triangle3Intersection> TriangleIntersections;

Field Value

ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

Methods

Triangle3IntersectionsComputeShader.Execute() Method

Executes the compute shader operation over the designated range of threads.

public void Execute();

Implements Execute()

Triangle3ShadingComputeShader Struct

public readonly struct Triangle3ShadingComputeShader : ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<DiGi.ComputeSharp.Spatial.Classes.Triangle3ShadingComputeShader>

Implements ComputeSharp.IComputeShader, ComputeSharp.Descriptors.IComputeShaderDescriptor<Triangle3ShadingComputeShader>

Constructors

Triangle3ShadingComputeShader(GraphicsDevice, IEnumerable<Triangle3>, Coordinate3) Constructor

Initializes a new instance of the Triangle3ShadingComputeShader struct.

public Triangle3ShadingComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D triangles to test against each other for shading.

vector Coordinate3

The direction vector for the shading calculation.

Triangle3ShadingComputeShader(GraphicsDevice, IEnumerable<Triangle3>, Coordinate3, double) Constructor

Initializes a new instance of the Triangle3ShadingComputeShader struct with a custom tolerance.

public Triangle3ShadingComputeShader(ComputeSharp.GraphicsDevice graphicsDevice, System.Collections.Generic.IEnumerable<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

graphicsDevice ComputeSharp.GraphicsDevice

The graphics device to use for allocating resources.

triangles System.Collections.Generic.IEnumerable<Triangle3>

The collection of 3D triangles to test against each other for shading.

vector Coordinate3

The direction vector for the shading calculation.

tolerance System.Double

The tolerance value used for geometric comparison.

Triangle3ShadingComputeShader(ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>, Coordinate3) Constructor

Initializes a new instance of the Triangle3ShadingComputeShader struct using pre-allocated buffers.

public Triangle3ShadingComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector);

Parameters

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D triangles to test against each other.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing shading results.

vector Coordinate3

The direction vector for the shading calculation.

Triangle3ShadingComputeShader(ReadOnlyBuffer<Triangle3>, ReadWriteBuffer<Triangle3Intersection>, Coordinate3, double) Constructor

Initializes a new instance of the Triangle3ShadingComputeShader struct using pre-allocated buffers and a custom tolerance.

public Triangle3ShadingComputeShader(ComputeSharp.ReadOnlyBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3> triangles, ComputeSharp.ReadWriteBuffer<DiGi.ComputeSharp.Spatial.Classes.Triangle3Intersection> triangleIntersections, DiGi.ComputeSharp.Spatial.Classes.Coordinate3 vector, double tolerance);

Parameters

triangles ComputeSharp.ReadOnlyBuffer<Triangle3>

The read-only buffer of 3D triangles to test against each other.

triangleIntersections ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

The read-write buffer for storing shading results.

vector Coordinate3

The direction vector for the shading calculation.

tolerance System.Double

The tolerance value used for geometric comparison.

Fields

Triangle3ShadingComputeShader.TriangleIntersections Field

Gets the writeable buffer containing the triangle shading intersection results.

public readonly ReadWriteBuffer<Triangle3Intersection> TriangleIntersections;

Field Value

ComputeSharp.ReadWriteBuffer<Triangle3Intersection>

Methods

Triangle3ShadingComputeShader.Execute() Method

Executes the compute shader operation over the designated range of threads.

public void Execute();

Implements Execute()

Triangulation3 Struct

Represents a 3D triangulation consisting of up to five triangles.

public readonly struct Triangulation3

Constructors

Triangulation3() Constructor

Initializes a new instance of the Triangulation3 struct with default values.

public Triangulation3();

Triangulation3(Triangle3) Constructor

Initializes a new instance of the Triangulation3 struct with one specified triangle.

public Triangulation3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3);

Parameters

triangle3 Triangle3

The first triangle to assign.

Triangulation3(Triangle3, Triangle3) Constructor

Initializes a new instance of the Triangulation3 struct with two specified triangles.

public Triangulation3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_1, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_2);

Parameters

triangle3_1 Triangle3

The first triangle to assign.

triangle3_2 Triangle3

The second triangle to assign.

Triangulation3(Triangle3, Triangle3, Triangle3) Constructor

Initializes a new instance of the Triangulation3 struct with three specified triangles.

public Triangulation3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_1, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_2, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_3);

Parameters

triangle3_1 Triangle3

The first triangle to assign.

triangle3_2 Triangle3

The second triangle to assign.

triangle3_3 Triangle3

The third triangle to assign.

Triangulation3(Triangle3, Triangle3, Triangle3, Triangle3) Constructor

Initializes a new instance of the Triangulation3 struct with four specified triangles.

public Triangulation3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_1, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_2, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_3, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_4);

Parameters

triangle3_1 Triangle3

The first triangle to assign.

triangle3_2 Triangle3

The second triangle to assign.

triangle3_3 Triangle3

The third triangle to assign.

triangle3_4 Triangle3

The fourth triangle to assign.

Triangulation3(Triangle3, Triangle3, Triangle3, Triangle3, Triangle3) Constructor

Initializes a new instance of the Triangulation3 struct with five specified triangles.

public Triangulation3(DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_1, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_2, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_3, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_4, DiGi.ComputeSharp.Spatial.Classes.Triangle3 triangle3_5);

Parameters

triangle3_1 Triangle3

The first triangle to assign.

triangle3_2 Triangle3

The second triangle to assign.

triangle3_3 Triangle3

The third triangle to assign.

triangle3_4 Triangle3

The fourth triangle to assign.

triangle3_5 Triangle3

The fifth triangle to assign.

Fields

Triangulation3.triangle_1 Field

The first triangle in the triangulation.

public readonly Triangle3 triangle_1;

Field Value

Triangle3

Triangulation3.triangle_2 Field

The second triangle in the triangulation.

public readonly Triangle3 triangle_2;

Field Value

Triangle3

Triangulation3.triangle_3 Field

The third triangle in the triangulation.

public readonly Triangle3 triangle_3;

Field Value

Triangle3

Triangulation3.triangle_4 Field

The fourth triangle in the triangulation.

public readonly Triangle3 triangle_4;

Field Value

Triangle3

Triangulation3.triangle_5 Field

The fifth triangle in the triangulation.

public readonly Triangle3 triangle_5;

Field Value

Triangle3

Methods

Triangulation3.IsNaN() Method

Checks if the triangulation contains NaN values by evaluating the first triangle.

public bool IsNaN();

Returns

System.Boolean
True if the first triangle is NaN; otherwise, false.

Clone this wiki locally