外部変形は データのやり取りをテキストファイルで行うので プログラム言語は 自由に選ぶことができます。図形は機能的かつシンプルなため、数多くのユーザーに受け入れられています。
mshtaで指示線を確認する(ln)
:mshtaで指示線を確認する(ln)
@echo off
if exist jwc_temp.txt (
copy jwc_temp.txt myfiles > nul
mshta %~f0 < myfiles > jwc_temp.txt
)
goto:eof
REM #jww
REM #1%dln 線を指示してください
REM #99#
REM #bz
REM #e
<script>
function lnlength(x) { //線長を返す
return Math.sqrt(Math.pow(x[3] - x[1], 2) + Math.pow(x[2] - x[0], 2))
}
hp =
ln =
with (new ActiveXObject("Scripting.FileSystemObject")) {
f = GetStandardStream(0) //stdin
g = GetStandardStream(1) //stdout
while (! f.AtEndOfStream) {
F = ($_ = f.ReadLine()).split(/\s+/)
if (/^hq/i .test($_)) {
g.WriteLine("bz"); continue
}
if (/^hp[1-9][0-9]?ln/i .test($_)) { //hp 指示点
hp[ F[0].match(/[0-9][0-9]?/) ] = [ F[1] * 1.0, F[2] * 1.0 ]
continue
}
if (/^hhp([1-9][0-9]?)ln/i .test($_)) { //指示線番号
i = RegExp.$1 * 1; continue
}
if (/^\s+/i .test($_)) { //ln 指示線
if (ln[i] = F) for (j = 0; j < ln[i].length; j++) ln[i][j] *= 1.0;
continue
}
}
f.close()
lnn = ln.length - 1
for (i = 1; i <= lnn; i++) {
r = lnlength(ln[i]) / 2
x1 = ln[i][0]
y1 = ln[i][1]
x2 = ln[i][2]
y2 = ln[i][3]
g.WriteLine(["ci", (x1 + x2) / 2, (y1 + y2) / 2, r].join(" "))
x1 = hp[i][0]
y1 = hp[i][1]
g.WriteLine(["ci", x1, y1, 1].join(" "))
}
}
close()
</script>
指示線を直径とする円を描き、指示点の位置に半径1mmの円をプロットしています。スクリプト言語は jscript を使用しています。