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 flat: its value is treated as CurvatureKinkZeroTolerance and the direction of the curvature vector is ignored. Put another way, every radius of curvature >= 1/CurvatureKinkZeroTolerance is treated as 1/CurvatureKinkZeroTolerance. If you know of a finite radius R that should be considered flat, set this to 1.0/R. If CurvatureKinkZeroTolerance > 0, then the curvature kink test is scale dependent. If CurvatureKinkZeroTolerance = 0, then the curvature kink test is independent of scale. The default is 0.

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, as used by IsCurvatureKink(Vector3d, Vector3d).
curvatureFromBelow (Vector3d)
curvatureFromAbove (Vector3d)
radiusOfCurvatureRatio (out double)min/max of the lengths of curvatureFromBelow and curvatureFromAbove, where a length <= CurvatureKinkZeroTolerance is treated as CurvatureKinkZeroTolerance. This is 1 when both lengths are <= CurvatureKinkZeroTolerance.
curvatureVectorAngleDegrees (out double)The angle between curvatureFromBelow and curvatureFromAbove. If one or both lengths are <= CurvatureKinkZeroTolerance, the direction is ignored and this returns RhinoMath.UnsetValue.
True if the calculation is successful.

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 ratio min/max <= CurvatureKinkRadiusRatio, where min and max are the minimum and maximum lengths of curvatureFromBelow and curvatureFromAbove, or if the angle between curvatureFromBelow and curvatureFromAbove is > KinkAngleDegrees. If a curvature vector has length <= CurvatureKinkZeroTolerance, it is treated as flat: its length is treated as CurvatureKinkZeroTolerance in the ratio and its direction is ignored, so the angle test is only done when both lengths are > CurvatureKinkZeroTolerance. Two flat curvatures are never a kink. When CurvatureKinkZeroTolerance = 0, both tests are scale independent. When CurvatureKinkZeroTolerance > 0, the test is scale dependent.
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)