Drawing3d documented Class Library

Curve Members

Curve overview

Public Static (Shared) Fields

RegisteredCurves Holds a list of curve types for copying curves and array of curves. A curve will be written in a stream and read from a stream. The basic concept contains the method LoadFromStream and SaveToStream By registrating
Register(1, typeof(Line));
Register(2, typeof(Arc));
Register(3, typeof(Bezier));
Register(4, typeof(QSpline));
Register(5, typeof(Nurbs2d));
Register(6, typeof(BSpline));
the curves can reconsturcted by calling the empty constructor

Public Static (Shared) Methods

Register Register a CurveType In Drawing3d.Curves the following 2d-Curves are registered Register(1, typeof(Line));
Register(2, typeof(Arc));
Register(3, typeof(Bezier));
Register(4, typeof(QSpline));
Register(5, typeof(Nurbs2d));
Register(6, typeof(BSpline));
registerAliases Register "alias"-names for some types.

Public Instance Constructors

Curve Constructor Parameterless constructor of Curve.

Public Instance Fields

OnChanged This event is fired by the method Changed
Tag Tag is a free programmable property

Public Instance Properties

A Returns and sets the StartPoint.See getA and setA
Atang Returns and sets the starttangent. See getAtang, setAtang and Btang
B Returns and sets the EndPoint.See getB and setB
Btang Returns and sets the endtangent. See getBtang, setBtang and Atang
CurveLength Retrieves the length of the curve.
fromParam Retrieves and sets the starting parameter. All parameters are within the interval [fromParam, toParam]. Initialvalue is 0;
Inverted Sets or gets the property, thats a curve is inverted is.
Maxrect A property, which calls GetMaxrect
Owner A CurveArray, which contains the Curve.
Resolution Retrieves and sets the resolution of the curve. The default value is 40.
Smooth Some classes are using this property to set BTang equals to the Atang of the "next" curve
toParam Retrieves and sets the end parameter. All parameters are within the interval [fromParam, toParam]. Initialvalue is 1;
Visible Several classes use this property and hide a curve, where visible is false.

Public Instance Methods

Changed This method is called, when the curve is changed. It fires the event OnChanged
Clone Produces an exact copy of the curve by using the BinaryFormatter. So you have to mark a new instance of Curve with the attribute [Serializable].
CrossOverloaded. Crosses the Curve with an other curve by crossing the interpolating polygonarray.
Derivation This abstract method must be overridden. It returns the first deriavation of the function defined in the method Value. All parameter t are taken from the interval [fromParam,toParam].
DistanceOverloaded. This method calculates the distance of a LineType to a Curve only in case, when the distance is smaller then MaxDist, otherwise big will be returned. You can imagine a cylinders with radius MaxDist around the Curve. If the line goes through the "curved" cylinder, then the distance will be calculated and returned.
Equals (inherited from Object) 
FindType Gets the associated type of an ID
GetCrossList Get a CrossList, which contains the crossing points with another curve?. The parameter param1 and param2 in CrossItem are converted to a curve parameter.
GetHashCode (inherited from Object) 
GetMaxrectOverloaded. Gets a minimal rectangle, which contains a curve, transformed by a transformation.
GetType (inherited from Object) 
InsertPoint Inserts a point at the position, which is given by Param.
Invert Inverts the direction of the curve by exchange A and B resp. Atang and Btang
LengthToParam Converts a length to a param, which can be used in the method Value.
LoadFromStream Loads A an B.
Parallel Returns a leftside parallel xyArray to the curve, which has a distance of width.
ParamToLength Calculates the length of a part of the curve, which is given from 0 to the value param.
SaveToStream Saves A an B.
SetBorderOverloaded. Set the border of the curve to the new start- and endpoints of the curve, whose are near to _A and to_B
Slice This method trims the curve to the part between "from" and "to". The base-method sets fromParam = from and toParam = to. In general this is not the best solution. So it is better to override this method without calling to the base method.
ToArray This method fills values, calculated by the function Value in an array, starting at index.
ToString (inherited from Object) 
ToXYArray Gets an array of Resolution+1 interpolationpoints.
Transform Transforms a Curve with the transformation given by m. The method in the base class is empty. So you have to override this function, if you want to transform a Curve.
Value This abstract method must be overridden. It returns the function for a value t.
public xy Value(double t){
return new xy(cos(t), sin(t));
}
public xy Drivation(double t){
return new xy(-sin(t), cos(t));
}
This example implements an unit circle.

Public Instance Events

OnGetDerivation Event, which is fired by the method derivation.
OnGetValue Event, which is fired by the method value.

Protected Instance Fields

Dirty Indicates, that the curve is changed A call to MakeClean sets dirty to false. In this method an Array of Resolution+1 point will be created and returned, when a request ToXYArray is given.

Protected Instance Methods

Finalize (inherited from Object) 
getA This is the virtual Get-Method of A. By default it calls 'Value(fromParam)'.
getAtang This method is the getMethod of the Atang-property, which retrieves the start tangent. By default Derivation(fromParam) is returned.
getB This is the virtual Get-Method of B. By default, it provides 'Value(toParam)'.
getBtang This method is the getMethod of the Btang-property, which retrieves the Endtangent. By default Derivaion(toParam) is returned.
GetMaxrectOverloaded. Gets the smaller rectangle, which contains the curve.
getVisible virtual getmethod of the property Visible
MemberwiseClone (inherited from Object) 
setA This method is the setMethod of the A-property, which retrieves the StartPoint. This method is abstract and has to be overridden.
setAtang This method is the setMethod of the Atang-property, which retrieves the starttangent. This method is an abstract one and has to be overridden.
setB This method is the setMethod of the B-property, which retrieves the EndPoint. This method is abstract and must be overridden.
setBtang This method is the setMethod of the Btang-property, which retrieves the end tangent. This method is abstract and has to be overridden.
setVisible Virtual setmethod of the property Visible

See Also

Curve Class | Drawing3d.Curves Namespace