distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPointsdistance_cc_min_points (Operator)
Name
distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPointsdistance_cc_min_points
— Calculate the minimum distance between two contours and the points used for
the calculation.
Signature
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
double HXLDCont::DistanceCcMinPoints(const HXLDCont& Contour2, const wchar_t* Mode, double* Row1, double* Column1, double* Row2, double* Column2) const
(Windows only)
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)
def distance_cc_min_points(contour_1: HObject, contour_2: HObject, mode: str) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]
def distance_cc_min_points_s(contour_1: HObject, contour_2: HObject, mode: str) -> Tuple[float, float, float, float, float]
Description
distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPointsDistanceCcMinPointsdistance_cc_min_points
calculates the minimum distance between
Contour1Contour1Contour1Contour1contour1contour_1
and Contour2Contour2Contour2Contour2contour2contour_2
.
The minimum distance is returned in DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_min
.
In comparison to distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMinDistanceCcMindistance_cc_min
, this operator also returns the
points on the contours that provide the minimum distance.
The point on Contour1Contour1Contour1Contour1contour1contour_1
is returned in Row1Row1Row1Row1row1row_1
and
Column1Column1Column1Column1column1column_1
; the point on Contour2Contour2Contour2Contour2contour2contour_2
is returned in
Row2Row2Row2Row2row2row_2
and Column2Column2Column2Column2column2column_2
.
The parameter ModeModeModeModemodemode
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""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""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""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""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
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on internal data level.
Parameters
Contour1Contour1Contour1Contour1contour1contour_1
(input_object) xld_cont(-array) →
objectHXLDContHObjectHXLDContHobject
First input contour.
Contour2Contour2Contour2Contour2contour2contour_2
(input_object) xld_cont(-array) →
objectHXLDContHObjectHXLDContHobject
Second input contour.
ModeModeModeModemodemode
(input_control) string →
HTuplestrHTupleHtuple (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"
"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""fast_point_to_segment", 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment""point_to_segment"
DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_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_points(Cont1, Cont2, "fast_point_to_segment", &distance_min,
&Row1, &Column1, &Row2, &Column2);
Result
distance_cc_min_pointsdistance_cc_min_pointsDistanceCcMinPointsDistanceCcMinPointsDistanceCcMinPointsdistance_cc_min_points
returns TRUE.
Alternatives
distance_scdistance_scDistanceScDistanceScDistanceScdistance_sc
,
distance_pcdistance_pcDistancePcDistancePcDistancePcdistance_pc
,
distance_ccdistance_ccDistanceCcDistanceCcDistanceCcdistance_cc
,
distance_contours_xlddistance_contours_xldDistanceContoursXldDistanceContoursXldDistanceContoursXlddistance_contours_xld
,
distance_cc_mindistance_cc_minDistanceCcMinDistanceCcMinDistanceCcMindistance_cc_min
See also
distance_srdistance_srDistanceSrDistanceSrDistanceSrdistance_sr
,
distance_prdistance_prDistancePrDistancePrDistancePrdistance_pr
Module
Foundation