PDA

View Full Version : Import point file


ganderson
05-13-2003, 03:23 PM
Is there a way to import a point file from ascii text? We want to create a cloud model from a text file containing x, y, and z values.

peder
05-14-2003, 02:40 AM
I did this once... i think there is a utillity called xyz2dxf that will make a model file LightWave can import. I'll se if i can find it.

Peder

ganderson
05-14-2003, 09:12 AM
Thanks, that would be enormously helpful.

vivekd
05-14-2003, 09:36 AM
#pragma warnings



main

{

var textFileName = getfile("xyz locations");

if(textFileName == nil)

return;



var textFile = File(textFileName);

if(textFile == nil)

{

error("Could not open file ",textFileName);

return;

}



editbegin();
// enter Mesh Data Edit mode

var line;

var linecount = 0;
var point;
var pntid;
while(true)

{

line = textFile.read();

++linecount;
if(textFile.eof() or linecount > 32000)

break;



// assign point to x,y,z read from line of file
point = vector(line); // parse the point coordinates from line

pntid = addpoint(point);
// add the point data to the object

addpolygon(pntid); // this may not be necessary if

// we don't want the polygons

}




editend();
// apply changes

}

ganderson
05-14-2003, 11:30 AM
RapidDXF (www.cadopolis.com) appears to do the trick. Thanks for your help.