Interface ICurve2D
Interface for a 2-dimensional curve.
2-dimensional curves occur e.g. in the parametric system of surfaces to build the outline of faces or
as projections of 3-dimensional curves on a plane.
There is a normalized parametric system for the curve that starts at 0.0 and ends at 1.0
Assembly: CADability.dll
Syntax
public interface ICurve2D : IQuadTreeInsertable
Properties
|
Improve this Doc
View Source
EndDirection
Returns the direction of the curve at the endpoint.
Declaration
GeoVector2D EndDirection { get; }
Property Value
|
Improve this Doc
View Source
EndPoint
Sets or gets the endpoint of the curve. When the endpoint is set, the startpoint remains unchanged.
Declaration
GeoPoint2D EndPoint { get; set; }
Property Value
|
Improve this Doc
View Source
IsClosed
Determins wether this curve is a closed curve (e.g. a circle)
Declaration
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Length
Returns the length of the curve
Declaration
Property Value
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
MiddleDirection
Returns the direction of the curve at its middle point.
Declaration
GeoVector2D MiddleDirection { get; }
Property Value
|
Improve this Doc
View Source
StartDirection
Returns the direction of the curve at the startpoint.
Declaration
GeoVector2D StartDirection { get; }
Property Value
|
Improve this Doc
View Source
StartPoint
Sets or gets the startpoint. The endpoint remains unchanged when setting the startpoint.
Declaration
GeoPoint2D StartPoint { get; set; }
Property Value
|
Improve this Doc
View Source
Sweep
Declaration
Property Value
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
UserData
Declaration
UserData UserData { get; }
Property Value
Methods
|
Improve this Doc
View Source
AddToGraphicsPath(GraphicsPath, Boolean)
Declaration
void AddToGraphicsPath(GraphicsPath path, bool forward)
Parameters
| Type |
Name |
Description |
| System.Drawing.Drawing2D.GraphicsPath |
path |
|
| System.Boolean |
forward |
|
|
Improve this Doc
View Source
Approximate(Boolean, Double)
Approximate this curve and return the approximation. maxError specifies the maximal
allowed error, i.e. the maximal deviation of the returned curve from this curve.
Is linesOnly ist true, only lines are returned, if linesOnly is false, lines
and circular arcs are returned. The result is usually a path consiting of lines and
arcs or lines only.
Declaration
ICurve2D Approximate(bool linesOnly, double maxError)
Parameters
| Type |
Name |
Description |
| System.Boolean |
linesOnly |
|
| System.Double |
maxError |
|
Returns
|
Improve this Doc
View Source
Clone()
Declaration
Returns
|
Improve this Doc
View Source
CloneReverse(Boolean)
Declaration
ICurve2D CloneReverse(bool reverse)
Parameters
| Type |
Name |
Description |
| System.Boolean |
reverse |
|
Returns
|
Improve this Doc
View Source
Copy(ICurve2D)
Copies the data of the given object to this object. Both objects must be of the same type.
Declaration
void Copy(ICurve2D toCopyFrom)
Parameters
| Type |
Name |
Description |
| ICurve2D |
toCopyFrom |
Copies the data of this object
|
|
Improve this Doc
View Source
DirectionAt(Double)
Returns the direction of the curve at the provided normalized position.
Declaration
GeoVector2D DirectionAt(double Position)
Parameters
| Type |
Name |
Description |
| System.Double |
Position |
Where to get the direction
|
Returns
|
Improve this Doc
View Source
Distance(GeoPoint2D)
Returns the distance of the specified point to this curve. If this curve
can be extended (e.g. a line or an arc) this method will return the distance to
the extended curve. If you need the distance to the unextended curve use MinDistance(ICurve2D).
Declaration
double Distance(GeoPoint2D p)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
p |
Point to compute the distance to
|
Returns
| Type |
Description |
| System.Double |
the distance
|
|
Improve this Doc
View Source
GetArea()
Declaration
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
GetAreaFromPoint(GeoPoint2D)
Declaration
double GetAreaFromPoint(GeoPoint2D p)
Parameters
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
GetExtendedHitTest()
Returns an IQuadTreeInsertable interface. The HitTest Method of this interface
returns true if the rectangle coincides with the infinite extension of this curve
(unbounded curve). Most curves are not extendable and therefore simply return "this".
Declaration
IQuadTreeInsertable GetExtendedHitTest()
Returns
|
Improve this Doc
View Source
GetFused(ICurve2D, Double)
Returnes a new curve of the same type which is the fusion of this curve with the provided curve, e.g. two
overlapping lines build a longer line. Returnes null if the fusion is not possible (e.g. a line and an arc
or two lines with different direction)
Declaration
ICurve2D GetFused(ICurve2D toFuseWith, double precision)
Parameters
| Type |
Name |
Description |
| ICurve2D |
toFuseWith |
Curve to fuse with
|
| System.Double |
precision |
the fused curve or null
|
Returns
|
Improve this Doc
View Source
GetInflectionPoints()
Returns a list of inflection points of this curve. The list might be empty
Declaration
double[] GetInflectionPoints()
Returns
| Type |
Description |
| System.Double[] |
List of inflection points
|
|
Improve this Doc
View Source
GetModified(ModOp2D)
Returns a ICurve which is this curve modified by m. The curve can be of different type, e.g. a
Circle may return an Ellpse
Declaration
ICurve2D GetModified(ModOp2D m)
Parameters
Returns
|
Improve this Doc
View Source
GetSelfIntersections()
Returns pairs of double values. Each pair defines the two parameters of the curve
of a self intersection. The result is either empty or has an even number of double values.
Declaration
double[] GetSelfIntersections()
Returns
| Type |
Description |
| System.Double[] |
self intersection parameters
|
|
Improve this Doc
View Source
Intersect(ICurve2D)
Declaration
GeoPoint2DWithParameter[] Intersect(ICurve2D IntersectWith)
Parameters
| Type |
Name |
Description |
| ICurve2D |
IntersectWith |
|
Returns
|
Improve this Doc
View Source
Intersect(GeoPoint2D, GeoPoint2D)
Declaration
GeoPoint2DWithParameter[] Intersect(GeoPoint2D StartPoint, GeoPoint2D EndPoint)
Parameters
Returns
|
Improve this Doc
View Source
IsParameterOnCurve(Double)
Determines, whether the given parameter denotes a point inside the bounds of the curve.
i.e. the parameter must be greater or equal to 0.0 and less than or equal 1.0.
The actual interval is a little bit extended according to the eps value.
Declaration
bool IsParameterOnCurve(double par)
Parameters
| Type |
Name |
Description |
| System.Double |
par |
the parameter to test
|
Returns
| Type |
Description |
| System.Boolean |
true if on curve
|
|
Improve this Doc
View Source
IsValidParameter(Double)
Determines, whether the given parameter is valid for this curve. Some curves are restricted to a
parameterrange by their nature.
Declaration
bool IsValidParameter(double par)
Parameters
| Type |
Name |
Description |
| System.Double |
par |
the parameter to test
|
Returns
| Type |
Description |
| System.Boolean |
true if valid
|
|
Improve this Doc
View Source
MakeGeoObject(Plane)
Declaration
IGeoObject MakeGeoObject(Plane p)
Parameters
| Type |
Name |
Description |
| Plane |
p |
|
Returns
|
Improve this Doc
View Source
MinDistance(ICurve2D)
Returns the minimal distance between this curve and the other curve given in the parameter.
If the two curves intersect, the minimal distance ist 0.
Declaration
double MinDistance(ICurve2D Other)
Parameters
| Type |
Name |
Description |
| ICurve2D |
Other |
curve to compute the distance to
|
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
MinDistance(GeoPoint2D)
Returns the distance of the point to the curve. In opposite to Distance(GeoPoint2D)
this method will return the distance to the unextended curve
Declaration
double MinDistance(GeoPoint2D p)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
p |
Point to compute the distance to
|
Returns
| Type |
Description |
| System.Double |
the distance
|
|
Improve this Doc
View Source
Move(Double, Double)
Move the curve by the given offset
Declaration
void Move(double x, double y)
Parameters
| Type |
Name |
Description |
| System.Double |
x |
|
| System.Double |
y |
|
|
Improve this Doc
View Source
Parallel(Double, Boolean, Double, Double)
Declaration
ICurve2D Parallel(double Dist, bool approxSpline, double precision, double roundAngle)
Parameters
| Type |
Name |
Description |
| System.Double |
Dist |
|
| System.Boolean |
approxSpline |
|
| System.Double |
precision |
|
| System.Double |
roundAngle |
|
Returns
|
Improve this Doc
View Source
Calculates the foot points of the perpendicular projection of the given point
on the curve. Perpendicular foot points are points, where the direction of the
curve ist perpendicular to the line that connects foot-point to the given point.
Declaration
GeoPoint2D[] PerpendicularFoot(GeoPoint2D FromHere)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
FromHere |
from this point
|
Returns
| Type |
Description |
| GeoPoint2D[] |
array of foot points
|
|
Improve this Doc
View Source
PointAt(Double)
Returns the point of the curve at the provided normalized position
Declaration
GeoPoint2D PointAt(double Position)
Parameters
| Type |
Name |
Description |
| System.Double |
Position |
Where to get the direction
|
Returns
|
Improve this Doc
View Source
PositionAtLength(Double)
Declaration
double PositionAtLength(double position)
Parameters
| Type |
Name |
Description |
| System.Double |
position |
|
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
PositionOf(GeoPoint2D)
Returns the position of point p on the curve: 0.0 corresponds to the StartPoint
1.0 to the EndPoint
Declaration
double PositionOf(GeoPoint2D p)
Parameters
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
Project(Plane, Plane)
The 2d-curve is assumed to reside in plane "fromPlane". It will be projected
perpendicular onto the plane "toPlane".
Declaration
ICurve2D Project(Plane fromPlane, Plane toPlane)
Parameters
| Type |
Name |
Description |
| Plane |
fromPlane |
the containing plane
|
| Plane |
toPlane |
the projection plane
|
Returns
| Type |
Description |
| ICurve2D |
the projected curve
|
|
Improve this Doc
View Source
ReinterpretParameter(ref Double)
Some curves especially Arc and EllipseArc have two possibilities to define
a parameter of a point outside the curve: either as a parameter less than 0
which means ahead of the startpoint or as a parameter greater than 1 behind
the endpoint. This method brings the given parameter into the other system,
that means a parameter less than 0 will become greater than 1 and vice versa.
Parameters between 0 and 1 will remain unchanged as well as most curves
will return false, because the double interpretation isnt meaningfull.
Declaration
bool ReinterpretParameter(ref double p)
Parameters
| Type |
Name |
Description |
| System.Double |
p |
parameter to change
|
Returns
| Type |
Description |
| System.Boolean |
true if possible, false otherwise
|
|
Improve this Doc
View Source
Reverse()
Reverses the direction of this curve
Declaration
|
Improve this Doc
View Source
Split(Double)
Declaration
ICurve2D[] Split(double Position)
Parameters
| Type |
Name |
Description |
| System.Double |
Position |
|
Returns
|
Improve this Doc
View Source
TangentPoints(GeoPoint2D, GeoPoint2D)
Calculates the points where the direction of the curve is parallel to the direction
from the given point to the calculated point. For circles and ellipses it reveals all
possible solutions, for other curves (e.g. BSpline) it reveals only the closest
solution to the point "CloseTo".
Declaration
GeoPoint2D[] TangentPoints(GeoPoint2D FromHere, GeoPoint2D CloseTo)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
FromHere |
From this point
|
| GeoPoint2D |
CloseTo |
Find the solution close to this point
|
Returns
| Type |
Description |
| GeoPoint2D[] |
array of tangential points
|
|
Improve this Doc
View Source
TangentPointsToAngle(Angle, GeoPoint2D)
Calculates the points where the direction of the curve is parallel to the direction
of the given angle. For circles and ellipses it reveals all
possible solutions, for other curves (e.g. BSpline) it reveals only the closest
solution to the point "CloseTo".
Declaration
GeoPoint2D[] TangentPointsToAngle(Angle ang, GeoPoint2D CloseTo)
Parameters
| Type |
Name |
Description |
| Angle |
ang |
the angle of the tangent
|
| GeoPoint2D |
CloseTo |
Find the solution close to this point
|
Returns
| Type |
Description |
| GeoPoint2D[] |
array of tangential points
|
|
Improve this Doc
View Source
TangentPointsToAngle(GeoVector2D)
Calculates the points where the direction of the curve is parallel to the given direction.
Returns all possible position within the curve (not the extended curve)
Declaration
double[] TangentPointsToAngle(GeoVector2D direction)
Parameters
| Type |
Name |
Description |
| GeoVector2D |
direction |
the direction
|
Returns
| Type |
Description |
| System.Double[] |
positions found
|
|
Improve this Doc
View Source
Trim(Double, Double)
Declaration
ICurve2D Trim(double StartPos, double EndPos)
Parameters
| Type |
Name |
Description |
| System.Double |
StartPos |
|
| System.Double |
EndPos |
|
Returns
|
Improve this Doc
View Source
TryPointDeriv2At(Double, out GeoPoint2D, out GeoVector2D, out GeoVector2D)
Tries to get the point and the first and second derivative of the curve at the specified position. (0..1)
Some curves do not implement the second derivative and hence will return false.
Declaration
bool TryPointDeriv2At(double position, out GeoPoint2D point, out GeoVector2D deriv1, out GeoVector2D deriv2)
Parameters
| Type |
Name |
Description |
| System.Double |
position |
Position where to calculate point and derivatives
|
| GeoPoint2D |
point |
The point at the required position
|
| GeoVector2D |
deriv1 |
|
| GeoVector2D |
deriv2 |
The second derivative at the provided parameter
|
Returns
| Type |
Description |
| System.Boolean |
|