intersection_region_contour_xldintersection_region_contour_xldIntersectionRegionContourXldIntersectionRegionContourXldintersection_region_contour_xld (Operator)
Name
intersection_region_contour_xldintersection_region_contour_xldIntersectionRegionContourXldIntersectionRegionContourXldintersection_region_contour_xld
— Intersect a contour with a region.
Signature
def intersection_region_contour_xld(region: HObject, contour: HObject, mode: str) -> HObject
Description
The operator intersection_region_contour_xldintersection_region_contour_xldIntersectionRegionContourXldIntersectionRegionContourXldintersection_region_contour_xld
intersects the contour
ContourContourContourcontourcontour
with the region RegionRegionRegionregionregion
and returns the parts
of the contour that are within the region in ContourIntersectionContourIntersectionContourIntersectioncontourIntersectioncontour_intersection
.
The type of intersection can be specified with ModeModeModemodemode
.
The following values are possible:
- 'lines'"lines""lines""lines""lines" (Default):
-
In 'lines'"lines""lines""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""points""points""points" but more accurate.
Line segments that are only partially within the region are split into
multiple segments if necessary.
- 'points'"points""points""points""points":
In 'points'"points""points""points""points" mode, entire line segments from ContourContourContourcontourcontour
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""lines""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.
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
RegionRegionRegionregionregion
(input_object) region →
objectHRegionHObjectHObjectHobject
Input region.
ContourContourContourcontourcontour
(input_object) xld_cont-array →
objectHXLDContHObjectHObjectHobject
Input contour.
ContourIntersectionContourIntersectionContourIntersectioncontourIntersectioncontour_intersection
(output_object) xld_cont-array →
objectHXLDContHObjectHObjectHobject *
Selected part of the input contour.
ModeModeModemodemode
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Intersection mode.
Default:
'lines'
"lines"
"lines"
"lines"
"lines"
List of values:
'lines'"lines""lines""lines""lines", 'points'"points""points""points""points"
Possible Predecessors
thresholdthresholdThresholdThresholdthreshold
,
gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld
,
lines_gausslines_gaussLinesGaussLinesGausslines_gauss
,
lines_facetlines_facetLinesFacetLinesFacetlines_facet
,
edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixedges_sub_pix
,
gen_contour_region_xldgen_contour_region_xldGenContourRegionXldGenContourRegionXldgen_contour_region_xld
,
zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixzero_crossing_sub_pix
,
threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixthreshold_sub_pix
Alternatives
intersection_closed_contours_xldintersection_closed_contours_xldIntersectionClosedContoursXldIntersectionClosedContoursXldintersection_closed_contours_xld
,
intersection_closed_polygons_xldintersection_closed_polygons_xldIntersectionClosedPolygonsXldIntersectionClosedPolygonsXldintersection_closed_polygons_xld
See also
intersection_closed_contours_xldintersection_closed_contours_xldIntersectionClosedContoursXldIntersectionClosedContoursXldintersection_closed_contours_xld
,
intersection_closed_polygons_xldintersection_closed_polygons_xldIntersectionClosedPolygonsXldIntersectionClosedPolygonsXldintersection_closed_polygons_xld
,
gen_region_contour_xldgen_region_contour_xldGenRegionContourXldGenRegionContourXldgen_region_contour_xld
Module
Foundation