Skip to content

split_contours_xldSplitContoursXldSplitContoursXldsplit_contours_xldsplit_contours_xldπŸ”—

Short descriptionπŸ”—

split_contours_xldSplitContoursXldSplitContoursXldsplit_contours_xldsplit_contours_xld β€” Split XLD contours at dominant points.

SignatureπŸ”—

split_contours_xld( xld_poly Polygons, out xld_cont Contours, string Mode, integer Weight, integer Smooth )void SplitContoursXld( const HObject& Polygons, HObject* Contours, const HTuple& Mode, const HTuple& Weight, const HTuple& Smooth )static void HOperatorSet.SplitContoursXld( HObject polygons, out HObject contours, HTuple mode, HTuple weight, HTuple smooth )def split_contours_xld( polygons: HObject, mode: str, weight: int, smooth: int ) -> HObject

Herror split_contours_xld( const Hobject Polygons, Hobject* Contours, const char* Mode, const Hlong Weight, const Hlong Smooth )

Herror T_split_contours_xld( const Hobject Polygons, Hobject* Contours, const Htuple Mode, const Htuple Weight, const Htuple Smooth )

HXLDCont HXLDPoly::SplitContoursXld( const HString& Mode, Hlong Weight, Hlong Smooth ) const

HXLDCont HXLDPoly::SplitContoursXld( const char* Mode, Hlong Weight, Hlong Smooth ) const

HXLDCont HXLDPoly::SplitContoursXld( const wchar_t* Mode, Hlong Weight, Hlong Smooth ) const (Windows only)

HXLDCont HXLDPoly.SplitContoursXld( string mode, int weight, int smooth )

DescriptionπŸ”—

split_contours_xldSplitContoursXld splits the contours which were used to generate the polygons Polygonspolygonspolygons at prominent points. If the mode 'polygon'"polygon" is selected, the contours are split at the polygons’ control points. In mode 'dominant'"dominant", they are split at dominant points, i.e., at points for which the calculated change of direction is larger than the (empirically determined) threshold \(2 \pi \textrm{Weight}/\mbox{\it contour length}\), and for which in the (empirically determined) neighborhood of \(\sqrt{ \textrm{Smooth}} * \log(\mbox{\it contour length})\) points no larger change of direction occurs. The contour direction is determined from the direction of the regression line (i.e., the least-squares approximating line) through all points in a neighborhood of Smoothsmoothsmooth points around a contour point. The directions thus determined are smoothed with a Gaussian of width Smoothsmoothsmooth. Weightweightweight is a weighting factor for the sensitiveness of the operator. The larger Weightweightweight is selected, the less dominant points are found.

Each polygon needs a reference to a contour. If the reference is missing, because the polygon is e.g., read from a DXF-File, split_contours_xldSplitContoursXld returns an error.

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) β†’ objectHObjectHXLDPolyHObjectHobject

Polygons for which the corresponding contours are to be split.

Contourscontourscontours (output_object) xld_cont(-array) β†’ objectHObjectHXLDContHObjectHobject *

Split contours.

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

Mode for the splitting of the contours.

Default: 'polygon'"polygon"
List of values: 'dominant', 'polygon'"dominant", "polygon"

Weightweightweight (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Weight for the sensitiveness.

Default: 11

Smoothsmoothsmooth (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the smoothing mask.

Default: 55

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

gen_polygons_xldGenPolygonsXld

Possible successors

regress_contours_xldRegressContoursXld

See also

gen_contours_skeleton_xldGenContoursSkeletonXld, lines_gaussLinesGauss, lines_facetLinesFacet, edges_sub_pixEdgesSubPix

ModuleπŸ”—

Foundation