Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

GRIP to create points 2

Status
Not open for further replies.

psicad

Computer
Jan 20, 2006
5
Hi,

I'm looking for a compiled grip programm for creating points from an ascii file (3 coordinates on each line).

Thanks in advance

Regards

 
Replies continue below

Recommended for you

Psicad,
Use a GRIP program found in the International GRIP Library named: 'FILE2POINTS.GRS' (source code file). If you need it compiled for you, I'm sure something can be arranged....

SS
 
Hi,

thanks for your answer, I found the file2points.grx directly and was able to test it.

But this programm read a file formatted like:
x1
y1
z1
x2
y2
z2
...

And my input file is formatted like:
x1 y1 z1
x2 y2 z2
...

Thanks in advance

Regards
 
Is the delimiter between points a space character or is there something else (like a comma, tab stop, or other special character)?
 
The delimeter is a space character.
 
I have been meaning to look up that grip program, but things got busy around here. However, I have thought of an alternative workaround.

You can define a spline by points (from file) delimited as you have described (one x y z point per line separated by spaces). So, create a spline using points from your file, then create a point set on the defining points, and delete the spline.

Maybe someday we will be able to import points from file directly in the point set command (makes sense to me, anyway).
 
Hi,

Just a problem, my file containt about 1500 points !!!
Thank's anyway
I will try and gave you a feedback
Regards
Didier

 
Hi ,

I wrote this to read a 3-D scan file from a Mitutoyo 3D cmm-machine .Maybe it can help . Enjoy .

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$
$$ SUBROUTINE :Read_cmm_points.GRS
$$
$$ FUNCTIE: Programma leest 3-D punten van een aangeduide scan-file van
$$ een Mitutoyo 3-D meetmachine en zet deze modelling op het
$$ scherm in de vorm van punten.
$$
$$
$$ GEBRUIKTE BESTANDEN : aangeduide scan-file.dat
$$
$$ Example input file format :
$$ -----------------------------
$$ #00:GEOPAK-WIN Scanning
$$ #02:kanaal_A
$$ #04:ZX(Y)
$$ #05:Cls
$$ #06:MM
$$ #12: -57.36521 110.27753 -64.24180 0.00112 0.00000 -1.00000
$$ #12: -57.36471 110.32947 -64.24111 0.00135 0.00000 -1.00000
$$ #12: -57.36521 110.38151 -64.24141 0.00161 0.00000 -1.00000
$$ #12: -57.36421 110.43046 -64.24122 -0.00016 0.00000 -1.00000
$$ #12: -57.36472 110.48066 -64.24053 -0.00056 0.00000 -1.00000
$$ #12: -57.36472 110.53987 -64.24131 0.00004 0.00000 -1.00000
$$ #12: -57.36472 110.59114 -64.24211 -0.00158 0.00000 -1.00000
$$ #12: -57.36522 110.65192 -64.24140 0.00006 0.00000 -1.00000
$$ #12: -57.36522 110.70269 -64.24170 -0.00155 0.00000 -1.00000
$$ #12: -57.36473 110.76114 -64.24200 0.00143 0.00000 -1.00000
$$ #12: -57.36473 110.81561 -64.24129 -0.00009 0.00000 -1.00000
$$ #12: -57.36523 110.87476 -64.24058 0.00149 0.00000 -1.00000
$$ #12: -57.36423 110.92300 -64.24038 -0.00164 0.00000 -1.00000
$$ #12: -57.36524 110.97405 -64.24019 -0.00162 0.00000 -1.00000
$$ #12: -57.36474 111.03577 -64.23947 -0.00001 0.00000 -1.00000
$$ #12: -57.36523 111.08461 -64.23926 -0.00309 0.00000 -1.00000
$$ #12: -57.36525 111.14470 -64.23956 -0.00004 0.00000 -1.00000
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
NUMBER/SRESP,aantal,xyz(3),xpunt,ypunt,zpunt
STRING/cmmfile(80),lijn(132)
ENTITY/PNTS(10000)
DATA/cmmfile,'PUNTEN.DAT'
st1:
TEXT/'Geef file naam (vb : P:\BLE\PUNTEN.DAT)',cmmfile,RESP,DEFLT
JUMP/STOP:,STOP:,RESP
IF/LENF(cmmfile)==0,JUMP/ST1:
FHREAD/cmmfile,IFERR,FILERR:
JUMP/next:
FILERR:
MESSG/'File niet gevonden'
JUMP/ST1:
next:
fhread/cmmfile,iferr,filerr:
fetch/txt,2,cmmfile
reset/2
aantal = 1
loop_3:
read/2,ifend,eof_3:,lijn
ifthen/substr(lijn,1,4)=='#12:'
xpunt = valf(substr(lijn,5,14))
ypunt = valf(substr(lijn,17,14))
zpunt = valf(substr(lijn,30,14))
point/xpunt,ypunt,zpunt
aantal = aantal + 1
endif
jump/loop_3:
eof_3:
fterm/txt,2
print/ 'Aantal gelezen punten '+ istr(aantal)
STOP: HALT




 
I got a chance to look at the FILE2PTS.GRS program. The version I looked at takes points in the format:
x1,y1,z1
x2,y2,z2
.
.
.
xn,yn,zn

So, I think if you edit your file to use commas as the separator (an automatic find and replace function will make this easy) you should be good to go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor