VS:RegularPolygon
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Creates a regular polygon of nSides sides. Mode 1 creates a circumscribed poly, mode 2 an inscribed poly.
PROCEDURE RegularPolygon(
centerX :REAL;
centerY :REAL;
radius :REAL;
numSides :INTEGER;
mode :INTEGER);
def vs.RegularPolygon(centerX, centerY, radius, numSides, mode): return None
Parameters
centerX REAL centerY REAL radius REAL numSides INTEGER mode INTEGER
Remarks
The object so created is not accessible to LNewObj, so you have to create something else first (like a locus), then call RegularPolygon, then use NextObj(firstObjectCreated) to find the polygon, then delete the dummy object.
centerX and centerY should be specified in millimeters (until this call gets standardized, and then uses document units).
Example
PROCEDURE Example; VAR cx, cy, radius :REAL; numsides, mode :INTEGER; BEGIN Message('Pick center point...'); GetPt(cx, cy); radius := RealDialog('Enter radius:', '10'); numsides := IntDialog('Enter num sides:', '10'); mode := IntDialog('Enter mode: 1 - circumscribed poly; 2 - inscribed poly', '1'); RegularPolygon(cx, cy, radius, numsides, mode); Message('Done!'); END; RUN(Example);
Version
Availability: from All Versions
This is drop-in function.