Previous Document Next Document

Object Model Reference : Classes : S : SubPath : Methods : SubPath.GetCurveSpeedAt


SubPath.GetCurveSpeedAt

Function GetCurveSpeedAt([Offset As Double = 0.5], [OffsetType As cdrSegmentOffsetType = cdrRelativeSegmentOffset]) As Double

Description

Member of SubPath

The GetCurveSpeedAt method returns a value indicating the rate at which the curvature of a subpath changes at a given point. A value close to 0 means that the curvature is steady — for example, in a circle. A value greater than 0 means that the curvature increases — for example, in a spiral. A value of less than 0 value means that the curvature decreases — for example, in an unwinding spiral.

Parameter
Description
Offset
Specifies the offset, in document units, of the point. This parameter is optional, and its default value is 0.5.
OffsetType
Specifies the offset type of the point, and returns cdrSegmentOffsetType. This parameter is optional, and its default value is cdrRelativeSegmentOffset (1).

VBA example

The following VBA example shows how the curvature changes in the middle of the first subpath of the selected curve.

Sub Test()
 Dim c As Double
 Dim sp As SubPath
 Set sp = ActiveShape.Curve.Subpaths(1)
 c = sp.GetCurveSpeedAt(0.5, cdrRelativeSegmentOffset)
 If Abs(c) < 0.01 Then
  MsgBox "Curvature is steady: " & c
 Else
  If c > 0 Then
   MsgBox "Curvature is increasing: " & c
  Else
   MsgBox "Curvature is decreasing: " & c
  End If
 End If
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.