pw:: Connector

Connector type

Derives From

pw::Object pw::Entity pw::GridEntity

Summary
Connector type
This action creates a new connector object.
This action creates new connector objects on the given database entities.
This action joins as many of the given connectors together as possible.
This action given two point-lists, returns a segment type, a start point, and an end point that represent the best segment between the given points.
This action gets a list of all connectors using the specified node.
This action finds the connectors adjacent to the given list of connectors.
This action checks if connectors will have a dimension after being created and the calculateDimension method called on them, based on the current settings.
This action finds connectors that have invalid distributions.
This default is the dimension of a connector when it is created.
This default is the distribution of a subconnector when it is created.
This default is the beginning spacing of a subconnector when it is created.
This default is the ending spacing of a subconnector when it is created.
This attribute is the dimension of a connector when it is created implicitly or when the calculateDimension action is called.
This attribute is the maximum dimension calculated for a connector when using the commands calculateDimension, setDimensionFromSpacing, and setDimensionFromDistribution.
This attribute is the average spacing between succesive grid points.
This attribute is a flag to allow the distribution of a connector to effect the dimension of the connector.
This attribute is the maximum turning angle allowed between succesive grid points.
This attribute is the maximum distance allowed between the analytic and discrete shape of a connector.
This attribute is a flag that allows the underlying surface of a connector to effect the NormalMaximumDeviation and CurveMaximumDeviation constraints.
This action delete this connector.
This action sets the dimension of this connector using its current solver settings.
This action gets the dimensions of this connector.
This action gets the dimensions of this connector.
This action sets the dimension of this connector.
This action sets the dimension of this connector based on equal spacing.
This action sets the dimension of this connector based on the current distribution.
This action sets the dimension of this connector by copying the dimension from a list of subconnectors.
This action increases the dimension of this connector.
This action gets the number of segments in this connector.
This action gets the segment at the given index.
This action sets the segment at the given index.
This action adds the segment to the end of the segments in the connector.
This action inserts the segment at the given index.
This action removes a segment from the connector.
This action removes all of the segments from the connector.
This action replaces all of the segments in the connector.
This action gets the number of subconnectors in this connector.
This action gets the dimension of a subconnector in this connector.
This action sets the dimensions of each subconnector in this connector.
This action gets the minimum and maximum grid point indices of a subconnector.
This action gets the distribution function of a subconnector.
This action sets the distribution function of a subconnector.
This action replaces the distribution function of a subconnector, retaining the previously set spacings.
This action locks the distribution of a subconnector.
This action switches all of the subconnector distributions that are of type pw::DistributionGeneral to use the current default distribution.
This action gets the parameter of the break point at the end of the subconnector with the given index.
This action gets the type of break point at the end of the subconnector.
This action adds one or more break points to the list of break points.
This action removes the break point from the connector at the end of the subconnector with the given index.
This action removes all of the break points from the connector.
This action checks if a break point can be added at a given location.
This action sets the spacing on both sides of a break point.
This action sets the shape of this connector to a smooth interpolation of the grid points of the given connector.
This action sets the shape of this connector to a least squares fit approximation of the grid points of the given connector.
This action sets the shape of this connector to a C1 continuous approximation of the shape of the given connector.
This action splits this connector at the given index or point.
This action joins this connector with a given connector.
This action projects this connector onto one or more database entities.
This action gets the default projection direction for this connector.
This action sets the orientation of this connector, by specifying the new imin node.
This action aligns the I orientation of the given connectors with this connector.
This action creates a periodic copy of this connector.
This action gets the connector that shares a periodic link with this connector.
This action breaks the periodic link that this connector has with another connector.
This action gets the position of a connector grid point.
This action sets the position of a connector interior grid point.
This action gets a position on a connector in the defining space of the connector.
This action gets the model space position on a connector.
This action gets a parameter value on a connector.
This action gets the connector length from the beginning to a given location.
This action gets the parameters at which the curve intersects the value.
This action gets the total length of the connector.
This action gets the average spacing between grid points of the connector.
This action gets the closest point on this connector to the given point.
This action gets the control point on this connector closest to the given point.
This action gets the number of control points on this connector.
This action gets a node from a connector.
This action checks if the connector is closed.
This action checks if the connector is a pole.
This action checks if the connector’s distributions on all of its subconnectors could be applied as requested.
This action checks to see if an index corresponds to a point in the interior of the connector.
This action returns the indices that are directly connected to the specified index.
This action gets the number of 1D cells in this connector.
This action gets the indices of the given 1D cell.

Static Actions

create

pw::Connector create

This action creates a new connector object.

Parameters

This action has no parameters.

Returns

This action returns a new pw::Connector object.

Example

This example shows how to create a connector with two conic segments that has an average spacing already set.  The name and dimension of the connector are outputted to the messages window.

Code

pw::Connector setCalculateDimensionMethod Spacing
pw::Connector setCalculateDimensionSpacing 0.3
set conic(1) [pw::SegmentConic create]
$conic(1) addPoint {-25 8 0}
$conic(1) addPoint {-8 8 0}
$conic(1) setIntersectPoint {-20 20 0}
set conic(2) [pw::SegmentConic create]
$conic(2) addPoint [$conic(1) getPoint [$conic(1) getPointCount]]
$conic(2) addPoint {10 16 0}
$conic(2) setShoulderPoint {8 8 0}
set con(1) [pw::Connector create]
$con(1) addSegment $conic(1)
$con(1) addSegment $conic(2)
$con(1) calculateDimension
puts "[$con(1) getName] has dimension of [$con(1) getDimension]."

Output

con-1 has dimension of 159.

createOnDatabase

pw::Connector createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_angle? ?-parametricConnectors mode? ?-reject rejectVar? ?-type type? entity_or_boundary_list

This action creates new connector objects on the given database entities.

Parameters

-merge toleranceThis optional parameter is the float tolerance for automatic connector merging with the range [0, infinity).  The default is 0 (no merging).
-splitConnectors split_angleThis optional parameter is the float turning angle to split connectors at with the range [0, 180).  The default is 0 (no splitting).
-joinConnectors join_angleThis optional parameter is the float turning angle to join connectors at with the range [0, 180).  The default is 0 (no joining).
-parametricConnectors modeThis optional parameter is the string mode for how connectors are created on parametric surfaces with options EndToEnd and Aligned.  The default is EndToEnd.
-reject rejectVarThis optional parameter is the string name of a variable to receive a list of pw::DatabaseEntity objects that were rejected for placing connectors on.  If a name is not given, rejections will be silently ignored.
-type typeThis optional parameter is the string name of the type of grid (Structured or Unstructured) to use when creating connectors from database entities.  This defaults to structured construction if not explicitly set to ‘Unstructured’.
entity_or_boundary_listThis parameter is a list of pw::DatabaseEntity objects and/or boundaries.

Returns

This action returns a list of new pw::Connector objects.

Information

This command supports progress updates.

Example

This example shows how to create connectors from database entities.  The -joinConnectors parameter is used to join connectors with a turning angle of less than 60 degrees.  The distribution of each connector created is then changed to tanh.

Code

pw::Connector setDefault Dimension 15
set db [pw::Database getAll]
set cons [pw::Connector createOnDatabase -joinConnectors 60 $db]
foreach con $cons {
$con replaceDistribution 1 [pw::DistributionTanh create]
}

join (static)

pw::Connector join ?-keepDistribution? ?-reject rejectVar? connectors

This action joins as many of the given connectors together as possible.

Parameters

-keepDistributionThis optional flag is notification that break points will be inserted into the connector in order to maintain the distribution settings.
-reject rejectVarThis optional parameter is the string name of a variable to receive a list of pw::Connector objects that were not joined.
connectorsThis parameter is a list of pw::Connector objects to join.

Returns

This action returns a list of the pw::Connector objects that were joined.

Information

This command supports progress updates.

Example

This example shows how to join multiple connectors at once but keep the distribution settings by adding break points.  The reject parameter is used to find which connectors were not joined.  $con(1), $con(2) and $con(3) are referencing existing connectors.

Code

pw::Connector join -keepDistribution -reject rj \
[list $con(1) $con(2) $con(3)]
foreach var $rj {
puts [$var getName]
}

Output

con-3

getBestSegment

pw::Connector getBestSegment -start startVar -end endVar start_points end_points

This action given two point-lists, returns a segment type, a start point, and an end point that represent the best segment between the given points.

Parameters

-start startVarThis optional parameter is the string name of a variable to receive the best start integer index or point.
-end endVarThis optional parameter is the string name of a variable to receive the best end integer index or point.
start_pointsThis parameter is a list of points for the start of the segment.
end_pointsThis parameter is a list of points for the end of the segment.

Returns

This action returns a segment type string.

Example

This example shows how to find the best segment between some optional end points.  $con(1) and $con(2) are referencing existing connectors.

Code

puts [pw::Connector getBestSegment -start st -end en \
[list [[$con(1) getNode End] getXYZ]] \
[list [[$con(2) getNode End] getXYZ]]]
puts $st; puts $en

Output

pw::SegmentSpline
0
0

getConnectorsFromNode

pw::Connector getConnectorsFromNode node

This action gets a list of all connectors using the specified node.

Parameters

nodeThis parameter is a pw::Node object.

Returns

This action returns a list of pw::Connector objects.

Example

This example shows how to get a list of all connectors using the given node.  $con(1) is referencing an existing connector.

Code

set node [$con(1) getNode End]
foreach cnctr [pw::Connector getConnectorsFromNode $node] {
puts [$cnctr getName]
}

Output

con-1
con-2
con-4
con-5

getAdjacentConnectors

pw::Connector getAdjacentConnectors ?-maximumAngle angle? ?-all? connectors

This action finds the connectors adjacent to the given list of connectors.

Parameters

-maximumAngle angleThis optional parameter is the maximum float bend angle for considering entities as adjacent with the range [0, 180].  The default is 180.
-allThis optional flag is notification to repeat search on the adjacent connectors found until there are no more adjacent connectors.
connectorsThis parameter is a list of pw::Connector objects to be used as the seed.

Returns

This action returns a list of adjacent pw::Connector objects.

Information

The returned list will not include any connectors specified in the original connectors list.

Example

This example shows how to get a list of all adjacent connectors using the given connector.  Any connectors returned will have less than a 90 degree bend angle with the given connector.  $con(2) is referencing an existing connector.

Code

foreach cnctr [pw::Connector getAdjacentConnectors \
-maximumAngle 90 $con(2)] {
puts [$cnctr getName]
}

Output

con-3
con-4

doConnectorsGetDimension

pw::Connector doConnectorsGetDimension

This action checks if connectors will have a dimension after being created and the calculateDimension method called on them, based on the current settings.

Parameters

This action has no parameters.

Returns

This action returns a boolean.

Example

This example shows how to check to see if newly created connectors will be dimensioned if calculateDimension is called on them.  For this example, no defaults had been set, so it returns false.

Code

puts [pw::Connector doConnectorsGetDimension]

Output

0

getInvalidDistributions

pw::Connector getInvalidDistributions ?-all?

This action finds connectors that have invalid distributions.

Parameters

-allThis optional flag is a notification that all connectors with invalid distributions are returned.  Otherwise, only the connectors that developed invalid distributions since the last call to this function are returned.

Returns

This action returns a list of pw::Connectors with invalid distributions.

Information

Connector distributions are not validated until the connector is queried for data.

Example

This example shows how to check for connectors with invalid distributions.  For this example, there were no invalid distributions.

Code

puts [pw::Connector getInvalidDistributions]

Output

(empty string)

Static Defaults

Dimension

pw::Connector get/setDefault Dimension dim

This default is the dimension of a connector when it is created.

Type

This default is an integer with the range 0 or [2, infinity).  0 is no dimension.

Default

The default value is 0.

Example

This example shows how to set and get the default dimension for connectors created within a script.

Code

pw::Connector setDefault Dimension 20
puts [pw::Connector getDefault Dimension]

Output

20

DistributionType

pw::Connector get/setDefault DistributionType distribution_type

This default is the distribution of a subconnector when it is created.

Type

This default is a string with options < Tanh | MRQS | Geometric >.

Default

The default value is Tanh.

Example

This example shows how to set and get the default distribution for subconnectors created within a script.

Code

pw::Connector setDefault DistributionType Geometric
puts [pw::Connector getDefault DistributionType]

Output

Geometric

BeginSpacing

pw::Connector get/setDefault BeginSpacing spacing

This default is the beginning spacing of a subconnector when it is created.

Type

This default is a float with the range [0, infinity).

Default

The default value is 0.0.

Example

This example shows how to set and get the default beginning spacing for subconnectors created within a script.

Code

pw::Connector setDefault BeginSpacing .01
puts [pw::Connector getDefault BeginSpacing]

Output

0.01

EndSpacing

pw::Connector get/setDefault EndSpacing spacing

This default is the ending spacing of a subconnector when it is created.

Type

This default is a float with the range [0, infinity).

Default

The default value is 0.0.

Example

This example shows how to set and get the default ending spacing for subconnectors created within a script.

Code

pw::Connector setDefault EndSpacing .1
puts [pw::Connector getDefault EndSpacing]

Output

0.1

Static Attributes

CalculateDimensionMethod

pw::Connector get/setCalculateDimensionMethod method

This attribute is the dimension of a connector when it is created implicitly or when the calculateDimension action is called.

Type

This attribute is a string with options < Explicit | Spacing >

Default

The default for this attribute is Explicit.

Information

When a connector is created its dimension is always set to the Dimension default.  When the calculateDimension action is called, the dimension will be altered using this method.

Explicit means to leave the dimension as is.  Spacing means to calculate the dimension using the CalculateDimensionSpacing attribute.

In the case of the createOnDatabase actions, the calculateDimension action is implicitly called after each connector has been created.

Example

This example shows how to dimension connectors according to a spacing attribute when creating connectors directly from a database.  $db is referencing an existing list of database entities.

Code

pw::Connector setCalculateDimensionMethod Spacing
pw::Connector setCalculateDimensionSpacing 0.3
pw::Connector createOnDatabase $db

CalculateDimensionMaximum

pw::Connector get/setCalculateDimensionMaximum dimension

This attribute is the maximum dimension calculated for a connector when using the commands calculateDimension, setDimensionFromSpacing, and setDimensionFromDistribution.

Type

This attribute is an integer with the range [2, infinity).

Default

The default for this attribute is 1024.

Example

This example shows how to set and get the maximum dimension that can be set when using calculateDimension on a connector.

Code

pw::Connector setCalculateDimensionMaximum 512
puts [pw::Connector getCalculateDimensionMaximum]

Output

512

CalculateDimensionSpacing

pw::Connector get/setCalculateDimensionSpacing spacing

This attribute is the average spacing between succesive grid points.

Type

This attribute is a float with the range [0, infinity).

Default

The default for this attribute is 0.

Information

This value is used to calculate the dimension of a connector when calculateDimension is called and with CalculateDimensionMethod set to Spacing.

An average spacing of 0.0 will undimension the connector.

Example

This example shows how to set and get the average spacing that a connector is created on database entities with.

Code

pw::Connector setCalculateDimensionSpacing .8
puts [pw::Connector getCalculateDimensionSpacing]

Output

0.8

See Also

calculateDimension

DistributionInfluence

pw::Connector get/setDistributionInfluence influence

This attribute is a flag to allow the distribution of a connector to effect the dimension of the connector.

Type

This attribute is a boolean.

Default

The default for this attribute is false.

Information

This value is used to calculate the dimension and distribution of a connector when calculateDimension is called.

Currently the only distribution that can have a meaningful effect on the dimension is the pw::DistributionShape type.  It will add to the dimension in order to meet the maximum deviation constraints set on the distribution.

Example

This example shows how to set and get the flag for distribution to effect dimension of a connector.

Code

pw::Connector setDistributionInfluence true
puts [pw::Connector getDistributionInfluence]

Output

1

See Also

calculateDimension

NormalMaximumDeviation

pw::Connector get/setNormalMaximumDeviation angle

This attribute is the maximum turning angle allowed between succesive grid points.

Type

This attribute is a float with the range [0, 180).  0 is disabled.

Default

The default for this attribute is 0.

Information

This value is used to calculate the dimension and distribution of a connector when calculateDimension is called.

Example

This example shows how to set and get the maximum turning angle between grid points on a connector.

Code

pw::Connector setNormalMaximumDeviation 150
puts [pw::Connector getNormalMaximumDeviation]

Output

150.0

See Also

calculateDimension

CurveMaximumDeviation

pw::Connector get/setCurveMaximumDeviation distance

This attribute is the maximum distance allowed between the analytic and discrete shape of a connector.

Type

This attribute is a float with the range [0, infinity).  0 is disabled

Default

The default for this attribute is 0.

Information

This value is used to calculate the dimension and distribution of a connector when calculateDimension is called.

Example

This example shows how to set and get the maximum distance between analytic and discrete curves of a connector.

Code

pw::Connector setCurveMaximumDeviation .001
puts [pw::Connector getCurveMaximumDeviation]

Output

0.001

See Also

calculateDimension

SurfaceCurvatureInfluence

pw::Connector get/setSurfaceCurvatureInfluence influence

This attribute is a flag that allows the underlying surface of a connector to effect the NormalMaximumDeviation and CurveMaximumDeviation constraints.

Type

This attribute is a boolean.

Default

The default for this attribute is false.

Information

This value is used to calculate the dimension and distribution of a connector when calculateDimension is called.  Maximum turning angle and curve deviation calculations use the underlying database curvature in addition to the connector curvature.  This is a factor when the database is highly curved transverse to the connector direction but relatively flat in the direction of the connector.

Example

This example shows how to set and get the flag for the underlying surface to effect normal maximum and curve maximum deviation constraints of a connector.

Code

pw::Connector setSurfaceCurvatureInfluence true
puts [pw::Connector getSurfaceCurvatureInfluence]

Output

1

See Also

calculateDimension

Instance Actions

delete

$con delete ?-force?

This action delete this connector.

Parameters

-forceThis optional flag is a notification that the entity will be deleted as well as higher level entities that depend on this entity.

Returns

This action returns nothing.

Example

This example shows how to delete a connector and any other entities it supports.

Code

set con(1) [pw::Grid getByName "con-45"]
$con(1) delete -force

calculateDimension

$con calculateDimension

This action sets the dimension of this connector using its current solver settings.

Parameters

This action has no parameters.

Returns

This action returns nothing.

Information

The dimension is calculated using the following steps:

1If the CalculateDimensionSpacing value is greater than 0, the dimension is set so that the difference between grid points is not greater than this value.
2If the DistributionInfluence flag is true, the dimension is increased based on the constraints of the connectors current distribution object.
3If the NormalMaximumDeviation value is greater than 0, the dimension is increased, and distribution altered, in order to meet this constraint.
4If the CurveMaximumDeviation value is greater than 0, the dimension is increased, and distribution altered, in order to meet this constraint.

SurfaceCurvatureInfluence affects steps 3 and 4 above if the connector has an underlying surface.  If true, the curvature of the underlying surface will be used in addition to the curvature of the connector.

Example

This example shows how to dimension a connector using average spacing.  $con(1) is referencing an existing connector.

Code

pw::Connector setCalculateDimensionMethod Spacing
pw::Connector setCalculateDimensionSpacing 2
$con(1) calculateDimension

getDimension

$con getDimension

This action gets the dimensions of this connector.

Parameters

This action has no parameters.

Returns

This action returns the integer number of grid points.  A non-dimensioned connector will return 0.

See Also

pw::Connector.getDimensions

Example

This example shows how to get the dimension of a connector.  $con(1) is referencing an existing connector.

Code

$con(1) getDimension

Output

9

getDimensions

$con getDimensions

This action gets the dimensions of this connector.

Parameters

This action has no parameters.

Returns

This action returns the integer number of grid points.  A non-dimensioned connector will return 0.

Information

This action is an alias for the getDimension action.  This action provides an interface consistent with the block, domain and node getDimensions actions.

See Also

pw::Connector.getDimension

Example

This example shows how to get the dimension of a connector.  $con(1) is referencing an existing connector.

Code

$con(1) getDimensions
# same as
$con(1) getDimension

Output

9
9

setDimension

$con setDimension dim

This action sets the dimension of this connector.

Parameters

dimThis parameter is the integer number of grid points of this connector with the range [2, infinity) or 0 if non-dimensioned.  If the dimension is less than the number of subconnectors plus 1, all interior breakpoints will be removed.

Returns

This action returns the resulting integer dimension.

Example

This example shows how to set the dimension of a connector explicitly.  $con(1) is referencing an existing connector.

Code

$con(1) setDimension 40

setDimensionFromSpacing

$con setDimensionFromSpacing spacing

This action sets the dimension of this connector based on equal spacing.

Parameters

spacingThis parameter is the float average spacing between grid points with the range (0, infinity).

Returns

This action returns the computed integer dimension.

Information

The dimension is limited by the CalculateDimensionMaximum attribute.

Example

This example shows how to set the dimension of a connector explicitly from spacing.  $con(1) is referencing an existing connector.

Code

puts [$con(1) setDimensionFromSpacing .2]

Output

79

setDimensionFromDistribution

$con setDimensionFromDistribution

This action sets the dimension of this connector based on the current distribution.

Parameters

This action has no parameters.

Returns

This action returns the computed integer dimension.

Information

The dimension is limited by the CalculateDimensionMaximum attribute.

Example

This example shows how to set the dimension of a connector explicitly from distribution.  $con(1) is referencing an existing connector.

Code

$con(1) replaceDistribution 1 [pw::DistributionShape create]
$con(1) setDimensionFromDistribution

setDimensionFromSubConnectors

$con setDimensionFromSubConnectors subcon_list

This action sets the dimension of this connector by copying the dimension from a list of subconnectors.

Parameters

subcon_listThis parameter is a list of subconnectors where each entry is a pw::Connector object and subconnector index.  If the pw::Connector only has one subconnector, the index can be omitted.  The direction of the chain of subconnectors can be specified by using either the word ‘Forward’ or the word ‘Reverse’ as the very first entry.  This is only necessary when the list of subconnectors is comprised of a single subconnector.  Otherwise, the direction can be determined from the order of the subconnectors.

Returns

This action returns the computed integer dimension.

Example

This example shows how to set the dimension of a connector explicitly from subconnectors.  $con(1) and $con(2) are referencing existing connectors.

Code

$con(2) setDimensionFromSubConnectors [list $con(1) 2]

increaseDimension

$con increaseDimension ?-surface? angle distance

This action increases the dimension of this connector.

Parameters

-surfaceThis optional flag is notification that the curvature of any underlying surfaces will be taken into account.
angleThis parameter is the float maximum normal deviation angle between grid points.  If 0.0, this criteria is ignored.
distanceThis parameter is the float maximum curve deviation distance between the grid and the analytical curve.  If 0.0, this criteria is ignored.

Returns

This action returns the new dimension.

Information

In order to meet the connectors curvature criteria, changing the dimension may alter the connector’s distribution.

Example

This example shows how to increase the dimension of a connector using the distance parameter.  $con(3) is referencing an existing connector.

Code

if {[$con(3) getDimension] < 15} {
puts [$con(3) increaseDimension 0 0.01]
}

Output

37

getSegmentCount

$con getSegmentCount

This action gets the number of segments in this connector.

Parameters

This action has no parameters.

Returns

This action returns the integer number of segments.

Example

This example shows how to get the number of segments in a connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getSegmentCount]

Output

2

getSegment

$con getSegment ?-copy? index

This action gets the segment at the given index.

Parameters

-copyThis optional flag is a notification that a copy of the segment is returned.
indexThis parameter is the integer index of the segment to get with the range [1, number of segments].

Returns

This action returns a pw::Segment object.

Example

This example shows how to get the number of control points for a certain segment in a connector.  $con(3) is referencing an existing connector.

Code

puts "This segment has [[$con(3) getSegment 2] getPointCount] \
control points."

Output

This segment has 5 control points.

setSegment

$con setSegment index segment

This action sets the segment at the given index.

Parameters

indexThis parameter is the integer index of the segment to set with the range [1, number of segments].
segmentThis parameter is the pw::Segment object to set.

Returns

This action returns nothing.

Example

This example shows how to set a segment at a certain index in a connector.  $con(1) is referencing an existing connector.

Code

set seg(1) [pw::SegmentSpline create]
$seg(1) addPoint [[$con(1) getSegment 1] getPoint 1]
$seg(1) addPoint "0 0 0"
$con(1) setSegment 1 $seg(1)

addSegment

$con addSegment segment

This action adds the segment to the end of the segments in the connector.

Parameters

segmentThis parameter is the pw::Segment object to add.

Returns

This action returns nothing.

Information

An error will be raised if the segment already belongs to another connector.

Example

This example shows how to add a segment to the end of a connector.  $con(1) is referencing an existing connector.

Code

set seg(1) [pw::SegmentSpline create]
$seg(1) addPoint [[$con(1) getSegment 2] getPoint 2]
$seg(1) addPoint "0 0 0"
$con(1) addSegment $seg(1)

insertSegment

$con insertSegment index segment

This action inserts the segment at the given index.

Parameters

indexThis parameter is the integer index to insert the given segment at with the range [1, number of segments+1].
segmentThis parameter is the pw::Segment object to insert.

Returns

This action returns nothing.

Information

An error will be raised if the segment already belongs to another connector.

Inserting at an index of (number-of-segments + 1) will append the segment.

Example

This example shows how to insert a segment at the second index of a connector.  $con(1) is referencing an existing connector.

Code

set seg(1) [pw::SegmentSpline create]
$seg(1) addPoint [[$con(1) getSegment 1] getPoint 2]
$seg(1) addPoint "0 0 0"
$con(1) insertSegment 2 $seg(1)

removeSegment

$con removeSegment < index | segment >

This action removes a segment from the connector.

Parameters

indexThis parameter is the integer index of the segment to remove with the range [1, number of segments].
segmentThis parameter is the pw::Segment object to remove.

Returns

This action returns nothing.

Example

This example shows how to remove a segment from a connector according to its index.  $con(1) is referencing an existing connector.

Code

$con(1) removeSegment 3

removeAllSegments

$con removeAllSegments

This action removes all of the segments from the connector.

Parameters

This action has no parameters.

Returns

This action returns nothing.

Example

This example shows how to remove all segments from a connector.  $con(1) is referencing an existing connector.

Code

$con(1) removeAllSegments

replaceAllSegments

$con replaceAllSegments segments

This action replaces all of the segments in the connector.

Parameters

segmentsThis parameter is a list of pw::Segment objects that will be the new segments of this connector.

Returns

This action returns nothing.

Example

This example shows how to replace all the existing segments in a connector with new ones.  $con(1) is referencing an existing connector.  $seg(1) and $seg(2) are referencing existing segments.

Code

$con(1) replaceAllSegments [list $seg(1) $seg(2)]

getSubConnectorCount

$con getSubConnectorCount

This action gets the number of subconnectors in this connector.

Parameters

This action has no parameters.

Returns

This action returns the integer number of subconnectors.

Example

This example shows how to get the subconnector count in order to set a breakpoint spacing at every breakpoint between subconnectors.  $con(1) is referencing an existing connector.

Code

for {set x 1} {$x < [$con(1) getSubConnectorCount]} {incr x} {
$con(1) setBreakPointSpacing $x 0.001
}

getSubConnectorDimension

$con getSubConnectorDimension ?index?

This action gets the dimension of a subconnector in this connector.

Parameters

indexThis parameter is the integer index of the subconnector to get the dimension of with the range [1, number of subconnectors].

Returns

This action returns the integer dimension of the subconnector, or if no index is specified, a list of integer dimensions for each subconnector.

Example

This example shows how to get the dimension of each subconnector in a given connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getSubConnectorDimension]

Output

96 148 88 71

setSubConnectorDimension

$con setSubConnectorDimension dims

This action sets the dimensions of each subconnector in this connector.

Parameters

dimsThis parameter is a list of integer dimensions for each subconnector; these must be compatible with the overall dimension of the connector.

Returns

This action returns nothing.

Example

This example shows how to set the dimension of each of the 4 subconnectors in a given connector with an overall dimension of 210.  $con(1) is referencing an existing connector.

Code

$con(1) setSubConnectorDimension [list 50 75 45 40]

getSubConnectorRange

$con getSubConnectorRange index

This action gets the minimum and maximum grid point indices of a subconnector.

Parameters

indexThis parameter is the integer index of the subconnector to get the range of with the range [1, number of subconnectors].

Returns

This action is a list containing the first and last grid point integer indices in the subconnector.

Example

This example shows how to get range of a subconnector within a given connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getSubConnectorRange 3]

Output

243 330

getDistribution

$con getDistribution ?-copy? index

This action gets the distribution function of a subconnector.

Parameters

-copyThis optional flag is a notification that a copy of the distribution is returned.
indexThis parameter is the integer index of the subconnector to get the distribution function of with the range [1, number of subconnectors].

Returns

This action returns a pw::Distribution object.

Example

This example shows how to get the distribution of the third subconnector within a given connector.  $con(1) is referencing an existing connector.

Code

puts [[$con(1) getDistribution 3] getType]

Output

pw::DistributionTanh

setDistribution

$con setDistribution ?-lockEnds? index distribution

This action sets the distribution function of a subconnector.

Parameters

-lockEndsThis flag will cause any unconstrained end spacings to be explicitly set to the naturally occurring spacing results.  This option is only valid if the connector is dimensioned.
indexThis parameter is the integer index of the subconnector to set the distribution function of with the range [1, number of subconnectors].
distributionThis parameter is the pw::Distribution object to set.

Returns

This action returns nothing.

Example

This example shows how to set the distribution of the third subconnector within a given connector.  Any previously set spacings will not be retained.  $con(1) is referencing an existing connector.

Code

$con(1) setDistribution 3 [pw::DistributionMRQS create]

replaceDistribution

$con replaceDistribution index distribution

This action replaces the distribution function of a subconnector, retaining the previously set spacings.

Parameters

indexThis parameter is the integer index of the subconnector to set the distribution function of with the range [1, number of subconnectors].
distributionThis parameter is the pw::Distribution object to set.

Returns

This action returns nothing.

Example

This example shows how to replace the distribution of the third subconnector within a given connector.  Any previously set spacings will be retained.  $con(1) is referencing an existing connector.

Code

$con(1) replaceDistribution 3 [pw::DistributionMRQS create]

lockDistribution

$con lockDistribution index

This action locks the distribution of a subconnector.

Parameters

indexThis parameter is the integer index of the subconnector to lock with the range [1, number of subconnectors].

Returns

This action returns nothing.

Information

Locking is done by converting the current distribution to a pw::DistributionGeneral object using the current dimension and distribution.

Example

This example shows how to lock the distribution of the third subconnector within a given connector.  $con(1) is referencing an existing connector.

Code

$con(1) lockDistribution 3

resetGeneralDistributions

$con resetGeneralDistributions

This action switches all of the subconnector distributions that are of type pw::DistributionGeneral to use the current default distribution.

Parameters

This action has no parameters.

Returns

This action returns nothing.

Example

This example shows how to reset the distributions of all subconnectors within a given connector.  $con(1) is referencing an existing connector.

Code

$con(1) resetGeneralDistributions

getBreakPoint

$con getBreakPoint index

This action gets the parameter of the break point at the end of the subconnector with the given index.

Parameters

indexThis parameter is the integer index of the break point to get with the range [1, number of subconnectors-1].

Returns

This action returns the float parameter of the break point; [0, 1].

Example

This example shows how to get the parameter of the break point at the end of the second subconnector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getBreakPoint 2]

Output

0.3361120722538553

getBreakPointType

$con getBreakPointType index

This action gets the type of break point at the end of the subconnector.

Parameters

indexThis parameter is the integer index of the break point to get with the range [1, number of subconnectors-1].

Returns

This action returns the string breakpoint type; < Control | Arc >.

Example

This example shows how to get the type of the break point at the end of the second subconnector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getBreakPointType 2]

Output

Arc

addBreakPoint

$con addBreakPoint ?< -control | -arc | -X | -Y | -Z | -U | -V >? value

This action adds one or more break points to the list of break points.

Parameters

-arcThis optional flag causes an Arc type break point to be added at an arc length.  The value is the normalized, float arc length from the start of the connector with the range [0.0, 1.0].  This is the default option.
-controlThis optional flag causes a Control type break point to be added at a control point.  The value is an integer index with the range (1, number of control points).
-XThis optional flag causes an Arc type break point to be added at each occurence of specified X location on the connector.  A location will be skipped if another break point is already present in the vicinity.
-YThis optional flag causes an Arc type break point to be added at each occurence of specified Y location on the connector.  A location will be skipped if another break point is already present in the vicinity.
-ZThis optional flag causes an Arc type break point to be added at each occurence of specified Z location on the connector.  A location will be skipped if another break point is already present in the vicinity.
-UThis optional flag causes an Arc type break point to be added at each occurence of specified U location on the connector.  A location will be skipped if another break point is already present in the vicinity.
-VThis optional flag causes an Arc type break point to be added at each occurence of specified V location on the connector.  A location will be skipped if another break point is already present in the vicinity.
valueThis parameter is the value to put the break point at.

Returns

This action returns the index of the break point added.  In the case of the -X, -Y, -Z, -U, or -V options, the return value is a list of the break point indices added.

Example

This example shows how to add a break point at three different X locations on a connector.  $con(1) is referencing an existing connector.

Code

foreach bp [list -15 0 10] {
puts [$con(1) addBreakPoint -X $bp]
}

Output

1
2
3

removeBreakPoint

$con removeBreakPoint index

This action removes the break point from the connector at the end of the subconnector with the given index.

Parameters

indexThis parameter is the integer index of the break point to remove with the [1, number of subconnectors-1].

Returns

This action returns nothing.

Example

This example shows how to remove a break point at the end of the second subconnector.  $con(1) is referencing an existing connector.

Code

$con(1) removeBreakPoint 2

removeAllBreakPoints

$con removeAllBreakPoints

This action removes all of the break points from the connector.

Parameters

This action has no parameters.

Returns

This action returns nothing.

Example

This example shows how to remove all the break points from a connector.  $con(1) is referencing an existing connector.

Code

$con(1) removeAllBreakPoints

checkBreakPoint

$con checkBreakPoint ?< -control | -arc >? value

This action checks if a break point can be added at a given location.

Parameters

-controlThis optional flag is notification to check the break point at a control point.  The value is an integer index; (1, number of control points).
-arcThis optional flag is notification to check the break point at an arc length.  The value is the normalized, float arc length from the start of the connector with the range [0.0, 1.0].  This is the default option.
valueThis parameter is the value to check the break point.

Returns

This action returns a boolean, true if the break point can be added, false if it is too close to an existing break point or if there are not enough grid points.

Example

This example shows how to check to see if a break point can be added at a certain arc length of a connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) checkBreakPoint -arc .6]

Output

1

setBreakPointSpacing

$con setBreakPointSpacing index < spacing | value >

This action sets the spacing on both sides of a break point.

Parameters

indexThis parameter is the integer index of the break point to set the spacing of with the range [1, number of subconnectors).
spacingThis parameter is the pw::Spacing object.
valueThis parameter is the float value to set for a pw::SpacingExplicit object which will be created for both sides of the given break point with the range [0, infinity).

Returns

This action returns nothing.

Information

This function replaces the affected distribution functions with duplicate distribution functions before changing the spacing to avoid changing the spacing on any other connectors sharing the modified distribution functions.  If you want the spacing to be used for all connectors sharing the distribution functions, you should get the distribution functions and change the spacing on them directly.

Example

This example shows how to set the break point spacing for every break point on a connector.  $con(1) is referencing an existing connector.

Code

for {set x 1} {$x < [$con(1) getSubConnectorCount]} {incr x} {
$con(1) setBreakPointSpacing $x 0.05
}

spline

$con spline ?connector?

This action sets the shape of this connector to a smooth interpolation of the grid points of the given connector.

Parameters

connectorThis optional parameter is a pw::Connector object whose grid points will be interpolated.  If not given the spline action will interpolate this connector’s own grid points.

Returns

This action returns nothing.

Information

If the given connector’s grid points are database constrained to a single parameter space, this action will set this connector’s shape to a smooth interpolation in that parameter space, otherwise the connector will be unconstrained.

Example

This example shows how to set the shape of $con(1) to a smooth interpolation of the grid points on $con(2).  $con(1) and $con(2) are referencing existing connectors.

Code

$con(1) spline $con(2)

fitLSQ

$con fitLSQ ?-tolerance tol? ?connector?

This action sets the shape of this connector to a least squares fit approximation of the grid points of the given connector.

Parameters

-tolerance tolThis optional parameter is the float approximation tolerance with the range [0, infinity).  The default is the current tolerance returned from pw::Database.getFitTolerance.
connectorThis optional parameter is a pw::Connector object whose grid points will be fitted.  If not given the spline action will fit this connector’s own grid points.

Returns

This action returns nothing.

Information

If the given connector’s grid points are database constrained to a single parameter space, this action will set this connector’s shape to a smooth interpolation in that parameter space, otherwise the connector will be unconstrained.

Example

This example shows how to set the shape of $con(1) to a least squares fit approximation with a tolerance other than the default.  $con(1) is referencing an existing connector.

Code

$con(1) fitLSQ -tolerance 0.0001

smoothC1

$con smoothC1 ?-tolerance tol? ?connector?

This action sets the shape of this connector to a C1 continuous approximation of the shape of the given connector.

Parameters

-tolerance tolThis optional parameter is the float approximation tolerance with the range [0, infinity).  The default is the current tolerance returned from pw::Database.getFitTolerance.
connectorThis optional parameter is a pw::Connector object whose shape will be approximated.  If not given the smoothC1 action will approximate this connector’s own shape.

Returns

This action returns nothing.

Information

If the given connector is database constrained to a single parameter space, this action will set the shape of this connector to a smooth interpolation in that parameter space, otherwise the shape will be unconstrained.

Example

This example shows how to set the shape of $con(1) to a C1 continuous approximation of the shape of $con(2).  $con(1) and $con(2) are referencing existing connectors.

Code

$con(1) smoothC1 $con(2)

split

$con split < -I index_list | param_list >

This action splits this connector at the given index or point.

Parameters

-I index_listThis optional parameter is the list of integer grid point indices to split at with the range [1, number of grid points].
param_listThis parameter is the list of float parameters to split at with the range [0.0, 1.0].  Note that parameter values do not represent the normalized arclength.

Returns

This action returns a list of pw::Connector objects.

Information

Duplicate indices or parameters will be ignored.

Indices and parameters at the limits of the connector will be ignored.

Parameter values can be obtained from the getParameter command.

Example

This example shows how to split a connector into four pieces.  Depending on how the connector is parameterized, this may or may not split the connector into quarters.  $con(1) is referencing an existing connector.

Code

foreach split [$con(1) split [list 0.25 0.5 0.75]] {
puts [$split getName]
}

Output

con-1-split-1
con-1-split-2
con-1-split-3
con-1-split-4

join

$con join ?-keepDistribution? connector ?side?

This action joins this connector with a given connector.

Parameters

-keepDistributionThis optional flag is notification that break points will be inserted into the connector in order to maintain the distribution settings.
connectorThis parameter is the pw::Connector object to join.
sideThis parameter is the side of this connector to join with options < Any | Begin | End >.

Returns

This action returns nothing.

Example

This example shows how to join two connectors but keep the distribution settings by adding a break point.  $con(1) is referencing an existing connector.

Code

$con(1) join -keepDistribution $con(2)

project

$con project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?<-interior | -shape>? ?dbentities?

This action projects this connector onto one or more database entities.

Parameters

-type proj_typeThis optional parameter is the string projection type to perform with options < ClosestPoint | Linear | SphericalIn | SphericalOut | CylindricalIn | CylindricalOut >.
-direction directionThis optional parameter is the projection vector for linear projection.  The default is determined by the entity and can be queried using getDefaultProjectDirection.
-center centerThis optional parameter is the center point vector for spherical projection.  The default is (0, 0, 0).
-axis point normalThis optional parameter is the axis defined by a point vector and normal vector used by cylindrical projection; The default point is (0, 0, 0) and the default normal is (1, 0, 0).
-interiorIf this optional flag is present, only the interior of the entities are projected.
-shapeIf this optional flag is present, the shape of the underlying curve will be projected to the database and the original distribution will be reapplied after the projection.
dbentitiesThis parameter is the optional list of database enitities to project onto.  If none are given, project to any currently enabled, visible database entities.

Returns

This action returns nothing.

Example

This example shows how to project a connector linearly along the -Y axis onto the first database entity it encounters in that path.  $con(1) is referencing an existing connector.

Code

$con(1) project -type Linear -direction "0 -1 0"

getDefaultProjectDirection

$con getDefaultProjectDirection

This action gets the default projection direction for this connector.

Parameters

This action has no parameters.

Returns

This action returns a vector.

Example

This example shows how to find the default projection direction for a connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getDefaultProjectDirection]

Output

0.0 0.0 1.0

setOrientation

$con setOrientation imin_node

This action sets the orientation of this connector, by specifying the new imin node.

Parameters

imin_nodeThis parameter is the index or end to be used as the Imin Node.  The foolowing end keywords or the associated index may be used: IMinimum = 1, IMaximum = 2.

Returns

This action returns nothing.

Information

Since the parameter specifies the new Imin node, if IMinimum or 1 is given as the imin_node parameter, the connector will not be changed.  Use an imin_node parameter of IMaximum or 2 to reverse the connector.

Example

This example shows how to set the connector orientation.  $con(1) is referencing an existing connector.

Code

$con(1) setOrientation 2

alignOrientation

$con alignOrientation connectors

This action aligns the I orientation of the given connectors with this connector.

Parameters

connectorsThis parameter is a list of topologically connected pw::Connector objects to align.

Returns

This action returns nothing.

Information

Any connectors in the given list that are not topologically connected to this connector will be ignored.

Example

This example shows how to align multiple connector orientations with the given connector’s orientation.  $con(1) is referencing an existing connector.

Code

$con(1) alignOrientation [list $con(2) $con(3)]

createPeriodic

$con createPeriodic < -translate vector | -rotate point normal angle >

This action creates a periodic copy of this connector.  This action will fail if the connector is already part of a periodic pair.

Parameters

-translateThis flag indicates that the periodic copy will be offset by the amount specified by the vector parameter.
vectorThis parameter is a translation vector that is applied to the new connector.  The length must be greater than zero.
-rotateThis flag indicates that the periodic copy will be rotated from the original about the origin specified by the point parameter and around the axis specified by the normal parameter by angle degrees.
pointThis parameter is the point of the axis to rotate the new connector.
normalThis parameter is the normal of the axis to rotate the new connector.  The normal must be non-zero.
angleThis parameter is the number of degrees to rotate the new connector.  The angle must be non-zero and not a multiple of 360.

Returns

This action returns a new pw::Connector object.  Under certain circumstances (such as the pw::Connector belonging to a periodic pw::Domain), the copy will be created but the periodic link will be broken.  Call getPeriodic to verify the periodicity.

Example

This example shows how to create a periodic copy of a connector via rotation.  $con(1) is referencing an existing connector.

Code

puts [[$con(1) createPeriodic \
-rotate [[$con(1) getNode End] getXYZ] "0 0 1" 120] getName]

Output

con-2

getPeriodic

$con getPeriodic ?-transform matrixVar?

This action gets the connector that shares a periodic link with this connector.

Parameters

-transform matrixVarThis optional parameter is the string name of the variable that receives a transform matrix for the periodic connector.

Returns

This action returns a pw::Connector object if there is a periodic link, or an empty string if there is no periodic link.

Example

This example shows how to return the periodic connector linked to a given connector.  $con(2) is referencing an existing connector.

Code

puts [[$con(2) getPeriodic] getName]

Output

con-1

breakPeriodic

$con breakPeriodic

This action breaks the periodic link that this connector has with another connector.  This action has no effect if the connector was not part of a periodic pair.

Parameters

This action has no parameters.

Returns

This action returns nothing.

Example

This example shows how to break the periodic link that a given connector has.  $con(1) is referencing an existing connector.

Code

$con(1) breakPeriodic

getPoint

$con getPoint ?-constrained constrainedVar? index

This action gets the position of a connector grid point.

Parameters

indexThis parameter is the integer index of the grid point to get with the range [1, dimension].
-constrained constrainedVarThis optional parameter is the string name of a variable.  If the grid point is database constrained, this variable is set to true.  If not constrained, it is set to false.

Returns

This action returns a point giving the grid point position and this may be in the form “u v dbentity”.

Example

This example shows how to get the point of a connector grid point.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getPoint 5]
puts [$con(1) getPoint -constrained isDb 5]
puts "isDb=$isDb"

Output

-7.709635714285716 4.160740000000001 0.0
-7.709635714285716 4.160740000000001 0.0
isDb=0

setPoint

$con setPoint index point

This action sets the position of a connector interior grid point.

Parameters

indexThis parameter is the integer index of the target grid point to set with the range (1, dimension).  The index must be for an interior grid point.
pointThis parameter is the new point value of the grid point.

Returns

This action returns nothing.

Information

If the new point is on the underlying segments and between the adjacent grid point, the segment is unchanged.  If the moved index is on a break point, the break point is removed.  If the new point is moved off of the underlying segments or is on the segments but is not between adjacent grid points, the underlying segments are replaced by one defined by the grid points (including the new value) and all break points are removed.  In all cases, the distribution of the final subconnector containing the point is changed to a general distribution function.

Example

This example shows how to set the point of an interior connector grid point.  The orignal connector is a line on the X-axis, so setting this point changes the shape of the connector.  $con(1) is referencing an existing connector.

Code

$con(1) setPoint 3 "2.5 1 0"

getPosition

$con getPosition ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value

This action gets a position on a connector in the defining space of the connector.

Parameters

-gridThis optional flag is the notification to get the position at a grid point. value is an integer index [1, number of grid points].  This is the default option.
-controlThis optional flag is the notification to get the position at a control point.  The value is an integer index with the range [1, number of control points].
-parameterThis optional flag is the notification to get the position at a parameter.  The value is a float with the range [0.0, 1.0] or a uv vector with v ignored.
-arcThis optional flag is the notification to get the position at an arc length.  The value is a normalized float arc length from the start of the connector with the range [0.0, 1.0].
-XThis optional flag is the notification to get the position at a constant x; value is a float constant x coordinate value.
-YThis optional flag is the notification to get the position at a constant y; value is a float constant y coordinate value.
-ZThis optional flag is the notification to get the position at a constant z; value is a float constant z coordinate value.
-closestThis optional flag is the notification to get the closest position; the value is an xyz point, or grid coord.
valueThis parameter is the value to get the position.

Returns

This action returns a point giving the position on the connector which may be in the form “u v dbentity”.

Information

If the connector is defined in model space, an xyz vector will be returned.  If the connector is defined by a database, the position will be returned in database parameter space.

Example

This example shows how to get the position at a constant X value on a connector.  This connector was created on a database entity.  $con(1) is referencing an existing connector.

Code

puts [pw::Application getDescription \
[$con(1) getPosition -X 3]]

Output

curve-1 (0.6,0)

getXYZ

$con getXYZ ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value

This action gets the model space position on a connector.

Parameters

-gridThis optional flag is the notification to get the position at a grid point. value is an integer index [1, number of grid points].  This is the default option.
-controlThis optional flag is the notification to get the position at a control point.  The value is an integer index with the range [1, number of control points].
-parameterThis optional flag is the notification to get the position at a parameter.  The value is a float with the range [0.0, 1.0] or a uv vector with v ignored.
-arcThis optional flag is the notification to get the position at an arc length.  The value is a normalized float arc length from the start of the connector with the range [0.0, 1.0].
-XThis optional flag is the notification to get the position at a constant x; value is a float constant x coordinate value.
-YThis optional flag is the notification to get the position at a constant y; value is a float constant y coordinate value.
-ZThis optional flag is the notification to get the position at a constant z; value is a float constant z coordinate value.
-closestThis optional flag is the notification to get the closest position; the value is an xyz point, or grid coord.
valueThis parameter is the value to get the position.

Returns

This action returns an XYZ vector.

Example

This example shows how to get the model space position at 3/4 the the length of a connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getXYZ -parameter [list 0.75]]

Output

3.75 2.0 0.0

getParameter

$con getParameter ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value

This action gets a parameter value on a connector.

Parameters

-gridThis optional flag is the notification to get the position at a grid point. value is an integer index [1, number of grid points].  This is the default option.
-controlThis optional flag is the notification to get the position at a control point.  The value is an integer index with the range [1, number of control points].
-parameterThis optional flag is the notification to get the position at a parameter.  The value is a float with the range [0.0, 1.0] or a uv vector with v ignored.
-arcThis optional flag is the notification to get the position at an arc length.  The value is a normalized float arc length from the start of the connector with the range [0.0, 1.0].
-XThis optional flag is the notification to get the position at a constant x; value is a float constant x coordinate value.
-YThis optional flag is the notification to get the position at a constant y; value is a float constant y coordinate value.
-ZThis optional flag is the notification to get the position at a constant z; value is a float constant z coordinate value.
-closestThis optional flag is the notification to get the closest position; the value is an xyz point, or grid coord.
valueThis parameter is the value to get the position.

Returns

This action returns the float parameter of the connector.

Information

The -parameter value option only returns the given value clamped to [0.0, 1.0].  It is included for consistency with other commands.

Example

This example shows how to get the parameter value of a grid point on a connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getParameter -grid 2]

Output

0.25

getLength

$con getLength ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value

This action gets the connector length from the beginning to a given location.

Parameters

-gridThis optional flag is the notification to get the position at a grid point. value is an integer index [1, number of grid points].  This is the default option.
-controlThis optional flag is the notification to get the position at a control point.  The value is an integer index with the range [1, number of control points].
-parameterThis optional flag is the notification to get the position at a parameter.  The value is a float with the range [0.0, 1.0] or a uv vector with v ignored.
-arcThis optional flag is the notification to get the position at an arc length.  The value is a normalized float arc length from the start of the connector with the range [0.0, 1.0].
-XThis optional flag is the notification to get the position at a constant x; value is a float constant x coordinate value.
-YThis optional flag is the notification to get the position at a constant y; value is a float constant y coordinate value.
-ZThis optional flag is the notification to get the position at a constant z; value is a float constant z coordinate value.
-closestThis optional flag is the notification to get the closest position; the value is an xyz point, or grid coord.
valueThis parameter is the value to get the position.

Returns

This action returns the float curve length.

Information

The -arc value option converts value from a normalized to a non-normalized length.  It is included for consistency with other commands.

Example

This example shows how to get the length along a connector from the the point on the connector closest to the given point.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getLength -closest "4.5 1 0"]

Output

6.985033540042618

getParameters

$con getParameters ?< -X | -Y | -Z >? value

This action gets the parameters at which the curve intersects the value.

Parameters

-XThis optional flag is the notification to get the position at a constant x; value is a float constant x coordinate value.
-YThis optional flag is the notification to get the position at a constant y; value is a float constant y coordinate value.
-ZThis optional flag is the notification to get the position at a constant z; value is a float constant z coordinate value.
valueThis parameter is the value to get the position.

Returns

This action returns an array of parameters.

Example

This example shows how to get parameters where this connector crosses Y-axis at 0.5.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getParameters -Y .5]

Output

0.17637560670204108 0.2778605205775764 0.692205316990254

getTotalLength

$con getTotalLength ?-constrained constrainedVar?

This action gets the total length of the connector.

Parameters

-constrained constrainedVarThis optional parameter is the string name of a variable to receive the length of the this entity, that is constrained to database entities.

Returns

This action returns float length with the range [0.0, infinity).

Example

This example shows how to get the total length of a connecter, plus the length of the part constrained to a database entity.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getTotalLength -constrained onDB]
puts $onDB

Output

10.012756135615804
5.0

getAverageSpacing

$con getAverageSpacing

This action gets the average spacing between grid points of the connector.

Parameters

This action has no parameters.

Returns

This action returns the float average spacing with the range [0.0, infinity).

Example

This example shows how to get the average spacing of grid points on this connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getAverageSpacing]

Output

0.1353075153461595

closestPoint

$con closestPoint ?-from fromVar? ?-distance distVar? ?-parameter paramVar? point ?dir?

This action gets the closest point on this connector to the given point.

Parameters

-from fromVarThis optional parameter is the string name of a variable to receive the xyz of the given point or the point along the ray that is closest to this connector.
-distance distVarThis optional parameter is the string name of a variable to receive the float distance between the given point or ray and the point returned.
-parameter paramVarThis optional parameter is the string name of a variable to receive the float parameter of the connector where the closest point occurs with the range [0.0, 1.0].
pointThis parameter is the point to project onto this connector.
dirThis parameter is a direction vector for finding the closest point from a ray.

Returns

This action returns a point giving the closest point position and this may be in the form “u v dbentity”.  If there is no closest point, the origin (0, 0, 0) will be returned.

Information

If the connector is defined in model space, an xyz vector will be returned.  If the connector is defined by a database, the position will be returned in database parameter space.

Example

This example shows how to get the point on the connector closest to the given point.  The connector is not database constrained.  $con(1) is referencing an existing connector.

Code

puts [$con(1) closestPoint -parameter param "4 3 0"]
puts $param

Output

4.230944469613184 0.7742033915483331 0.0
0.748219646260448

closestControlPoint

$con closestControlPoint ?-from fromVar? ?-distance distVar? ?-parameter paramVar? ?-index indexVar? point ?dir?

This action gets the control point on this connector closest to the given point.

Parameters

-from fromVarThis optional parameter is the string name of a variable to receive the xyz of the given point or the point along the ray that is closest to this connector.
-distance distVarThis optional parameter is the string name of a variable to receive the float distance between the given point or ray and the point returned.
-parameter paramVarThis optional parameter is the string name of a variable to receive the float parameter of the connector where the closest point occurs with the range [0.0, 1.0].
-index indexVarThis optional parameter is the string name of a variable to receive the control point index of the closest control point.
pointThis parameter is the point to project onto this connector.
dirThis paramter is a direction vector for finding the closest point from a ray.

Returns

This action returns a point in model space or the origin (0,0,0) if there is no closest point.

Example

This example shows how to return the point of the nearest control point to a given point.  A break point is then added at that control point if it is not one of the end control points.  $con(1) is referencing an existing connector.

Code

puts [$con(1) closestControlPoint -index cp ".5 .5 0"]
if {$cp > 1 && $cp < [$con(1) getControlPointCount]} {
$con(1) addBreakPoint -control $cp
}

Output

0.36029 -0.170198 0.0

getControlPointCount

$con getControlPointCount

This action gets the number of control points on this connector.

Parameters

This action has no parameters.

Returns

This action returns the integer number of connector control points.

Example

This example shows how to get the number of controls points on a connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getControlPointCount]

Output

4

getNode

$con getNode < Begin | End | index >

This action gets a node from a connector.

Parameters

BeginThis parameter is the node at the beginning of the connector.
EndThis paramtere is the node at the end of the connector.
indexThis parameter is the integer index of the node to get with the range [1, 2].

Returns

This action returns a pw::Node object.

Information

Begin and 1 are the same.  End and 2 are the same.

Example

This example shows how to get the end node of a connector and then find the XYZ position of that node.  $con(1) is referencing an existing connector.

Code

set node [$con(1) getNode End]
puts [$node getXYZ]

Output

20.5703 -2.17697 0.0

isClosed

$con isClosed

This action checks if the connector is closed.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the connector is closed.

Example

This example checks to see whether a circle connector is closed.  $con(1) is referencing an existing connector.

Code

puts [$con(1) isClosed]

Output

1

isPole

$con isPole

This action checks if the connector is a pole.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the connector is a pole.

Example

This example checks to see whether a connector is a pole.  $con(1) is referencing an existing connector.

Code

puts [$con(1) isPole]

Output

0

checkDistributionValidity

$con checkDistributionValidity

This action checks if the connector’s distributions on all of its subconnectors could be applied as requested.

Parameters

This action has no parameters.

Returns

This action returns a boolean, true if the distributions on all of the connector’s subconnectors were applied successfully.

Information

This will check to see if spacing constraints that are applied to the ends of a subconnector can be enforced.

Example

This example shows how to check if a distribution was correctly applied to a subconnector.  $con(1) is referencing an existing connector.

Code

[$con(1) getDistribution 1] setEndSpacing .5
puts [$con(1) checkDistributionValidity]

Output

1

isInteriorIndex

$con isInteriorIndex index

This action checks to see if an index corresponds to a point in the interior of the connector.

Parameters

indexThis parameter is the integer index of the grid point to check with the range [1, dimension].

Returns

This action returns true if the index is an interior point.

Example

This example shows how to check to see if a certain index is in the interior of a connector.  $con(1) is referencing an existing connector that has a dimension of 10.

Code

puts [$con(1) isInteriorIndex 1]
puts [$con(1) isInteriorIndex 4]
puts [$con(1) isInteriorIndex 10]

Output

0
1
0

getAdjacentIndices

$con getAdjacentIndices ?-linear? index

This action returns the indices that are directly connected to the specified index.

Parameters

-linearIf this option is specified, the results will be a list of linear integer indices regardless of the input form (present only to retain consistency with the syntax of the same command for pw::Domain and pw::Block objects).
indexThis parameter is the integer linear index of the target grid point with the range [1, number of points].

Returns

This action returns a list of indices representing the adjacent coordinates.  The result will be a list of integer indices.

Example

This example shows how to return a list of integer indices that are adjacent to the given integer index on a connector.  $con(1) is referencing an existing connector.

Code

puts [$con(1) getAdjacentIndices 5]

Output

4 6

getCellCount

$con getCellCount

This action gets the number of 1D cells in this connector.

Parameters

This action has no parameters.

Returns

This action returns the integer number of cells.

Information

This action provides an interface consistent with the block, domain getCellCount actions.

A 1D cell is a line segment between two consecutive connector grid points.

The number of connector cells is equal to [$con getPointCount]1.

See Also

pw::Domain.getCellCount, pw::Block.getCellCount, pw::Connector.getCell

Example

This example shows how to get the number of cells in a connector.  $con is referencing an existing connector.

Code

$con setDimension 5
puts "getPointCount: [$con getPointCount]"
puts "getCellCount: [$con getCellCount]"

Output

getPointCount: 5
getCellCount: 4

getCell

$con getCell index

This action gets the indices of the given 1D cell.

Parameters

indexThis parameter is the integer index of the cell to get with the range [1, number of cells].

Returns

This action returns a list of two integer point indices.

Information

This action provides an interface consistent with the block, domain getCell actions.

A 1D cell is a line segment between two consecutive connector grid points.

A connector’s cell is equal to [list $index [expr {$index + 1}]].

See Also

pw::Domain.getCell, pw::Block.getCell, pw::Connector.getCellCount

Example

This example shows how to get the indices for a cell.  $con is referencing an existing connector.

Code

$con setDimension 5
puts "getPointCount: [$con getPointCount]"
puts "getCellCount: [set cnt [$con getCellCount]]"
for {set i 1} { $i <= $cnt } {incr i} {
puts "getCell $i: \{ [$con getCell $i] \}"
}

Output

getPointCount: 5
getCellCount: 4
getCell 1: { 1 2 }
getCell 2: { 2 3 }
getCell 3: { 3 4 }
getCell 4: { 4 5 }
pw::Connector create
This action creates a new connector object.
pw::Connector createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_angle? ?-parametricConnectors mode? ?-reject rejectVar? ?-type type? entity_or_boundary_list
This action creates new connector objects on the given database entities.
pw::Connector join ?-keepDistribution? ?-reject rejectVar? connectors
This action joins as many of the given connectors together as possible.
pw::Connector getBestSegment -start startVar -end endVar start_points end_points
This action given two point-lists, returns a segment type, a start point, and an end point that represent the best segment between the given points.
pw::Connector getConnectorsFromNode node
This action gets a list of all connectors using the specified node.
pw::Connector getAdjacentConnectors ?-maximumAngle angle? ?-all? connectors
This action finds the connectors adjacent to the given list of connectors.
pw::Connector doConnectorsGetDimension
This action checks if connectors will have a dimension after being created and the calculateDimension method called on them, based on the current settings.
$con calculateDimension
This action sets the dimension of this connector using its current solver settings.
pw::Connector getInvalidDistributions ?-all?
This action finds connectors that have invalid distributions.
pw::Connector get/setDefault Dimension dim
This default is the dimension of a connector when it is created.
pw::Connector get/setDefault DistributionType distribution_type
This default is the distribution of a subconnector when it is created.
pw::Connector get/setDefault BeginSpacing spacing
This default is the beginning spacing of a subconnector when it is created.
pw::Connector get/setDefault EndSpacing spacing
This default is the ending spacing of a subconnector when it is created.
pw::Connector get/setCalculateDimensionMethod method
This attribute is the dimension of a connector when it is created implicitly or when the calculateDimension action is called.
pw::Connector get/setCalculateDimensionMaximum dimension
This attribute is the maximum dimension calculated for a connector when using the commands calculateDimension, setDimensionFromSpacing, and setDimensionFromDistribution.
$con setDimensionFromSpacing spacing
This action sets the dimension of this connector based on equal spacing.
$con setDimensionFromDistribution
This action sets the dimension of this connector based on the current distribution.
pw::Connector get/setCalculateDimensionSpacing spacing
This attribute is the average spacing between succesive grid points.
pw::Connector get/setDistributionInfluence influence
This attribute is a flag to allow the distribution of a connector to effect the dimension of the connector.
pw::Connector get/setNormalMaximumDeviation angle
This attribute is the maximum turning angle allowed between succesive grid points.
pw::Connector get/setCurveMaximumDeviation distance
This attribute is the maximum distance allowed between the analytic and discrete shape of a connector.
pw::Connector get/setSurfaceCurvatureInfluence influence
This attribute is a flag that allows the underlying surface of a connector to effect the NormalMaximumDeviation and CurveMaximumDeviation constraints.
$con delete ?-force?
This action delete this connector.
$con getDimension
This action gets the dimensions of this connector.
$con getDimensions
This action gets the dimensions of this connector.
$con setDimension dim
This action sets the dimension of this connector.
$con setDimensionFromSubConnectors subcon_list
This action sets the dimension of this connector by copying the dimension from a list of subconnectors.
$con increaseDimension ?-surface? angle distance
This action increases the dimension of this connector.
$con getSegmentCount
This action gets the number of segments in this connector.
$con getSegment ?-copy? index
This action gets the segment at the given index.
$con setSegment index segment
This action sets the segment at the given index.
$con addSegment segment
This action adds the segment to the end of the segments in the connector.
$con insertSegment index segment
This action inserts the segment at the given index.
$con removeSegment < index | segment >
This action removes a segment from the connector.
$con removeAllSegments
This action removes all of the segments from the connector.
$con replaceAllSegments segments
This action replaces all of the segments in the connector.
$con getSubConnectorCount
This action gets the number of subconnectors in this connector.
$con getSubConnectorDimension ?index?
This action gets the dimension of a subconnector in this connector.
$con setSubConnectorDimension dims
This action sets the dimensions of each subconnector in this connector.
$con getSubConnectorRange index
This action gets the minimum and maximum grid point indices of a subconnector.
$con getDistribution ?-copy? index
This action gets the distribution function of a subconnector.
$con setDistribution ?-lockEnds? index distribution
This action sets the distribution function of a subconnector.
$con replaceDistribution index distribution
This action replaces the distribution function of a subconnector, retaining the previously set spacings.
$con lockDistribution index
This action locks the distribution of a subconnector.
$con resetGeneralDistributions
This action switches all of the subconnector distributions that are of type pw::DistributionGeneral to use the current default distribution.
General distribution function type
$con getBreakPoint index
This action gets the parameter of the break point at the end of the subconnector with the given index.
$con getBreakPointType index
This action gets the type of break point at the end of the subconnector.
$con addBreakPoint ?< -control | -arc | -X | -Y | -Z | -U | -V >? value
This action adds one or more break points to the list of break points.
$con removeBreakPoint index
This action removes the break point from the connector at the end of the subconnector with the given index.
$con removeAllBreakPoints
This action removes all of the break points from the connector.
$con checkBreakPoint ?< -control | -arc >? value
This action checks if a break point can be added at a given location.
$con setBreakPointSpacing index < spacing | value >
This action sets the spacing on both sides of a break point.
$con spline ?connector?
This action sets the shape of this connector to a smooth interpolation of the grid points of the given connector.
$con fitLSQ ?-tolerance tol? ?connector?
This action sets the shape of this connector to a least squares fit approximation of the grid points of the given connector.
$con smoothC1 ?-tolerance tol? ?connector?
This action sets the shape of this connector to a C1 continuous approximation of the shape of the given connector.
$con split < -I index_list | param_list >
This action splits this connector at the given index or point.
$con join ?-keepDistribution? connector ?side?
This action joins this connector with a given connector.
$con project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?<-interior | -shape>? ?dbentities?
This action projects this connector onto one or more database entities.
$con getDefaultProjectDirection
This action gets the default projection direction for this connector.
$con setOrientation imin_node
This action sets the orientation of this connector, by specifying the new imin node.
$con alignOrientation connectors
This action aligns the I orientation of the given connectors with this connector.
$con createPeriodic < -translate vector | -rotate point normal angle >
This action creates a periodic copy of this connector.
$con getPeriodic ?-transform matrixVar?
This action gets the connector that shares a periodic link with this connector.
$con breakPeriodic
This action breaks the periodic link that this connector has with another connector.
$con getPoint ?-constrained constrainedVar? index
This action gets the position of a connector grid point.
$con setPoint index point
This action sets the position of a connector interior grid point.
$con getPosition ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value
This action gets a position on a connector in the defining space of the connector.
$con getXYZ ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value
This action gets the model space position on a connector.
$con getParameter ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value
This action gets a parameter value on a connector.
$con getLength ?< -grid | -control | -parameter | -arc | -X | -Y | -Z | -closest >? value
This action gets the connector length from the beginning to a given location.
$con getParameters ?< -X | -Y | -Z >? value
This action gets the parameters at which the curve intersects the value.
$con getTotalLength ?-constrained constrainedVar?
This action gets the total length of the connector.
$con getAverageSpacing
This action gets the average spacing between grid points of the connector.
$con closestPoint ?-from fromVar? ?-distance distVar? ?-parameter paramVar? point ?dir?
This action gets the closest point on this connector to the given point.
$con closestControlPoint ?-from fromVar? ?-distance distVar? ?-parameter paramVar? ?-index indexVar? point ?dir?
This action gets the control point on this connector closest to the given point.
$con getControlPointCount
This action gets the number of control points on this connector.
$con getNode < Begin | End | index >
This action gets a node from a connector.
$con isClosed
This action checks if the connector is closed.
$con isPole
This action checks if the connector is a pole.
$con checkDistributionValidity
This action checks if the connector’s distributions on all of its subconnectors could be applied as requested.
$con isInteriorIndex index
This action checks to see if an index corresponds to a point in the interior of the connector.
$con getAdjacentIndices ?-linear? index
This action returns the indices that are directly connected to the specified index.
$con getCellCount
This action gets the number of 1D cells in this connector.
$con getCell index
This action gets the indices of the given 1D cell.
Base type for all glyph types
Entity type
Connector type
A float is a fractional number.
A string is an array of characters.
Base type for all database entities
An integer is a whole number.
A point is a position either in model space or database parameter space.
Node type
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
Shape distribution function type
Connector and Curve segment type
Base class for distribution types
Base class for spacing types
Explicit spacing type
pw::Database getFitTolerance
This action gets the fit tolerance for database operations.
A vector is a list of float values.
Domain type
A coord is a position in grid space.
Block type
$dom getCellCount
This action gets the number of cells in this domain.
$block getCellCount
This action gets the number of cells in this block.
$dom getCell index
This action gets the indices of the given cell.
$block getCell index
This action gets the indices of the given cell.