difference difference Difference Difference difference (Operator)
Name
difference difference Difference Difference difference
— Calculate the difference of two regions.
Signature
def difference (region : HObject, sub : HObject) -> HObject
Description
difference difference Difference Difference Difference difference
calculates the set-theoretic difference of
two regions:
(Regions in Region) - (Regions in Sub)
The resulting region is defined as the input region
(Region Region Region Region region region
) with all points from Sub Sub Sub Sub sub sub
removed.
Note that, internally, all regions of Sub Sub Sub Sub sub sub
are united to
a single region before the differences between the individual regions of
Region Region Region Region region region
and the united region are calculated.
Attention
Empty regions are valid for both parameters. On output, empty
regions may result. The value of the system flag
'store_empty_region' "store_empty_region" "store_empty_region" "store_empty_region" "store_empty_region" "store_empty_region" determines the behavior in this
case.
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
Region Region Region Region region region
(input_object) region(-array) →
object HRegion HObject HRegion Hobject
Regions to be processed.
Sub Sub Sub Sub sub sub
(input_object) region(-array) →
object HRegion HObject HRegion Hobject
The union of these regions is subtracted from Region.
RegionDifference RegionDifference RegionDifference RegionDifference regionDifference region_difference
(output_object) region(-array) →
object HRegion HObject HRegion Hobject *
Resulting region.
Example (HDevelop)
* provides the region X without the points in Y
difference(X,Y,RegionDifference)
Example (C)
/* provides the region X without the points in Y */
difference(X,Y,&RegionDifference);
Example (HDevelop)
* provides the region X without the points in Y
difference(X,Y,RegionDifference)
Example (HDevelop)
* provides the region X without the points in Y
difference(X,Y,RegionDifference)
Example (HDevelop)
* provides the region X without the points in Y
difference(X,Y,RegionDifference)
Complexity
Let
be the number of regions,
be their average area, and
be the total area of all regions in Sub Sub Sub Sub sub sub
. Then
the runtime complexity is
.
Result
difference difference Difference Difference Difference difference
always returns the value 2 (H_MSG_TRUE ). The
behavior in case of empty input (no regions given) can be set via
set_system('no_object_result',<Result>) set_system("no_object_result",<Result>) SetSystem("no_object_result",<Result>) SetSystem("no_object_result",<Result>) SetSystem("no_object_result",<Result>) set_system("no_object_result",<Result>)
and the behavior in case of an empty input region via
set_system('empty_region_result',<Result>) set_system("empty_region_result",<Result>) SetSystem("empty_region_result",<Result>) SetSystem("empty_region_result",<Result>) SetSystem("empty_region_result",<Result>) set_system("empty_region_result",<Result>)
.
If necessary, an exception is raised.
Possible Predecessors
threshold threshold Threshold Threshold Threshold threshold
,
connection connection Connection Connection Connection connection
,
regiongrowing regiongrowing Regiongrowing Regiongrowing Regiongrowing regiongrowing
,
pouring pouring Pouring Pouring Pouring pouring
,
class_ndim_norm class_ndim_norm ClassNdimNorm ClassNdimNorm ClassNdimNorm class_ndim_norm
Possible Successors
select_shape select_shape SelectShape SelectShape SelectShape select_shape
,
disp_region disp_region DispRegion DispRegion DispRegion disp_region
See also
intersection intersection Intersection Intersection Intersection intersection
,
union1 union1 Union1 Union1 Union1 union1
,
union2 union2 Union2 Union2 Union2 union2
,
complement complement Complement Complement Complement complement
,
symm_difference symm_difference SymmDifference SymmDifference SymmDifference symm_difference
Module
Foundation