|
TNTmips Downloads Menu

|
vmake.sml
# vmake.sml
clear();
vector V;
array numeric xPoints[10], yPoints[10];
numeric numPolys, numPoints;
GetOutputVector(V, "VectorToolkit");
# draw some boxes - this will create polygons
# all closed lines are converted to polygons
xPoints[1] = 0;
yPoints[1] = 0;
xPoints[2] = 100;
yPoints[2] = 0;
xPoints[3] = 100;
yPoints[3] = 100;
xPoints[4] = 0;
yPoints[4] = 100;
xPoints[5] = 0;
yPoints[5] = 0;
VectorAddLine(V, 5, xPoints, yPoints);
# now add some points
numeric i;
for i = 1 to 4 {
VectorAddPoint(V, xPoints[i] + 150, yPoints[i] + 150);
}
numPolys = NumVectorPolys(V);
numPoints = NumVectorPoints(V);
print("number of polygons, points: ", numPolys, numPoints);
©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010 USA
Business & Sales: (402)477-9554 Support: (402)477-9562 Fax: (402)477-9559
Business info@microimages.com
Support support@microimages.com
Web webmaster@microimages.com
| |