Constructing a Two-Dimensional Straight Line/Segment
The function
MbResultType Line( const MbCartPoint & point1,
const MbCartPoint & point2,
MbCurve *& result );
constructs a two-dimensional straight line based on two non-matching points.
Input parameters of the function are as follows:
point1 is the first point that lies on the straight line;
point2 is the second point that lies on the straight line.
The output parameter of the function is the constructed straight line result.
If successful, the function returns rt_Success, otherwise it returns an error code from MbResultType.
The function is declared in action_curve.h file.
The point1 parameter defines the start point of the straight line that corresponds to zero parameter value. The tangent vector (normalized derivative) of the straight line has unit length and is directed from point1 towards point2, Fig. 1:
Fig. 1
Straight line is described in subsection MbLine_Two-Dimensional_Straight_Line.
The function
MbResultType Segment( const MbCartPoint & point1,
const MbCartPoint & point2,
MbCurve *& result );
constructs a two-dimensional straight line segment based on two non-matching points.
Input parameters of the function are as follows:
point1 is the segment starting point;
point2 is the segment end point.
The output parameter of the function is the constructed line segment result.
If successful, the function returns rt_Success, otherwise it returns an error code from MbResultType enumeration.
The function is declared in action_curve.h file.
point1 parameter defines the starting point of the line segment, it corresponds to zero value of curve parameter. point2 parameter defines the end point of the line segment, it corresponds to curve parameter equal to one, see Fig. 2:
Fig. 2
Line segment is described in subsection MbLineSegment Two-Dimensional Straight Line Segment.