Previous Document Next Document

Object Model Reference : Classes : S : Segment : Methods : Segment.GetBendPoints


Segment.GetBendPoints

Function GetBendPoints(Offset1 As Double, Offset2 As Double, [OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset]) As Long

Description

Member of Segment

The GetBendPoints method returns the number of bend points in a curve segment. A bend point is the offset where a curve segment bends (that is, where it changes its curvature from positive to negative). There can be a maximum of two bend points per segment, and possibly none.

Parameter
Description
Offset1
Specifies the offset, in document units, of the first bend point
Offset2
Specifies the offset, in document units, of the second bend point
OffsetType
Specifies the type of offset of the point on the curve’s subpath, and returns cdrSegmentOffsetType. This parameter is optional, and its default value is cdrParamSegmentOffset (2).

VBA example

The following VBA example marks, with small circles, all bend points in the selected curve.

Sub Test()
Dim seg As Segment
Dim t1 As Double, t2 As Double, n As Long
For Each seg In ActiveShape.Curve.Segments
n = seg.GetBendPoints(t1, t2)
If n > 1 Then MarkPoint seg, t2
If n > 0 Then MarkPoint seg, t1
Next seg
End Sub
Private Sub MarkPoint(seg As Segment, t As Double)
Dim x As Double, y As Double
Dim s As Shape
seg.GetPointPositionAt x, y, t
Set s = ActiveLayer.CreateEllipse2(x, y, 0.03)
s.Fill.UniformColor.RGBAssign 255, 255, 0
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.