Overview | Statement List | Example


创建样条拟合方法

Synopsis

obj list = BCURVE/FIT,{obj list1,|num list1}[,WGHT,num list2],{SEGS|TOLER},num1[,DEGREE,num2][,START,{VECT,dx,dy,dz|TANTO,{curve|angle}}][,END,{VECT,dx,dy,dz|TANTO,{curve|angle}}],STATUS,numa[,IFERR,label:]

Description

Creates a spline by "fitting" the curve to the data points. This method reduces the amount of data needed to define the curve. Since the curve is not forced to pass through the data points, the spline definition is simplified. The system does not store defining points for curves created using the spline creation function. However, these points are stored for B-curve creation functions.

You can either specify a list of object identifiers to use for the approximation or a list of WCS coordinates which correspond to the points to be used.

You can also set various parameters such as the degree of the spline and the weight factor of the data points, etc.

Parameters

Parameter

Description

obj list1

A list of point object identifiers to use as data points.

num list1

The list of WCS coordinates corresponding to the data points to use for the approximation, instead of using objects.

WGHT

Optional minor word indicates that the numbers in the following list are weights to assign to the points.

num list2

Optional list of weights to assign to the points. Specifying a large value for the weight ensures that the spline passes through or close to that data point. Assigning a weight of 0.0 ensures that a particular point is ignored in the fitting process. This is useful for omitting "bad" data points. Note that the spline always passes through the first and last points, regardless of any assigned weights.

NOTE: The default weight factors are such that sparsely located points are more heavily weighted than densely located points.

SEGS

This minor word specifies the use of the segment method. This method allows you to specify the number of segments the spline is to contain. Given the number of segments, the system makes the best fit possible without adding any more knot points. This method only gives you indirect control over the allowable distance the curve may deviate from a data point. This option is faster than the tolerance method since it requires much less computation.

The number of segments you should specify depends on the degree of the curve you want to create, the shape of the data, and the degree of tolerance to achieve. A general rule of thumb is that you need one segment for every time the slope varies as much as 90 degrees. You can use fewer segments if the spline has a higher degree.

TOLER

This minor word specifies the use of the tolerance method. This method allows you to specify the maximum allowable distance the curve may deviate from a data point. The system attempts to reduce the number of segments in the spline while ensuring that the maximum distance from any raw data point to the created spline is less than the error value you specify. The error value is the maximum distance from any data point to the created spline.

NOTE: A tight tolerance causes the spline to be closer to the data points; which results in more spline segments. If you use a very tight tolerance, the system produces a curve that actually passes through the data points.

num1

Represents either the number of segments or the tolerance depending on the method requested.

DEGREE

Optional minor word indicates that the following number is the degree to assign to the curve.

num2

Optional number that contains the degree. The default degree for the spline is three, but it can be any value between 1 and 24.

START

Optional minor word indicates that the following vector data is a tangent constraint on the start point.

VECT

Optional minor word indicates that the following three numbers dx,dy,dz are vector components to use for a tangent constraint.

TANTO

Optional minor word indicates that the following data is either a curve or an angle value from which the tangent constraint is created.

curve

Any curve object whose nearest end point is used to calculate the tangent constraint.

angle

A numeric value that specifies the slope by an angle.

END

Optional minor word indicates that the following tangent data is applied to the end point.

STATUS

Required minor word indicates that the next variable contains the return status.

numa

The variable in which to put the return code.

Status Values

-1 = Memory allocation error
 0 = Successful creation of curve
 1 = Resultant curve did not meet tolerance, interpolation was done.
      This is not considered an error.
 2 = Not enough constraints for requested degree
 3 = Degree not between 1 and 24
 4 = Number of weights doesn't match number of data points
 5 = Invalid tolerance value
 6 = Invalid number of segments
 7 = Unable to create curve

IFERR,label:

Specifies a label to which program execution jumps if numa contains an error value.


Copyright ©2015 胡君NX二次开发官网(www.UGapi.com) QQ:85585969 All Rights Reserved.