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
public CurveKinkDefinition()
Construct a new instance with default values.
Create a CurveKinkDefinition with specified settings.
Parameters:
| 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
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.
Returns: The ratio used to test for curvature vector kinks.
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.
The angle, in degrees, used to determine if when an abrupt change in tangent or curvature vector direction is a kink.
Returns: The tangent or curvature kink angle in degrees.
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().
Methods
Calculates the curvature radius ratio and the angle between the two curvature vectors, as used by IsCurvatureKink(Vector3d, Vector3d).
Parameters:
| 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. |
Returns: True if the calculation is successful.
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
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.
Parameters:
| disposing (bool) | true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer. |
True if there is a curvature discontinuity at curve(t) that passes the curvature kink test.
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.
Returns true if the curvature vector is considered to be zero given the CurvatureKinkZeroTolerance
Parameters:
| curvature (double) |
Returns true if the curvature vector is considered to be zero given the CurvatureKinkZeroTolerance
Parameters:
| curvature (Vector3d) |
True if there is a kink at curve(t).
True if there is a tangent discontinuity at curve(t) and the agnle between the two tangents is > KinkAngleDegrees