|
TNTmips Downloads Menu

|
VerticesInLines.sml
# Script demonstrates a way to print out coordinates of line vertices
# Lists all vertices for every line in a vector object
# Be sure to first resample (warp) your vector to the Coordinate Reference System you want the vertices to be in
# Cindy Robbins - 28 April 2005
clear();
numeric i, numLines, j, numPoints, lineID, k;
class VECTOR V;
GetInputVector(V);
# Here's where the output file will go:
class FILE myFile = fopen("c:/vertices.csv");
# the following arrays will be resized automatically
array lineArray[10];
array xArray[10];
array yArray[10];
array zArray[10];
numLines = NumVectorLines(V);
for j = 1 to numLines {
numPoints = GetVectorLinePointList(V, xArray, yArray, j, zArray);
lineID = V.line[j].Internal.ElemNum;
for k = 1 to numPoints {
# modify this to format the output the way you want
fprintf(myFile, "%d%s%f%s%f%s%f\n", j, ",",xArray[k], ",", yArray[k], ",",zArray[k]);
}
}
print("Done");
©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
| |