|
|
Vector Shapes - Create Donut
Added on 2/7/2006
|
This custom behavior returns a vertexList of a donut shape. the outRad defines the outer radius and the inRad defines the inner radius (the hole of the donut).
on createDonut(outRad, inRad)
vertList = []
rXY1 = outRad * 0.552284749830794
rXY2 = inRad * 0.552284749830794
vertList1 = [[#vertex: point(0, -outRad), #handle1: point(rXY1, 0), #handle2: point(-rXY1, 0)], [#vertex: point(outRad, 0), #handle1: point(0, rXY1), #handle2: point(0, -rXY1)], [#vertex: point(0, outRad), #handle1: point(-rXY1, 0), #handle2: point(rXY1, 0)], [#vertex: point(-outRad, 0), #handle1: point(0, -rXY1), #handle2: point(0, rXY1)]]
repeat with i in vertList1
vertList.add(i)
end repeat
vertList.add([#newCurve])
vertList2 = [[#vertex: point(0, -inRad), #handle1: point(rXY2, 0), #handle2: point(-rXY2, 0)], [#vertex: point(inRad, 0), #handle1: point(0, rXY2), #handle2: point(0, -rXY2)], [#vertex: point(0, inRad), #handle1: point(-rXY2, 0), #handle2: point(rXY2, 0)], [#vertex: point(-inRad, 0), #handle1: point(0, -rXY2), #handle2: point(0, rXY2)]]
repeat with i in vertList2
vertList.add(i)
end repeat
return vertList
end
|
|