DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Collapse DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links 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 interface.

To create an Arc Spline Curve:

1. call to Create(2) of IDIObjectGenerator interface with parameter eType set to eObjTypeArcSplineCurve member of EObjectType enumeration.

2. Cast or query IArcSpline3DCurve  from IUnknown returned from the above call.

2. Use ICurveFreeForm queried from ArcSpline3DCurve to define set of data points

3. Use IArray3D obtained with IArcSpline3DCurve.GetSplineNormals to access array of normals one per spline plane

4. Use IArrayNum obtained with IArcSpline3DCurve.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 from IArcSpline3DCurve. Obtained IFrame interface gives access (via query) to IFrameEx, which has ToLocal and ToGlobal methods.

IArcSpline3DCurve.GetSpline method gives access to IArc interface implemented by a single spline in the curve. The interface along with IArcEx accessed from it allow more detailed local calculations. Results of the calculations can be converted to/from 3D as described above.

See also:  Pipes sample

 

See also: Curves Overview, Native Curves