#1




Points on curve
Hi! Is there any method to calculate the X/Y coordinates of points lying on a curve shape? I searched the API but cannot find anything like "ConvertToPolygonPoints" or something similar.
I just would like to select a curve shape, specify a number of points to calculate and the macro creates a list of X/Y values representing the selected curve. Any hints highly appreciated. Many thanks in advance! 
#3




Many thanks! Your hint seems to be the right direction so I can forget about implementing my own cubic bezier function for calculating x/y values on curve segments !
However, if someone is interested in, here is the C# source for a similar function like GetPointPositionAt working in 3D: private Point3D CubicBezier(Point3D p0,Point3D p1,Point3D p2,Point3D p3,double mu) { // p0 = StartNode, p1 = StartControlPoint, p2 = EndControlPoint, p3 = EndNode Point3D a = new Point3D(); Point3D b = new Point3D(); Point3D c = new Point3D(); Point3D p = new Point3D(); c.x = 3 * (p1.x  p0.x); c.y = 3 * (p1.y  p0.y); c.z = 3 * (p1.z  p0.z); b.x = 3 * (p2.x  p1.x)  c.x; b.y = 3 * (p2.y  p1.y)  c.y; b.z = 3 * (p2.z  p1.z)  c.z; a.x = p3.x  p0.x  c.x  b.x; a.y = p3.y  p0.y  c.y  b.y; a.z = p3.z  p0.z  c.z  b.z; p.x = a.x * mu * mu * mu + b.x * mu * mu + c.x * mu + p0.x; p.y = a.y * mu * mu * mu + b.y * mu * mu + c.y * mu + p0.y; p.z = a.z * mu * mu * mu + b.z * mu * mu + c.z * mu + p0.z; return p; } Use the segments' StartNode X/Y values as parameter p0, the segments' StartingControlPointX/Y as parameter p1, the EndingControlPointX/Y as p2 and finally the EndNode X/Y values as p3. Specify the paramter mu (distance from the startpoint) as value between 0..1. The function returns the X/Y/Z values of the point on the curve. This is applicable for most vector drawing software like Freehand, Flash, etc. 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)  
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Bending shapes to match a curve  jemmyell  CorelDRAW/Corel DESIGNER VBA  0  01112005 23:54 
Print problem of create curve  petu  CorelDRAW/Corel DESIGNER VBA  5  25052005 21:02 
The formula of crossing direct from a curve Bezier is necess  drg  CorelDRAW/Corel DESIGNER VBA  2  26092004 09:27 
Tone Curve in PP12  Michael Cervantes  Corel PhotoPaint VBA  2  06042004 13:00 
New user  curve default?  dxf conversion?  Anonymous  CurveWorks  2  16052003 10:23 