CurveKinkDefinition

A "kink" in a curve is a unit tangent discontinuity or a vector curvature discontinuity. This class is used to determine which types and magnitudes of unit tangent discontinuities and vector curvature discontinuities should are a "kink." It also provides functions for determining if there is a kink at a specific curve parameter.

Constructors

CurveKinkDefinition

#Since v9.0
public CurveKinkDefinition()
Construct a new instance with default values.

CurveKinkDefinition

#Since v9.0
public CurveKinkDefinition(double kinkAngleDegrees, double curvatureKinkRadiusRatio, bool kinkAtTangentChange, bool kinkAtCurvatureChange)
Create a CurveKinkDefinition with specified settings.
kinkAngleDegrees (double)0 <= kinkAngleDegrees <= 180. Values > 180 are treated as 180 and other values outside the [0,180] are treated as ON_CurveKinkDefinition::DefaultPolylineTangentKinkAngleDegrees. If a curve is a polyline and the angle (in degrees) between the tangents at a tangent discontinuity is > polyline_tangent_kink_angle_degrees, then that discontinuity is treated as a kink. In particular, passing 180.0 disables tangent discontinuity checks for polyline curves.
curvatureKinkRadiusRatio (double)0 <= curvatureKinkRadiusRatio <= 1. Values > 1 are treated as 1 and other values outside the [0,1] are treated as ON_CurveKinkDefinition::DefaultCurvatureKinkRadiusRatio. If the ratio (minimum radius of curvature)/(maximum radius of curvature) at a curvature discontinuity is < curvature_kink_radius_ratio, then that discontinuity is treated as a kink. In particular, passing 0.0 disables curvature radius discontinuity checks.
kinkAtTangentChange (bool)true if tangent discontinuities should be tested to determine if the tangent discontinuity is a kink. false to ignore tangent discontinuities.
kinkAtCurvatureChange (bool)true if curvature discontinuities should be tested to determine if the curvature discontinuity is a kink. false to ignore curvature discontinuities.

Finalizer

~CurveKinkDefinition

#
~CurveKinkDefinition()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().

Properties

CurvatureKinkRadiusRatio

#Since v9.0
public double CurvatureKinkRadiusRatio { get; set; }
If the ratio (minimum radius of curvature)/(maximum radius of curvature) at a curvature discontinuity is < CurvatureKinkRadiusRatio, then that curvature discontinuity is treated as a kink. In particular, if CurvatureKinkRadiusRatio = 0, then curvature radius discontinuity checks are disabled.
The ratio used to test for curvature vector kinks.

CurvatureKinkZeroTolerance

#Since v9.0
public double CurvatureKinkZeroTolerance { get; set; }
If the curvature <= CurvatureKinkZeroTolerance, then it is treated as zero curvature. Put another way, if (radius of curvature) * CurvatureKinkZeroTolerance >= 1, then the radius is treated as infinite. If CurvatureKinkZeroTolerance > 0, then the curvature kink test is scale dependent. If CurvatureKinkZeroTolerance = 0, then the curvature kink test is indpendent of scale.

KinkAngleDegrees

#Since v9.0
public double KinkAngleDegrees { get; set; }
The angle, in degrees, used to determine if when an abrupt change in tangent or curvature vector direction is a kink.
The tangent or curvature kink angle in degrees.

KinkAtCurvatureChange

#Since v9.0
public bool KinkAtCurvatureChange { get; set; }
Returns true if curvature discontinuities should be tested when finding kinks. The angle used vector curvature direction discontinuities is KinkAngleDegrees(). The ratio used for radius of curvature discontinuities is CurvatureKinkRadiusRatio().

KinkAtTangentChange

#Since v9.0
public bool KinkAtTangentChange { get; set; }
Returns true if tangent discontinuities should be tested when finding kinks. The angle used for testing is KinkAngleDegrees().

Methods

ComputeCurvatureRadiusRatio

#Since v9.0
public bool ComputeCurvatureRadiusRatio(Vector3d curvatureFromBelow, Vector3d curvatureFromAbove, out double radiusOfCurvatureRatio, out double curvatureVectorAngleDegrees)
Calculates the curvature radius ratio and the angle between the two curvature vectors.
curvatureFromBelow (Vector3d)
curvatureFromAbove (Vector3d)
radiusOfCurvatureRatio (out double)
curvatureVectorAngleDegrees (out double)If one or both of the vectors have zero length, this returns RhinoMath.UnsetValue

Dispose

#Since v9.0
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.

Dispose

#
protected virtual void Dispose(bool disposing)
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

disposing (bool)true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.

IsCurvatureKink

#Since v9.0
public bool IsCurvatureKink(Curve curve, double t)
True if there is a curvature discontinuity at curve(t) that passes the curvature kink test.
curve (Curve)
t (double)

IsCurvatureKink

#Since v9.0
public bool IsCurvatureKink(Vector3d curvatureFromBelow, Vector3d curvatureFromAbove)
True if the angle between curvature_from_below and curvature_from_above is > KinkAngleDegrees or the ratio min/max < CurvatureKinkRadiusRatio, where min and max are the minimum and maximum lengths of curvatureFromBelow and v. Both of these tests are scale independent. If an input curvature vector has length <= CurvatureKinkZeroTolerance, then that curvature is treated as zero. When is CurvatureKinkZeroTolerance > 0, the test is scale dependent. The default value is chosen to work reasonably well for most models at most scales.
curvatureFromBelow (Vector3d)
curvatureFromAbove (Vector3d)
True if either curvature vector is not valid or if, based on the tests described above, they are different enough to be considered a "curvature kink."

IsCurvatureZero

#Since v9.0
public bool IsCurvatureZero(double curvature)
Returns true if the curvature vector is considered to be zero given the CurvatureKinkZeroTolerance
curvature (double)

IsCurvatureZero

#Since v9.0
public bool IsCurvatureZero(Vector3d curvature)
Returns true if the curvature vector is considered to be zero given the CurvatureKinkZeroTolerance
curvature (Vector3d)

IsKink

#Since v9.0
public bool IsKink(Curve curve, double t)
True if there is a kink at curve(t).
curve (Curve)
t (double)

IsTangentKink

#Since v9.0
public bool IsTangentKink(Curve curve, double t)
True if there is a tangent discontinuity at curve(t) and the agnle between the two tangents is > KinkAngleDegrees
curve (Curve)
t (double)

IsTangentKink

#Since v9.0
public bool IsTangentKink(Vector3d tangentFromBelow, Vector3d tangentFromAbove)
True if the angle between tangent_from_below and tangent_from_above is > KinkAngleDegrees
tangentFromBelow (Vector3d)
tangentFromAbove (Vector3d)