ClassesClasses | | Operators

distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPoints (Operator)

Name

distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPoints — Calculate the minimum distance between two contours and the points used for the calculation.

Signature

distance_cc_min_points(Contour1, Contour2 : : Mode : DistanceMin, Row1, Column1, Row2, Column2)

Herror distance_cc_min_points(const Hobject Contour1, const Hobject Contour2, const char* Mode, double* DistanceMin, double* Row1, double* Column1, double* Row2, double* Column2)

Herror T_distance_cc_min_points(const Hobject Contour1, const Hobject Contour2, const Htuple Mode, Htuple* DistanceMin, Htuple* Row1, Htuple* Column1, Htuple* Row2, Htuple* Column2)

void DistanceCcMinPoints(const HObject& Contour1, const HObject& Contour2, const HTuple& Mode, HTuple* DistanceMin, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2)

HTuple HXLDCont::DistanceCcMinPoints(const HXLDCont& Contour2, const HString& Mode, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2) const

double HXLDCont::DistanceCcMinPoints(const HXLDCont& Contour2, const HString& Mode, double* Row1, double* Column1, double* Row2, double* Column2) const

double HXLDCont::DistanceCcMinPoints(const HXLDCont& Contour2, const char* Mode, double* Row1, double* Column1, double* Row2, double* Column2) const

static void HOperatorSet.DistanceCcMinPoints(HObject contour1, HObject contour2, HTuple mode, out HTuple distanceMin, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2)

HTuple HXLDCont.DistanceCcMinPoints(HXLDCont contour2, string mode, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2)

double HXLDCont.DistanceCcMinPoints(HXLDCont contour2, string mode, out double row1, out double column1, out double row2, out double column2)

Description

distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPointsDistanceCcMinPoints calculates the minimum distance between Contour1Contour1Contour1Contour1contour1 and Contour2Contour2Contour2Contour2contour2. The minimum distance is returned in DistanceMinDistanceMinDistanceMinDistanceMindistanceMin. In comparison to distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMinDistanceCcMin, this operator also returns the points on the contours that provide the minimum distance. The point on Contour1Contour1Contour1Contour1contour1 is returned in Row1Row1Row1Row1row1 and Column1Column1Column1Column1column1; the point on Contour2Contour2Contour2Contour2contour2 is returned in Row2Row2Row2Row2row2 and Column2Column2Column2Column2column2.

The parameter ModeModeModeModemode sets the type of computing the distance. 'fast_point_to_segment'"fast_point_to_segment""fast_point_to_segment""fast_point_to_segment""fast_point_to_segment" calculates the distance between the line segments adjacent to the closest contour points, and 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment" determines the actual minimum distance between the contour segments.

While 'fast_point_to_segment'"fast_point_to_segment""fast_point_to_segment""fast_point_to_segment""fast_point_to_segment" is an efficient algorithm with a complexity of n*log(n), 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment" has quadratic complexity and thus takes a longer time to execute, especially for contours with many line segments.

Attention

Both iconic input parameters must contain the same number of contours.

Execution Information

Parameters

Contour1Contour1Contour1Contour1contour1 (input_object)  xld_cont(-array) objectHXLDContHXLDContHobject

First input contour.

Contour2Contour2Contour2Contour2contour2 (input_object)  xld_cont(-array) objectHXLDContHXLDContHobject

Second input contour.

ModeModeModeModemode (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Distance calculation mode.

Default value: 'fast_point_to_segment' "fast_point_to_segment" "fast_point_to_segment" "fast_point_to_segment" "fast_point_to_segment"

List of values: 'fast_point_to_segment'"fast_point_to_segment""fast_point_to_segment""fast_point_to_segment""fast_point_to_segment", 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment"

DistanceMinDistanceMinDistanceMinDistanceMindistanceMin (output_control)  number(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Minimum distance between the two contours.

Row1Row1Row1Row1row1 (output_control)  point.y(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Row coordinate of the point on Contour1Contour1Contour1Contour1contour1.

Column1Column1Column1Column1column1 (output_control)  point.x(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Column coordinate of the point on Contour1Contour1Contour1Contour1contour1.

Row2Row2Row2Row2row2 (output_control)  point.y(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Row coordinate of the point on Contour2Contour2Contour2Contour2contour2.

Column2Column2Column2Column2column2 (output_control)  point.x(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Column coordinate of the point on Contour2Contour2Contour2Contour2contour2.

Example (C)

gen_contour_polygon_rounded_xld(Cont1, [0,100,100,0,0], [0,0,100,100,0],
                                [50,50,50,50,50], 0.5);
gen_contour_polygon_rounded_xld(Cont2, [41,91,91,41,41], [41,41,91,91,41],
                                [25,25,25,25,25], 0.5);
distance_cc_min_points(Cont1, Cont2, "fast_point_to_segment", &distance_min,
                       &Row1, &Column1, &Row2, &Column2);

Result

distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPointsDistanceCcMinPoints returns 2 (H_MSG_TRUE).

Alternatives

distance_scdistance_scDistanceScDistanceScDistanceSc, distance_pcdistance_pcDistancePcDistancePcDistancePc, distance_ccdistance_ccDistanceCcDistanceCcDistanceCc, distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXld, distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMinDistanceCcMin

See also

distance_srdistance_srDistanceSrDistanceSrDistanceSr, distance_prdistance_prDistancePrDistancePrDistancePr

Module

Foundation


ClassesClasses | | Operators