DG Kernel Documentation

Skip Navigation Links.
Skip Navigation LinksHome Page > API Reference > General Geometry > Curves > 2D > ICurve2d_DG Search Documentation

ICurve2d_DG Interface


If this curve defines an edge or otherwise is part of a model, after any modification IGeometry_DG.SetModified() has to be called for the change to appear in 3D view.

void GetParameterRange(double *min, double *max)

Range_DG GetParameterRange1()

void SetParameterRange(double min, double max)

Modifies parameter range of the curve. The values are expected to be geometrically feasible for the curve

bool IsFiniteParameterRange()

Returns true if length of the range returned by GetParameterRange is not greater than 1.0e+90. The return is false for a straight line, for an example.

bool IsClosed()

Returns true if end points coinside

bool IsPeriodic()

Returns true if GetPoint(u) is same as GetPoint(u+T) for all u, where T = GetPeriod();

double GetPeriod()

Returns period for periodic curves or 1.0e+307 otherwise

DG2D GetPoint(double u)

DG2D GetTangent(double u)

DG2D GetEndPoint(int end)

end is expected to be 0 or 1

bool SlideEndPoint(int end, DG2D point)

Assuming point is geometrically close to the curve, range of the curve is modified so that (projection of) point becomes an end of this curve.

double GetNearestPoint(DG2D point, [out] DG2D pointNearest)

Returns parameter of the nearest point.
Distance between point and pointNearest is the distance of point to this curve.
This method is often used for obtaining parameter of a 3D point lying on the curve.

PointVs2dCurveLocation_DG GetPointLocation(DG2D point, double tolerance)

Identifies relative position of the point.

double GetLength()

double GetLengthAt(double u)

Returns length of the curve from the first end to the point specified by the parameter u.

double GetParameterAtLength(double length)

Returns parameter of the curve at the point specified by the distance along the curve from the first end to length.

double GetParameterAtRatio(double ratio)

Returns parameter obtained by linear mapping of the parameter range to range [0,1].

double GetRatioAt(double u)

Returns ratio obtained by linear mapping of the parameter range to range [0,1].

int GetIntersection(ICurve2d_DG curve, double tolerance, IArrayDouble_DG paramsThis, IArrayDouble_DG paramsCurve, [out] bool haveTangentialIntersection)

A simplified version of the generic GetIntersection1() method below. Returns an array of non-tangential intersections of the curves. Returns number of intersections, which coinsides with the sizes of both paramsThis and paramsCurve.

The paramsThis and paramsCurve arrays are synchronised: i-th element in each is the parameter value related to i-th intersection point.

haveTangentialIntersection indicates whether the curves have tangential intersection points, where tangents are collinear. If the returned haveTangentialIntersection is true, the GetIntersection1() method below can be used to obtain the full intersection.

bool GetIntersection1(ICurve2d_DG curve, double tolerance, ISetR1_DG paramsThis, ISetR1_DG paramsCurve, IArrayBool_DG flagsTangential)

Intersection of two 2D curves. Returns false if the intersection is empty.

The paramsThis, paramsCurve and flagsTangential are synchronised: i-th range in each, are the parameter values related to i-th intersection.

Isolated intersection points are returned as singleton (min = max) ranges.

flagsTangential[i] is true if the intersection is tangential (tangents are collinear) on the i-th range. flagsTangential can be false only for isolated intersection points.