pw:: Merger

The merge mode type

Derives From

pw::Object pw::Mode

Summary
The merge mode type
Thsi action replaces the first entity with the second entity, unless -automatic option is specified.
This action automatically merges two connectors.
This action finds pairs of entities that are within the given tolerance, filtered by the given type and topology.
This action gets the number of pairs found from the last findPairs action.
This action gets a pair of entities with the given index.
This action sets the merge status of the given pair.
This action merges the pairs that have been marked for merging.
This action merges connectors and nodes within the tolerance.

Instance Actions

replace

$merger replace ?-automatic? < node1 node2 | con1 con2 >

Thsi action replaces the first entity with the second entity, unless -automatic option is specified.  For -automatic, the best replacement is done.  The two entities must be of the same type.

Parameters

-automaticThis optional parameter indicates to automatically choose the best replacement.
node1This parameter is a pw::Node object to merge.
node2This parameter is a pw::Node object to merge.
con1This parameter is a pw::Connector object to merge.
con2This parameter is a pw::Connector object to merge.

Returns

This action returns nothing.

merge

$merger merge con1 con2

This action automatically merges two connectors.

Parameters

con1This parameter is a pw::Connector object to merge.
con2This parameter is a pw::Connector object to merge.

Returns

This action returns true if the connectors were merged.

findPairs

$merger findPairs -tolerance tol ?-exclude topology? types

This action finds pairs of entities that are within the given tolerance, filtered by the given type and topology.  Any previously found pairs will be cleared and not merged.

Parameters

-tolerance tolThis parameter is the tolerance that connectors and nodes must be within for merging to take place
-exclude topologyThis optional parameter indicates the type of topology to exclude from merging; None | Manifold | NonFree
-visibleOnlyThis flag causes only visible entities to be considered for merging.  All hidden entities are ignored.
typesThis parameter is the type of pairs to find; Node | Connector | NodeConnector.

Returns

This action returns nothing.

getPairCount

$merger getPairCount

This action gets the number of pairs found from the last findPairs action.

Parameters

none

Returns

This action returns the number of pairs.

getPair

$merger getPair ?-delta deltaVar? ?-status statusVar? index

This action gets a pair of entities with the given index.

Parameters

-delta deltaVarThis optional parameter is a variable name to recieve the difference between the pair.
-status statusVarThis optional parameter is a variable name to recieve the merge status of the pair; it is a boolean value where 0 means do not merge and 1 means merge.
indexThis parameter is the index of the pair to retrieve.

Returns

Depending on the type of the last findPairs action this action will return a list of two pw::Node objects, a list of two pw::Connector objects, or a list of a single pw::Node object and a single pw::Connector object.

setPairStatus

$merger setPairStatus index status

This action sets the merge status of the given pair.

Parameters

indexThis parameter is the index of the pair for which to set the status.
statusThis parameter is the merge status of the pair; boolean value.

Returns

This action returns nothing.

mergePairs

$merger mergePairs

This action merges the pairs that have been marked for merging.  If the pair of entities are of the same type, the best will be chosen to replace the other entity of the pair

Parameters

none

Returns

This action returns nothing.

mergeConnectors

$merger mergeConnectors ?-exclude topology? ?-visibleOnly? -tolerance tol

This action merges connectors and nodes within the tolerance.

Parameters

-exclude topologyThis optional parameter indicates the topology to exclude from merging; None | Manifold | NonFree
-tolerance tolThis parameter is the tolerance connectors and nodes must be within for merging to take place.
-visibleOnlyThis flag causes only visible connectors to be considered for merging.  All hidden connectors are ignored.

Returns

This action returns nothing.

$merger replace ?-automatic? < node1 node2 | con1 con2 >
Thsi action replaces the first entity with the second entity, unless -automatic option is specified.
$merger merge con1 con2
This action automatically merges two connectors.
$merger findPairs -tolerance tol ?-exclude topology? types
This action finds pairs of entities that are within the given tolerance, filtered by the given type and topology.
$merger getPairCount
This action gets the number of pairs found from the last findPairs action.
$merger getPair ?-delta deltaVar? ?-status statusVar? index
This action gets a pair of entities with the given index.
$merger setPairStatus index status
This action sets the merge status of the given pair.
$merger mergePairs
This action merges the pairs that have been marked for merging.
$merger mergeConnectors ?-exclude topology? ?-visibleOnly? -tolerance tol
This action merges connectors and nodes within the tolerance.
Base type for all glyph types
The mode base type
Node type
Connector type
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.