Public Class Form1 Dim pi As Double = Math.PI Dim Nmax As Integer = 2000 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load PictureBox1.Visible = True ToolStripStatusLabel1.Text = "size and Png file name" End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Call main_part() End Sub '-------------------------------------------------------------------------------------------- Private Sub main_part() Dim sr As System.IO.StreamReader Dim fnameR As String = "" Dim fnameW As String = "" Dim fnameF As String = "" Dim fnameZ As String = "" Dim dat As String Dim sbuf() As String Dim delim As Char = ","c Dim ksp As Integer Dim D0 As Double Dim Tc As Double Dim Tx As Double Dim W As Double Dim ts As Double Dim tp As Double Dim bboxv(3) As Integer Dim theta As Double Dim B As Double Dim H As Double Dim Ae As Double Dim Ac As Double Dim Ls As Double Dim iii As Integer Dim nnn As Integer OpenFileDialog1.InitialDirectory = System.IO.Directory.GetCurrentDirectory() If OpenFileDialog1.ShowDialog() = DialogResult.OK Then fnameR = OpenFileDialog1.FileName sr = New System.IO.StreamReader(fnameR, System.Text.Encoding.Default) dat = sr.ReadLine() : sbuf = dat.Split(delim) nnn = Integer.Parse(sbuf(0)) For iii = 1 To nnn dat = sr.ReadLine() : sbuf = dat.Split(delim) fnameW = sbuf(0).Trim() 'コマンド記述ファイル名*/ fnameF = sbuf(1).Trim() '出力画像ファイル名*/ ksp = Integer.Parse(sbuf(2)) '鉄管の有無(-1:モデル図,0:鉄管無し,1:鉄管有り*/ D0 = Double.Parse(sbuf(3)) '水路内径*/ Tc = Double.Parse(sbuf(4)) '覆工厚*/ Tx = Double.Parse(sbuf(5)) 'インバート部付加厚*/ W = Double.Parse(sbuf(6)) '掘削インバート幅*/ ts = Double.Parse(sbuf(7)) '吹付厚*/ tp = Double.Parse(sbuf(8)) '設計線から支払線までの距離*/ bboxv(0) = Integer.Parse(sbuf(9)) 'BoundingBox bboxv(1) = Integer.Parse(sbuf(10)) 'BoundingBox bboxv(2) = Integer.Parse(sbuf(11)) 'BoundingBox bboxv(3) = Integer.Parse(sbuf(12)) 'BoundingBox fnameW = System.IO.Path.GetDirectoryName(fnameR) & "\" & fnameW theta = CAL_THETA(D0, Tc, Tx, W) ' 掘削面積 (Pay line)*/ B = D0 + 2.0 * Tc + 2.0 * ts + 2.0 * tp H = D0 + 2.0 * Tc + Tx + ts + 2.0 * tp Ae = CAL_AREA(B, H, theta) Ae = Ae * 0.000001 ' 覆工面積 (Concrete)*/ B = D0 + 2.0 * Tc H = D0 + 2.0 * Tc + Tx Ac = CAL_AREA(B, H, theta) - 0.25 * pi * D0 * D0 Ac = Ac * 0.000001 ' 吹付長 (Shotcrete)*/ B = D0 + 2.0 * Tc + 2.0 * ts H = D0 + 2.0 * Tc + Tx + ts Ls = CAL_LENG(B, H, theta) Ls = Ls * 0.001 If ksp < 0 Then WGPLmodel(fnameW, fnameF, D0, Tc, Tx, W, ts, tp, theta) Else WGPL(fnameW, fnameF, ksp, D0, Tc, Tx, W, ts, tp, theta, Ae, Ac, Ls) End If 'fnameF のフルパス指定 fnameF = System.IO.Path.GetDirectoryName(fnameR) & "\" & fnameF '************************************************************** 'gnuplot 起動+epsファイル作成 (fnameW: コマンド記述ファイル名) '************************************************************** GPL(fnameW) System.Threading.Thread.Sleep(1000) '1秒待つ '************************************************************** 'eps の BoundingBox 修正 (fnameF: eps画像ファイル名) '************************************************************** fnameZ = fnameF.Replace("_eps_", "_eps_z_") BBOX(fnameF, fnameZ, bboxv) '************************************************************** 'ImageMagick による png 画像作成 (fnameZ: eps画像ファイル名) '************************************************************** IMCVT(fnameZ) '************************************************************** 'ImageMagick による 白背景合成 (fnameZ: png画像ファイル名) '************************************************************** fnameZ = fnameZ.Replace("eps", "png") IMCMP(fnameZ) '************************************************************** 'png 画像画面表示 (fnameZ: png画像ファイル名) '************************************************************** fnameZ = fnameZ.Replace("_png_z_", "_png_zw_") VIEWPNG(fnameZ) Next iii sr.Close() MessageBox.Show("計算完了", "完了通知") End Sub '-------------------------------------------------------------------------------------------- Private Sub GPL(ByVal fnameR As String) '***************************************************** 'gnuplot 起動+epsファイル作成 '***************************************************** Dim pr As System.Diagnostics.Process Dim sw As System.IO.StreamWriter Dim dir As String = "" Dim fname As String = "" Dim dat As String = "" dir = System.IO.Path.GetDirectoryName(fnameR) System.IO.Directory.SetCurrentDirectory(dir) fname = System.IO.Path.GetFileName(fnameR) pr = New System.Diagnostics.Process() pr.StartInfo.FileName = "gnuplot.exe" pr.StartInfo.RedirectStandardInput = True pr.StartInfo.RedirectStandardOutput = True pr.StartInfo.UseShellExecute = False pr.StartInfo.CreateNoWindow = True pr.Start() sw = pr.StandardInput dat = String.Format("load ""{0:s}""", fname) sw.WriteLine(dat) sw.Close() pr.WaitForExit() pr.Close() End Sub '-------------------------------------------------------------------------------------------- Private Sub BBOX(ByVal fnameR As String, ByVal fnameW As String, ByRef bboxv() As Integer) Dim sr As System.IO.StreamReader Dim sw As System.IO.StreamWriter Dim dat As String Dim i As Integer 'データ入力 sr = New System.IO.StreamReader(fnameR, System.Text.Encoding.Default) sw = New System.IO.StreamWriter(fnameW, False, System.Text.Encoding.Default) i = 0 Do Until sr.EndOfStream i = i + 1 dat = sr.ReadLine() If i = 6 Then dat = String.Format("%%BoundingBox: {0:D} {1:D} {2:D} {3:D}", bboxv(0), bboxv(1), bboxv(2), bboxv(3)) sw.WriteLine(dat) Loop sr.Close() sw.Close() End Sub '-------------------------------------------------------------------------------------------- Private Sub IMCVT(ByVal fnameF As String) '***************************************************** 'ImageMagick convert で png 画像作成 '***************************************************** Dim fnameP As String Dim pr As System.Diagnostics.Process Dim sw As System.IO.StreamWriter Dim dat As String = "" fnameP = fnameF.Replace("eps", "png") pr = New System.Diagnostics.Process() pr.StartInfo.FileName = "cmd.exe" pr.StartInfo.RedirectStandardInput = True pr.StartInfo.RedirectStandardOutput = True pr.StartInfo.UseShellExecute = False pr.StartInfo.CreateNoWindow = True pr.Start() sw = pr.StandardInput dat = String.Format("convert -density 300 {0:s} {1:s}", fnameF, fnameP) sw.WriteLine(dat) sw.Close() pr.WaitForExit() pr.Close() End Sub '-------------------------------------------------------------------------------------------- Private Sub IMCMP(ByVal fnameZ As String) '***************************************************** 'ImageMagick convert で 白背景合成画像作成 '***************************************************** Dim fnameP As String Dim fnameB As String Dim pr As System.Diagnostics.Process Dim sw As System.IO.StreamWriter Dim dat As String = "" Dim img As Image Dim ww As Integer Dim hh As Integer img = Image.FromFile(fnameZ) ww = img.Width hh = img.Height img.Dispose() fnameP = fnameZ.Replace("_z_", "_zw_") fnameB = System.IO.Path.GetDirectoryName(fnameP) & "\base.png" pr = New System.Diagnostics.Process() pr.StartInfo.FileName = "cmd.exe" pr.StartInfo.RedirectStandardInput = True pr.StartInfo.RedirectStandardOutput = True pr.StartInfo.UseShellExecute = False pr.StartInfo.CreateNoWindow = True pr.Start() sw = pr.StandardInput dat = String.Format("convert -size {0:D}x{1:D} xc:""#FFFFFF"" {2:s}", ww, hh, fnameB) sw.WriteLine(dat) dat = String.Format("convert {0:s} {1:s} -composite {2:s}", fnameB, fnameZ, fnameP) sw.WriteLine(dat) sw.Close() pr.WaitForExit() pr.Close() End Sub '-------------------------------------------------------------------------------------------- Private Sub VIEWPNG(ByVal fnameZ As String) '***************************************************** 'png 画像画面表示 (50%縮尺) '***************************************************** Dim img As Image Dim bmp As Bitmap Dim g As Graphics Dim ratio As Single = 0.5 Dim ww As Integer Dim hh As Integer Dim w_org As Integer Dim h_org As Integer img = Image.FromFile(fnameZ) w_org = img.Width h_org = img.Height ww = CInt(ratio * w_org) hh = CInt(ratio * h_org) PictureBox1.Size = New Size(ww, hh) bmp = New Bitmap(ww, hh) PictureBox1.Image = bmp g = Graphics.FromImage(PictureBox1.Image) g.DrawImage(img, 0, 0, ww, hh) g.Dispose() img.Dispose() PictureBox1.Left = 0 PictureBox1.Top = ToolStrip1.Height Me.ClientSize = New Size(PictureBox1.Width, PictureBox1.Height + ToolStrip1.Height + StatusStrip1.Height) ToolStripStatusLabel1.Text = String.Format("{0:D} x {1:D} : {2:s}", w_org, h_org, fnameZ) End Sub '-------------------------------------------------------------------------------------------- Private Function CAL_AREA(ByVal B As Double, ByVal H As Double, ByVal theta As Double) As Double Dim rr As Double Dim hh As Double Dim ang As Double Dim A0 As Double Dim A1 As Double Dim A2 As Double ang = theta / 180.0 * pi rr = 0.5 * B hh = H - rr - rr * Math.Sin(ang) A0 = (2.0 * rr * Math.Cos(ang) - hh * Math.Tan(ang)) * hh ' 高さhhの台形の面積 */ A1 = rr * rr * (ang + 0.5 * pi) ' 扇の面積 */ A2 = rr * rr * Math.Sin(ang) * Math.Cos(ang) ' 三角形の面積 */ Return A0 + A1 + A2 End Function '-------------------------------------------------------------------------------------------- Private Function CAL_LENG(ByVal B As Double, ByVal H As Double, ByVal theta As Double) As Double Dim rr As Double Dim hh As Double Dim ang As Double Dim L0 As Double Dim L1 As Double ang = theta / 180.0 * pi rr = 0.5 * B hh = H - rr - rr * Math.Sin(ang) L0 = rr * (pi + 2.0 * ang) ' 扇の周長 */ L1 = hh / Math.Cos(ang) ' 片側直線部の長さ */ Return L0 + 2.0 * L1 End Function '-------------------------------------------------------------------------------------------- Private Function CAL_THETA(ByVal D0 As Double, ByVal Tc As Double, ByVal Tx As Double, ByVal W As Double) As Double ' 角度設定 (degree) */ Dim r As Double Dim x1 As Double Dim x2 As Double Dim x3 As Double Dim f1 As Double Dim f2 As Double Dim f3 As Double r = 0.5 * D0 + Tc x1 = 0.0 x2 = 90.0 x3 = 0.5 * (x1 + x2) Do f1 = CAL_F(x1, W, r, Tx) f2 = CAL_F(x2, W, r, Tx) f3 = CAL_F(x3, W, r, Tx) If f1 * f3 < 0 Then x2 = x3 : x3 = 0.5 * (x1 + x2) End If If f3 * f2 < 0 Then x1 = x3 : x3 = 0.5 * (x1 + x2) End If Loop While (Math.Abs(x1 - x2) > 0.000001) Return 0.5 * (x1 + x2) End Function '-------------------------------------------------------------------------------------------- Private Function CAL_F(ByVal ang As Double, ByVal W As Double, ByVal r As Double, ByVal Tx As Double) As Double Return W - (2.0 * r * Math.Cos(ang / 180.0 * pi) - 2.0 * (r + Tx - r * Math.Sin(ang / 180.0 * pi)) * Math.Tan(ang / 180.0 * pi)) End Function '-------------------------------------------------------------------------------------------- Private Sub WGPL(ByVal fnameW As String, ByVal fnameF As String, ByVal ksp As Integer, _ ByVal D0 As Double, ByVal Tc As Double, ByVal Tx As Double, ByVal W As Double, _ ByVal ts As Double, ByVal tp As Double, ByVal theta As Double, _ ByVal Ae As Double, ByVal Ac As Double, ByVal Ls As Double) Dim sw As System.IO.StreamWriter Dim x1 As Double Dim y1 As Double Dim x2 As Double Dim y2 As Double Dim x3 As Double Dim y3 As Double Dim x4 As Double Dim y4 As Double Dim h As Double Dim BB As Double Dim HU As Double Dim HL As Double Dim ds As Double Dim dss As Double Dim dl As Double Dim dsh As Double Dim phi As Double Dim dat As String Dim str As String BB = D0 + 2.0 * Tc + 2.0 * ts + 2.0 * tp HU = 0.5 * D0 + Tc + ts + tp HL = 0.5 * D0 + Tc + Tx + tp sw = New System.IO.StreamWriter(fnameW, False, System.Text.Encoding.Default) dat = "reset" : sw.WriteLine(dat) dat = "set terminal postscript eps enhanced font ""Helvetica"" 16" : sw.WriteLine(dat) dat = String.Format("set output ""{0:s}""", fnameF) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "set multiplot" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "set origin 0,0" : sw.WriteLine(dat) dat = "set size ratio -1" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "set xrange [-8000:8000]" : sw.WriteLine(dat) dat = "set yrange [-8000:8000]" : sw.WriteLine(dat) dat = "set border 0" : sw.WriteLine(dat) dat = "set xtics 0,0,0" : sw.WriteLine(dat) dat = "set ytics 0,0,0" : sw.WriteLine(dat) dat = "set xtics nomirror" : sw.WriteLine(dat) dat = "set ytics nomirror" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "set style arrow 1 size graph 0.02,10 filled nohead linewidth 1 linetype 5" : sw.WriteLine(dat) '一点鎖線*/ dat = "set style arrow 2 size graph 0.02,10 filled nohead linewidth 1 linetype 1" : sw.WriteLine(dat) '実線*/ dat = "set style arrow 3 size graph 0.02,10 filled heads linewidth 1 linetype 1" : sw.WriteLine(dat) '両矢印*/ dat = "set style arrow 4 size graph 0.02,10 filled linewidth 1 linetype 1" : sw.WriteLine(dat) '片矢印*/ dat = "#" : sw.WriteLine(dat) '一点鎖線*/ ds = 1000.0 dss = 200.0 dl = 400.0 x1 = 0.5 * BB + ds + dss : y1 = 0.0 x2 = -(0.5 * BB + 0.5 * ds) : y2 = 0.0 x3 = 0.0 : y3 = -HL - 0.5 * ds x4 = 0.0 : y4 = HU + 0.5 * ds dat = String.Format("set arrow as 1 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set arrow as 1 from {0:F3},{1:F3} to {2:F3},{3:F3}", x3, y3, x4, y4) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '実線*/ x1 = 0.0 : y1 = 0.5 * D0 + Tc x2 = 0.5 * BB + ds + ds + dss : y2 = y1 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.0 : y1 = 0.5 * D0 x2 = 0.5 * BB + ds + dss : y2 = y1 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = 0.5 * BB + ds + dss : y2 = y1 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.0 : y1 = -0.5 * D0 x2 = 0.5 * BB + ds + dss : y2 = y1 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.5 * W : y1 = -(0.5 * D0 + Tc + Tx) x2 = 0.5 * BB + ds + ds + dss : y2 = y1 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) str = String.Format("{0:F3}{1:s}", theta, "{/Symbol {\\260}}") x1 = 0.0 y1 = 0.0 x2 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y2 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x3 = 0.5 * (0.5 * D0) * Math.Cos(theta / 180.0 * pi) - dl * Math.Sin(theta / 180.0 * pi) y3 = -0.5 * (0.5 * D0) * Math.Sin(theta / 180.0 * pi) - dl * Math.Cos(theta / 180.0 * pi) dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotat by {3:F3}", str, x3, y3, -theta) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) x1 = -(0.5 * D0 + Tc) : y1 = 0.0 x2 = x1 : y2 = -HL - ds - ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = -0.5 * W : y1 = -HL + tp x2 = -0.5 * W : y2 = -HL - ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.5 * W : y1 = -HL + tp x2 = 0.5 * W : y2 = -HL - ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = x1 : y2 = -HL - ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = (0.5 * D0 + Tc) : y1 = 0.0 x2 = x1 : y2 = -HL - ds - ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '両矢印*/ str = (0.5 * D0).ToString("0") x1 = 0.5 * BB + ds : y1 = 0.5 * D0 x2 = x1 : y2 = 0.0 x3 = x1 - dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotate by 90", str, x3, y3) : sw.WriteLine(dat) str = ((0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi)).ToString("0") x1 = 0.5 * BB + ds : y1 = 0.0 x2 = x1 : y2 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x3 = x1 + dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotate by 90", str, x3, y3) : sw.WriteLine(dat) str = (0.5 * D0 - (0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi)).ToString("0") x1 = 0.5 * BB + ds : y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = x1 : y2 = -(0.5 * D0) x3 = x1 - dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotate by 90", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) str = (D0 + 2.0 * Tc + Tx).ToString("0") x1 = 0.5 * BB + ds + ds : y1 = -HL x2 = x1 : y2 = HU - ts x3 = x1 + dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotate by 90", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) str = (0.5 * D0 + Tc - 0.5 * W).ToString("0") x1 = -(0.5 * D0 + Tc) : y1 = -HL - ds x2 = -0.5 * W : y2 = y1 x3 = 0.5 * (x1 + x2) : y3 = y2 - dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = W.ToString("0") x1 = -0.5 * W : y1 = -HL - ds x2 = 0.5 * W : y2 = y1 x3 = 0.0 : y3 = y2 - dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = ((0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) - 0.5 * W).ToString("0") x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) : y1 = -HL - ds x2 = 0.5 * W : y2 = y1 x3 = 0.5 * (x1 + x2) : y3 = y2 + dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) str = (D0 + 2.0 * Tc).ToString("0") x1 = -(0.5 * D0 + Tc) : y1 = -HL - ds - ds x2 = 0.5 * D0 + Tc : y2 = y1 x3 = 0.5 * (x1 + x2) : y3 = y2 - dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '片矢印*/ dsh = 0.8 * ds str = Tc.ToString("0") x1 = 0.5 * BB + ds : y1 = 0.5 * D0 + Tc + dsh x2 = x1 : y2 = 0.5 * D0 + Tc x3 = x1 + dl : y3 = 0.5 * (y2 + 0.5 * D0) dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotate by 90", str, x3, y3) : sw.WriteLine(dat) str = (Tc + Tx).ToString("0") x1 = 0.5 * BB + ds : y1 = -(0.5 * D0 + Tc + Tx + dsh) x2 = x1 : y2 = -(0.5 * D0 + Tc + Tx) x3 = x1 + dl : y3 = 0.5 * (y2 - 0.5 * D0) dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotate by 90", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) str = ((0.5 * D0 + Tc) * (1.0 - Math.Cos(theta / 180.0 * pi))).ToString("0") x1 = 0.5 * D0 + Tc + dsh : y1 = -HL - ds x2 = 0.5 * D0 + Tc : y2 = y1 x3 = 0.5 * (x2 + (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi)) : y3 = y2 - dl dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) 'Shotcrete*/ phi = 40.0 str = String.Format("t={0:F0}", ts) h = 0.5 * D0 + Tc + ts x1 = -(h + dsh) * Math.Cos(phi / 180.0 * pi) y1 = (h + dsh) * Math.Sin(phi / 180.0 * pi) x2 = -h * Math.Cos(phi / 180.0 * pi) y2 = h * Math.Sin(phi / 180.0 * pi) x3 = x1 : y3 = y1 + 0.5 * dl dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = "Shotcrete" y3 = y3 + 1.2 * dl dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) If ksp <> 0 Then 'Steel pipe (t0=50mm)*/ phi = 75.0 str = "Steel pipe" h = 0.5 * D0 + Tc + ts x1 = -(h + dsh) * Math.Cos(phi / 180.0 * pi) y1 = (h + dsh) * Math.Sin(phi / 180.0 * pi) h = 0.5 * D0 + 50.0 x2 = -h * Math.Cos(phi / 180.0 * pi) y2 = h * Math.Sin(phi / 180.0 * pi) x3 = x1 : y3 = y1 + 0.5 * dl dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) End If '水路内径*/ str = String.Format("r={0:F0}", 0.5 * D0) x1 = 0.0 y1 = 0.0 x2 = 0.5 * D0 * Math.Cos(45.0 / 180.0 * pi) y2 = 0.5 * D0 * Math.Sin(45.0 / 180.0 * pi) x3 = 0.5 * x2 - dl * Math.Sin(45.0 / 180.0 * pi) y3 = 0.5 * y2 + dl * Math.Cos(45.0 / 180.0 * pi) dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center rotate by 45", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '数量描画*/ x3 = 0.0 str = String.Format("Ae={0:F1}{1:s}", Ae, "m^{/=10 2}") y3 = 7500.0 dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3}", str, x3, y3) : sw.WriteLine(dat) str = String.Format("Ac={0:F1}{1:2}", Ac, "m^{/=10 2}") y3 = 6750.0 dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3}", str, x3, y3) : sw.WriteLine(dat) str = String.Format("Ls={0:F1} m", Ls) y3 = 6000.0 dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3}", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '骨材記号描画*/ AGR(sw, D0, Tc, Tx, W, theta) dat = "#" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '構造線描画*/ dat = "plot ""-"" with lines linewidth 3 linetype 1 notitle,\" : sw.WriteLine(dat) '覆工外形線*/" dat = """-"" with lines linewidth 3 linetype 1 notitle" : sw.WriteLine(dat) '掘削外形線*/ '覆工外形*/ x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = 0.5 * W y2 = -(0.5 * D0 + Tc + Tx) x3 = -x2 y3 = y2 x4 = -x1 y4 = y1 dat = String.Format("{0:F3} {1:F3}", x1, y1) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x2, y2) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x3, y3) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x4, y4) : sw.WriteLine(dat) dat = "e" : sw.WriteLine(dat) '掘削外形*/ x1 = (0.5 * D0 + Tc + ts) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc + ts) * Math.Sin(theta / 180.0 * pi) x2 = 0.5 * W + ts / Math.Cos(theta / 180.0 * pi) y2 = -(0.5 * D0 + Tc + Tx) x3 = -x2 y3 = y2 x4 = -x1 y4 = y1 dat = String.Format("{0:F3} {1:F3}", x1, y1) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x2, y2) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x3, y3) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x4, y4) : sw.WriteLine(dat) dat = "e" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '円形部描画*/ dat = "set origin 0,0" : sw.WriteLine(dat) dat = "set polar" : sw.WriteLine(dat) dat = "set angles degree" : sw.WriteLine(dat) dat = "set samples 720" : sw.WriteLine(dat) dat = "set trange [0:360]" : sw.WriteLine(dat) If ksp = 0 Then dat = String.Format("plot {0:F3} with lines linewidth 3 linetype 1 notitle", 0.5 * D0) : sw.WriteLine(dat) '水路内径*/ Else dat = String.Format("plot {0:F3} with lines linewidth 3 linetype 1 notitle,\", 0.5 * D0) : sw.WriteLine(dat) '鉄管内径*/ dat = String.Format("{0:F3} with lines linewidth 3 linetype 1 notitle", 0.5 * D0 + 50.0) : sw.WriteLine(dat) '鉄管外径(t0=50mm)*/ End If dat = "#" : sw.WriteLine(dat) dat = "set origin 0,0" : sw.WriteLine(dat) dat = String.Format("set trange [{0:F3}:{1:F3}]", -theta, 180.0 + theta) : sw.WriteLine(dat) dat = String.Format("plot {0:F3} with lines linewidth 3 linetype 1 notitle,\", 0.5 * D0 + Tc) : sw.WriteLine(dat) '覆工外径*/ dat = String.Format("{0:F3} with lines linewidth 2 linetype 1 notitle", 0.5 * D0 + Tc + ts) : sw.WriteLine(dat) '掘削径*/ dat = "#" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "unset multiplot" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) sw.Close() End Sub '-------------------------------------------------------------------------------------------- Private Sub AGR(ByVal sw As System.IO.StreamWriter, ByVal D0 As Double, ByVal Tc As Double, ByVal Tx As Double, ByVal W As Double, ByVal theta As Double) '骨材マークの描画*/ Dim i As Integer Dim MG As Integer Dim MT As Integer Dim x(Nmax) As Double Dim y(Nmax) As Double Dim dr1 As Double = 500.0 Dim dr2 As Double = 200.0 Dim t1 As Double = 0.0 Dim t2 As Double = 360.0 Dim dat As String Call CAL_XYARRAY(t1, t2, dr1, dr2, x, y, MG, MT, D0, Tc, Tx, W, theta) For i = 0 To MG dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center font ""arial,{3:D}""", "o", x(i), y(i), 10) sw.WriteLine(dat) Next i For i = MG + 1 To MT dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center font ""arial,{3:D}""", "o", x(i), y(i), 3) sw.WriteLine(dat) Next i End Sub '-------------------------------------------------------------------------------------------- Private Sub CAL_XY(ByVal t1 As Double, ByVal t2 As Double, ByVal D0 As Double, ByVal Tc As Double, ByVal Tx As Double, _ ByVal W As Double, ByVal theta As Double, ByRef xx As Double, ByRef yy As Double) '***************************/ ' 乱数での座標設定 */ '***************************/ Dim rr As Double Dim tt As Double Dim r1 As Double Dim r2 As Double Dim phi1 As Double Dim phi2 As Double Dim x1 As Double Dim y1 As Double Dim x2 As Double Dim y2 As Double Dim a1 As Double Dim b1 As Double Dim a2 As Double Dim b2 As Double Dim a3 As Double Dim b3 As Double Dim rand As New Random() Dim irmax As Integer = 32767 Dim ir As Integer r2 = 0.0 x1 = 0.5 * W y1 = (0.5 * D0 + Tc + Tx) phi1 = 270.0 - Math.Atan(x1 / y1) / pi * 180.0 x1 = -(0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = -0.5 * W y2 = -(0.5 * D0 + Tc + Tx) a1 = (y2 - y1) / (x2 - x1) b1 = (x2 * y1 - x1 * y2) / (x2 - x1) a2 = 0.0 b2 = -(0.5 * D0 + Tc + Tx) x1 = 0.5 * W y1 = (0.5 * D0 + Tc + Tx) phi2 = 270.0 + Math.Atan(x1 / y1) / pi * 180.0 x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = 0.5 * W y2 = -(0.5 * D0 + Tc + Tx) a3 = (y2 - y1) / (x2 - x1) b3 = (x2 * y1 - x1 * y2) / (x2 - x1) ir = rand.Next(irmax) tt = t1 + CDbl(ir) / CDbl(irmax) * (t2 - t1) r1 = 0.5 * D0 + 100.0 If 0.0 <= tt And tt <= 180.0 + theta Then r2 = 0.5 * D0 + Tc If 180.0 + theta < tt And tt <= phi1 Then r2 = Math.Abs(b1 / (Math.Sin(tt / 180.0 * pi) - a1 * Math.Cos(tt / 180.0 * pi))) If phi1 < tt And tt <= phi2 Then r2 = Math.Abs(b2 / (Math.Sin(tt / 180.0 * pi) - a2 * Math.Cos(tt / 180.0 * pi))) If phi2 < tt And tt <= 360.0 - theta Then r2 = Math.Abs(b3 / (Math.Sin(tt / 180.0 * pi) - a3 * Math.Cos(tt / 180.0 * pi))) If 360.0 - theta < tt And tt <= 360.0 Then r2 = 0.5 * D0 + Tc ir = rand.Next(irmax) r2 = r2 - 100.0 rr = r1 + CDbl(ir) / CDbl(irmax) * (r2 - r1) xx = rr * Math.Cos(tt / 180.0 * pi) yy = rr * Math.Sin(tt / 180.0 * pi) End Sub '-------------------------------------------------------------------------------------------- Private Sub CAL_XYARRAY(ByVal t1 As Double, ByVal t2 As Double, ByVal dr1 As Double, ByVal dr2 As Double, _ ByRef x() As Double, ByRef y() As Double, ByRef MG As Integer, ByRef MT As Integer, _ ByVal D0 As Double, ByVal Tc As Double, ByVal Tx As Double, ByVal W As Double, ByVal theta As Double) '***************************/ ' 骨材を描画する座標の設定 */ '***************************/ Dim i As Integer Dim k As Integer Dim l1 As Integer Dim l2 As Integer Dim mflag As Integer Dim iflag As Integer Dim xx As Double Dim yy As Double Call CAL_XY(t1, t2, D0, Tc, Tx, W, theta, xx, yy) x(0) = xx y(0) = yy k = 0 l1 = 0 Do l2 = 0 Do Call CAL_XY(t1, t2, D0, Tc, Tx, W, theta, xx, yy) mflag = 1 For i = 0 To k If dr1 < Math.Sqrt((xx - x(i)) * (xx - x(i)) + (yy - y(i)) * (yy - y(i))) Then iflag = 1 Else iflag = 0 End If mflag = mflag * iflag Next i If mflag = 1 Then Exit Do l2 = l2 + 1 Loop While (l2 < CInt(Nmax / 2)) If mflag = 1 Then k = k + 1 x(k) = xx y(k) = yy End If l1 = l1 + 1 Loop While l1 < CInt(Nmax / 2) MG = k l1 = 0 Do l2 = 0 Do Call CAL_XY(t1, t2, D0, Tc, Tx, W, theta, xx, yy) mflag = 1 For i = 0 To k If dr2 < Math.Sqrt((xx - x(i)) * (xx - x(i)) + (yy - y(i)) * (yy - y(i))) Then iflag = 1 Else iflag = 0 End If mflag = mflag * iflag Next i If mflag = 1 Then Exit Do l2 = l2 + 1 Loop While l2 < CInt(Nmax / 2) If mflag = 1 Then k = k + 1 x(k) = xx y(k) = yy End If l1 = l1 + 1 Loop While l1 < CInt(Nmax / 2) MT = k End Sub '-------------------------------------------------------------------------------------------- Private Sub WGPLmodel(ByVal fnameW As String, ByVal fnameF As String, ByVal D0 As Double, ByVal Tc As Double, _ ByVal Tx As Double, ByVal W As Double, ByVal ts As Double, ByVal tp As Double, ByVal theta As Double) Dim sw As System.IO.StreamWriter Dim x1 As Double Dim y1 As Double Dim x2 As Double Dim y2 As Double Dim x3 As Double Dim y3 As Double Dim x4 As Double Dim y4 As Double Dim h As Double Dim BB As Double Dim HU As Double Dim HL As Double Dim ds As Double Dim dss As Double Dim dl As Double Dim dat As String Dim str As String BB = D0 + 2.0 * Tc + 2.0 * ts + 2.0 * tp HU = 0.5 * D0 + Tc + ts + tp HL = 0.5 * D0 + Tc + Tx + tp ds = 1000.0 dss = 200.0 dl = 500.0 sw = New System.IO.StreamWriter(fnameW, False, System.Text.Encoding.Default) dat = "reset" : sw.WriteLine(dat) dat = "set terminal postscript eps enhanced font ""Helvetica"" 20" : sw.WriteLine(dat) dat = String.Format("set output ""{0:s}""", fnameF) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "set multiplot" : sw.WriteLine(dat) dat = "#" dat = "set origin 0,0" : sw.WriteLine(dat) dat = "set size ratio -1" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "set xrange [-10000:10000]" : sw.WriteLine(dat) dat = "set yrange [-10000:10000]" : sw.WriteLine(dat) dat = "set border 0" : sw.WriteLine(dat) dat = "set xtics 0,0,0" : sw.WriteLine(dat) dat = "set ytics 0,0,0" : sw.WriteLine(dat) dat = "set xtics nomirror" : sw.WriteLine(dat) dat = "set ytics nomirror" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "set style arrow 1 size graph 0.02,10 filled nohead linewidth 1 linetype 5" : sw.WriteLine(dat) '一点鎖線*/ dat = "set style arrow 2 size graph 0.02,10 filled nohead linewidth 1 linetype 1" : sw.WriteLine(dat) '実線*/ dat = "set style arrow 3 size graph 0.02,10 filled heads linewidth 1 linetype 1" : sw.WriteLine(dat) '両矢印*/ dat = "set style arrow 4 size graph 0.02,10 filled linewidth 1 linetype 1" : sw.WriteLine(dat) '片矢印*/ '一点鎖線*/ x1 = 0.5 * BB + 0.5 * ds : y1 = 0.0 x2 = -x1 : y2 = 0.0 x3 = 0.0 : y3 = -HL - 0.5 * ds x4 = 0.0 : y4 = HU + 0.5 * ds dat = String.Format("set arrow as 1 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set arrow as 1 from {0:F3},{1:F3} to {2:F3},{3:F3}", x3, y3, x4, y4) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '実線*/ x1 = 0.0 : y1 = 0.5 * D0 + Tc + ts x2 = 0.5 * BB + ds + dss : y2 = 0.5 * D0 + Tc + ts dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.0 : y1 = 0.5 * D0 + Tc x2 = 0.5 * BB + ds + dss : y2 = 0.5 * D0 + Tc dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.0 : y1 = 0.5 * D0 x2 = 0.5 * BB + ds + dss : y2 = 0.5 * D0 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.0 : y1 = -0.5 * D0 x2 = 0.5 * BB + ds + dss : y2 = -0.5 * D0 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.0 : y1 = -(0.5 * D0 + Tc) x2 = 0.5 * BB + ds + dss : y2 = -(0.5 * D0 + Tc) dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.5 * W : y1 = -(0.5 * D0 + Tc + Tx) x2 = 0.5 * BB + ds + dss : y2 = -(0.5 * D0 + Tc + Tx) dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) str = "{/Symbol q}" x1 = 0.0 y1 = 0.0 x2 = -(0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y2 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x3 = 0.5 * x2 y3 = 0.25 * y2 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = "{/Symbol q}" x1 = 0.0 y1 = 0.0 x2 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y2 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x3 = 0.5 * x2 y3 = 0.25 * y2 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) x1 = -0.5 * W : y1 = -HL + tp x2 = -0.5 * W : y2 = -HL - ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = 0.5 * W : y1 = -HL + tp x2 = 0.5 * W : y2 = -HL - ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = -(0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = x1 : y2 = -HL - 2.0 * ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = x1 : y2 = -HL - 2.0 * ds - dss dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = -(0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = -0.5 * BB - ds - dss y2 = y1 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) x1 = -0.5 * W y1 = -HL + tp x2 = -0.5 * BB - ds - dss y2 = y1 dat = String.Format("set arrow as 2 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) '両矢印*/ dl = 500.0 str = "T{/=14 c}" x1 = 0.5 * BB + ds : y1 = 0.5 * D0 + Tc x2 = x1 : y2 = 0.5 * D0 x3 = x1 + dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} left", str, x3, y3) : sw.WriteLine(dat) str = "D{/=14 0}" x1 = 0.5 * BB + ds : y1 = 0.5 * D0 x2 = x1 : y2 = -0.5 * D0 x3 = x1 + dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} left", str, x3, y3) : sw.WriteLine(dat) str = "T{/=14 c}" x1 = 0.5 * BB + ds : y1 = -0.5 * D0 x2 = x1 : y2 = -(0.5 * D0 + Tc) x3 = x1 + dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} left", str, x3, y3) : sw.WriteLine(dat) str = "W" x1 = -0.5 * W : y1 = -HL - ds x2 = 0.5 * W : y2 = y1 x3 = 0.0 : y3 = y2 - dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = "h*tan{/Symbol q}" x1 = -(0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -HL - ds x2 = -0.5 * W : y2 = y1 x3 = 0.5 * (x1 + x2) : y3 = y2 - dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = "h*tan{/Symbol q}" x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -HL - ds x2 = 0.5 * W : y2 = y1 x3 = 0.5 * (x1 + x2) : y3 = y2 - dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = "2(D{/=14 0}/2+T{/=14 c})*cos{/Symbol q}" x1 = -(0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -HL - 2.0 * ds x2 = -x1 y2 = y1 x3 = 0.0 : y3 = y2 - dl dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) str = "h" x1 = -0.5 * BB - ds y1 = -(0.5 * D0 + Tc + Tx) x2 = x1 y2 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x3 = x1 - dl : y3 = 0.5 * (y1 + y2) dat = String.Format("set arrow as 3 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} center", str, x3, y3) : sw.WriteLine(dat) '片矢印*/ str = "t{/=14 s}" x1 = 0.5 * BB + ds : y1 = 0.5 * D0 + Tc + ts + ds x2 = x1 : y2 = 0.5 * D0 + Tc + ts x3 = x1 + dl : y3 = 0.5 * (y2 + 0.5 * D0 + Tc) dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} left", str, x3, y3) : sw.WriteLine(dat) str = "T{/=14 x}" x1 = 0.5 * BB + ds : y1 = -(0.5 * D0 + Tc + Tx + ds) x2 = x1 : y2 = -(0.5 * D0 + Tc + Tx) x3 = x1 + dl : y3 = 0.5 * (y2 - (0.5 * D0 + Tc)) dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} left", str, x3, y3) : sw.WriteLine(dat) h = 0.5 * D0 + Tc + ts x1 = -(h - ds) * Math.Cos(45.0 / 180.0 * pi) y1 = (h - ds) * Math.Sin(45.0 / 180.0 * pi) x2 = -h * Math.Cos(45.0 / 180.0 * pi) y2 = h * Math.Sin(45.0 / 180.0 * pi) dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) str = " t{/=14 p}" h = 0.5 * D0 + Tc + ts + tp x1 = -(h + ds) * Math.Cos(45.0 / 180.0 * pi) y1 = (h + ds) * Math.Sin(45.0 / 180.0 * pi) x2 = -h * Math.Cos(45.0 / 180.0 * pi) y2 = h * Math.Sin(45.0 / 180.0 * pi) x3 = x1 : y3 = y1 dat = String.Format("set arrow as 4 from {0:F3},{1:F3} to {2:F3},{3:F3}", x1, y1, x2, y2) : sw.WriteLine(dat) dat = String.Format("set label ""{0:s}"" at {1:F3},{2:F3} right rotate by -45", str, x3, y3) : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '構造線描画*/ dat = "plot ""-"" with lines linewidth 5 linetype 1 notitle,\" : sw.WriteLine(dat) '覆工外形線*/" dat = """-"" with lines linewidth 5 linetype 1 notitle,\" : sw.WriteLine(dat) '掘削外形線*/" dat = """-"" with lines linewidth 3 linetype 3 notitle" : sw.WriteLine(dat) '支払外形線*/ '覆工外形*/ x1 = (0.5 * D0 + Tc) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc) * Math.Sin(theta / 180.0 * pi) x2 = 0.5 * W y2 = -(0.5 * D0 + Tc + Tx) x3 = -x2 y3 = y2 x4 = -x1 y4 = y1 dat = String.Format("{0:F3} {1:F3}", x1, y1) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x2, y2) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x3, y3) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x4, y4) : sw.WriteLine(dat) dat = "e" : sw.WriteLine(dat) '掘削外形*/ x1 = (0.5 * D0 + Tc + ts) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc + ts) * Math.Sin(theta / 180.0 * pi) x2 = 0.5 * W + ts / Math.Cos(theta / 180.0 * pi) y2 = -(0.5 * D0 + Tc + Tx) x3 = -x2 y3 = y2 x4 = -x1 y4 = y1 dat = String.Format("{0:F3} {1:F3}", x1, y1) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x2, y2) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x3, y3) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x4, y4) : sw.WriteLine(dat) dat = "e" : sw.WriteLine(dat) '支払外形*/ x1 = (0.5 * D0 + Tc + ts + tp) * Math.Cos(theta / 180.0 * pi) y1 = -(0.5 * D0 + Tc + ts + tp) * Math.Sin(theta / 180.0 * pi) h = 0.5 * D0 + Tc + Tx + tp - (0.5 * D0 + Tc + ts + tp) * Math.Sin(theta / 180.0 * pi) x2 = x1 - h * Math.Sin(theta / 180.0 * pi) y2 = -(0.5 * D0 + Tc + Tx + tp) x3 = -x2 y3 = y2 x4 = -x1 y4 = y1 dat = String.Format("{0:F3} {1:F3}", x1, y1) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x2, y2) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x3, y3) : sw.WriteLine(dat) dat = String.Format("{0:F3} {1:F3}", x4, y4) : sw.WriteLine(dat) dat = "e" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) '円形部描画*/ dat = "set origin 0,0" : sw.WriteLine(dat) dat = "set polar" : sw.WriteLine(dat) dat = "set angles degree" : sw.WriteLine(dat) dat = "set samples 720" : sw.WriteLine(dat) dat = "set trange [0:360]" : sw.WriteLine(dat) dat = String.Format("plot {0:F3} with lines linewidth 5 linetype 1 notitle,\", 0.5 * D0) : sw.WriteLine(dat) '水路内径*/ dat = String.Format("{0:F3} with lines linewidth 5 linetype 3 notitle", 0.5 * D0 + Tc) : sw.WriteLine(dat) '覆工外径円*/ dat = "#" : sw.WriteLine(dat) dat = "set origin 0,0" : sw.WriteLine(dat) dat = String.Format("set trange [{0:F3}:{1:F3}]", -theta, 180.0 + theta) : sw.WriteLine(dat) dat = String.Format("plot {0:F3} with lines linewidth 5 linetype 1 notitle,\", 0.5 * D0 + Tc) : sw.WriteLine(dat) '覆工外径*/ dat = String.Format("{0:F3} with lines linewidth 5 linetype 1 notitle,\", 0.5 * D0 + Tc + ts) : sw.WriteLine(dat) '掘削径*/ dat = String.Format("{0:F3} with lines linewidth 3 linetype 2 notitle", 0.5 * D0 + Tc + ts + tp) : sw.WriteLine(dat) '支払径*/ dat = "#" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) dat = "unset multiplot" : sw.WriteLine(dat) dat = "#" : sw.WriteLine(dat) sw.Close() End Sub '-------------------------------------------------------------------------------------------- End Class