Class TransformedCurve2D
- Namespace
- CADability.Curve2D
- Assembly
- CADability.dll
A general 2D Curve which results from a non-affine transformation of the 2D space
public class TransformedCurve2D : GeneralCurve2D, ICurve2D, IQuadTreeInsertable, ISerializable
- Inheritance
-
TransformedCurve2D
- Implements
- Inherited Members
Constructors
TransformedCurve2D(ICurve2D, ICurveTransformation2D)
Creates the transformed curve. The original curve is referenced, not copied; points and directions are computed from it through the transformation on demand.
public TransformedCurve2D(ICurve2D original, ICurveTransformation2D transformation2D)
Parameters
originalICurve2Dthe curve in the original space
transformation2DICurveTransformation2Dthe transformation to apply
Properties
EndPoint
The end point of the curve (see EndPoint). This base implementation takes it from the last base point of the triangulation; setting it only replaces that base point and leaves the underlying geometry unchanged, which is acceptable for small corrections only. Curves with their own data override it.
public override GeoPoint2D EndPoint { get; set; }
Property Value
StartPoint
The start point of the curve (see StartPoint). This base implementation takes it from the first base point of the triangulation; setting it only replaces that base point and leaves the underlying geometry unchanged, which is acceptable for small corrections only. Curves with their own data override it.
public override GeoPoint2D StartPoint { get; set; }
Property Value
Methods
Clone()
Returns an independent copy of this curve of the same type. Modifying the copy does not affect this curve.
public override ICurve2D Clone()
Returns
- ICurve2D
the copy
CloneReverse(bool)
Returns a copy of this curve (see Clone()) which is reversed when reverse is true, i.e.
start point and end point are exchanged and the parameter runs the other way round.
public override ICurve2D CloneReverse(bool reverse)
Parameters
reversebooltrue to reverse the copy, false to copy it as it is
Returns
- ICurve2D
the copy
Copy(ICurve2D)
Copies the data of the given object to this object. Both objects must be of the same type.
public override void Copy(ICurve2D toCopyFrom)
Parameters
toCopyFromICurve2DCopies the data of this object
DirectionAt(double)
Returns the direction of the curve at the provided normalized position.
public override GeoVector2D DirectionAt(double Position)
Parameters
PositiondoubleWhere to get the direction
Returns
- GeoVector2D
The direction
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
public override ICurve2D GetModified(ModOp2D m)
Parameters
mModOp2D
Returns
GetTriangulationBasis(out GeoPoint2D[], out GeoVector2D[], out double[])
Supplies the base points of the triangulation (see MakeTriangulation()): a list of parameters, ascending from 0.0 to 1.0, with the points and the directions of the curve at them. Between two consecutive base points the curve must be free of kinks, and it should bend to one side only, so that the triangle spanned by the two points and their tangents encloses that piece of the curve; the knots of a spline or the quadrant points of an arc are typical choices. GetInflectionPoints() and Length use the same basis to bracket their numerical work. The default implementation takes the parameters 0.0, 0.25, 0.5, 0.75 and 1.0 with the normalized DirectionAt(double).
protected override void GetTriangulationBasis(out GeoPoint2D[] points, out GeoVector2D[] directions, out double[] parameters)
Parameters
pointsGeoPoint2D[]the base points on the curve
directionsGeoVector2D[]the directions of the curve at the base points
parametersdouble[]the normalized parameters of the base points, ascending
Move(double, double)
Move the curve by the given offset
public override void Move(double x, double y)
Parameters
PointAt(double)
Returns the point of the curve at the provided normalized position
public override GeoPoint2D PointAt(double Position)
Parameters
PositiondoubleWhere to get the direction
Returns
- GeoPoint2D
The point
PositionOf(GeoPoint2D)
Returns the position of point p on the curve: 0.0 corresponds to the StartPoint 1.0 to the EndPoint
public override double PositionOf(GeoPoint2D p)
Parameters
Returns
Reverse()
Reverses the direction of this curve
public override void Reverse()
Split(double)
Splits the curve at the given normalized parameter. The curve itself remains unchanged.
public override ICurve2D[] Split(double Position)
Parameters
Positiondoublethe parameter where to split
Returns
- ICurve2D[]
two new curves, the part from 0.0 to
Positionand the part fromPositionto 1.0; a single copy of the whole curve whenPositionis not strictly between 0.0 and 1.0
Trim(double, double)
Returns a new curve of the same type which is the part of this curve between the two normalized parameters. The curve
itself remains unchanged. Normally StartPos is less than EndPos; for a closed curve
(Circle2D, Ellipse2D) reversed parameters select the part that runs across the start point of
the curve, for other curves the behaviour depends on the type (a Line2D or Arc2D returns the
part in reversed direction).
public override ICurve2D Trim(double StartPos, double EndPos)
Parameters
Returns
- ICurve2D
the trimmed curve, or null when the result would be degenerate (e.g. an arc with zero sweep)
TryPointDeriv2At(double, out GeoPoint2D, out GeoVector2D, out GeoVector2D)
Returns the point and the first two derivatives of the curve with respect to the normalized parameter at
position (see TryPointDeriv2At(double, out GeoPoint2D, out GeoVector2D, out GeoVector2D)). This base implementation only provides the point
and DirectionAt(double) as first derivative, sets the second derivative to the null vector and returns false; curves
that know their second derivative override it.
public override bool TryPointDeriv2At(double position, out GeoPoint2D point, out GeoVector2D deriv, out GeoVector2D deriv2)
Parameters
positiondoublethe normalized parameter
pointGeoPoint2Dthe point at the parameter
derivGeoVector2Dderiv2GeoVector2Dthe second derivative, the null vector when not available
Returns
- bool
true if the second derivative is available, false otherwise