|
|
Vector Shape - Create Ellipse
Added on 2/7/2006
|
Pass the custom handler a width and height and it will return a vertexList consisting of an elliptical shape to which you can set to a #vectorshape member type. The code can be used anywhere.
on createEllipse (aWidth, aHeight)
rX = aWidth / 2.0
rY = aHeight / 2.0
rXk = rX * 0.552284749830794
rYk = rY * 0.552284749830794
vertList = [[#vertex: point(0, -rY), #handle1: point(rXk, 0), #handle2: point(-rXk, 0)], [#vertex: point(rX, 0), #handle1: point(0, rYk), #handle2: point(0, -rYk)], [#vertex: point(0, rY), #handle1: point(-rXk, 0), #handle2: point(rXk, 0)], [#vertex: point(-rX, 0), #handle1: point(0, -rYk), #handle2: point(0, rYk)]]
return vertList
end
|
|