pw:: Curve

Database curve type

Derives From

pw::Object pw::Entity pw::DatabaseEntity

Summary
Database curve type
This action creates a new curve object.
This action joins as many of the given curves together as possible.
This action, given two lists of points, returns a segment type, a start point, and an end point that represent the best segment between the given points.
This action gets the best offset point for the given curve.
This action finds the best offset normal vector from this curve to a point.
This action gets the number of segments in this curve.
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 curve.
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 curve.
This action replaces all of the segments in the curve.
This action gets a position on a curve in the defining space of the curve.
This action gets a position on the curve in model space.
This action gets a normalized parameter value on a curve.
This action gets the curve length from the beginning to a given location.
This action gets the parameters at which the curve intersect the value.
This action gets the total length of the curve.
This action sets this curve as an offset from the given curve.
This action gets the best offset point for the given curve.
This action finds the best offset normal vector from this curve to a point.
This action sets this curve as a constant paramater curve of the given surface.
This action sets this curve to a smooth interpolation of the control points of the given curve.
This action sets this curve to a least squares fit approximation of the control points of the given curve.
This action sets this curve to a C1 continuous approximation of the shape of the given curve.
This action splits the curve at a given parameter value.
This action projects this curve onto one or more database entities.
This action gets the default projection direction for this curve.
This action sets the curve orientation.
This action aligns the U orientation of the given curves with this curve.
This action checks if the curve is closed.
This action check if the curve is a pole.
This action returns a list of parameters at discontinuities with a bend angle greater than the given angle.
This action gets the control point on this curve closest to the given point or ray.
This action gets the number of control points on this curve.

Static Actions

create

pw::Curve create

This action creates a new curve object.

Parameters

This action has no parameters.

Returns

This action returns a new pw::Curve object.

join

pw::Curve join ?-reject rejectVar? ?-tolerance tol? curves

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

Parameters

-reject rejectVarThis optional parameter is the string name of a variable to recieve a list of pw::Curve objects that were not used in joining.
-tolerance tolThis optional parameter is the join tolerance, with the default value being the current fit tolerance.
curvesThis parameter is a list of pw::Curve objects to join.

Returns

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

Information

This command supports progress updates.

getBestSegment

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

This action, given two lists of points, 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 recieve the best start integer index or point.
-end endVarThis optional parameter is the string name of a variable to recieve 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.

getOffsetPoint

pw::Curve getOffsetPoint ?-flip? curve target_point ?dir?

This action gets the best offset point for the given curve.

Parameters

-flipThis optional falg is the notification that the offset point will be flipped to the opposite side of the curve.
curveThis parameter is a pw::Curve object or a boundary to offset from
target_pointThis parameter finds the offset point closest to point target_point.
dirThis parameter is a direction vector that is used to find the closest offset point to a ray.

Returns

This action returns the offset point.

getOffsetNormal

pw::Curve getOffsetNormal ?-flip? curve point ?dir?

This action finds the best offset normal vector from this curve to a point.

Parameters

-flipThis optional flag is the notification that the offset normal will be flipped to the opposite side of the curve.
curveThis parameter is a pw::Curve object or a boundary to offset from
target_pointThis parameter finds the offset vector closest to point target_point.
dirThis parameter is a direction vector and is used to find the best offset normal vector to a ray.

Returns

This action returns the best normal vector.

Instance Actions

getSegmentCount

$curve getSegmentCount

This action gets the number of segments in this curve.

Parameters

This action has no parameters.

Returns

This action returns the integer number of segments.

getSegment

$curve 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.

setSegment

$curve 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.

addSegment

$curve addSegment segment

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

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 curve.

insertSegment

$curve 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 curve.

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 a pw::Segment object to remove.

Returns

This action returns nothing.

removeAllSegments

$curve removeAllSegments

This action removes all of the segments from the curve.

Parameters

This action has no parameters.

Returns

This action returns nothing.

replaceAllSegments

$curve replaceAllSegments segments

This action replaces all of the segments in the curve.

Parameters

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

Returns

This action returns nothing.

getPosition

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

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

Parameters

-parameterThis optional flag is 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 u having the range [0.0, 1.0] and v ignored.
-controlThis optional flag denotes that value represents a control point index.  value is an integer index with the range [1, number of control points].  See getControlPointCount.
-arcThis optional flag designates value as the normalized arc length from the start of the curve.  value is a float with the range [0.0, 1.0].
-XThis optional flag causes the routine to calculate the position at the singular point on the curve at X = value.  An error is returned if there is not a unique point.
-YThis optional flag causes the routine to calculate the position at the singular point on the curve at Y = value.  An error is returned if there is not a unique point.
-ZThis optional flag causes the routine to calculate the position at the singular point on the curve at Z = value.  An error is returned if there is not a unique point.
-closestThis optional flag results in the routine calculating the position of the point on the curve closest to the specified valuevalue is an xyz point, or grid coord.
valueThis parameter is the value at which to get the position.  Its interpretation is determined by the above flags.  The default mode is the -parameter flag.

Returns

This action returns a point giving the position on the curve (may be in the form “u v dbentity”).

getXYZ

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

This action gets a position on the curve in model space.

Parameters

-parameterThis optional flag is notification to get the XYZ value at a parameter.  The value is a float with the range [0.0, 1.0], or a uv vector with u having the range [0.0, 1.0] and v ignored.
-controlThis optional flag denotes that value represents a control point index.  value is an integer index with the range [1, number of control points].  See getControlPointCount.
-arcThis optional flag designates value as the normalized arc length from the start of the curve.  value is a float with the range [0.0, 1.0].
-XThis optional flag causes the routine to calculate the XYZ value at the singular point on the curve at X = value.  An error is returned if there is not a unique point.
-YThis optional flag causes the routine to calculate the XYZ value at the singular point on the curve at Y = value.  An error is returned if there is not a unique point.
-ZThis optional flag causes the routine to calculate the XYZ value at the singular point on the curve at Z = value.  An error is returned if there is not a unique point.
-closestThis optional flag results in the routine calculating the XYZ value of the point on the curve closest to the specified valuevalue is an xyz point, or grid coord.
valueThis parameter is the value at which to get the XYZ value.  Its interpretation is determined by the above flags.  The default mode is the -parameter flag.

Returns

This action returns an XYZ vector.

getParameter

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

This action gets a normalized parameter value on a curve.

Parameters

-parameterThis optional flag is 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 u having the range [0.0, 1.0] and v ignored.
-controlThis optional flag denotes that value represents a control point index.  value is an integer index with the range [1, number of control points].  See getControlPointCount.
-arcThis optional flag designates value as the normalized arc length from the start of the curve.  value is a float with the range [0.0, 1.0].
-XThis optional flag causes the routine to calculate the parameter at the singular point on the curve at X = value.  An error is returned if there is not a unique point.
-YThis optional flag causes the routine to calculate the parameter at the singular point on the curve at Y = value.  An error is returned if there is not a unique point.
-ZThis optional flag causes the routine to calculate the parameter at the singular point on the curve at Z = value.  An error is returned if there is not a unique point.
-closestThis optional flag results in the routine calculating the parameter of the point on the curve closest to the specified valuevalue is an xyz point, or grid coord.
valueThis parameter is the value at which to get the parameter.  Its interpretation is determined by the above flags.  The default mode is the -parameter flag.

Returns

This action returns the float parameter of the curve.

Information

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

getLength

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

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

Parameters

-parameterThis optional flag indicates that the specified value should be interpreted as a normalized parametric value.  value is expected to be a float with the range [0.0, 1.0], or a uv vector with u having the range [0.0, 1.0] and v ignored.  This is the default mode.
-controlThis optional flag denotes that value represents a control point index.  value is an integer index with the range [1, number of control points].  See getControlPointCount.
-arcThis optional flag designates value as the normalized arc length from the start of the curve.  value is a float with the range [0.0, 1.0].  A value of 1 will return the total length of the curve.
-XThis optional flag causes the routine to calculate the length of the curve from the beginning to the singular point on the curve at X = value.  An error is returned if there is not a unique point.
-YThis optional flag causes the routine to calculate the length of the curve from the beginning to the singular point on the curve at Y = value.  An error is returned if there is not a unique point.
-ZThis optional flag causes the routine to calculate the length of the curve from the beginning to the singular point on the curve at Z = value.  An error is returned if there is not a unique point.
-closestThis optional flag results in the routine calculating the length from the beginning to the point on the curve closest to the specified valuevalue is an xyz point, or grid coord.
valueThis parameter is the value at which to get the length.  Its interpretation is determined by the above flags.  The default mode is the -parameter flag.

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.

See also the getTotalLength command.

getParameters

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

This action gets the parameters at which the curve intersect 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.

getTotalLength

$curve getTotalLength ?-constrained constrainedVar?

This action gets the total length of the curve.

Parameters

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

Returns

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

offset

$curve offset ?-normal vec? ?-tolerance tol? ?-flip? ?-computedDistance computedDistanceVar? < distance | point > curve

This action sets this curve as an offset from the given curve.

Parameters

-normal vecThis optional parameter is the normal vector of the plane in which the curve will be offset with default (0, 0, 1).
-tolerance tolThis optional parameter is the float tolerance used to create the offset curve with defaults to the fit tolerance.
-flipThis optional flag is the notification to reverse the offest curve.
-computedDistance computedDistanceVarThis optional parameter is the string name of a variable to recieve the computed offset distance.
distanceThis parameter is the float distance to offset the curve.
pointThis parameter is the point to offset to.
curveThis parameter is a pw::Curve object to offset from.

Returns

This action returns the float offset distance.

Information

The returned distance is calculated if using an offset point.  Otherwise the return is the provided input distance.

If the offset curve cannot be created then the curve will be empty.

getOffsetPoint

$curve getOffsetPoint ?-flip? target_point ?dir?

This action gets the best offset point for the given curve.

Parameters

-flipThis optional falg is the notification that the offset point will be flipped to the opposite side of the curve.
target_pointThis parameter finds the offset point closest to point target_point.
dirThis parameter is a direction vector that is used to find the closest offset point to a ray.

Returns

This action returns the offset point.

getOffsetNormal

$curve getOffsetNormal ?-flip? point ?dir?

This action finds the best offset normal vector from this curve to a point.

Parameters

-flipThis optional flag is the notification that the offset normal will be flipped to the opposite side of the curve.
target_pointThis parameter finds the offset vector closest to point target_point.
dirThis parameter is a direction vector and is used to find the best offset normal vector to a ray.

Returns

This action returns the best normal vector.

extract

$curve extract ?< -U | -V >? parameter surface

This action sets this curve as a constant paramater curve of the given surface.

Parameters

-UThis optional flag is the notification to extract at a constant u parameter.  This is the default.
-VThis optional flag is the notification to extract at a constant v parameter.
parameterThis parameter is the float parameter to extract with the range [0.0, 1.0].
surfaceThis parameter is the pw:: Surface to extract the curve from.

Returns

This action returns nothing.

spline

$curve spline ?curve?

This action sets this curve to a smooth interpolation of the control points of the given curve.

Parameters

curveThis opitional parameter is a pw::Curve object or boundary whose control points will be interpolated.  If not given the spline action will interpolate this curve’s own control points.

Returns

This action returns nothing.

Information

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

fitLSQ

$curve fitLSQ ?-tolerance tol? ?curve?

This action sets this curve to a least squares fit approximation of the control points of the given curve.

Parameters

-tolerance tolThis optional parameter is the float approximation tolerance with the range [0, infinity).  The default is the current tolerance returned from <getFitTolerance>.
curveThis opitional parameter is a pw::Curve object or boundary whose control points will be interpolated.  If not given the spline action will interpolate this curve’s own control points.

Returns

This action returns nothing.

Information

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

smoothC1

$crv smoothC1 ?-tolerance tol? ?curve?

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

Parameters

-tolerance tolThis optional parameter is the float approximation tolerance with the range [0, infinity).  The default is the current tolerance returned from <getFitTolerance>.
curveThis opitional parameter is a pw::Curve object or boundary whose shape will be approximated.  If not given the smoothC1 action will approximate this curve’s own shape.

Returns

This action returns nothing.

Information

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

split

$curve split parameters

This action splits the curve at a given parameter value.

Parameters

parametersThis parameter is a list of float parameters to split at with the range [0, 1].

Returns

This action returns a list of the new pw::Curve objects.

Information

Any duplicate parameters will be ignored, as well as parameters at the limits of the curve.

project

$curve project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-interior? ?dbentities?

This action projects this curve 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.
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.

getDefaultProjectDirection

$curve getDefaultProjectDirection

This action gets the default projection direction for this curve.

Parameters

This action has no parameters.

Returns

This action returns a vector.

setOrientation

$curve setOrientation umin_end

This action sets the curve orientation.

Parameters

umin_endThis parameter is the integer id of the Umin end with options < UMinimum | 1 | UMaximum | 2 >.

Returns

This action returns nothing.

Information

UMinimum and 1 are the same.  UMaximum and 2 are the same.

alignOrientation

$curve alignOrientation ?-tolerance tol? curves

This action aligns the U orientation of the given curves with this curve.

Parameters

-tolerance tolThis optional parameter is the float tolerance used to consider curves adjacent.  The default is fit tolerance.
curvesThis parameter is a list of pw::Curve objects to align with.

Returns

This action returns nothing.

Information

Any curves in the given list that are not connected (within tol) to this curve will be ignored.

isClosed

$curve isClosed

This action checks if the curve is closed.

Parameters

This action has no parameters.

Returns

This action returns boolean, true if the curve is closed.

isPole

$curve isPole

This action check if the curve is a pole.

Parameters

This action has no parameters.

Returns

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

getDiscontinuities

$curve getDiscontinuities ?angle?

This action returns a list of parameters at discontinuities with a bend angle greater than the given angle.

Parameters

angleAll discontinuies with a bend angle greater than this given angle will be returned; the default is 0.0 which will return all discontinuities.

Returns

This action returns a list of parameters at discontinuities.

closestControlPoint

$curve closestControlPoint ?-from fromVar? ?-distance distVar? ?-index indexVar? point ?dir?

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

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 curve.
-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.
-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 database curve.
dirThis optional parameter is a direction vector for finding the closest point from a ray.

Returns

This action returns a point in the parameter space of this database curve or the origin (0,0,0) if there is no closest point.

getControlPointCount

$curve getControlPointCount

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

Parameters

This action has no parameters.

Returns

This action returns the integer number of control points for this curve.

pw::Curve create
This action creates a new curve object.
pw::Curve join ?-reject rejectVar? ?-tolerance tol? curves
This action joins as many of the given curves together as possible.
pw::Curve getBestSegment -start startVar -end endVar start_points end_points
This action, given two lists of points, returns a segment type, a start point, and an end point that represent the best segment between the given points.
pw::Curve getOffsetPoint ?-flip? curve target_point ?dir?
This action gets the best offset point for the given curve.
A point is a position either in model space or database parameter space.
pw::Curve getOffsetNormal ?-flip? curve point ?dir?
This action finds the best offset normal vector from this curve to a point.
$curve getSegmentCount
This action gets the number of segments in this curve.
$curve getSegment ?-copy? index
This action gets the segment at the given index.
$curve setSegment index segment
This action sets the segment at the given index.
$curve addSegment segment
This action adds the segment to the end of the segments in the curve.
$curve insertSegment index segment
This action inserts the segment at the given index.
$con removeSegment < index | segment >
This action removes a segment from the connector.
$curve removeAllSegments
This action removes all of the segments from the curve.
$curve replaceAllSegments segments
This action replaces all of the segments in the curve.
$curve getPosition ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets a position on a curve in the defining space of the curve.
$curve getXYZ ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets a position on the curve in model space.
$curve getParameter ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets a normalized parameter value on a curve.
$curve getLength ?< -parameter | -control | -arc | -X | -Y | -Z | -closest >? value
This action gets the curve length from the beginning to a given location.
$curve getParameters ?< -X | -Y | -Z >? value
This action gets the parameters at which the curve intersect the value.
$curve getTotalLength ?-constrained constrainedVar?
This action gets the total length of the curve.
$curve offset ?-normal vec? ?-tolerance tol? ?-flip? ?-computedDistance computedDistanceVar? < distance | point > curve
This action sets this curve as an offset from the given curve.
$curve extract ?< -U | -V >? parameter surface
This action sets this curve as a constant paramater curve of the given surface.
$curve spline ?curve?
This action sets this curve to a smooth interpolation of the control points of the given curve.
$curve fitLSQ ?-tolerance tol? ?curve?
This action sets this curve to a least squares fit approximation of the control points of the given curve.
$crv smoothC1 ?-tolerance tol? ?curve?
This action sets this curve to a C1 continuous approximation of the shape of the given curve.
$curve split parameters
This action splits the curve at a given parameter value.
$curve project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-interior? ?dbentities?
This action projects this curve onto one or more database entities.
$curve getDefaultProjectDirection
This action gets the default projection direction for this curve.
$curve setOrientation umin_end
This action sets the curve orientation.
$curve alignOrientation ?-tolerance tol? curves
This action aligns the U orientation of the given curves with this curve.
$curve isClosed
This action checks if the curve is closed.
$curve isPole
This action check if the curve is a pole.
$curve getDiscontinuities ?angle?
This action returns a list of parameters at discontinuities with a bend angle greater than the given angle.
$curve closestControlPoint ?-from fromVar? ?-distance distVar? ?-index indexVar? point ?dir?
This action gets the control point on this curve closest to the given point or ray.
$curve getControlPointCount
This action gets the number of control points on this curve.
Base type for all glyph types
Entity type
Base type for all database entities
Database curve type
A string is an array of characters.
An integer is a whole number.
A boundary is reference to either a database curve or the edge of a database surface.
A vector is a list of float values.
Connector and Curve segment type
A float is a fractional number.
A coord is a position in grid space.
Database surface type
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.