Click or drag to resize
Line Structure
Represents the value of start and end points in a single line segment.

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.50000.0 (5.0.20693.0)
Syntax
[SerializableAttribute]
public struct Line : IEquatable<Line>, 
	IEpsilonComparable<Line>

The Line type exposes the following members.

Constructors
  NameDescription
Public methodLine(Point3d, Point3d)
Constructs a new line segment between two points.
Public methodLine(Point3d, Vector3d)
Constructs a new line segment from start point and span vector.
Public methodLine(Point3d, Vector3d, Double)
Constructs a new line segment from start point, direction and length.
Public methodLine(Double, Double, Double, Double, Double, Double)
Constructs a new line segment between two points.
Top
Properties
  NameDescription
Public propertyBoundingBox
Gets the line's 3d axis aligned bounding box.
Public propertyCode exampleDirection
Gets the direction of this line segment. The length of the direction vector equals the length of the line segment.
Public propertyFrom
Start point of line segment.
Public propertyFromX
Gets or sets the X coordinate of the line From point.
Public propertyFromY
Gets or sets the Y coordinate of the line From point.
Public propertyFromZ
Gets or sets the Z coordinate of the line From point.
Public propertyIsValid
Gets a value indicating whether or not this line is valid. Valid lines must have valid start and end points.
Public propertyLength
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.
Public propertyTo
End point of line segment.
Public propertyToX
Gets or sets the X coordinate of the line To point.
Public propertyToY
Gets or sets the Y coordinate of the line To point.
Public propertyToZ
Gets or sets the Z coordinate of the line To point.
Public propertyUnitTangent
Gets the tangent of the line segment. Note that tangent vectors are always unit vectors.
Public propertyStatic memberUnset
Gets a line segment which has Unset end points.
Top
Methods
  NameDescription
Public methodClosestParameter
Finds the parameter on the infinite line segment that is closest to a test point.
Public methodClosestPoint
Finds the point on the (in)finite line segment that is closest to a test point.
Public methodDistanceTo
Compute the shortest distance between this line segment and a test point.
Public methodEpsilonEquals
Check that all values in other are within epsilon of the values in this
Public methodEquals(Object)
Determines whether an object is a line that has the same value as this line.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Line)
Determines whether a line has the same value as this line.
Public methodExtend
Extend the line by custom distances on both sides.
Public methodExtendThroughBox(BoundingBox)
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 methodExtendThroughBox(Box)
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 methodExtendThroughBox(BoundingBox, Double)
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 methodExtendThroughBox(Box, Double)
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 methodFlip
Flip the endpoints of the line segment.
Public methodGetHashCode
Computes a hash number that represents this line.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodMaximumDistanceTo(Line)
Finds the largest distance between this line as a finite segment and another finite segment.
Public methodMaximumDistanceTo(Point3d)
Finds the largest distance between this line as a finite segment and a test point.
Public methodMinimumDistanceTo(Line)
Finds the shortest distance between this line as a finite segment and another finite segment.
Public methodMinimumDistanceTo(Point3d)
Finds the shortest distance between this line as a finite segment and a test point.
Public methodCode examplePointAt
Evaluates the line at the specified parameter.
Public methodToNurbsCurve
Constructs a nurbs curve representation of this line. This amounts to the same as calling NurbsCurve.CreateFromLine().
Public methodToString
Contructs the string representation of this line, in the form "From,To".
(Overrides ValueTypeToString.)
Public methodTransform
Transform the line using a Transformation matrix.
Public methodStatic memberTryCreateBetweenCurves
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 methodStatic memberTryFitLineToPoints
Attempt to fit a line through a set of points.
Public methodTryGetPlane
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.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Determines whether two lines have the same value.
Public operatorStatic memberInequality
Determines whether two lines have different values.
Top
See Also