Curve Constructors

Predefined Order Constants

A number of curve constructors and operators require an argument specifying the order of the curve which is the degree plus one. A number of predefined constants are provided to make this less confusing:
Linear : 2;
Cubic : 4;
Quartic : 5;
Quintic : 6;

Engineering Constructors

crvFromArc( Arc )
Returns
<curve> Coerce an arc to a B-spline curve.
Arc
<arc> The arc to convert.
crvFromCircle( Circ )
Returns
<curve> Coerce a circle into a curve.
Circ
<circle> The circle to convert.
profile( Corner1, ... )
Returns
<curve> Concatenate a sequence of items into a composite curve.
Corner1, ...
<euclidPoint | arc | curve> An arbitrary sequence of points, arcs and curves to concatenate.
Returns
<curve> Round the corners of a polyline.
Poly
<polyline> The polyline to round the corners of.
<number | arrayOf number | roundSpec> The radii for each of the polyline corners in sequence. If only one number is given, all radii will be the same. If the array is too short, the last value will be repeated as necessary to round all the corners. If the polyline is closed, then the last corner rounded will be the one where the first and last point of the polyline join.
outlineCrv( SpecArray, OpenFlag )
Returns
<curve> A curve constructed from the elements of SpecArray.
SpecArray
<arrayOf( point | line | circle | specFn ) > An array of points, lines circles, or special specification functions (see below.)
OpenFlag
<boolean> If true, will construct an open, rather than closed, profile.
There are restrictions on the beginning and ending elements of the specification array if an open outline is being made. The specification must begin and end with either a point or a pair of lines. Fillets, chamfers, and circles don't make sense at the ends of an open outline.

The specification array may contain objects (points, lines, and circles only), or specifier functions. The specifier functions are a special set of functions for use with outlineCrv. The complete list of options for the specification array is:

<point>
Result in sharp corners in the profile.
<line>
Orientation does not matter.
<circle>
Traversed in the clockwise direction.
circCCW( Circle )
Traverse Circle in the counter-clockwise direction.
fillet( R )
A fillet between the two neighbors of radius R. If one of the neighbors is a circle, then the assumption is that you want the fillet that is inside the circle. If both neighbors are circles, then fillet() and filletOutside() don't matter - the correct fillet is determined by the circle directions.
filletPt( R, Corner )
Like fillet, but a corner point may be specified.
filletOutside( R )
Like fillet, but it will be outside the circle if one of the neighbors is a circle.
sharpPt( Pt )
Make a sharp corner at a given point. Lets you do pt-pt-pt polyline constructions in the profile if that's the kind of data you have. This is exactly equivalent to just specifying the point.
chamf( Dist )
Make a chamfer of given size between the two neighbors. The neighbors have to be lines or other corners with explicit shoulder points.
lineCtl( Line, BegHint, EndHint )
If there is an ambiguity in which line/circle intersection to use, this can be resolved by the lineCtl specifier function. Use the lineCtl specifier in place of the Line in the specification array. The hints must be the keyword false (use the default intersection) or one of the following strings: "max_x", "max_y", "min_x", "min_y". If a hint string is given, the intersection of the line with its neighbors is choosen based on the hint. The BegHint refers to the intersection of the line with the previous item in the specification array.
straightFromLine( Line )
This represents a line segment during construction of an outline curve. (These are usually filled-in implicitly, but there are some cases where and explicit specification is required.)
sprocketCrv( Pitch, NTeeth )
Returns
<curve> Create a sprocket curve with the given pitch and number of teeth.
Pitch
<number> Pitch of the chain in inches.
NTeeth
<integer> Number of teeth for the sprocket.
Returns
<curve> Creates an involute profile gear curve with above parameters. It requires three, four, five or six parameters.  AddendumRatio, DedendumRatio, FilletRadiusRatio are optional.For non-standard involute gears  they can be used.
PressureAngle
<number> Pressure angle for the gear in degrees.
Module
<number> Module of the gear.
NTeeth
<integer> Number of teeth for the gear.
Non-standard Gears : -
<number> Addendum of the gear / Module of the gear
DedendumRatio
<number> Dedendum of the gear / Module of the gear
<number> Fillet radius of the gear / Module of the gear. It should be less that 0.5 for pressure angle less than or equal to 20 degrees. It should be less than 0.4 for pressure angle greater than 20 degrees.
internalSplineCrv( Module, NTeeth )
Returns
<curve> Creates an involute profile internal spline curve.
Module
<number> Module of the gear.
NTeeth
<integer> Number of teeth for the gear.
externalSplineCrv( Module, NTeeth )
Returns
<curve> Creates an involute profile external spline curve.
Module
<number> Module of the gear.
NTeeth
<integer> Number of teeth for the gear.

Basic Constructors

uniOpCrv( Order, ControlPts )
Returns
<curve> Construct a B-spline curve (with open end conditions and uniform knot vector) from a set of control points.
Order
<order> Polynomial order (degree plus one) of the curve. There must be at least this many control points specified.
ControlPts
<ctlPoly | polyline | arrayOf point> The set of points to use as the control polygon.
crvFromPolyline( PolyLn )
Returns
<curve> Coerce a polyline into a curve.
PolyLn
<polyline> The polyline to convert.
knotVector( KnotValues )
Returns
<knotVector> Create a knot vector with the given values.
KnotValues
<arrayOf number | number...> The knot values, in non-decreasing order. An array of values may be given, or a series of values separated by commas.
curve( Order, EndCond, KnotVec, ControlPts )
Returns
<curve> Construct a B-spline curve.
Order
<integer> The order (degree + 1) for the curve.
EndCond
<string> The end conditions for the curve. Valid strings are: "ec_open", "ec_floating", and "ec_periodic".
KnotVec
<string | knotVector | arrayOf number> Either a knot vector specifier (string) or an explicit knot vector. Valid specifiers are: "kv_bezier", "kv_uniform", and "kv_chord". An explicit knot vector can be the result of the knotVector function or an array of numbers.
ControlPts
<ctlPoly | polyline | arrayOf point> The set of points to use as the control polygon.
crvFromSrf( Srf, Dir, Index )
Returns
<curve> Extract a curve corresponding to a particular row or column from a surface given a direction and a row or column index.
Srf
<surface> The surface to examine.
Dir
<string> One of "row" or "col".
Index
<integer> The row or column index of the desired curve.
completeCubicInterp( Params, Positions, BeginTangent, EndTangent )
Returns
<curve> Construct a curve interpolated from positions and two tangents.
Params
<arrayOf number> Array of parameter values (in increasing order).
Positions
<arrayOf point> Vector of positional data, one for each parameter.
BeginTangent, EndTangent
<geomVector> These optional vectors indicate the direction of the curve at its end points. For convenience, either of these can be left out.
completeUniCubicInterp( Positions, BeginTangent, EndTangent )
Returns
<curve> Constructs a uniform cubic curve interpolated from positions and two tangents.
Positions
<arrayOf point> Vector of positional data.
BeginTangent, EndTangent
<geomVector> These vectors indicate the direction of the curve at its end points.
crvFit( Order, Kv, InterpData )
Returns
<curve> Constructs a curve which interpolates a set of data.
Order
<integer> Order of the resulting interpolating curve.
Kv
<knotVector> The knotvector of the resulting curve. Each data point is associated with a knot value.
InterpData
<array> An array of points and vectors. The resulting curve will interpolate these points and vectors.
crvApprox( Crv, Kv, StartCond, EndCond )
Returns
<curve> Constructs a curve which is a least squares fit to the input curve using the specified knot vector.
Crv
<curve> The curve to approximate.
Kv
<knotVector> The knotvector of the resulting curve.
StartCond, EndCond
<string> One of "red_ec_none", "red_ec_pos", and "red_ec_tan", specifiying no end condition constraints, a positional constraint, or a tangency constraint, respectively. The condition "red_ec_none" is the default.
crvConcat( CrvArray, MinOrder )
Returns
<curve> Concatenates a set of curves with common endpoints.
CrvArray
<arrayOf curve> Array of curves for concatenation.
MinOrder
<number> Minimum order of resulting curve (default is 2).
quatCurve( Pts )
Returns
<quat curve> Create curve from time values and quaternions.
Pts
<arrayOf quat> Array of quaternion points (created with "quat").

Curve Accessors

cOrder( Crv )
Returns
<integer> Retrieve the order of a curve.
Crv
<curve> The curve to examine.
cKv( Crv )
Returns
<knotVector> Retrieve the knot vector of the curve.
Crv
<curve> The curve to examine.
cPoly( Crv )
Returns
<ctlPoly> Retrieve the control polygon of a curve.
Crv
<curve> The curve to examine.
cPolySize( CtlPoly )
Returns
<integer> Returns the size of the control polygon.
CtlPoly
<ctlPoly> The control polygon for determining the size.
crvPt( Crv, Indx )
Returns
<point> Extract a control point of the curve.
Crv
<curve> The curve to be examined.
Indx
<integer> Index of the desired control point.
crvEval( Crv, Param )
Returns
<euclidPoint> Calculate a point on a spline curve at some parameter value.
Crv
<curve> The curve to evaluate.
Param
<number> Parameter value at which to evaluate the curve.
regionFromCrv( Crv, MinVal, MaxVal )
Returns
<curve> Extract a curve from a given curve which is bounded by two parametric values.
Crv
<curve> The reference curve.
MinVal, MaxVal
<number> These are the starting and ending parametric values of the desired curve.
crvTangent( Crv, Param )
Returns
<Vector> Calculate a unit tangent on a spline curve at some parameter value.
Crv
<curve> The curve to evaluate.
Param
<number> Parameter value at which to evaluate the curve tangent.
crvNormal( Crv, Param, Ref )
Returns
<Vector> Calculate a unit normal on a spline curve at some parameter value. It requires two or three parameters. If the third parameter is not mentioned then the normal emanates from origin.
Crv
<curve> The curve to evaluate.
Param
<number> Parameter value at which to evaluate the curve normal.
Ref
<boolean> It decides the point from which the curve normal emanates.
TRUE   :- Normal from the reference point, evaluated by the param value.
FALSE :-  Normal from origin.
crvBinormal( Crv, Param )
Returns
<Vector> Calculate a unit normal on a spline curve at some parameter value.
Crv
<curve> The curve to evaluate.
Param
<number> Parameter value at which to evaluate the curve binormal.
crvCurvature( Crv, Param )
Returns
<number> Calculate the curve curvature at parameter value Param.
Crv
<curve> The curve to evaluate.
Param
<number> Parameter value at which to evaluate the curve curvature.
crvTorsion( Crv, Param )
Returns
<number> Calculate the curve torsion at parameter value Param.
Crv
<curve> The curve to evaluate.
Param
<number> Parameter value at which to evaluate the curve torsion.

Curve Modifiers

cRefine( OldCrv, NewKnots, Merge )
Returns
<curve> Refine a given curve with a new knot vector. This results in a curve with more flexibility.
OldCrv
<curve> The original curve to refine.
NewKnots
<knotVector | arrayOf number | vectorOf number> The new knot vector for the curve.
Merge
<boolean | function> If boolean, indicates whether newKnots needs to be merged into the original knot vector (not necessary if the new knot vector already contains all the original knots). If a function is given, it is used to do the merging (and merging is assumed to be needed).
raiseCrvOrder( Obj, Order )
Returns
<object> Walk through a structure of an object degree raising only the curves.
Obj
<object> The object to degree raise.
Order
<integer> The desired order of the curves.
cReduce( Crv, Tolerance )
Returns
<curve> New curve which is within the given tolerance of the original curve.
Crv
<curve> The curve to approximate.
Tolerance
<number> How closely the new curve must match the existing one.
diffCrv( Crv, N )
Returns
<curve> Differentiate a B-spline curve.
Crv
<curve> The curve to differentiate.
N
<opt integer> The number of times to differentiate (default 1).
qOffset( Crv, RefVec )
Returns
<curve> Compute an offset curve of the curve specified.
Crv
<curve> The curve to be offset.
RefVec
<number | geomVector> Specifies the offset distance and direction of the offset. If RefVec is a number, then the first point of the curve is offset a distance d, in the direction of the curve normal at this point, to yield the first point of the offset curve. Note that d is a signed distance, i.e., if it is negative the offset will be in the direction opposite the curve normal at the first point. If the curve normal is not defined at the first point of the curve, then the first point along the curve where the normal is defined is located, and the normal there is "mapped" back to the first point on the curve. If the curve normal is not defined anywhere on the curve, then an arbitrary vector in the normal plane of the first point of the curve is used. If RefVec is a vector, then it will be taken directly as the vector by which the first point of the curve is to be offset.
arcLengthCrv( Crv, Tol )
Returns
<curve> Return the curve reparameterized by arc-length.
Crv
<curve> The curve to reverse.
Tol
<number> The tolerance of the arc-length approximation.
reverseCrv( Crv )
Returns
<curve> Return the same curve going in the opposite direction.
Crv
<curve> The curve to reverse.
crvOpen( Crv )
Returns
<curve> Returns the same curve with open end condition.
Crv
<curve> The curve to be made open.
replaceCKv( Crv, KnotValues )
Returns
<curve> Replace the knot vector of a curve.
Crv
<curve> The original curve.
KnotValues
<arrayOf number> The array of new knot values for the curve.
kRefineCrv( Crv, Resolution, Autoscale, MaxKnots )
Returns
<curve> Refined curve.
Crv
<curve> Curve to be refined.
Resolution(5.0)
<number> Resolution parameter to control refinement level. Default 5.0.
Autoscale(1.0)
<number> Width of bounding box in object space, divided by 2. Default 1.0.
MaxKnots(0)
<integer> Maximum number of knots added per interval. Default 0 (no maximum).
mergeKv( newKv, oldKv )
Returns
<knotVector> Merges a new set of knots into an existing knot vector.
newKv
<knotVector | arrayOf number> New knots to be merged in.
oldKv
<knotVector> The original knot vector.
kvNormalize( knotVec )
Returns
<knotVector> Constructs an equivalent knot vector which begins at value 0 and ends at value 1.
knotVec
<knotVector> The original knot vector.
mkCompatible( CrvArray, Coerce )
Returns
<arrayOf curve> Ensures curves have same order and knot vector.
CrvArray
<arrayOf curve> Array of curves to modify. Curves must have open end conditions.
Coerce
<boolean> Coercion flag. Whether resulting curves are to have same point types.
sameOrder( CrvArray, MinOrder )
Returns
<arrayOf curve> Ensures curves have same order. Returns an array of the new curves with same order.
CrvArray
<arrayOf curve> Array of curves to modify.
MinOrder(2)
<integer> Optional minimum order. Default 2. C_Shape_Edit User's Manual Home Page
Alpha_1 User's Manual.