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 STORE_SPLINE_DEFS is set to yes, 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 STORE_SPLINE_DEFS is not specified or set to no, then the coordinates of the spline returned by the reader are interpolated values based on the spline definition.

Tip: Tip: When you are performing an AutoCAD-to-AutoCAD translation, then you should always set STORE_SPLINE_DEFS to yes 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_degree

The degree of the polynomial used to form the spline.

autocad_knot_tolerance

The tolerance of the spline knots.

autocad_degree

The degree of the spline.

autocad_cntl_pt_tolerance

The tolerance of the control points.

autocad_fit_tolerance

The tolerance of fit points.

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_knots

The number of knots.

autocad_flag

The flag that indicates the type of spline. It is a bit vector normally only used when going from AutoCAD to AutoCAD.

1. CLOSED

2. PERIODIC

4. RATIONAL

8. PLANAR

16. LINEAR

autocad_start_tangent_x

autocad_start_tangent_y

autocad_start_tangent_z

The start tangent for the spline.

autocad_end_tangent_x

autocad_end_tangent_y

autocad_end_tangent_z

The end tangent for the spline.

autocad_control_x

autocad_control_y

autocad_control_z

A comma separated list. The control point coordinates in comma separated values. If STORE_SPLINE_DEFS is specified, then the control points are also stored as the coordinates.

autocad_control_weights

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

When writing to splines, the spline must be specified exactly as it is returned from the reader with STORE_SPLINE_DEFS set to yes:

  1. If the spline is defined by fit points then autocad_num_cntl_pts must be zero and autocad_num_fit_pts must be the same as the number of coordinates in the feature. The coordinates of the feature are taken to be the fit points.
  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 coordinates in the feature. The coordinates of the feature are taken to be the control points.