Splines

autocad_entity: autocad_splines

Spline features are linear or area features – depending on whether or not they are closed – and are used to represent features that have smooth curves. Each spline has a number of attributes that completely make up the spline. When the reader parameter Store Spline Definitions is enabled, the reader sets the coordinates to be either the fit points or the control points (depending on what is used to define the spline).

Splines are always 3D – there is no way in AutoCAD to indicate if the feature was intended to be only 2D. If the reader parameter Store Spline Definitions is enabled, then the coordinates of the spline returned by the reader are interpolated values based on the spline definition.

Tip  For an AutoCAD-to-AutoCAD translation, you should always enable the parameter Store Spline Definitions to get the best results.

AutoCAD splines have several attributes, which are returned when reading and must be specified when writing.

Attribute Name

Content

autocad_cntl_pt_tolerance

The tolerance of the control points.

autocad_control_weights

The control point weights. A comma-separated list of the weight values for each control vertex.

autocad_control_x

autocad_control_y

autocad_control_z

The comma-separated lists representing the coordinates of the control points of a spline. There should be exactly n entries in each list, where n is the value of autocad_num_cntl_pts.

If the reader parameter Store Spline Definitions is enabled, then the control points are also stored as the coordinates.

autocad_degree

The degree of the polynomial used to form the spline.

autocad_degree

The degree of the spline.

autocad_end_tangent_x

autocad_end_tangent_y

autocad_end_tangent_z

A vector representing the end tangent for fit point type splines.

autocad_fit_tolerance

The tolerance of fit points.

autocad_fit_x

autocad_fit_y

autocad_fit_z

The comma-separated lists representing the coordinates of the fit points of a fit point type spline.

There should be exactly n entries in each list, where n is the value of autocad_num_fit_pts.

autocad_flag

The flag that indicates the type of spline.

It is a bit vector usually used only when translating from AutoCAD to AutoCAD.

1. CLOSED

2. PERIODIC

4. RATIONAL

8. PLANAR

16. LINEAR

autocad_knot_param

The computation method used to determine the curvature of the spline between fit points, for fit point type splines.

Range: chord | sqrtchord | uniform | custom

autocad_knot_tolerance

The tolerance of the spline knots.

autocad_knot_tolerance

The tolerance of knots.

autocad_num_cntl_pts

The number of control points.

autocad_num_fit_pts

The number of fit points.

autocad_num_knots

The number of knots.

autocad_spline_type

A value representing the form of the spline. A spline can be defined as either a control point spline with no fit points, or a fit point spline with fit points and possibly control points as well.

Range: fit | control_vertices

autocad_start_tangent_x

autocad_start_tangent_y

autocad_start_tangent_z

A vector representing the start tangent for fit point type splines.

When writing to splines, the spline must be specified exactly as it is returned from the reader when the reader parameter Store Spline Definitions is enabled:

  1. A spline can be defined from control point attributes as a control point type spline. These would be attributes such as autocad_control_x, autocad_num_cntl_points, and autocad_cntl_pt_tolerance. Additionally a spline can be defined from similar fit point attributes, with or without control point attributes, as a fit point type spline.
  2. If the spline is defined by control points then the autocad_num_fit_pts must be zero and autocad_num_cntl_pts must be the same as the number of values in the autocad_control_x, autocad_control_y, and autocad_control_z attributes.