API reference - Class EdgeProcessor

Notation used in Ruby API documentation

Module: db

Description: The edge processor (boolean, sizing, merge)

The edge processor implements the boolean and edge set operations (size, merge). Because the edge processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times.

Here is a simple example of how to use the edge processor:

ep = RBA::EdgeProcessor::new
# Prepare two boxes
a = [ RBA::Polygon::new(RBA::Box::new(0, 0, 300, 300)) ]
b = [ RBA::Polygon::new(RBA::Box::new(100, 100, 200, 200)) ]
# Run an XOR -> creates a polygon with a hole, since the 'resolve_holes' parameter
# is false:
out = ep.boolean_p2p(a, b, RBA::EdgeProcessor::ModeXor, false, false)
out.to_s    # -> [(0,0;0,300;300,300;300,0/100,100;200,100;200,200;100,200)]

Public constructors

new EdgeProcessor ptrnewCreates a new object of this class

Public methods

[const]EdgeProcessor ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidassign(const EdgeProcessor other)Assigns another object to self
Edge[]boolean_e2e(Edge[] a,
Edge[] b,
int mode)
Boolean operation for a set of given edges, creating edges
Polygon[]boolean_e2p(Edge[] a,
Edge[] b,
int mode,
bool resolve_holes,
bool min_coherence)
Boolean operation for a set of given edges, creating polygons
Edge[]boolean_p2e(Polygon[] a,
Polygon[] b,
int mode)
Boolean operation for a set of given polygons, creating edges
Polygon[]boolean_p2p(Polygon[] a,
Polygon[] b,
int mode,
bool resolve_holes,
bool min_coherence)
Boolean operation for a set of given polygons, creating polygons
voiddisable_progressDisable progress reporting
[const]new EdgeProcessor ptrdupCreates a copy of self
voidenable_progress(string label)Enable progress reporting
Edge[]merge_p2e(Polygon[] in,
unsigned int min_wc)
Merge the given polygons
Polygon[]merge_p2p(Polygon[] in,
unsigned int min_wc,
bool resolve_holes,
bool min_coherence)
Merge the given polygons
Edge[]simple_merge_e2e(Edge[] in)Merge the given edges in a simple "non-zero wrapcount" fashion
Edge[]simple_merge_e2e(Edge[] in,
int mode)
Merge the given polygons and specify the merge mode
Polygon[]simple_merge_e2p(Edge[] in,
bool resolve_holes,
bool min_coherence)
Merge the given edges in a simple "non-zero wrapcount" fashion into polygons
Polygon[]simple_merge_e2p(Edge[] in,
bool resolve_holes,
bool min_coherence,
int mode)
Merge the given polygons and specify the merge mode
Edge[]simple_merge_p2e(Polygon[] in)Merge the given polygons in a simple "non-zero wrapcount" fashion
Edge[]simple_merge_p2e(Polygon[] in,
int mode)
Merge the given polygons and specify the merge mode
Polygon[]simple_merge_p2p(Polygon[] in,
bool resolve_holes,
bool min_coherence)
Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons
Polygon[]simple_merge_p2p(Polygon[] in,
bool resolve_holes,
bool min_coherence,
int mode)
Merge the given polygons and specify the merge mode
Edge[]size_p2e(Polygon[] in,
int dx,
int dy,
unsigned int mode)
Size the given polygons
Edge[]size_p2e(Polygon[] in,
int d,
unsigned int mode)
Size the given polygons (isotropic)
Polygon[]size_p2p(Polygon[] in,
int dx,
int dy,
unsigned int mode,
bool resolve_holes,
bool min_coherence)
Size the given polygons into polygons
Polygon[]size_p2p(Polygon[] in,
int d,
unsigned int mode,
bool resolve_holes,
bool min_coherence)
Size the given polygons into polygons (isotropic)

Public static methods and constants

intModeANotBboolean method's mode value for A NOT B operation
intModeAndboolean method's mode value for AND operation
intModeBNotAboolean method's mode value for B NOT A operation
intModeOrboolean method's mode value for OR operation
intModeXorboolean method's mode value for XOR operation

Deprecated methods (protected, public, static, non-static and constructors)

Edge[]boolean(Polygon[] a,
Polygon[] b,
int mode)
Use of this method is deprecated. Use boolean_p2e instead
Edge[]boolean(Edge[] a,
Edge[] b,
int mode)
Use of this method is deprecated. Use boolean_e2e instead
Polygon[]boolean_to_polygon(Polygon[] a,
Polygon[] b,
int mode,
bool resolve_holes,
bool min_coherence)
Use of this method is deprecated. Use boolean_p2p instead
Polygon[]boolean_to_polygon(Edge[] a,
Edge[] b,
int mode,
bool resolve_holes,
bool min_coherence)
Use of this method is deprecated. Use boolean_e2p instead
voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead
Edge[]merge(Polygon[] in,
unsigned int min_wc)
Use of this method is deprecated. Use merge_p2e instead
Polygon[]merge_to_polygon(Polygon[] in,
unsigned int min_wc,
bool resolve_holes,
bool min_coherence)
Use of this method is deprecated. Use merge_p2p instead
[static]intmode_andUse of this method is deprecated. Use ModeAnd instead
[static]intmode_anotbUse of this method is deprecated. Use ModeANotB instead
[static]intmode_bnotaUse of this method is deprecated. Use ModeBNotA instead
[static]intmode_orUse of this method is deprecated. Use ModeOr instead
[static]intmode_xorUse of this method is deprecated. Use ModeXor instead
Edge[]simple_merge(Polygon[] in)Use of this method is deprecated. Use simple_merge_p2e instead
Edge[]simple_merge(Polygon[] in,
int mode)
Use of this method is deprecated. Use simple_merge_p2e instead
Edge[]simple_merge(Edge[] in)Use of this method is deprecated. Use simple_merge_e2e instead
Edge[]simple_merge(Edge[] in,
int mode)
Use of this method is deprecated. Use simple_merge_e2e instead
Polygon[]simple_merge_to_polygon(Polygon[] in,
bool resolve_holes,
bool min_coherence)
Use of this method is deprecated. Use simple_merge_p2p instead
Polygon[]simple_merge_to_polygon(Polygon[] in,
bool resolve_holes,
bool min_coherence,
int mode)
Use of this method is deprecated. Use simple_merge_p2p instead
Polygon[]simple_merge_to_polygon(Edge[] in,
bool resolve_holes,
bool min_coherence)
Use of this method is deprecated. Use simple_merge_e2p instead
Polygon[]simple_merge_to_polygon(Edge[] in,
bool resolve_holes,
bool min_coherence,
int mode)
Use of this method is deprecated. Use simple_merge_e2p instead
Edge[]size(Polygon[] in,
int dx,
int dy,
unsigned int mode)
Use of this method is deprecated. Use size_p2e instead
Edge[]size(Polygon[] in,
int d,
unsigned int mode)
Use of this method is deprecated. Use size_p2e instead
Polygon[]size_to_polygon(Polygon[] in,
int dx,
int dy,
unsigned int mode,
bool resolve_holes,
bool min_coherence)
Use of this method is deprecated. Use size_p2p instead
Polygon[]size_to_polygon(Polygon[] in,
int d,
unsigned int mode,
bool resolve_holes,
bool min_coherence)
Use of this method is deprecated. Use size_p2p instead

Detailed description

ModeANotB

Signature: [static] int ModeANotB

Description: boolean method's mode value for A NOT B operation

Python specific notes:
The object exposes a readable attribute 'ModeANotB'. This is the getter.

ModeAnd

Signature: [static] int ModeAnd

Description: boolean method's mode value for AND operation

Python specific notes:
The object exposes a readable attribute 'ModeAnd'. This is the getter.

ModeBNotA

Signature: [static] int ModeBNotA

Description: boolean method's mode value for B NOT A operation

Python specific notes:
The object exposes a readable attribute 'ModeBNotA'. This is the getter.

ModeOr

Signature: [static] int ModeOr

Description: boolean method's mode value for OR operation

Python specific notes:
The object exposes a readable attribute 'ModeOr'. This is the getter.

ModeXor

Signature: [static] int ModeXor

Description: boolean method's mode value for XOR operation

Python specific notes:
The object exposes a readable attribute 'ModeXor'. This is the getter.

_const_cast

Signature: [const] EdgeProcessor ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

assign

Signature: void assign (const EdgeProcessor other)

Description: Assigns another object to self

boolean

(1) Signature: Edge[] boolean (Polygon[] a, Polygon[] b, int mode)

Description: Boolean operation for a set of given polygons, creating edges

a:The input polygons (first operand)
b:The input polygons (second operand)
mode:The boolean mode
Returns:The output edges

Use of this method is deprecated. Use boolean_p2e instead

This method computes the result for the given boolean operation on two sets of polygons. The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a Boolean operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Edge[] boolean (Edge[] a, Edge[] b, int mode)

Description: Boolean operation for a set of given edges, creating edges

a:The input edges (first operand)
b:The input edges (second operand)
mode:The boolean mode (one of the Mode.. values)
Returns:The output edges

Use of this method is deprecated. Use boolean_e2e instead

This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

boolean_e2e

Signature: Edge[] boolean_e2e (Edge[] a, Edge[] b, int mode)

Description: Boolean operation for a set of given edges, creating edges

a:The input edges (first operand)
b:The input edges (second operand)
mode:The boolean mode (one of the Mode.. values)
Returns:The output edges

This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

boolean_e2p

Signature: Polygon[] boolean_e2p (Edge[] a, Edge[] b, int mode, bool resolve_holes, bool min_coherence)

Description: Boolean operation for a set of given edges, creating polygons

a:The input polygons (first operand)
b:The input polygons (second operand)
mode:The boolean mode (one of the Mode.. values)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.

This method produces polygons on output and allows fine-tuning of the parameters for that purpose.

Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

boolean_p2e

Signature: Edge[] boolean_p2e (Polygon[] a, Polygon[] b, int mode)

Description: Boolean operation for a set of given polygons, creating edges

a:The input polygons (first operand)
b:The input polygons (second operand)
mode:The boolean mode
Returns:The output edges

This method computes the result for the given boolean operation on two sets of polygons. The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a Boolean operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

boolean_p2p

Signature: Polygon[] boolean_p2p (Polygon[] a, Polygon[] b, int mode, bool resolve_holes, bool min_coherence)

Description: Boolean operation for a set of given polygons, creating polygons

a:The input polygons (first operand)
b:The input polygons (second operand)
mode:The boolean mode (one of the Mode.. values)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

This method computes the result for the given boolean operation on two sets of polygons. This method produces polygons on output and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a Boolean operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

boolean_to_polygon

(1) Signature: Polygon[] boolean_to_polygon (Polygon[] a, Polygon[] b, int mode, bool resolve_holes, bool min_coherence)

Description: Boolean operation for a set of given polygons, creating polygons

a:The input polygons (first operand)
b:The input polygons (second operand)
mode:The boolean mode (one of the Mode.. values)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use boolean_p2p instead

This method computes the result for the given boolean operation on two sets of polygons. This method produces polygons on output and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a Boolean operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Polygon[] boolean_to_polygon (Edge[] a, Edge[] b, int mode, bool resolve_holes, bool min_coherence)

Description: Boolean operation for a set of given edges, creating polygons

a:The input polygons (first operand)
b:The input polygons (second operand)
mode:The boolean mode (one of the Mode.. values)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use boolean_e2p instead

This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.

This method produces polygons on output and allows fine-tuning of the parameters for that purpose.

Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

disable_progress

Signature: void disable_progress

Description: Disable progress reporting

Calling this method will stop the edge processor from showing a progress bar. See enable_progress.

This method has been introduced in version 0.23.

dup

Signature: [const] new EdgeProcessor ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

enable_progress

Signature: void enable_progress (string label)

Description: Enable progress reporting

After calling this method, the edge processor will report the progress through a progress bar. The label is a text which is put in front of the progress bar. Using a progress bar will imply a performance penalty of a few percent typically.

This method has been introduced in version 0.23.

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

merge

Signature: Edge[] merge (Polygon[] in, unsigned int min_wc)

Description: Merge the given polygons

in:The input polygons
min_wc:The minimum wrap count for output (0: all polygons, 1: at least two overlapping)
Returns:The output edges

Use of this method is deprecated. Use merge_p2e instead

In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

merge_p2e

Signature: Edge[] merge_p2e (Polygon[] in, unsigned int min_wc)

Description: Merge the given polygons

in:The input polygons
min_wc:The minimum wrap count for output (0: all polygons, 1: at least two overlapping)
Returns:The output edges

In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

merge_p2p

Signature: Polygon[] merge_p2p (Polygon[] in, unsigned int min_wc, bool resolve_holes, bool min_coherence)

Description: Merge the given polygons

in:The input polygons
min_wc:The minimum wrap count for output (0: all polygons, 1: at least two overlapping)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

merge_to_polygon

Signature: Polygon[] merge_to_polygon (Polygon[] in, unsigned int min_wc, bool resolve_holes, bool min_coherence)

Description: Merge the given polygons

in:The input polygons
min_wc:The minimum wrap count for output (0: all polygons, 1: at least two overlapping)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use merge_p2p instead

In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

mode_and

Signature: [static] int mode_and

Description: boolean method's mode value for AND operation

Use of this method is deprecated. Use ModeAnd instead

Python specific notes:
The object exposes a readable attribute 'ModeAnd'. This is the getter.

mode_anotb

Signature: [static] int mode_anotb

Description: boolean method's mode value for A NOT B operation

Use of this method is deprecated. Use ModeANotB instead

Python specific notes:
The object exposes a readable attribute 'ModeANotB'. This is the getter.

mode_bnota

Signature: [static] int mode_bnota

Description: boolean method's mode value for B NOT A operation

Use of this method is deprecated. Use ModeBNotA instead

Python specific notes:
The object exposes a readable attribute 'ModeBNotA'. This is the getter.

mode_or

Signature: [static] int mode_or

Description: boolean method's mode value for OR operation

Use of this method is deprecated. Use ModeOr instead

Python specific notes:
The object exposes a readable attribute 'ModeOr'. This is the getter.

mode_xor

Signature: [static] int mode_xor

Description: boolean method's mode value for XOR operation

Use of this method is deprecated. Use ModeXor instead

Python specific notes:
The object exposes a readable attribute 'ModeXor'. This is the getter.

new

Signature: [static] new EdgeProcessor ptr new

Description: Creates a new object of this class

Python specific notes:
This method is the default initializer of the object.

simple_merge

(1) Signature: Edge[] simple_merge (Polygon[] in)

Description: Merge the given polygons in a simple "non-zero wrapcount" fashion

in:The input polygons
Returns:The output edges

Use of this method is deprecated. Use simple_merge_p2e instead

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Edge[] simple_merge (Polygon[] in, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input polygons
Returns:The output edges

Use of this method is deprecated. Use simple_merge_p2e instead

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

(3) Signature: Edge[] simple_merge (Edge[] in)

Description: Merge the given edges in a simple "non-zero wrapcount" fashion

in:The input edges
Returns:The output edges

Use of this method is deprecated. Use simple_merge_e2e instead

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(4) Signature: Edge[] simple_merge (Edge[] in, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input edges
Returns:The output edges

Use of this method is deprecated. Use simple_merge_e2e instead

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

simple_merge_e2e

(1) Signature: Edge[] simple_merge_e2e (Edge[] in)

Description: Merge the given edges in a simple "non-zero wrapcount" fashion

in:The input edges
Returns:The output edges

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Edge[] simple_merge_e2e (Edge[] in, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input edges
Returns:The output edges

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

simple_merge_e2p

(1) Signature: Polygon[] simple_merge_e2p (Edge[] in, bool resolve_holes, bool min_coherence)

Description: Merge the given edges in a simple "non-zero wrapcount" fashion into polygons

in:The input edges
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Polygon[] simple_merge_e2p (Edge[] in, bool resolve_holes, bool min_coherence, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input edges
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

simple_merge_p2e

(1) Signature: Edge[] simple_merge_p2e (Polygon[] in)

Description: Merge the given polygons in a simple "non-zero wrapcount" fashion

in:The input polygons
Returns:The output edges

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Edge[] simple_merge_p2e (Polygon[] in, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input polygons
Returns:The output edges

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

simple_merge_p2p

(1) Signature: Polygon[] simple_merge_p2p (Polygon[] in, bool resolve_holes, bool min_coherence)

Description: Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons

in:The input polygons
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Polygon[] simple_merge_p2p (Polygon[] in, bool resolve_holes, bool min_coherence, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input polygons
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

simple_merge_to_polygon

(1) Signature: Polygon[] simple_merge_to_polygon (Polygon[] in, bool resolve_holes, bool min_coherence)

Description: Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons

in:The input polygons
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use simple_merge_p2p instead

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Polygon[] simple_merge_to_polygon (Polygon[] in, bool resolve_holes, bool min_coherence, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input polygons
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use simple_merge_p2p instead

The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

(3) Signature: Polygon[] simple_merge_to_polygon (Edge[] in, bool resolve_holes, bool min_coherence)

Description: Merge the given edges in a simple "non-zero wrapcount" fashion into polygons

in:The input edges
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use simple_merge_e2p instead

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(4) Signature: Polygon[] simple_merge_to_polygon (Edge[] in, bool resolve_holes, bool min_coherence, int mode)

Description: Merge the given polygons and specify the merge mode

mode:See description
in:The input edges
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use simple_merge_e2p instead

The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.

This method produces polygons and allows fine-tuning of the parameters for that purpose.

This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.

This method has been added in version 0.22.

The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).

size

(1) Signature: Edge[] size (Polygon[] in, int dx, int dy, unsigned int mode)

Description: Size the given polygons

in:The input polygons
dx:The sizing value in x direction
dy:The sizing value in y direction
mode:The sizing mode (standard is 2)
Returns:The output edges

Use of this method is deprecated. Use size_p2e instead

This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied on the individual result polygons of the merge step. The result may contain overlapping contours, but no self-overlaps.

dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both dx and dy.

The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Edge[] size (Polygon[] in, int d, unsigned int mode)

Description: Size the given polygons (isotropic)

in:The input polygons
d:The sizing value in x direction
mode:The sizing mode
Returns:The output edges

Use of this method is deprecated. Use size_p2e instead

This method is equivalent to calling the anisotropic version with identical dx and dy.

Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

size_p2e

(1) Signature: Edge[] size_p2e (Polygon[] in, int dx, int dy, unsigned int mode)

Description: Size the given polygons

in:The input polygons
dx:The sizing value in x direction
dy:The sizing value in y direction
mode:The sizing mode (standard is 2)
Returns:The output edges

This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied on the individual result polygons of the merge step. The result may contain overlapping contours, but no self-overlaps.

dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both dx and dy.

The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.

Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Edge[] size_p2e (Polygon[] in, int d, unsigned int mode)

Description: Size the given polygons (isotropic)

in:The input polygons
d:The sizing value in x direction
mode:The sizing mode
Returns:The output edges

This method is equivalent to calling the anisotropic version with identical dx and dy.

Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

size_p2p

(1) Signature: Polygon[] size_p2p (Polygon[] in, int dx, int dy, unsigned int mode, bool resolve_holes, bool min_coherence)

Description: Size the given polygons into polygons

in:The input polygons
dx:The sizing value in x direction
dy:The sizing value in y direction
mode:The sizing mode (standard is 2)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied on the individual result polygons of the merge step. The result may contain overlapping polygons, but no self-overlapping ones. Polygon overlap occurs if the polygons are close enough, so a positive sizing makes polygons overlap.

dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both dx and dy.

The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. This method produces polygons and allows fine-tuning of the parameters for that purpose.

Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Polygon[] size_p2p (Polygon[] in, int d, unsigned int mode, bool resolve_holes, bool min_coherence)

Description: Size the given polygons into polygons (isotropic)

in:The input polygons
d:The sizing value in x direction
mode:The sizing mode
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

This method is equivalent to calling the anisotropic version with identical dx and dy.

Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

size_to_polygon

(1) Signature: Polygon[] size_to_polygon (Polygon[] in, int dx, int dy, unsigned int mode, bool resolve_holes, bool min_coherence)

Description: Size the given polygons into polygons

in:The input polygons
dx:The sizing value in x direction
dy:The sizing value in y direction
mode:The sizing mode (standard is 2)
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use size_p2p instead

This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied on the individual result polygons of the merge step. The result may contain overlapping polygons, but no self-overlapping ones. Polygon overlap occurs if the polygons are close enough, so a positive sizing makes polygons overlap.

dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both dx and dy.

The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. This method produces polygons and allows fine-tuning of the parameters for that purpose.

Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.

(2) Signature: Polygon[] size_to_polygon (Polygon[] in, int d, unsigned int mode, bool resolve_holes, bool min_coherence)

Description: Size the given polygons into polygons (isotropic)

in:The input polygons
d:The sizing value in x direction
mode:The sizing mode
resolve_holes:true, if holes should be resolved into the hull
min_coherence:true, if touching corners should be resolved into less connected contours
Returns:The output polygons

Use of this method is deprecated. Use size_p2p instead

This method is equivalent to calling the anisotropic version with identical dx and dy.

Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.