Namespace CADability.Curve2D
Classes
- Arc2D
Describes a circular Arc in 2D. Implements the ICurve2D interface.
- BSpline2D
A non-uniform rational B-spline curve (NURBS) in 2d. It is mostly used as a curve in the parameter space of a surface (e.g. as part of the outline of a Face) or as the projection of a 3d BSpline onto a plane. The curve is defined by its poles (control points), optional weights (a rational spline has one weight per pole), the knots with their multiplicities, the degree and a start and end parameter. The underlying NURBS is always clamped, the periodic flag only records how the spline was created. Like every ICurve2D it is addressed by a normalized parameter running from 0.0 (start point) to 1.0 (end point).
- Circle2D
A full circle in 2d space, given by its center and radius. The circle is a closed curve; its normalized parameter runs from 0.0 at the point in direction of the positive x-axis once around the circle, counterclockwise by default and clockwise if the circle was created with a negative radius or has been reversed. Circular arcs are represented by the derived class Arc2D. Circles occur as projections of 3d circles (Ellipse) onto a plane and in the parameter space of surfaces.
- CompareGeoPoint2DWithParameter1
Non-generic IComparer that orders GeoPoint2DWithParameter values by par1, the parameter on the first curve of an intersection. Sorting the result of Intersect(ICurve2D) with it arranges the intersection points along the first curve. The generic counterpart for a List<T> is ICompareGeoPoint2DWithParameter1.
- Curve2DException
Exception thrown by operations on 2d curves (ICurve2D) that cannot be carried out, e.g. setting the start point of a full circle or computing the parallel of a line with zero length. ExceptionType tells the kind of failure.
- Curves2D
This class provides some static Methods concerning the interaction of two ICurve2D objects.
- Ellipse2D
Describes an ellipse in 2D. Implements the ICurve2D interface.
- EllipseArc2D
Describes an arc of an ellipse in 2D. Implements the ICurve2D interface
- GeneralCurve2D
Only temporary (commented out): later all 2d curves were meant to be derived from TriangulatedCurve2D
- ICompareGeoPoint2DWithParameter1
Orders GeoPoint2DWithParameter values by par1, the parameter on the first of the two curves of an intersection, so that the intersection points returned by Intersect(ICurve2D) can be sorted along the first curve. ICompareGeoPoint2DWithParameter2 sorts along the second curve.
- ICompareGeoPoint2DWithParameter2
Orders GeoPoint2DWithParameter values by par2, the parameter on the second of the two curves of an intersection, so that the intersection points returned by Intersect(ICurve2D) can be sorted along the second curve. ICompareGeoPoint2DWithParameter1 sorts along the first curve.
- Line2D
Implements a line in 2D space. By implementing the ICurve2D interface this line can be handled as any 2D curve.
- Path2D
Composition of one or more ICurve2D objects. The contained ICurve2D objects are connected and stored in the right order, i.e. SubCurve[i].EndPoint is identical or close to SubCurve[i+1].StartPoint. Path2D may be open or closed. It also may be self-intersecting.
- Polyline2D
Implements a polyline in 2D space. By implementing the ICurve2D interface this polyline can be handled as any 2D curve.
- Polyline2DException
Thrown by the constructor of Polyline2D when the polyline cannot be built, i.e. when fewer than two distinct vertices are given. MakePolyline2D(GeoPoint2D[]) returns null in that case instead.
- Reduce2D
Helper class to reduce duplicated or 2d connected curves. To use this class create an empty instance, Add curves to it and access the Reduced property. Some flags add additional control on how the reduction is performed
- SineCurve2D
A 2d curve of the form y = a*sin(x - x0) + y0: the segment of the unit sine curve (u, sin(u)) for u from UStart to UStart + UDiff, transformed by FromUnit. This is the shape of a planar section of a cylinder (an ellipse) in the parameter space of the CylindricalSurface, which uses it as the exact 2d curve of such intersections instead of an approximating spline. Create one with the constructor or, from four points, with Create(GeoPoint2D, GeoPoint2D, GeoPoint2D, GeoPoint2D).
- TransformedCurve2D
A general 2D Curve which results from a non-affine transformation of the 2D space
Structs
- GeoPoint2DWithParameter
A point in 2d together with its parameters on two curves, as returned by Intersect(ICurve2D) and Intersect(GeoPoint2D, GeoPoint2D): p is the intersection point, par1 its parameter on the curve the method was called on and par2 its parameter on the other curve (or on the line given by two points). The parameters are normalized (0.0 at the start point, 1.0 at the end point of the respective curve); values outside that range denote a point on the extension of the curve.
Interfaces
- 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
- ICurveTransformation2D
Interface for non affine parameterspace transformation for 2d curves
Enums
- Curve2DException.Curve2DExceptionType
The kind of failure a Curve2DException reports:
Generalfor an operation the curve does not support (e.g. modifying the start point of a Circle2D),LineIsNullfor a line of zero length, which has no direction (e.g. in Parallel(double, bool, double, double)),InternalErrorfor an inconsistency in the data of the curve itself.
- ParallelFlag
Intended to select how the corners of a parallel (offset) curve are treated:
Standardextends the offset segments to their intersection,RoundEdgesjoins them with an arc. Not used by the library at present: Parallel(double, bool, double, double) decides this from itsroundAngleparameter instead.
- Reduce2D.Mode
Mode definition.