distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMindistance_cc_min (Operator)

Name

distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMindistance_cc_min — Calculate the minimum distance between two contours.

Signature

distance_cc_min(Contour1, Contour2 : : Mode : DistanceMin)

Herror distance_cc_min(const Hobject Contour1, const Hobject Contour2, const char* Mode, double* DistanceMin)

Herror T_distance_cc_min(const Hobject Contour1, const Hobject Contour2, const Htuple Mode, Htuple* DistanceMin)

void DistanceCcMin(const HObject& Contour1, const HObject& Contour2, const HTuple& Mode, HTuple* DistanceMin)

HTuple HXLDCont::DistanceCcMin(const HXLDCont& Contour2, const HString& Mode) const

HTuple HXLDCont::DistanceCcMin(const HXLDCont& Contour2, const char* Mode) const

HTuple HXLDCont::DistanceCcMin(const HXLDCont& Contour2, const wchar_t* Mode) const   ( Windows only)

static void HOperatorSet.DistanceCcMin(HObject contour1, HObject contour2, HTuple mode, out HTuple distanceMin)

HTuple HXLDCont.DistanceCcMin(HXLDCont contour2, string mode)

def distance_cc_min(contour_1: HObject, contour_2: HObject, mode: str) -> Sequence[float]

def distance_cc_min_s(contour_1: HObject, contour_2: HObject, mode: str) -> float

Description

distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMindistance_cc_min calculates the minimum distance between two contours Contour1Contour1Contour1contour1contour_1 and Contour2Contour2Contour2contour2contour_2. The minimum distance is returned in DistanceMinDistanceMinDistanceMindistanceMindistance_min.

The parameter ModeModeModemodemode sets the type of computing the distance. 'point_to_point'"point_to_point""point_to_point""point_to_point""point_to_point" determines the distance between the closest contour points, '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 these 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 'point_to_point'"point_to_point""point_to_point""point_to_point""point_to_point" and 'fast_point_to_segment'"fast_point_to_segment""fast_point_to_segment""fast_point_to_segment""fast_point_to_segment" are efficient algorithms 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

Contour1Contour1Contour1contour1contour_1 (input_object)  xld_cont(-array) objectHXLDContHObjectHObjectHobject

First input contour.

Contour2Contour2Contour2contour2contour_2 (input_object)  xld_cont(-array) objectHXLDContHObjectHObjectHobject

Second input contour.

ModeModeModemodemode (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Distance calculation mode.

Default: '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_point'"point_to_point""point_to_point""point_to_point""point_to_point", 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment"

DistanceMinDistanceMinDistanceMindistanceMindistance_min (output_control)  number(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Minimum distance between the two contours.

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(Cont1, Cont2, "fast_point_to_segment", &distance_min);

Result

distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMindistance_cc_min returns 2 ( H_MSG_TRUE) .

Alternatives

distance_scdistance_scDistanceScDistanceScdistance_sc, distance_pcdistance_pcDistancePcDistancePcdistance_pc, distance_ccdistance_ccDistanceCcDistanceCcdistance_cc, distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXlddistance_contours_xld

See also

distance_srdistance_srDistanceSrDistanceSrdistance_sr, distance_prdistance_prDistancePrDistancePrdistance_pr

Module

Foundation