CurveBroker

public static class CurveBroker
A utility class for dealing with various different kinds of curves. Use this class to drastically reduce the amount of type-checking, casting and conversions you have to do.

Methods

Cast

#
Cast an object to the correct curve type.
public static CurveType Cast(
data,
Data to cast.
out Line
p2,
Output in case data is a Line.
p3,
Output in case data is a Triangle.
p4,
Output in case data is a Rectangle3d.
pn,
Output in case data is a Polyline.
out Circle
a360,
Output in case data is a Circle.
out Arc
ax,
Output in case data is an Arc.
out Curve
c
Output in case data is a Curve.
)
The type of data.

CastOrConvert

#
Cast or convert an object to a curve type if possible.
public static CurveType CastOrConvert(
data,
Data to cast.
out Line
p2,
Output in case data is a Line.
p3,
Output in case data is a Triangle.
p4,
Output in case data is a Rectangle3d.
pn,
Output in case data is a Polyline.
out Circle
a360,
Output in case data is a Circle.
out Arc
ax,
Output in case data is an Arc.
out Curve
c
Output in case data is a Curve.
)
Curve type, if any.

Convert

#
Convert an object to a curve type if possible.
public static CurveType Convert(
data,
Data to cast.
out Line
p2,
Output in case data is a Line.
p3,
Output in case data is a Triangle.
p4,
Output in case data is a Rectangle3d.
pn,
Output in case data is a Polyline.
out Circle
a360,
Output in case data is a Circle.
out Arc
ax,
Output in case data is an Arc.
out Curve
c
Output in case data is a Curve.
)
Numeric type, if any.

IsCurve

#
Check whether a value is a kind of curve.
public static CurveType IsCurve(
data
Data to check.
)
Type of curve, or None is the data is null or not a curve type.

Simplify

#
Simplify a curve and convert it to a more fundamental type if possible. If the curve cannot be simplified or is of an unknown type, it'll be returned wholesale.
public static object Simplify(
curve
)

ToRhinoCurve

#
Try to convert a curve like type to a Rhino curve. This method uses all registered curve assistants. This method make sure that for all standard conversions the curve domain of the returned value matches the domain of the argument.
public static Curve ToRhinoCurve(
datum
)

ToRhinoCurves

#
Try to convert a collection of curve like data into Rhino curves.
public static IEnumerable<Curve> ToRhinoCurves()