HM_ExtAPI::CurveComposedGetSegment()

Returns individual segments of composed curve.

Syntax

bool CurveComposedGetSegment(
const HM_EntityGeometryCurve& curve,
int iseg,
HM_EntityGeometryCurve& segment,
double& start_param,
double& end_param,
double& seg_start_param,
double& seg_end_param
);

Type

HyperMesh Ext API

Description

The function expects that the type of curve object is HM_ExtAPI::COMPOSED_CURVE(). Application should call the function HM_ExtAPI::GeomCurveGetType() to verify the type before calling CurveComposedGetSegment function.

Use the function HM_ExtAPI::CurveComposedGetSize() to get number of segments in composed curve.

Composed curve geometry is defined by its curve segments. The parametric range of the composed curve is subdivided into parametric segment with each segment corresponding to one of the curve segments of the composed curve. Depending on the location of the composed curve parameter in one of the parametric segments corresponding curve segment is used to calculate the curve point for this parameter.

Subdivision of parametric range of the composed curve is defined by a set of parametric values {tα} with index α taking the values in the range 0 … N and N is the number of curve segments. For parametric value t such that

tα ≤ t ≤ tα+1

the point on the composed curve is calculated as

C(t) = Cα(τ)

where the “local” parameter τ is obtained by mapping from global parameter t as

τ = τα, 0 + (τα, 1 - τα, 0) (t - tα) / (tα+1 - tα) The following table clarifies correspondence between parameters used in the equation above and parameter values returned by the function CurveComposedGetSegment.

Parameters used by CurveComposedGetSegment Composed curve parameters
iseg α
segment
start_param
end_param tα+1
seg_start_param τα, 0
seg_end_param τα, 1
Parameters returned by CurveComposedGetSegment Composed curve parameters
number_of_segments N

If the function succeeds, the return value is true. If the function fails, the return value is false. To get extended value information, call HM_ExtAPI::GetLastErrorCode().

Requires including hm_extapi.h.

Inputs

curve
[in] - Handle to curve object that was returned by previous calls to API functions.
iseg
[out] - Segment index. The value must be in the range from 0 to number_of_segments - 1, where number_of_segments is the number of composed curve segments as returned by the functionHM_ExtAPI::CurveComposedGetSize().
segment
[out] - Curve segment.
start_param
[out] - Parameter of composed curve that corresponds to start point of the segment, which in turn is defined by segment curve parameter seg_start_param.
end_param
[out] - Parameter of composed curve that corresponds to end point of the segment, which in turn is defined by segment curve parameter seg_end_param.
seg_start_param
[out] - Segment curve parameter that defines segment start point.
seg_end_param
[out] - Segment curve parameter that defines segment end point.

Errors

None.