# ICurve3D Interface

Provides access to members that define operations common to curves with Zs.

## Description

`This interface is new at ArcGIS 9.3.

Returns the 3D length of a curve, or the sum of the distances between adjacent XYZ points along the curve. Queries a point at a specified distance from the beginning of the curve, finds a point on the curve closest to the specified input point, and extracts a portion of the curve into a new curve. In contrast to ICurve, Z values are taken into account when performing length calculations and distance queries.`

## Members

Name Description GetSubcurve3D Extracts a portion of this curve into a new curve. IsClosed3D Indicates if 'from' and 'to' points (of each part) are identical. Length3D The length of the curve. QueryPoint3D Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve. QueryPointAndDistance3D Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.

### ICurve3D.GetSubcurve3D Method

Extracts a portion of this curve into a new curve.

``````Public Sub GetSubcurve3D ( _
ByVal fromDistance As Double, _
ByVal toDistance As Double, _
ByVal bAsRatio As Boolean, _
ByRef ppOutSubCurve As ICurve3D _
)
``````
``````public void GetSubcurve3D (
double fromDistance,
double toDistance,
bool bAsRatio,
ref ICurve3D ppOutSubCurve
);
``````

#### Description

Gets the subcurve between the specified points along the original curve and creates a new curve. The elements in the new subcurve are the same type and have the same properties as the elements of the original curve.

``````public static void GetSubcurve3D()

{

const double FromDistance = 0.27;

const double ToDistance = 0.823;

IGeometry  polygonGeometry =  GetPolygonGeometry();

IPointCollection  pointCollection =

polygonGeometry  as  IPointCollection;

IPoint  firstPoint = pointCollection.get_Point(0);

ICurve3D  curve3D = polygonGeometry  as  ICurve3D;

ICurve3D  subcurve3D;

curve3D.GetSubcurve3D(

FromDistance, ToDistance, true, out subcurve3D

);

}
``````

### ICurve3D.IsClosed3D Property

Indicates if 'from' and 'to' points (of each part) are identical.

``````Public ReadOnly Property IsClosed3D As Boolean
``````
``````public bool IsClosed3D {get;}
``````
``````public static void GetIsClosed3D()

{

IGeometry  polylineGeometry = GetPolylineGeometry();

ICurve3D curve3D = polylineGeometry as ICurve3D;

bool isClosed3D = curve3D.IsClosed3D;

//isClosed3D = false

}
``````

### ICurve3D.Length3D Property

The length of the curve.

``````Public ReadOnly Property Length3D As Double
``````
``````public double Length3D {get;}
``````

#### Description

Returns the 3D length of the entire curve. The length of the curve is the sum of the lengths along each parameterized Segment between vertices along the curve.

``````public static void GetLength3D()

{

IGeometry  polylineGeometry = GetPolylineGeometry();

ICurve3D curve3D = polylineGeometry as ICurve3D;

double length3D = curve3D.Length3D;

//length3D = 60.761

}
``````

### ICurve3D.QueryPoint3D Method

Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.

``````Public Sub QueryPoint3D ( _
ByVal extension As esriSegmentExtension, _
ByVal DistanceAlongCurve As Double, _
ByVal bAsRatio As Boolean, _
ByVal pOutPoint As IPoint _
)
``````
``````public void QueryPoint3D (
esriSegmentExtension extension,
double DistanceAlongCurve,
bool bAsRatio,
IPoint pOutPoint
);
``````

#### Description

Returns the Point at a given 3D distance along the curve or extended curve. If the distance is less than the length of the curve, then the returned point is the point at that distance along the curve. If the distance is less than zero, or greater than the length of the curve, then the returned point is on the curve specified by the extension method. The distance may be specified as a fixed unit of measure or a ratio of the 3D length of the curve.

``````public static void QueryPoint3D()

{

const double  DistanceAlongCurve = 0.707;

IGeometry  polylineGeometry =  GetPolylineGeometry();

IPolyline  polyline = polylineGeometry  as  IPolyline;

IPoint  firstPoint = polyline.FromPoint;

ICurve3D  curve3D = polylineGeometry  as  ICurve3D;

IPoint  outPoint =  new  PointClass();

curve3D.QueryPoint3D(

esriSegmentExtension.esriNoExtension, DistanceAlongCurve,  true, outPoint

);

//outPoint = (-4.685, -4.437, -5.804)

}
``````

### ICurve3D.QueryPointAndDistance3D Method

Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.

``````Public Sub QueryPointAndDistance3D ( _
ByVal extension As esriSegmentExtension, _
ByVal pInPoint As IPoint, _
ByVal bAsRatio As Boolean, _
ByVal pOutPoint As IPoint, _
ByRef pDistanceAlongCurve As Double, _
ByRef pDistanceFromCurve As Double _
)
``````
``````public void QueryPointAndDistance3D (
esriSegmentExtension extension,
IPoint pInPoint,
bool bAsRatio,
IPoint pOutPoint,
ref double pDistanceAlongCurve,
ref double pDistanceFromCurve
);
``````

#### Description

Finds the Point on the specified extended curve nearest to the input point and the distance between those points. Also returns the distance along the curve and distance from the curve that the nearest point occurs. The operation is performed in 3D space.

``````public static void QueryPointAndDistance3D()

{

const double  DistanceAlongCurve = 0.707;

IGeometry  polygonGeometry =  GetPolygonGeometry();

IPointCollection  pointCollection =

polygonGeometry  as  IPointCollection;

IPoint  firstPoint = pointCollection.get_Point(0);

ICurve3D  curve3D = polygonGeometry  as  ICurve3D;

IPoint  inPoint = pointCollection.get_Point(7);

IPoint  outPoint =  new  PointClass();

double  distanceAlongCurve = 0;

double  distanceFromCurve = 0;

curve3D.QueryPointAndDistance3D(

esriSegmentExtension.esriNoExtension,

inPoint,  true, outPoint,

ref  distanceAlongCurve,  ref  distanceFromCurve

);

//inPoint = (-10.714, -3.67, 7.941)

//outPoint = (-10.714, -3.67, 7.941)

//distanceAlongCurve = 0.778

}
``````

## Classes that implement ICurve3D

Classes Description
Line A 2D straight line between a pair of 2D endpoints; can optionally have height, measure and ID attributes at each endpoint.
Polygon A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.
Polyline An ordered collection of paths; optionally has measure, height and ID attributes.
Ring An area bounded by one, closed sequence of connected segments; optionally has measure, height and ID attributes at each vertex.

## Remarks

These methods are intended to be called against top-level geometries only (Polyline, Polygon). To call a method against a Segment/Path or Ring, first add the part to a Polyline or Polygon container, respectively, and then call the appropriate method against the container.