外部変形は データのやり取りをテキストファイルで行うので プログラム言語は 自由に選ぶことができます。図形は機能的かつシンプルなため、数多くのユーザーに受け入れられています。
tclshで構築線を引く(xline)
:tclshで構築線を引く(xline)
@echo off
for /f "delims=:" %%n in ('findstr /n "^#!" %0') do (
copy jwc_temp.txt myfiles > nul
more +%%n %0 | tclsh - > jwc_temp.txt
)
goto:eof
REM #jww
REM #0 基準点を指示して下さい
REM #e
#!この次の行からプログラムを書いてください
set tcl_precision 16; #文字列を数値演算するとき有効桁数 16 (デフォルト 12)
set PI [expr acos(-1)]
set f [open myfiles]
foreach 0 [split [read $f] \n] {
switch -regexp -- $0 {
^hk {
lassign $0 1 hk
set d [expr $hk * $PI / 180]
set x [expr cos($d) * 1e+10]
set y [expr sin($d) * 1e+10]
puts "[expr 0-$x] [expr 0-$y] $x $y"
puts "[expr 0-$y] $x $y [expr 0-$x]"; #直交軸
}
}
}
close $f
参考までに
wish を使うこともできます。
:構築線 xline
@echo off
for /f "delims=:" %%n in ('findstr /n "^#!" %0') do (
copy jwc_temp.txt myfiles > nul
: more +%%n %0 | tclsh - > jwc_temp.txt
more +%%n %0 | wish - > jwc_temp.txt
)
type jwc_temp.txt
pause
goto:eof
REM #jww
REM #0 基準点を指示して下さい
REM #e
#!この次の行からプログラムを書いてください
set tcl_precision 16; #文字列を数値演算するとき有効桁数 16 (デフォルト 12)
set PI [expr acos(-1)]
set f [open myfiles]
foreach 0 [split [read $f] \n] {
switch -regexp -- $0 {
^hk {
lassign $0 1 hk
set d [expr $hk * $PI / 180]
set x [expr cos($d) * 1e+10]
set y [expr sin($d) * 1e+10]
puts "[expr 0-$x] [expr 0-$y] $x $y"
puts "[expr 0-$y] $x $y [expr 0-$x]"; #直交軸
}
}
}
close $f
exit #tcl/tkの画面を終了する