Determining Extrusion or Rotation Parameters

The function

void GetRangeToSurface( const MbSurface &    surface,
                        const MbCurve3D &    curve,
                        const MbVector3D &   direction,
                        const MbAxis3D &     axis,
                        const bool           rotation,
                        const bool           operationDirection,
                        const MbCartPoint &  imagePosition,
                              double         range,
                              MbRect &       rectOnSurface,
                              MbResultType & resType );

computes the extrusion depths in the forward and backward directions or the revolution angles in the forward and backward directions for subsequent construction of a body by extruding or revolving a generatrix curve up to the given surface, and also determines the bounding box of the curve image.

The input parameters of the function are:

  • surface – the surface up to which the curve is to be extruded or revolved;

  • curve – the generatrix curve;

  • direction – the extrusion direction (used for the extrusion calculation);

  • axis – the axis of revolution (used for the revolution calculation);

  • rotation – the flag specifying the calculation type: true for revolution and false for extrusion;

  • operationDirection – the direction of the subsequent operation: forward (true) or backward (false);

  • imagePosition – the point on the surface where the image of the generatrix curve lies.

The output parameters of the function are:

  • range – the distances to the surface: range[0] is in the backward direction and range[1] is in the forward direction;

  • rectOnSurface – the bounding rectangle of the curve image on the surface;

  • resType – the operation result code: if the function succeeds, it returns rt_Success; otherwise it returns an error code from the MbResultType enumeration (see mb_operation_result.h).

The function is an auxiliary one for the ExtrusionSolid(), RevolutionSolid(), ExtrusionResult() and RevolutionResult() functions.