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

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

CastOrConvert

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

Convert

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

IsCurve

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

Simplify

#
public static object Simplify(object curve)
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.
curve (object)

ToRhinoCurve

#
public static Curve ToRhinoCurve(object datum)
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.
datum (object)

ToRhinoCurves

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