ArcObjects Library Reference  (Geometry)    

IGeometryBridge_Densify_Example

[C#]
//This method demonstrates how to use the ISegment.Densify method
private void Densify()
{  
    //Create a new closed Circular Arc segment
    IPoint center = new PointClass();
    center.PutCoords(0, 0);
    IPoint fromToPoint = new PointClass();
    fromToPoint.PutCoords(10, 10);
    ICircularArc circularArc = new CircularArcClass();
    circularArc.PutCoords(center, fromToPoint, fromToPoint, esriArcOrientation.esriArcClockwise);
    ISegment segment = circularArc as ISegment;
  
    //Call densify
    //maxDeviation: 0.1, tells the method that the segment must not further
    //                    a part from that distance from the curve
    //outSegments: output parameter returning the the number of segments created
    //outSegmentsArray: array will contain the output segments. 
    //The array size is the max number of parts

    ILine[] outSegmentsArray = new ILine[7];
    double maxDeviation = 0.1;
    int outSegments = 0;
    IGeometryBridge geometryBridge = new GeometryEnvironmentClass();
    geometryBridge.Densify(segment, maxDeviation, ref outSegments, ref outSegmentsArray);
    System.Windows.Forms.MessageBox.Show("The segment array contains : " + outSegments + " segments");
}

[Visual Basic 6.0, Visual Basic .NET, C++]
No example is available for Visual Basic 6.0, Visual Basic .NET, or C++. To view a C# example, click the Language Filter button Language Filter in the upper-left corner of the page.