Line
References[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 48)]
[Serializable]
public struct Line : IEquatable<Line>, IEpsilonComparable<Line>, ICloneable, IFormattable
Represents the value of start and end points in a single line segment.
Constructors
Constructs a new line segment between two points.
Constructs a new line segment between two points.
Constructs a new line segment from start point, direction and length.
Properties
Gets the line's 3d axis aligned bounding box.
Returns: 3d bounding box.
Gets the direction of this line segment. The length of the direction vector equals the length of the line segment.
Gets or sets the X coordinate of the line From point.
Gets or sets the Y coordinate of the line From point.
Gets or sets the Z coordinate of the line From point.
Gets a value indicating whether or not this line is valid. Valid lines must have valid start and end points, and the points must not be equal.
Gets or sets the length of this line segment. Note that a negative length will invert the line segment without making the actual length negative. The line From point will remain fixed when a new Length is set.
Gets the tangent of the line segment. Note that tangent vectors are always unit vectors.
Value: Sets only the direction of the line, the length is maintained.
Gets a line segment which has Point3d.Unset end points.
Methods
Finds the parameter on the infinite line segment that is closest to a test point.
Returns: The parameter on the line that is closest to testPoint.
Finds the point on the (in)finite line segment that is closest to a test point.
Returns: The point on the (in)finite line that is closest to testPoint.
Compute the shortest distance between this line segment and a test point.
Returns: The shortest distance between this line segment and testPoint.
Check that all values in other are within epsilon of the values in this
Implements: EpsilonEquals
Determines whether a line has the same value as this line.
Returns: true if other has the same coordinates as this; otherwise false.
Equals
#Determines whether an object is a line that has the same value as this line.
Returns: true if obj is a Line and has the same coordinates as this; otherwise false.
Overrides: ValueType.Equals
Extend the line by custom distances on both sides.
Returns: true on success, false on failure.
Ensure the line extends all the way through a box. Note, this does not result in the shortest possible line that overlaps the box.
public bool ExtendThroughBox()
box,
Box to extend through.
additionalLength
Additional length to append at both sides of the line.
Returns: true on success, false on failure.
Ensure the line extends all the way through a box. Note, this does not result in the shortest possible line that overlaps the box.
Returns: true on success, false on failure.
Ensure the line extends all the way through a box. Note, this does not result in the shortest possible line that overlaps the box.
Returns: true on success, false on failure.
Ensure the line extends all the way through a box. Note, this does not result in the shortest possible line that overlaps the box.
Returns: true on success, false on failure.
GetHashCode
#Computes a hash number that represents this line.
Returns: A number that is not unique to the value of this line.
Overrides: ValueType.GetHashCode
Finds the largest distance between this line as a finite segment and another finite segment.
Returns: The maximum distance.
Finds the largest distance between this line as a finite segment and a test point.
Returns: The maximum distance.
Finds the shortest distance between this line as a finite segment and another finite segment.
Returns: The minimum distance.
Finds the shortest distance between this line as a finite segment and a test point.
Returns: The minimum distance.
Evaluates the line at the specified parameter.
Returns: The point at the specified parameter.
Computes a point located at a specific metric distance from the line origin (From).
If line start and end coincide, then the start point is always returned.
Returns: The newly found point.
Constructs a nurbs curve representation of this line. This amounts to the same as calling NurbsCurve.CreateFromLine().
Returns: A nurbs curve representation of this line or null if no such representation could be made.
ToString
#Constructs the string representation of this line, in the form "From,To".
Returns: A text string.
Overrides: ValueType.ToString
Formats the value of the current instance using the specified format.
[ConstOperation]
public string ToString()
format,
The format to use. -or- A null reference (
Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProvider
The provider to use to format the value. -or- A null reference (
Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.Returns: The value of the current instance in the specified format.
Transform the line using a Transformation matrix.
Returns: true on success, false on failure.
Creates a line segment between a pair of curves such that the line segment is either tangent or perpendicular to each of the curves.
public static bool TryCreateBetweenCurves()
curve0,
The first curve.
curve1,
The second curve.
ref double
t0,
Parameter value of point on curve0. Seed value at input and solution at output.
ref double
t1,
Parameter value of point on curve 0. Seed value at input and solution at output.
perpendicular0,
Find line perpendicular to (true) or tangent to (false) curve0.
perpendicular1,
Find line Perpendicular to (true) or tangent to (false) curve1.
out Line
line
The line segment if successful.
Returns: true on success, false on failure.
Attempt to fit a line through a set of points.
Returns: true on success, false on failure.
Gets a plane that contains the line. The origin of the plane is at the start of the line. If possible, a plane parallel to the world XY, YZ, or ZX plane is returned.
Returns: true on success.