pw::Merger

The merge mode type

Derives From

pw::Object pw::Mode

Notes

To create a mode of this type, use the pw::Application.begin command with the mode Merge specified, like this:

set merger [pw::Application begin Merge]
Summary
pw::MergerThe merge mode type
Instance Actions
replaceThis action replaces the first entity with the second entity, unless -automatic option is specified.
mergeThis action automatically merges two connectors.
findPairsThis action finds pairs of entities that are within the given tolerance, filtered by the given type and topology.
getPairCountThis action gets the number of pairs found from the last findPairs action.
getPairThis action gets a pair of entities with the given index.
getPairsThis action gets all the pairs of entities.
setPairStatusThis action sets the merge status of the given pair.
mergePairsThis action merges the pairs that have been marked for merging.
mergeConnectorsThis action merges connectors and nodes within the tolerance.

Instance Actions

replace

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

This 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 receive the difference between the pair.
-status statusVarThis optional parameter is a variable name to receive 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.

getPairs

$merger getPairs

This action gets all the pairs of entities.

Parameters

This action has no parameters.

Returns

Depending on the type of the last findPairs action this action will return a list of pairs which are 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 fallowed by the merge status and delta between the objects; (ent1 ent2 0|1 delta).

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 >
This 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 getPairs
This action gets all the pairs of entities.
$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
pw::Application begin ?-mode_specific_flags? mode ?entities?
This action begins a mode in the application.
A node is the zero-dimensional boundary of a one-dimensional pw::Connector.
A connector is a computationally one-dimensional grid entity, defined in the parameter space of one or more end-connected curve segments.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
Close