Skip to content

gen_parallels_xldgen_parallels_xldGenParallelsXldGenParallelsXldgen_parallels_xldgen_parallels_xldπŸ”—

Short descriptionπŸ”—

gen_parallels_xldgen_parallels_xldGenParallelsXldGenParallelsXldgen_parallels_xldgen_parallels_xld β€” Extract parallel XLD polygons.

SignatureπŸ”—

gen_parallels_xld( xld_poly Polygons, out xld_para Parallels, number Len, number Dist, number Alpha, string Merge )gen_parallels_xld( Polygons : Parallels : Len, Dist, Alpha, Merge : )void GenParallelsXld( const HObject& Polygons, HObject* Parallels, const HTuple& Len, const HTuple& Dist, const HTuple& Alpha, const HTuple& Merge )static void HOperatorSet.GenParallelsXld( HObject polygons, out HObject parallels, HTuple len, HTuple dist, HTuple alpha, HTuple merge )def gen_parallels_xld( polygons: HObject, len: Union[float, int], dist: Union[float, int], alpha: Union[float, int], merge: str ) -> HObject

Herror gen_parallels_xld( const Hobject Polygons, Hobject* Parallels, double Len, double Dist, double Alpha, const char* Merge )

Herror T_gen_parallels_xld( const Hobject Polygons, Hobject* Parallels, const Htuple Len, const Htuple Dist, const Htuple Alpha, const Htuple Merge )

HXLDPara HXLDPoly::GenParallelsXld( const HTuple& Len, const HTuple& Dist, const HTuple& Alpha, const HString& Merge ) const

HXLDPara HXLDPoly::GenParallelsXld( double Len, double Dist, double Alpha, const HString& Merge ) const

HXLDPara HXLDPoly::GenParallelsXld( double Len, double Dist, double Alpha, const char* Merge ) const

HXLDPara HXLDPoly::GenParallelsXld( double Len, double Dist, double Alpha, const wchar_t* Merge ) const (Windows only)

HXLDPara HXLDPoly.GenParallelsXld( HTuple len, HTuple dist, HTuple alpha, string merge )

HXLDPara HXLDPoly.GenParallelsXld( double len, double dist, double alpha, string merge )

DescriptionπŸ”—

gen_parallels_xldGenParallelsXld examines the XLD polygons passed in Polygonspolygonspolygons for parallelism. The resulting parallel polygons are returned in Parallelsparallelsparallels. If the parameter Mergemergemerge is set to 'true'"true", adjacent parallel polygons are returned in a single parallel relation. Otherwise, one parallel relation is returned for each pair of parallel line segments.

Only polygon segments longer than Lenlenlen are taken into account. Whether two polygon segments are parallel depends on a maximum allowed angle difference Alphaalphaalpha (in radians). Furthermore, the projections of the two segments onto their angle bisector have to overlap. Finally, the overlap on the angle bisector is reprojected onto the two segments. If the maximal distance of the reprojections is smaller than Distdistdist, the segments are stored in Parallelsparallelsparallels.

As a side effect, a quality factor is calculated for each pair of parallels, compare mod_parallels_xldModParallelsXld. It is based on the normalized angular difference and the normalized length of the overlap:

\[\begin{eqnarray*} q = \frac{\pi / 2 - \delta\alpha}{\pi / 2}\frac{2 overlap}{len_{1} + len_{2}} \qquad \mbox{with} \quad 0 \le q \le 1 \end{eqnarray*}\]

Here, \(\delta\alpha\) is the angle difference of the polygon segments, \(overlap\) is the length of the overlap, \(len_{1}\) and \(len_{2}\) the lengths of the polygon segments, and \(q\) the resulting quality factor. The quality factor is a measure of parallelism (the larger its value, the β€œmore parallel” the polygons). Finally, the quality factors of all parallel polygon segments contained in a single polygon are added, weighted with their length of the overlapping area. Note that you can query the range for the quality factor with info_parallels_xldInfoParallelsXld.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Polygonspolygonspolygons (input_object) xld_poly-array β†’ objectobjectHObjectHXLDPolyHObjectHobject

Input polygons.

Parallelsparallelsparallels (output_object) xld_para-array β†’ objectobjectHObjectHXLDParaHObjectHobject *

Parallel polygons.

Lenlenlen (input_control) number β†’ (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Minimum length of the individual polygon segments.

Default: 10.010.0
Suggested values: 5.0, 10.0, 15.0, 20.05.0, 10.0, 15.0, 20.0
Restriction: Len > 0.0

Distdistdist (input_control) number β†’ (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Maximum distance between the polygon segments.

Default: 30.030.0
Suggested values: 20.0, 25.0, 30.0, 40.0, 50.0, 75.020.0, 25.0, 30.0, 40.0, 50.0, 75.0
Restriction: Dist > 0.0

Alphaalphaalpha (input_control) number β†’ (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Maximum angle difference of the polygon segments.

Default: 0.150.15
Suggested values: 0.05, 0.10, 0.15, 0.20, 0.300.05, 0.10, 0.15, 0.20, 0.30
Restriction: 0 <= Alpha && Alpha <= pi/2

Mergemergemerge (input_control) string β†’ (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Should adjacent parallel relations be merged?

Default: 'true'"true"
List of values: 'false', 'true'"false", "true"

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

gen_polygons_xldGenPolygonsXld

Possible successors

mod_parallels_xldModParallelsXld, get_parallels_xldGetParallelsXld, info_parallels_xldInfoParallelsXld

ModuleπŸ”—

Foundation