Skip to content

intersection_region_contour_xldintersection_region_contour_xldIntersectionRegionContourXldIntersectionRegionContourXldintersection_region_contour_xldintersection_region_contour_xld🔗

Short description🔗

intersection_region_contour_xldintersection_region_contour_xldIntersectionRegionContourXldIntersectionRegionContourXldintersection_region_contour_xldintersection_region_contour_xld — Intersect a contour with a region.

Signature🔗

intersection_region_contour_xld( region Region, xld_cont Contour, out xld_cont ContourIntersection, string Mode )intersection_region_contour_xld( Region, Contour : ContourIntersection : Mode : )void IntersectionRegionContourXld( const HObject& Region, const HObject& Contour, HObject* ContourIntersection, const HTuple& Mode )static void HOperatorSet.IntersectionRegionContourXld( HObject region, HObject contour, out HObject contourIntersection, HTuple mode )def intersection_region_contour_xld( region: HObject, contour: HObject, mode: str ) -> HObject

Herror intersection_region_contour_xld( const Hobject Region, const Hobject Contour, Hobject* ContourIntersection, const char* Mode )

Herror T_intersection_region_contour_xld( const Hobject Region, const Hobject Contour, Hobject* ContourIntersection, const Htuple Mode )

HXLDCont HRegion::IntersectionRegionContourXld( const HXLDCont& Contour, const HString& Mode ) const

HXLDCont HRegion::IntersectionRegionContourXld( const HXLDCont& Contour, const char* Mode ) const

HXLDCont HRegion::IntersectionRegionContourXld( const HXLDCont& Contour, const wchar_t* Mode ) const (Windows only)

HXLDCont HXLDCont::IntersectionRegionContourXld( const HRegion& Region, const HString& Mode ) const

HXLDCont HXLDCont::IntersectionRegionContourXld( const HRegion& Region, const char* Mode ) const

HXLDCont HXLDCont::IntersectionRegionContourXld( const HRegion& Region, const wchar_t* Mode ) const (Windows only)

HXLDCont HRegion.IntersectionRegionContourXld( HXLDCont contour, string mode )

HXLDCont HXLDCont.IntersectionRegionContourXld( HRegion region, string mode )

Description🔗

The operator intersection_region_contour_xldIntersectionRegionContourXld intersects the contour Contourcontourcontour with the region Regionregionregion and returns the parts of the contour that are within the region in ContourIntersectioncontourIntersectioncontour_intersection.

The type of intersection can be specified with Modemodemode. The following values are possible:

  • 'lines'"lines" (Default): In 'lines'"lines" mode, each line segment of the input contour is intersected with the region with sub-pixel accuracy. This mode is usually slower than 'points'"points" but more accurate. Line segments that are only partially within the region are split into multiple segments if necessary.

  • 'points'"points": In 'points'"points" mode, entire line segments from Contourcontourcontour are tested against the region using their start and end point. If both the start and end point of a line segment are within the region, that line segment is included in the output. This mode is faster than 'lines'"lines" but less accurate, especially if the contour is coarsely sampled. For example, line segments might leave the region between their start and end point, but are still included in the output. Further, a line segment might be contained in the region for the most part but is not included in the output if the start or end point are not in the region.

 
(1) (2)

Result for 'lines'"lines" (1) and 'points'"points" mode (2) when intersecting a contour with a region (green). The red sections of the contour will be returned as the result.

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🔗

Regionregionregion (input_object) region → objectobjectHObjectHRegionHObjectHobject

Input region.

Contourcontourcontour (input_object) xld_cont-array → objectobjectHObjectHXLDContHObjectHobject

Input contour.

ContourIntersectioncontourIntersectioncontour_intersection (output_object) xld_cont-array → objectobjectHObjectHXLDContHObjectHobject *

Selected part of the input contour.

Modemodemode (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Intersection mode.

Default: 'lines'"lines"
List of values: 'lines', 'points'"lines", "points"

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, gen_contours_skeleton_xldGenContoursSkeletonXld, lines_gaussLinesGauss, lines_facetLinesFacet, edges_sub_pixEdgesSubPix, gen_contour_region_xldGenContourRegionXld, zero_crossing_sub_pixZeroCrossingSubPix, threshold_sub_pixThresholdSubPix

Alternatives

intersection_closed_contours_xldIntersectionClosedContoursXld, intersection_closed_polygons_xldIntersectionClosedPolygonsXld

See also

intersection_closed_contours_xldIntersectionClosedContoursXld, intersection_closed_polygons_xldIntersectionClosedPolygonsXld, gen_region_contour_xldGenRegionContourXld

Module🔗

Foundation