public sealed class Curve
A general implementation of the kinds of curves that system edges can be. This includes lines, arcs, linear arcs, circular arcs and circles.

Properties

Bounds

#
public BoundingBox Bounds { get; }
Gets the boundingbox of this curve.

Centre

#
public Point2d Centre { get; }
Gets the centre point of this curve, assuming it's a circle or an arc.

Length

#
public double Length { get; }
Gets the length of this curve.

Radius

#
public double Radius { get; }
Gets the radius of this curve.

Type

#
public EdgeType Type { get; }
Gets the type of this curve.

Methods

Average

#
public static Curve Average(params Curve[] curves)
Compute the average of a set of curves. They must all be of the same type.
curves (params Curve[])

ClosestPoint

#
public Point2d ClosestPoint(Point2d point)
Gets a point on this curve closest to another point. This will yield the correct results for circles with infinite radius.
point (Point2d)

ComputeArc

#
public static Arc ComputeArc(Point2d a, Point2d b, double bulge)
a (Point2d)
b (Point2d)
bulge (double)

ComputeBulge

#
public static double ComputeBulge(Arc arc)
Compute the bulge distance based on an arc.
arc (Arc)

ComputeBulge

#
public static double ComputeBulge(Point2d a, Point2d b, Point2d m)
Compute the bulge distance based on three points.
a (Point2d)Arc start point.
b (Point2d)Arc end point.
m (Point2d)Arc mid point. And it has to be the *mid* point.

ComputeBulgeFlexible

#
public static double ComputeBulgeFlexible(Point2d a, Point2d b, Point2d interior)
Compute the arc bulge factor based on three points.
a (Point2d)Arc start.
b (Point2d)Arc end.
interior (Point2d)Any point on arc interior.

ComputeMidPoint

#
public static Point2d ComputeMidPoint(Point2d a, Point2d b, double bulge)
Compute the position of the midpoint.
a (Point2d)
b (Point2d)
bulge (double)

CreateArc

#
public static Curve CreateArc(Point2d a, Point2d b, double bulge)
a (Point2d)
b (Point2d)
bulge (double)

CreateArc

#
public static Curve CreateArc(Point2d a, Point2d b, Point2d c)
a (Point2d)
b (Point2d)
c (Point2d)

CreateCircle

#
public static Curve CreateCircle(Point2d centre, Point2d radius)
centre (Point2d)
radius (Point2d)

CreateLine

#
public static Curve CreateLine(Point2d a, Point2d b)
a (Point2d)
b (Point2d)

ParameterAt

#
public double ParameterAt(Point2d point)
Gets the normalised parameter closest to a point.
point (Point2d)

PointAt

#
public Point2d PointAt(double t)
Curve evaluator.
t (double)Normalised arc-length parameter.

Convertors

OperationResultDescription
implicitArcCurve
implicitCircleCurve
implicitLineCurve