Generated by DocFX

Class Line

A curve representing a straight line.

Inheritance
System.Object
NurbsBase
Line
Inherited Members
NurbsBase.Weights
NurbsBase.Degree
NurbsBase.ControlPointLocations
NurbsBase.ControlPoints
NurbsBase.Knots
NurbsBase.IsClosed
NurbsBase.IsPeriodic
NurbsBase.Close()
NurbsBase.PointAtNormalizedLength(Double)
NurbsBase.ParameterAtChordLength(Double, Double)
NurbsBase.DivideByChordLength(Double)
NurbsBase.TangentAt(Double)
NurbsBase.DerivativeAt(Double, Int32)
NurbsBase.Extrema()
NurbsBase.CurvatureAt(Double)
NurbsBase.PerpendicularFrameAt(Double)
NurbsBase.ParameterAtLength(Double)
NurbsBase.ClampEnds()
NurbsBase.Join(IList<NurbsBase>)
NurbsBase.DecomposeIntoBeziers()
NurbsBase.ElevateDegree(Int32)
NurbsBase.ReduceDegree(Double)
NurbsBase.Divide(Int32)
NurbsBase.Divide(Double, Boolean)
NurbsBase.PerpendicularFrames(List<Double>, Nullable<Vector3>, Nullable<Vector3>)
NurbsBase.SplitAt(Double)
NurbsBase.SplitAt(Double[])
NurbsBase.SubCurve(Interval)
NurbsBase.Equals(NurbsBase)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
public class Line : NurbsBase, IGeometry<NurbsBase>, IEquatable<NurbsBase>, ITransformable<NurbsBase>, IGeometry<Line>, IEquatable<Line>, ITransformable<Line>
Examples
// Initializes a line by start and end point.
Point3 pt1 = new Point3(5, 0, 0);
Point3 pt2 = new Point3(15, 15, 0);
_exampleLine = new Line(pt1, pt2);

// Initializes a line by a starting point a direction and a length.
Line line = new Line(pt1, Vector3.XAxis, 15);

Constructors

| Improve this Doc View Source

Line(Point3, Point3)

Initializes a line by start point and end point.

Declaration
public Line(Point3 startPoint, Point3 endPoint)
Parameters
Type Name Description
Point3 startPoint

Start point.

Point3 endPoint

End point.

| Improve this Doc View Source

Line(Point3, Vector3, Double)

Initializes a line from a starting point, direction and length.

Declaration
public Line(Point3 startPoint, Vector3 direction, double length)
Parameters
Type Name Description
Point3 startPoint

Starting point of the line.

Vector3 direction

Direction of the line.

System.Double length

Length of the line.

Properties

| Improve this Doc View Source

Direction

Unit vector representing direction of the line.

Declaration
public Vector3 Direction { get; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

EndPoint

Gets the end point of the line.

Declaration
public override Point3 EndPoint { get; }
Property Value
Type Description
Point3
Overrides
NurbsBase.EndPoint
| Improve this Doc View Source

Length

Length of the line.

Declaration
public override double Length { get; }
Property Value
Type Description
System.Double
Overrides
NurbsBase.Length
| Improve this Doc View Source

MidPoint

Gets the middle point of the line.

Declaration
public override Point3 MidPoint { get; }
Property Value
Type Description
Point3
Overrides
NurbsBase.MidPoint
| Improve this Doc View Source

StartPoint

Gets the start point of the line.

Declaration
public override Point3 StartPoint { get; }
Property Value
Type Description
Point3
Overrides
NurbsBase.StartPoint

Methods

| Improve this Doc View Source

ClosestParameter(Point3)

Computes the parameter on the line that is closest to a test point.

Declaration
public override double ClosestParameter(Point3 point)
Parameters
Type Name Description
Point3 point

The test point.

Returns
Type Description
System.Double

The parameter on the line closest to the test point.

Overrides
NurbsBase.ClosestParameter(Point3)
| Improve this Doc View Source

ClosestPoint(Point3)

Gets the closest point on the line to the test point.

Declaration
public override Point3 ClosestPoint(Point3 point)
Parameters
Type Name Description
Point3 point

The closest point to find.

Returns
Type Description
Point3

The point on the line closest to the test point.

Overrides
NurbsBase.ClosestPoint(Point3)
| Improve this Doc View Source

Equals(Line)

Checks if the line is equal to the provided line.
Two lines are equal if the end points are the same.

Declaration
public bool Equals(Line other)
Parameters
Type Name Description
Line other

The line to compare.

Returns
Type Description
System.Boolean

True if the end points are equal, otherwise false.

| Improve this Doc View Source

Equals(Object)

Checks if the line is equal to the provided line.
Two lines are equal if the end points are the same.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The curve object.

Returns
Type Description
System.Boolean

Return true if the nurbs curves are equal.

Overrides
NurbsBase.Equals(Object)
| Improve this Doc View Source

Extend(Double, Double)

Extends the line by lengths on both side.

Declaration
public Line Extend(double startLength, double endLength)
Parameters
Type Name Description
System.Double startLength

Length to extend the line at the start point.

System.Double endLength

Length to extend the line at the end point.

Returns
Type Description
Line

The extended line.

| Improve this Doc View Source

GetBoundingBox()

Gets the bounding box in ascending fashion.

Declaration
public override BoundingBox GetBoundingBox()
Returns
Type Description
BoundingBox
Overrides
NurbsBase.GetBoundingBox()
| Improve this Doc View Source

GetHashCode()

Gets the hash code for the line.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A unique hashCode of an line.

Overrides
NurbsBase.GetHashCode()
| Improve this Doc View Source

LengthAt(Double)

Returns the length at a given parameter.

Declaration
public override double LengthAt(double t)
Parameters
Type Name Description
System.Double t

Parameter, between 0.0 and 1.0.

Returns
Type Description
System.Double

The curve length at parameter.

Overrides
NurbsBase.LengthAt(Double)
| Improve this Doc View Source

Offset(Double, Plane)

Computes the offset of the line.

Declaration
public Line Offset(double distance, Plane pln)
Parameters
Type Name Description
System.Double distance

The distance of the offset. If negative the offset will be in the opposite side.

Plane pln

The plane for the offset operation.

Returns
Type Description
Line

The offset line.

| Improve this Doc View Source

PointAt(Double)

Evaluates the line at the specified parameter.

Declaration
public override Point3 PointAt(double t)
Parameters
Type Name Description
System.Double t

Parameter to evaluate the line. Parameter should be between 0.0 and 1.0.

Returns
Type Description
Point3

The point at the specific parameter.

Overrides
NurbsBase.PointAt(Double)
| Improve this Doc View Source

PointAtLength(Double)

Evaluates the point on the curve at a given length.

Declaration
public override Point3 PointAtLength(double length)
Parameters
Type Name Description
System.Double length

Length, between 0.0 and the length of the curve.

Returns
Type Description
Point3

The point at the given length.

Overrides
NurbsBase.PointAtLength(Double)
| Improve this Doc View Source

Reverse()

Flip the endpoint of the line.

Declaration
public Line Reverse()
Returns
Type Description
Line

The line flipped.

| Improve this Doc View Source

ToString()

Constructs the string representation of the line.

Declaration
public override string ToString()
Returns
Type Description
System.String

A text string.

Overrides
NurbsBase.ToString()
| Improve this Doc View Source

Transform(TransformMatrix)

Transforms the line using the transformation matrix.

Declaration
public Line Transform(TransformMatrix t)
Parameters
Type Name Description
TransformMatrix t

Transformation matrix to apply.

Returns
Type Description
Line

A line transformed.

Implements

IGeometry<T>
System.IEquatable<T>
ITransformable<T>
IGeometry<T>
System.IEquatable<T>
ITransformable<T>