pw:: Segment

Connector and Curve segment type

Derives From

pw::Object

Summary
Connector and Curve segment type
This action deletes the segment.
This action gets the number of control points of this curve segment
This action gets the control point at the given index.
This action sets the control point at the given index.
This action adds a control point to the end of the control points for this curve segment.
This action inserts a control point before the given index.
This action removes the control point at the given index.
This action gets the position in the defining space of the segment at the given parameter, index, arc length, or constant value.
This action gets the position of the segment in model space at the given parameter, index, arc length, constant value, or closest point.
This action gets the parametric value of the segment at the given parameter, index, arc length, constant value, or closest point.
This action gets the length of the portion of the segment from the beginning to the given parameter, index, arc length, constant value, or closest point.
This actions gets the bay of the segment contained by the given parameter, index, arc length, constant value, or closest point
This action gets the total length of the segment.
This action gets the closest point on this segment to the given point or ray.
This action checkis if the segment is closed.
This action checks if the segment is a pole.
This action gets a list of points between two control points of a segment suitable for rendering.

Instance Actions

delete

$segment delete

This action deletes the segment.  This is necessary if the segment has not been added to a pw::Curve or pw::Connector.  Calling delete on a segment after it has been added, will generate an error.

Parameters

none

Returns

This action does not return anything.

getPointCount

$segment getPointCount

This action gets the number of control points of this curve segment

Parameters

none

Returns

This action returns the number of control points.

getPoint

$segment getPoint index

This action gets the control point at the given index.

Parameters

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

Returns

This action returns the point at the given index.

setPoint

$segment setPoint index point

This action sets the control point at the given index.

Parameters

indexThis parameter is the integer index of the point to set with the range [1, number of points].
pointThis parameter is the point to set.

Returns

This action does not return anything.

addPoint

$segment addPoint point

This action adds a control point to the end of the control points for this curve segment.

Parameters

pointThis parameter is the point to add.

Returns

This action does not return anything.

insertPoint

$segment insertPoint index point

This action inserts a control point before the given index.

Parameters

indexThis parameter is the index to insert the given point at; [1, number of points + 1]
pointThis parameter is the point to be inserted.

Returns

This action does not return anything.

removePoint

$segment removePoint index

This action removes the control point at the given index.

Parameters

indexThis parameter is the index of the point to remove; [1, number of points]

Returns

This action does not return anything.

getPosition

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

This action gets the position in the defining space of the segment at the given parameter, index, arc length, or constant value.

Parameters

-parameterThis parameter indicates to get the position at a specified parameteric value; the value is a parameter or a uv parameter [(0,0), (1,1)]; this is the default option.
-controlThis parameter indicates to get the position at a control point; the value is an index.  [1, number of points]
-arcThis parameter indicates to get the position at an arc length; the value is the normalized arc length from the start of the curve.
-XThis parameter indicates to get the position at a constant x; the value is the constant x coordinate value (-infinity, +infinity)
-YThis parameter indicates to get the position at a constant y; the value is the constant y coordinate value (-infinity, +infinity)
-ZThis parameter indicates to get the position at a constant z; the value is the constant z coordinate value (-infinity, +infinity)
-closestThis parameter indicates to get the closest position; the value is xyz, point, or grid coordinate
valueThis parameter is the value at which to get the position.

Returns

This action returns a point at the position on the segment.  (It will be in the form “u v dbentity” if the segment is database constrained and otherwise in the form “X Y Z”.)

getXYZ

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

This action gets the position of the segment in model space at the given parameter, index, arc length, constant value, or closest point.

Parameters

-parameterThis parameter indicates to get the xyz at a parameter; the value is a parameter or a uv parameter [(0,0), (1,1)]; this is the default option.
-controlThis parameter indicates to get the xyz at a control point; the value is an index [1, number of points].
-arcThis parameter indicates to get the xyz at an arc length; the value is the normalized arc length from the start of the curve.
-XThis parameter indicates to get the xyz at a constant x; the value is the constant x coordinate value (-infinity, +infinity).
-YThis parameter indicates to get the xyz at a constant y; the value is the constant y coordinate value (-infinity, +infinity).
-ZThis parameter indicates to get the xyz at a constant z; the value is the constant z coordinate value (-infinity, +infinity).
-closestThis parameter indicates to get the closest xyz; the value is a xyz, point, or grid coordinate.
valueThis parameter is the value at which to get the xyz.

Returns

This action returns an XYZ vector.

getParameter

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

This action gets the parametric value of the segment at the given parameter, index, arc length, constant value, or closest point.

Parameters

-parameterThis parameter indicates to get the parametric value at a parameter; the value is a parameter or a uv parameter [(0,0), (1,1)]; this is the default option.
-controlThis parameter indicates to get the parametric value at a control point; the value is an index [1, number of points].
-arcThis parameter indicates to get the parametric value at an arc length; the value is the normalized arc length from the start of the curve [0 , 1].
-XThis parameter indicates to get the parametric value at a constant x; the value is the constant x coordinate value (-infinity, +infinity).
-YThis parameter indicates to get the parametric value at a constant y; the value is the constant y coordinate value (-infinity, +infinity).
-ZThis parameter indicates to get the parametric value at a constant z; the value is the constant z coordinate value (-infinity, +infinity).
-closestThis parameter indicates to get the parametric value at the closest point on the segment; the value is a xyz, point, or grid coordinate.
valueThis parameter is the value at which to get the parameter.

Returns

This action returns the parametric value at the specified location on the segment.

Information

The -parameter option only returns the given parameter, but is included for consistency with other commands

getLength

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

This action gets the length of the portion of the segment from the beginning to the given parameter, index, arc length, constant value, or closest point.

Parameters

-parameterThis parameter indicates to get the length to a parametric value; the value is a parameter or a uv parameter with [(0,0), (1,1)]; this is the default option.
-controlThis parameter indicates to get the length to a control point; the value is an index [1, number of points].
-arcThis parameter indicates to get the length to an arc length; the value is the normalized arc length from the start of the curve.
-XThis parameter indicates to get the length to a constant x; the value is the constant x coordinate value (-infinity, +infinity).
-YThis parameter indicates to get the length to a constant y; the value is the constant y coordinate value (-infinity, +infinity).
-ZThis parameter indicates to get the length to a constant z; the value is the constant z coordinate value (-infinity, +infinity).
-closestThis parameter indicates to get the length to the point on the sgement that is closest to the specified point; the value is a xyz, point, or grid coordinate.
valueThis parameter is the value at which to get the length.

Returns

This action returns the length of the segment.

Information

The -arc option only converts from normalized to non-normalized length, but is included for consistency with other commands.

getBay

$segment getBay ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value

This actions gets the bay of the segment contained by the given parameter, index, arc length, constant value, or closest point

Parameters

-parameterThis parameter indicates to get the bay at a parametric value; the value is a parameter or a uv parameter [(0,0), (1,1)]; this is the default option.
-controlThis parameter indicates to get the bay at a control point; the value is an index [1, number of points].
-arcThis parameter indicates to get the bay at an arc length; the value is the normalized arc length from the start of the curve.
-XThis parameter indicates to get the bay at a constant x; the value is the constant x coordinate value (-infinity, +infinity).
-YThis parameter indicates to get the bay at a constant y; the value is the constant y coordinate value (-infinity, +infinity).
-ZThis parameter indicates to get the bay at a constant z; the value is the constant z coordinate value (-infinity, +infinity).
-closestThis parameter indicates to get the bay containing the closest point on the segment; the value is a xyz, point, or grid coordinate.
valueThis parameter is the value at which to get the position.

Returns

This action returns the bay of the segment, [0, number of points].

Information

Special treatment is given to the ends of the segment.  If the given value specifies the beginning of the segment, a bay of 0 is returned, if the given value specifies the end of the segment, a bay of the number of points is returned.  For a segment with less than two control points, the result is always 0.

getTotalLength

$segment getTotalLength

This action gets the total length of the segment.

Parameters

none

Returns

This action returns the length [0.0, +infinity).

closestPoint

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

This action gets the closest point on this segment to the given point or ray.

Parameters

-from fromVarThis optional parameter is a variable name to receive the xyz of the given point or the point along the ray that is closest to this segment.
-distance distVarThis optional parameter is a variable name to receive the distance between the given point or ray and the point returned.
-parameter paramVarThis optional parameter is a variable name to receive the parameter of the segment where the closest point occurs; [0.0, 1.0].
pointThis parameter is the point that is projected onto this segment.
dirThis optional parameter is a direction vector for finding the closest point from a ray emanating from the specified point.

Returns

This action returns an xyz point; if there is no closest point this action will return the origin.

isClosed

$segment isClosed

This action checkis if the segment is closed.

Parameters

none

Returns

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

isPole

$segment isPole

This action checks if the segment is a pole.

Parameters

none

Returns

This action returns a<boolean>, which is true if the segment is a pole.

getXYZsOfBay

$segment getXYZsOfBay index

This action gets a list of points between two control points of a segment suitable for rendering.

Parameters

indexThis parameter is the index of the bay;
[1, number of points1].

Returns

This action returns a list of the xyz points.

$segment delete
This action deletes the segment.
$segment getPointCount
This action gets the number of control points of this curve segment
$segment getPoint index
This action gets the control point at the given index.
$segment setPoint index point
This action sets the control point at the given index.
$segment addPoint point
This action adds a control point to the end of the control points for this curve segment.
$segment insertPoint index point
This action inserts a control point before the given index.
$segment removePoint index
This action removes the control point at the given index.
$segment getPosition ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets the position in the defining space of the segment at the given parameter, index, arc length, or constant value.
$segment getXYZ ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets the position of the segment in model space at the given parameter, index, arc length, constant value, or closest point.
$segment getParameter ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets the parametric value of the segment at the given parameter, index, arc length, constant value, or closest point.
$segment getLength ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets the length of the portion of the segment from the beginning to the given parameter, index, arc length, constant value, or closest point.
$segment getBay ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This actions gets the bay of the segment contained by the given parameter, index, arc length, constant value, or closest point
$segment getTotalLength
This action gets the total length of the segment.
$segment closestPoint ?-from fromVar? ?-distance distVar? ?-parameter paramVar? point ?dir?
This action gets the closest point on this segment to the given point or ray.
$segment isClosed
This action checkis if the segment is closed.
$segment isPole
This action checks if the segment is a pole.
$segment getXYZsOfBay index
This action gets a list of points between two control points of a segment suitable for rendering.
Base type for all glyph types
Database curve type
Connector type
An integer is a whole number.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.