我已经实现了这段程序了:
FILE *myfile;
float fx,fy,fz;
int count;
tag_t Point, feature_tag;
double P[3];
count = 0;
myfile = fopen("D:\\Start.dat", "r.");
rewind(myfile);
while(!feof(myfile))
{
fscanf(myfile, "%f %f %f\n", &fx, &fy, &fz);
count++;
}
fclose(myfile);
myfile = fopen("D:\\Start.dat", "r.");
rewind(myfile);
for (int i=0; i<count; i++)
{
fscanf(myfile, "%f %f %f\n", &fx, &fy, &fz);
P[0] = (double)fx;
P[1] = (double)fy;
P[2] = (double)fz;
UF_CURVE_create_point (P, &Point);
UF_MODL_create_points_feature (1, &Point, &feature_tag );
}
fclose(myfile);
uc1601("ok",1);
} |