## DGKC Control Documentation

 Go to ActiveX docs Search Documentation

# Arc Spline Curves

Arc Spline Curves are Free-form curves, which instead of interpolation between data points are defined by pieces of arcs (splines) connecting adjacent points. Each spline arc belongs to its own plane (plane of the spline) passing through the two points and which has normal defined by the user.

When Arc Spline Curve has n data points it also has n-1 splines, one per each adjacent pair of points. Each spline has two properties: double Curvature and a 3D Normal vector.

Plane of i-th spline is calculated as plane with i-th normal vector passing through i-th data point. Only direction orthogonal to the segment between ends of the spline, which are the i-th and i+1-th data points, (called segment of the spline)  is important in normal of the spline. That is why during object initialization normals are adjusted to make directions orthogonal to the segments and normalised (length modified to 1). Normal vector of a spline must not be parallel to segment of the spline.

Note that because each spline has its own plane the resulting curve does not have to be flat or two dimensional.

When an arc has zero curvature and hence is a straight line there are many planes which can contain the line. In this case normal for the spline does not have to be defined.

The curve has parameterization by piecewise normalized natural parameter: for a given parameter t it corresponds to point with normalized natural parameter tLoc =  t - i on the i-th arc, where i = floor(t) is the integral part of t. t=2.5, for example is parameter of the point in the middle of the third arc.

Arc Spline Curves implement IArcSpline3DCurve_DG interface.

To create an Arc Spline Curve:

1. Call to IObjectGenerator_DG.Create<IArcSpline3DCurve_DG>() to obtain IArcSpline3DCurve_DG.

2. Use ICurveFreeForm_DG queried from IArcSpline3DCurve_DG to define set of data points

3. Use IPointArray_DG obtained with IArcSpline3DCurve_DG.GetSplineNormals to access array of normals one per spline plane

4. Use IArrayDouble_DG obtained with IArcSpline3DCurve_DG.GetCurvatureArray to modify curvature of arcs. By default, curvature is zero, which represents a straight line.

### Spline frames

Each plane of spline has distinctive frame (frame of the spline)  associated with it: Origin of the frame is located at the first end of the spline arc. x axis belongs to the plane and directed towards the second end of the spline arc. y axis belongs to the plane too and defined as orthogonal to x. direction of z axis coincides with normal of the plane.

Spline frames described above are useful for conversion between two dimensional coordinates of arcs in spline planes and 3D coordinates. The frames can be accessed by querying  IFrameArray_DG from IArcSpline3DCurve_DG. The obtained IFrame_DG interfaces have ToLocal and ToGlobal methods.

IArcSpline3DCurve_DG.GetSpline method gives access to IArc_DG interface implemented by a single spline in the curve. The interface allows more detailed local calculations. Results of the calculations can be converted to/from 3D as described above.