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
Construct a new instance with default values.
public CurveKinkDefinition()

CurveKinkDefinition

#Since v9.0
Create a CurveKinkDefinition with specified settings.
public CurveKinkDefinition(
kinkAngleDegrees,
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,
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,
true if tangent discontinuities should be tested to determine if the tangent discontinuity is a kink. false to ignore tangent discontinuities.
kinkAtCurvatureChange
true if curvature discontinuities should be tested to determine if the curvature discontinuity is a kink. false to ignore curvature discontinuities.
)

Finalizer

~CurveKinkDefinition

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

Properties

CurvatureKinkRadiusRatio

#Since v9.0
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.
public double CurvatureKinkRadiusRatio { get; set; }
The ratio used to test for curvature vector kinks.

CurvatureKinkZeroTolerance

#Since v9.0
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.
public double CurvatureKinkZeroTolerance { get; set; }

KinkAngleDegrees

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

KinkAtCurvatureChange

#Since v9.0
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().
public bool KinkAtCurvatureChange { get; set; }

KinkAtTangentChange

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

Methods

ComputeCurvatureRadiusRatio

#Since v9.0
Calculates the curvature radius ratio and the angle between the two curvature vectors, as used by IsCurvatureKink(Vector3d, Vector3d).
public bool ComputeCurvatureRadiusRatio(
curvatureFromBelow,
curvatureFromAbove,
out double
radiusOfCurvatureRatio,
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.
out double
curvatureVectorAngleDegrees
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
Actively reclaims unmanaged resources that this instance uses.
public void Dispose()

Dispose

#
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.

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

IsCurvatureKink

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

IsCurvatureKink

#Since v9.0
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.
public bool IsCurvatureKink(
curvatureFromBelow,
curvatureFromAbove
)
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
Returns true if the curvature vector is considered to be zero given the CurvatureKinkZeroTolerance
public bool IsCurvatureZero(
curvature
)

IsCurvatureZero

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

IsKink

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

IsTangentKink

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

IsTangentKink

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