Constructing a Line and a Segment
The function
MbResultType Line( const MbCartPoint3D & point1,
const MbCartPoint3D & point2,
MbCurve3D *& result );
constructs a straight line through two non-matched points in space.
The input parameters of the function are:
point1 — the first point through which the line passes;
point2 — the second point through which the line passes.
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 the MbResultType enumeration.
The function is declared in the action_curve3d.h file.
The point1 parameter defines the starting point of the line, corresponding to the zero parameter value of the line. The vector starting at point1 and ending at point2 defines the line direction, as shown in Fig. 1. The derivative of the line represents a unit-length vector.
Fig. 1
The straight line is described in the section Straight Line MbLine3D.
The function
MbResultType Segment( const MbCartPoint3D & point1,
const MbCartPoint3D & point2,
MbCurve3D *& result );
constructs a line segment between two non-matched points in space.
The input parameters of the function are:
point1 — the starting point of the segment;
point2 — the ending point of the segment.
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 the MbResultType enumeration.
The function is declared in the action_curve3d.h file.
The point1 parameter defines the starting point of the segment, corresponding to the zero parameter value of the line. The point2 parameter defines the ending point of the segment, corresponding to the line parameter value of one, as shown in Fig. 2:
Fig. 2
The line segment is described in the section Straight Line Segment MbLineSegment3D.