%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
MeasureCurve Method
See Also  Example
vdWebLibrary Namespace > vdrawObj Class : MeasureCurve Method
entity
An entity of the following type : vdLine, vdPolyline, vdRect, vdCircle, vdArc, vdEllipse
length
The distance lenght used to place each segment
Calculates an array of points over the entity, where each point has a distance equal to length from the previous point.

Syntax

JScript 
public function MeasureCurve( 
   entity : Object,
   length : double
) : Object[];

Parameters

entity
An entity of the following type : vdLine, vdPolyline, vdRect, vdCircle, vdArc, vdEllipse
length
The distance lenght used to place each segment

Example

divide an entity to 10 segments
C#Copy Code
var circle = vdcanvas.AddCircle([0, 0, 0], 2); 
var overalllength = vdcanvas.GetEntityLength(circle); 
var segmentlength = overalllength / 10; 
var pts = vdcanvas.MeasureCurve(circle, segmentlength); 
var pline = vdcanvas.AddPolyline(pts);//add a new polyline with created points 
vdcanvas.redraw(); 
 

See Also