RhinoCommonExtensionMethods

public static class RhinoCommonExtensionMethods
Some extension methods for various RhinoCommon types.

Methods

AddSphere

#Example
public static void AddSphere(this CustomDisplay display, Sphere sphere, Color colour, int thickness)
display (CustomDisplay)
sphere (Sphere)
colour (Color)
thickness (int)

AddSphere

#Example
public static void AddSphere(this CustomDisplay display, Sphere sphere)
display (CustomDisplay)
sphere (Sphere)

FindCusps

#
public static IEnumerable<double> FindCusps(NurbsCurve curve, int spanIndex)
Find parameters where cusps occur within the given interval. Note that the limits of the interval are rejected as possible cusp locations.
curve (NurbsCurve)
spanIndex (int)

FindCusps

#Example
public static IEnumerable<double> FindCusps(this NurbsCurve curve)
Find parameters where cusps occur within the interior of spans.
curve (NurbsCurve)The NURBS curve to analyse.

FocusWindowNAH

#Example
public static void FocusWindowNAH(this RhinoDoc doc)
Make sure the Rhino window hosting the specified document has focus.
doc (RhinoDoc)

GetContinuityLevel

#Example
public static DiscontinuityLevel GetContinuityLevel(this Curve curve, double t, double angleTolerance = 0.01, double relativeTolerance = 0.01)
Evaluate the level of discontinuity at a given curve parameter.
curve (Curve)Curve.
t (double)Parameter on curve.
angleTolerance (double = 0.01)Angle tolerance between normalised derivatives in radians.
relativeTolerance (double = 0.01)Relative tolerance between normalised derivatives.
Highest level of continuity.

HasSelectableObjects

#Example
public static bool HasSelectableObjects(this ObjectTable objects, ObjectType type)
Gets whether this document contains any selectable (i.e. non-hidden and non-locked) object of the given type.
objects (ObjectTable)
type (ObjectType)

Invert

#Example
public static DisplayMaterial Invert(this DisplayMaterial material)
Create a new material with inverted back and front face properties.
material (DisplayMaterial)

MakeClosedViaLine

#Example
public static Curve MakeClosedViaLine(this Curve curve)
Close a curve by inserting a line segment from the end to the start point.
curve (Curve)Curve to close. If curve is already closed, it will be returned immediately.
Closed curve or null.

RedrawAndReturnImmediately

#Example
public static void RedrawAndReturnImmediately(this RhinoDoc document)
Redraw all Rhino viewports. All GH code should use this method rather than ViewTable.Redraw().
document (RhinoDoc)Document whose viewports to redraw.

Reflex

#Example
public static Arc Reflex(this Arc arc)
Get the reflex arc.
arc (Arc)

RegionIndices

#Example
public static int[] RegionIndices(this CurveBooleanRegions regions, int regionIndex, int[] indexMap = null)
Find all the indices of input curves that went into a specific region.
regions (CurveBooleanRegions)
regionIndex (int)
indexMap (int[] = null)