Betoniera
Guest
Hello everyone
Please help to extract the coordinates from a text file to be used to draw a wing profile. I'll explain better.
there are databases of alar profiles that provide the coordinates of a profile in the form indicated below (see file hq3014.dat)
- the first number indicates the coordinate x
- the second number indicates the coordinate y
- the first group of numbers indicates the coordinates y positive
- the second group of numbers indicates the negative y coordinates
I know the lisp (not the visual lisp), but I have trouble managing files and field separators.
I look for a fragment of code that:
- open the filenamefile.dat
- jump the first 2 rows
- check the x,y positive coordinates (34 lines)
- jumps 1 row
- assign negative x,t coordinates (34 lines)
- drawings a positive spline
- drawings a negative spline
- close the filenamefile.dat
Can you help me?
Thank you.
content of file text hq3014.dat
hq 3.0/14 airfoil
39. 39.
0.0000000
0.0025000
0.0140500
0.0087500 0.0194200
0.0125000 0.0235800
0.0187500
0.0250000 0.0342500
0.0375 0.0424200
0.0500 0.0492000
0.0750000 0.0600600
0.1000 0.0684400
0.1250000 0.0751100
0.1500 0.0804900
0.1750000 0.0849300
0.2000 0.0885600
0.2250000 0.0914600
0.2500 0.0937500
0.2750000 0.0955900
0.3000 0.0970200
0.3250000 0.0980200
0.3500 0.0985300
0.3750000 0.0986000
0.4000 0.0982700
0.4500 0.0965300
0.5000 0.0932800
0.5500 0.0884700
0.6000 0.0821400
0.6500 0.0744100
0.7000 0.0655900
0.7500 0.0557200
0.8000 0.0450600
0.8250000 0.0394900
0.8500 0.0338900
0.8750000 0.0283000
0.9000 0.0226400
0.9250000 0.0170200
0.9500 0.0111900
0.9750000
100000000000
0.0000000
0.0025000 -.0055100
0.0050000 -.0080800
0.0087500 -.0110900
0.0125000 -.0135200
0.0187500 -.0167400
0.0250000 -.0191200
0.0375000 -.0228200
0.0500000 -.0255700
0.0750000 -.0297300
0.1000000 -.0328100
0.1250000 -.0352300
0.1500000 -.0371400
0.1750000 -.0385500
0.2000000 -.0395700
0.2250000 -.0403000
0.2500000 -.0407900
0.2750000 -.0411000
0.3000000 -.0412900
0.3250000 -.0413900
0.3500000 -.0413300
0.3750000 -.0408500
0.4000000 -.0399500
0.4500000 -.0372800
0.5000000 -.0335500
0.5500000 -.0290300
0.6000000 -.0238800
0.6500000 -.0184000
0.7000000 -.0129700
0.7500000 -.0078500
0.8000000 -.0034700
0.8250000 -.0017400
0.8500000 -.0003800
0.8750000 0.0004700
0.9000000 0.0010000
0.9250000 0.0010200
0.9500000000
0.9750000
100000000000
Please help to extract the coordinates from a text file to be used to draw a wing profile. I'll explain better.
there are databases of alar profiles that provide the coordinates of a profile in the form indicated below (see file hq3014.dat)
- the first number indicates the coordinate x
- the second number indicates the coordinate y
- the first group of numbers indicates the coordinates y positive
- the second group of numbers indicates the negative y coordinates
I know the lisp (not the visual lisp), but I have trouble managing files and field separators.
I look for a fragment of code that:
- open the filenamefile.dat
- jump the first 2 rows
- check the x,y positive coordinates (34 lines)
- jumps 1 row
- assign negative x,t coordinates (34 lines)
- drawings a positive spline
- drawings a negative spline
- close the filenamefile.dat
Can you help me?
Thank you.
content of file text hq3014.dat
hq 3.0/14 airfoil
39. 39.
0.0000000
0.0025000
0.0140500
0.0087500 0.0194200
0.0125000 0.0235800
0.0187500
0.0250000 0.0342500
0.0375 0.0424200
0.0500 0.0492000
0.0750000 0.0600600
0.1000 0.0684400
0.1250000 0.0751100
0.1500 0.0804900
0.1750000 0.0849300
0.2000 0.0885600
0.2250000 0.0914600
0.2500 0.0937500
0.2750000 0.0955900
0.3000 0.0970200
0.3250000 0.0980200
0.3500 0.0985300
0.3750000 0.0986000
0.4000 0.0982700
0.4500 0.0965300
0.5000 0.0932800
0.5500 0.0884700
0.6000 0.0821400
0.6500 0.0744100
0.7000 0.0655900
0.7500 0.0557200
0.8000 0.0450600
0.8250000 0.0394900
0.8500 0.0338900
0.8750000 0.0283000
0.9000 0.0226400
0.9250000 0.0170200
0.9500 0.0111900
0.9750000
100000000000
0.0000000
0.0025000 -.0055100
0.0050000 -.0080800
0.0087500 -.0110900
0.0125000 -.0135200
0.0187500 -.0167400
0.0250000 -.0191200
0.0375000 -.0228200
0.0500000 -.0255700
0.0750000 -.0297300
0.1000000 -.0328100
0.1250000 -.0352300
0.1500000 -.0371400
0.1750000 -.0385500
0.2000000 -.0395700
0.2250000 -.0403000
0.2500000 -.0407900
0.2750000 -.0411000
0.3000000 -.0412900
0.3250000 -.0413900
0.3500000 -.0413300
0.3750000 -.0408500
0.4000000 -.0399500
0.4500000 -.0372800
0.5000000 -.0335500
0.5500000 -.0290300
0.6000000 -.0238800
0.6500000 -.0184000
0.7000000 -.0129700
0.7500000 -.0078500
0.8000000 -.0034700
0.8250000 -.0017400
0.8500000 -.0003800
0.8750000 0.0004700
0.9000000 0.0010000
0.9250000 0.0010200
0.9500000000
0.9750000
100000000000