require 'Illu2' # Utilities def plus(a, b=[0,0]) if a[0].kind_of?(Array) then a.each{ |aa| aa = plus(aa, b) } else return a if a.size != b.size a.each_index{ |i| a[i] += b[i] } end # if a[0].kind_of?(Array) return a end # Illustrator utilities class Illu # Illu にちょっと追加 DefaultItems = ['DefaultFilled', 'DefaultFillColor','DefaultStrokeCap', 'DefaultStrokeColor', 'DefaultStroked', 'DefaultStrokeJoin', 'DefaultStrokeMiterLimit', 'DefaultStrokeWidth'] def get_defaults defaults = Hash.new DefaultItems.each do |item| defaults[item] = eval("@paper.#{item}") end # DefaultItems.each do |item| return defaults end # def get_defaults def set_defaults(defaults) DefaultItems.each do |item| eval("@paper.#{item} = defaults[item]") end # DefaultItems.each do |item| @paper.DefaultFilled = defaults['DefaultFilled'] end # def set_defaults(defaults) end # class Illu # Illustration utilities ゆくゆくは Illuクラスに追加してかなくてはならない # # アクション実行の辺りは実に定型なんでまとめるべき def color_value(color) resarr = Array.new case color.Color when Illu::AiColorCMYK cmyk = color.CMYK resarr = ['cmyk', cmyk.Cyan, cmyk.Magenta, cmyk.Yellow, cmyk.Black] when Illu::AiColorGray gray = color.Gray resarr = ['gray', gray.Gray] when Illu::AiColorNone resarr = ['none'] when Illu::AiColorPattern resarr = ['pattern'] when Illu::AiColorRGB rgb = color.RGB resarr = ['rgb', rgb.Red, rgb.Green, rgb.Blue] when Illu::AiColorSpot resarr = ['spot'] else end # case color.Color return resarr end # def color_value(color) def closed_path(folding, points) res = folding.paper.ActiveLayer.PathItems.Add res.Stroked = true res.Closed = true points.each do |pt| #p pt pp = res.PathPoints.Add pp.Anchor = plus(pt, [folding.left, folding.bottom]) pp. LeftDirection = pp.Anchor pp.RightDirection = pp.Anchor end # points.each do |pt| return res end # def closed_path(folding, points) def raster(folding, fname, w,h, p) image = folding.paper.RasterItems.Add image.File = fname vbounds = image.VisibleBounds wd,ht = (vbounds[2]-vbounds[0]).abs, (vbounds[1]-vbounds[3]).abs sizer = (h.to_f) / (ht.to_f) image.Resize(sizer*100, sizer*100) image.Position = p return image end # def raster(folding, fname, w,h, p) def doughnut(folding, obj_1, obj_2) defaults = folding.get_defaults res_arr = Array.new() folding.paper.Selection = Array.new() sleep 0.23 while folding.paper.Application.ActionIsRunning obj_1.Selected = true obj_2.Selected = true sleep 0.23 while folding.paper.Application.ActionIsRunning folding.paper.Application.DoScript('myKataNuki','myActions') sleep 0.23 while folding.paper.Application.ActionIsRunning res_arr = folding.paper.Selection folding.paper.Selection = Array.new() sleep 0.23 while folding.paper.Application.ActionIsRunning folding.set_defaults(defaults) return res_arr end # def doughnut(folding, obj_1, obj_1) def yako(folding, startend, ko, flip=[+1,-1], xy=+1) # startend = [[start_x,start_y], [end_x,end_y]] # ko = [偏差のX方向成分, 偏差の垂直成分] # flip ko のどっち成分を反転させるか。+1:侭、-1:反転 ya = folding.paper.ActiveLayer.PathItems.Add ya.Closed = false ya.StrokeWidth = $yawidth yaPts = ya.PathPoints 2.times{ yaPts.Add } yas = yaPts.item(1) yas.PointType = AiEnumerations::AiSmooth yas.Anchor = plus(startend[0], [folding.left, folding.bottom]) yas. LeftDirection = yas.Anchor yas.RightDirection = plus(yas.Anchor, [Illustration.sh(flip[0]+0.6)*ko[0], Illustration.sh(flip[1]+0.6)*ko[1]]) yae = yaPts.item(2) yae.PointType = AiEnumerations::AiSmooth yae.Anchor = plus(startend[1], [folding.left, folding.bottom]) if xy>0 then yae. LeftDirection = plus(yae.Anchor, [Illustration.sh(flip[0]+1.6)*ko[0], Illustration.sh(flip[1]+1.6)*ko[1]]) yae.RightDirection = yae.Anchor else # if xy>0 then yae. LeftDirection = plus(yae.Anchor, [Illustration.sh(flip[1]+1.6)*ko[1], Illustration.sh(flip[0]+1.6)*ko[0]]) yae.RightDirection = yae.Anchor end # if xy>0 then # 0.6 = 0+0.6, 1.6 = 1+0.6: 0|1 = start|end # +1->1.6|2.6->+1|+1, -1->-0.4|+0.6->-1|+1 return ya end # def yako(folding, startend, ko) def arrowize(folding, path, mode='d') case mode when '1',/^1/ sname = 'myArrow' when '2',/^2/ sname = 'myArrow2' when 'd',/^d/i sname = 'myDoubleArrow' when 'w',/^w/i sname = 'myArrowWH' when 'b',/^b/i sname = 'myArrowBlow' else sname = 'myArrow2' end # case mode folding.paper.Selection = Array.new() path.Selected = true folding.Application.DoScript(sname, 'myActions') sleep 0.23 while folding.Application.ActionIsRunning selected = folding.paper.Selection folding.paper.Selection = Array.new() return selected end # def arrowize(folding, path, mode=2) def arrow_white(folding, path) white = WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = $white white.CMYK = cmyk sname = 'myArrow1_2' defaults = folding.get_defaults res_arr = Array.new() folding.paper.Selection = Array.new() path.Selected = true folding.Application.DoScript(sname, 'myActions') sleep 0.23 while folding.paper.Application.ActionIsRunning res_arr = folding.paper.Selection folding.paper.Selection = Array.new() folding.set_defaults(defaults) grp = res_arr[0] aw = grp.PathItems.item(1) aw.Stroked = true aw.StrokeWidth = 0.25 aw.FillColor = white # aw = grp(1) return res_arr end # def arrow_white(folding, path) def arrow_blow(folding, path) sname = 'myArrowBlow' defaults = folding.get_defaults res_arr = Array.new() folding.paper.Selection = Array.new() path.Selected = true folding.Application.DoScript(sname, 'myActions') sleep 0.23 while folding.paper.Application.ActionIsRunning res_arr = folding.paper.Selection folding.paper.Selection = Array.new() grp = res_arr[0] grp.PathItems.Count.times do |i| # 18/27矢柄 は、一つの閉路としてある。そして中棒は開路 aw = grp.PathItems.item(i+1) aw.Stroked = true aw.StrokeWidth = 0.1 aw.Filled = false end # grp.PathItems.Count.times do |i| grp.GroupItems.Count.times do |i| # 14/27鏃 は、二つの閉路からなる一つのグループとしてある。 aw = grp.GroupItems.item(i+1) aw.PathItems.Count.times do |i| awp = aw.PathItems.item(i+1) awp.Stroked = true awp.StrokeWidth = 0.1 awp.Filled = false end # aw.PathItems.Count.times do |i| end # grp.PathItems.Count.times do |i| folding.set_defaults(defaults) return res_arr end # def arrow_blow(folding, path) def text_back(folding, path) defaults = folding.get_defaults res_arr = Array.new() folding.paper.Selection = Array.new() sleep 0.23 while folding.paper.Application.ActionIsRunning tcolor = path.TextRange.FillColor path.Selected = true sleep 0.23 while folding.paper.Application.ActionIsRunning folding.Application.DoScript('myTextBackground', 'myActions') sleep 0.23 while folding.paper.Application.ActionIsRunning res_arr = folding.paper.Selection folding.paper.Selection = Array.new() sleep 0.23 while folding.paper.Application.ActionIsRunning # res_arr.each{ |t| t.TextRange.FillColor = tcolor} # 効かない folding.set_defaults(defaults) return res_arr end # def text_back(folding, path) alias text_back_obsolete text_back def text_back(folding, tart) white = WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = $white white.CMYK = cmyk another = tart.Duplicate another = another.CreateOutline # こっちのが上にある # こっちもアウトラインを取るかどうかは悩む tart = tart.CreateOutline tart.CompoundPathItems.each do |cpath| cpath.PathItems.each do |path| path.Stroked = true path.StrokeWidth = 1.5 # Stroked の後に指定する path.StrokeColor = white path.StrokeJoin = Illustration::AiRoundEndJoin path.StrokeCap = Illustration::AiRoundEndCap path.Filled = true path.FillColor = white end # cpath.PathItems.each do |path| end # tart.CompoundPathItems.each do |path| return tart, another end # def text_back(folding, path) # Foldings def basic(folding) f, es1 = folding.square($size, 'Basic Square') f, e2 = folding.line([[$size/2,0], [$size/2,$size]], 'Central Folding') e2.Hidden = true return es1 + [e2] end # def basic(folding) def figure(folding) edges = [] # 横線 edges << folding.lineV([[0,$size/2], [$size,$size/2]])[1] [+1,-1].each do |rl| # 対角線 edges << folding.lineM([[0, Illustration::hs( rl)*$size], [$size,Illustration::hs(-rl)*$size] ])[1] # 小対角線 edges << folding.line([[$size/2, 0], [$size*(1+rl)/2,$size/2]])[1] edges << folding.line([[$size/2,$size], [$size*(1+rl)/2,$size/2]])[1] # 3/8補助線 edges << folding.line([[$size*(4+rl)/8,0], [$size*(4+rl)/8,$size]])[1] # 手足の丸ハッチの所の斜め、というか、要するに止め斜め [+1,-1].each do |tb| edges << folding.line([[$size*(2+rl)/4,$size*(4 + tb*4)/8], [$size*(4+rl)/8,$size*(4 + tb*3)/8] ])[1] edges << folding.line([[$size*(2+rl)/4,$size*(4 + tb*0)/8], [$size*(4+rl)/8,$size*(4 + tb*1)/8] ])[1] end # [+1,-1] do |tb| end # [+1,-1].each do |rl| return edges end # def figure(folding) def halo(folding) paths = [] [0, 4, 8].each do |y| [+1, -1].each do |x| teashi = folding.elli([$size*(4 + x*1.05)/8, $size*y/8], $size/8*(Math::sqrt(2)/2)*0.85 )[1] teashi.StrokeWidth = $haloStrokeWidth paths << teashi end # [+1, -1].each do |x| end # [0, 4, 8].each do |y| # ハロのなんとなく口な継ぎ目線は5点パス depth = 0.52 [+1, -1].each do |tb| # mukuchi = folding.paper.PathItems.Add # Cmmentout 03x24 mukuchi = folding.paper.ActiveLayer.PathItems.Add paths << mukuchi mukuchi.StrokeWidth = $haloStrokeWidth muPts = mukuchi.PathPoints 5.times{ muPts.Add } pc = muPts.item(3) pc.PointType = AiEnumerations::AiSmooth pc.Anchor = [folding.left+$size*4/8, folding.bottom+$size*(4 + tb*(2-depth))/8] pc.LeftDirection = [pc.Anchor[0] - $size*0.9/16, pc.Anchor[1]] pc.RightDirection = [pc.Anchor[0] + $size*0.9/16, pc.Anchor[1]] [+1,-1].each do |el| pl = muPts.item(3+el*1) pl.PointType = AiEnumerations::AiSmooth pl.Anchor = [folding.left+$size*(4+el*2)/8, folding.bottom+$size*(2+tb)/4] pl.LeftDirection = [pl.Anchor[0] - Illustration::hs(el)*$size*3.3/16 - Illustration::hs(-el)*$size*0.4/16 , pl.Anchor[1] + tb*Illustration::hs( el)*$size*0.1/16] pl.RightDirection = [pl.Anchor[0] + Illustration::hs(el)*$size*0.4/16 + Illustration::hs(-el)*$size*3.3/16 , pl.Anchor[1] + tb*Illustration::hs(-el)*$size*0.1/16] pl.PointType = AiEnumerations::AiSmooth pL = muPts.item(3+el*2) pL.PointType = AiEnumerations::AiSmooth pL.Anchor = [folding.left+$size*(4+el*2.1)/8, folding.bottom+$size*(2+tb)/4] pL.LeftDirection = pL.Anchor pL.RightDirection = pL.Anchor end # [+1,-1].each do |el| end # [+1, -1].each to |tb| # ハロの目 [+1,-1].each do |rl| eye = folding.elli([$size*(8 + rl*(0.7))/16, $size*5.6/16], $size/192, $size/96)[1] eye.StrokeWidth = $haloStrokeWidth paths << eye end # [+1,-1].each do |rl| return paths end # def halo(folding)11 def titles(folding) items = [] return items end # def titles(folding) def back(folding) bg = folding.paper.PathItems.Add bg.Closed = true bgPts = bg.PathPoints 4.times{ bgPts.Add } # # b,l, h,w = 5,100, 590-b,750-l b,l, h,w = 5,124.44, 585,593 p = bgPts.item(1) p.Anchor = [b , l ] p.LeftDirection = p.Anchor p.RightDirection = p.Anchor p = bgPts.item(2) p.Anchor = [b , l+w] p.LeftDirection = p.Anchor p.RightDirection = p.Anchor p = bgPts.item(3) p.Anchor = [b+h, l+w] p.LeftDirection = p.Anchor p.RightDirection = p.Anchor p = bgPts.item(4) p.Anchor = [b+h, l ] p.LeftDirection = p.Anchor p.RightDirection = p.Anchor bg.Stroked = false color= WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = $bgcolor color.CMYK = cmyk bg.FillColor = color return bg end # def titles(folding) def tombo(folding) basic = folding.filled([[0,0], [$size,0], [$size,$size], [0,$size]], 'Solid', 'tombo', [0,0,0,0])[1] basic.Filled = false basic.Selected = true folding.paper.Application.DoScript('myTrimMark', 'myActions') sleep 0.23 while folding.Application.ActionIsRunning basic.Hidden = true basic.Selected = false return basic end # def tombo(folding) def balloon(folding) pink = WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = $linecolor pink.CMYK = cmyk edges = [] # 縦線 edges << folding.lineV([[$size/2,0], [$size/2,$size]])[1] edges[-1].StrokeColor = pink [+1,-1].each do |rl| # 対角線 edges << folding.lineM([[0, Illustration::hs( rl)*$size], [$size,Illustration::hs(-rl)*$size] ])[1] edges[-1].StrokeColor = pink [+1,-1].each do |tb| # 小対角線 edges << folding.lineM([[$size/2,$size/2 + tb*$size/2], [$size/2 + rl*$size/4,$size/2 + tb*$size/4]])[1] edges[-1].StrokeColor = pink edges << folding.lineV([[$size/2 + rl*$size/2,$size/2], [$size/2 + rl*$size/4,$size/2 + tb*$size/4]])[1] edges[-1].StrokeColor = pink # 袖四角 # # 内側縦 edges << folding.lineM([[$size/2 + rl*$size*1/8,$size/2 + tb*$size*1/8], [$size/2 + rl*$size*1/8,$size/2 + tb*$size*3/8]])[1] edges[-1].StrokeColor = pink # # 外側縦 edges << folding.lineM([[$size/2 + rl*$size*3/8,$size/2 + tb*$size*1/8], [$size/2 + rl*$size*3/8,$size/2 + tb*$size*3/8]])[1] edges[-1].StrokeColor = pink # # 央側横 edges << folding.lineV([[$size/2 + rl*$size*1/8,$size/2 + tb*$size*1/8], [$size/2 + rl*$size*3/8,$size/2 + tb*$size*1/8]])[1] edges[-1].StrokeColor = pink # # 辺側横 edges << folding.lineV([[$size/2 + rl*$size*1/8,$size/2 + tb*$size*3/8], [$size/2 + rl*$size*3/8,$size/2 + tb*$size*3/8]])[1] edges[-1].StrokeColor = pink # 隅三角 edges << folding.lineV([[$size/2 + rl*$size*3/8,$size/2 + tb*$size*3/8], [$size/2 + rl*$size*2/8,$size/2 + tb*$size*4/8]])[1] edges[-1].StrokeColor = pink edges << folding.lineM([[$size/2 + rl*$size*3/8,$size/2 + tb*$size*3/8], [$size/2 + rl*$size*4/8,$size/2 + tb*$size*2/8]])[1] edges[-1].StrokeColor = pink # 隅四角 edges << folding.lineV([[$size/2 + rl*$size*3/8,$size/2 + tb*$size*3/8], [$size/2 + rl*$size*3/8,$size/2 + tb*$size*4/8]])[1] edges[-1].StrokeColor = pink edges << folding.lineM([[$size/2 + rl*$size*3/8,$size/2 + tb*$size*3/8], [$size/2 + rl*$size*4/8,$size/2 + tb*$size*3/8]])[1] edges[-1].StrokeColor = pink end # [+1,-1].each do |tb| end # [+1,-1].each do |rl| return edges end # def balloon(folding) def drift() return 0 end # def drift() def numbers(folding) pink = WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = $linecolor pink.CMYK = cmyk charsize = 0.7 textitems = [] # 縦央 textitems << folding.settext('(1)', [$size/2 + drift(), $size-$size/16.0], 0, charsize)[1] trange = textitems[-1].TextRange # trange.StrokeColor = pink trange.FillColor = pink deg = 45 [+1,-1].each do |rl| textitems << folding.settext('(1)', [$size/2 + rl*$size*7/16.0 + drift(), $size - $size/16.0], rl*(-45), charsize)[1] trange = textitems[-1].TextRange trange.FillColor = pink [+1,-1].each do |tb| textitems << folding.settext('(2)', [$size/2 + rl*$size*5/16.0 + drift(), $size/2 + tb*$size*3/16.0], deg, charsize)[1] trange = textitems[-1].TextRange trange.FillColor = pink textitems << folding.settext('(3)', [$size/2 + rl*$size*7/32.0, $size/2 + tb*$size*6/16.0 + drift()], rl*(-90), charsize)[1] trange = textitems[-1].TextRange trange.FillColor = pink textitems << folding.settext('(4)', [$size/2 + rl*$size*6/16.0, $size/2 + tb*$size*7/16.0 + drift()], rl*(-90), charsize)[1] trange = textitems[-1].TextRange trange.FillColor = pink textitems << folding.settext('(5)', [$size/2 + rl*$size*5/16.0, $size/2 + tb*$size*7/16.0 + drift()], 180+deg, charsize)[1] trange = textitems[-1].TextRange trange.FillColor = pink deg += rl*90 end # [+1,-1].each do |tb| deg += 90 end # [+1,-1].each do |rl| return textitems end # def numbers(folding) def nukare(folding, obj) defaults = folding.get_defaults folding.paper.Selection = Array.new() obj.Selected = true folding.Application.DoScript('myTextOutline', 'myActions') sleep 0.23 while folding.Application.ActionIsRunning obj = folding.paper.Selection folding.paper.Selection = Array.new() folding.set_defaults(defaults) return obj end # def nukare(folding, another) alias textoutline nukare def nuki(folding, tarts=[]) white = WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = $white white.CMYK = cmyk tarts.each do |tart| another = tart.Duplicate another = textoutline(folding, another) # こっちのが上にある tart = nukare(folding, tart) # 元のは後方にある、それを白く太らせる tart.each do |item| # puts item.Name item.PathItems.each do |path| # path.Stroked = true # path.StrokeWidth = 2 # path.StrokeColor = white # path.Filled = true # path.FillColor = white end # item.PathItems.each do |path| item.CompoundPathItems.each do |cpath| cpath.PathItems.each do |path| # puts item.Name # path.StrokeWidth = 2.0 # こっちでは太さ指定出来ず path.Stroked = true path.StrokeWidth = 1.5 # Stroked の後でないと指定出来ないというのだ path.StrokeColor = white path.StrokeJoin = Illustration::AiRoundEndJoin path.StrokeCap = Illustration::AiRoundEndCap path.Filled = true path.FillColor = white end # cpath.PathItems.each do |path| end # item.CompoundPathItems.each do |path| end # another.PathItems.each |path| end # tarts.each do |tart| end # def nuki(folding, tarts=[]) def small_halo(folding, pos=[0,512]) small_halo = halo(folding) #halo_square = basic(folding) #small_halo += halo_square small_halo.each do |hpath| hpath.Translate(pos[0], pos[1]) end # small_halo.each do |hpath| sqr_rear = closed_path(folding, [[0,0], [0,$size], [$size,$size], [$size,0]]) sqr_fore = sqr_rear.Duplicate sqr_rear.Resize(105, 119) sqr_fore.Filled , sqr_rear.Filled = true , true sqr_fore.Stroked, sqr_rear.Stroked = false , false sqr_fore.Translate(pos[0], pos[1]) sqr_rear.Translate(pos[0], pos[1]) fuchi = doughnut(folding, sqr_rear, sqr_fore) sqr_black = closed_path(folding, [[0,0], [0,$size], [$size,$size], [$size,0]]) # sqr_black.Filled, sqr_black.Stroked, sqr_black.StrokeWidth= false, true, 0.25 sqr_black.Translate(pos[0], pos[1]) sqr_black.MoveToBeginning(folding.paper.ActiveLayer) end # def small_halo(folding, num, texts, pos=[0,512]) def first (folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add lyr.Name = texts[-1] small_halo(folding, pos) line01 = folding.lineV(plus([[$size/2,0], [$size/2,$size]], pos))[1] # line01.Filled, line01.Stroked, line01.StrokeWidth = false, true, 0.25 # line01.StrokeDashes = $valley # ya = yako(folding, plus([[$size*1.2/4,$size*13/16], [$size*2.8/4,$size*13/16]], pos), # [-$size*1/8,$size*1.3/16], [-1,+1]) # ちょっと大振りな矢印になるかな # ya = yako(folding, plus([[$size*2.5/8,$size*13.1/16], [$size*5.5/8,$size*13.1/16]], pos), # [-$size*1/8,$size*1.1/16], [-1,+1]) # まだもう一寸寝かせた方が良いみたい ya = yako(folding, plus([[$size*2.5/8,$size*13.2/16], [$size*5.5/8,$size*13.2/16]], pos), [-$size*1/8,$size*1/16], [-1,+1]) arrowize(folding, ya, 'd') folding.settext(texts[-1], plus([-$size/12, $size+5], pos)) texts << "顔\rを\r内\r側\rに\r半\r分\rに\r折\rっ\rて" folding.settext(texts[-1], plus([-$size*0.5/8, $size/2+6], pos)); texts[-1].gsub!("\r",'') texts << "ま\rた\r開\rき\rま\rす\r \r谷\r折\rり\r目\rで\rす" folding.settext(texts[-1], plus([-$size*1.1/8, $size/2+1], pos)); texts[-1].gsub!("\r",'') end # def first (floding, num, texts, pos=[0,512]) def second(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add lyr.Name = texts[-1] small_halo(folding, pos) ya_shu = yako(folding, plus([[$size*26/32,$size*(+1)/32], [$size*31/32,$size*6/32]], pos), [$size*1/16,$size*4/16], [-1,-1], -1) arrowize(folding, ya_shu, 'd') # どっちが良いのかは未だ決断がつかない。取敢えずこういう事にしておこう。 # ya_shu = yako(folding, plus([[$size*7/8,$size*(-1)/32], [$size*33/32,$size*1/8]], pos), # [$size*1/16,$size*2/16], [-1,-1], -1) # arrowize(folding, ya_shu, 'd') back_shu = closed_path(folding, plus([[$size+$size*1.5/128.0,0-$size*1.5/128.0], [$size*7/8,0-$size*1.5/128.0], [$size+$size*1.5/128.0,$size*1/8]], pos)) back_shu.Filled, back_shu.Stroked = true, false ya_ho = yako(folding, plus([[$size*26/32,$size*(31)/32], [$size*31/32,$size*26/32]], pos), [$size*(-1)/16,$size*(+4)/16], [+1,+1], -1) arrowize(folding, ya_ho, 'd') # どっちが良いのかは未だ決断がつかない。取敢えずこういう事にしておこう。 # ya_ho = yako(folding, plus([[$size*7/8,$size*33/32], [$size*33/32,$size*7/8]], pos), # [$size*(-1)/16,$size*(+2)/16], [+1,+1], -1) # arrowize(folding, ya_ho, 'd') back_ho = closed_path(folding, plus([[$size+$size*1.5/128.0,$size+$size*1.5/128.0], [$size*7/8,$size+$size*1.5/128.0], [$size+$size*1.5/128.0,$size*7/8]], pos)) back_ho.Filled, back_ho.Stroked = true, false sqr_black = closed_path(folding, plus([[0,0], [0,$size], [$size,$size], [$size,0]], pos)) line02 = folding.lineM(plus([[0,0], [$size,$size]], pos))[1] line03 = folding.lineM(plus([[0,$size], [$size,0]], pos))[1] folding.settext(texts[-1], plus([-$size/12, $size+5], pos)) texts << "対\r角\r線\rは\r山\r折\rり\r目\rを\r付\rけ\rま\rす" folding.settext(texts[-1], plus([-$size*0.5/8, $size/2+1], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def third(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add lyr.Name = texts[-1] small_halo(folding, pos) line01 = folding.lineV(plus([[$size/2,0], [$size/2,$size]], pos))[1] line02 = folding.lineM(plus([[0,0], [$size,$size]], pos))[1] line03 = folding.lineM(plus([[0,$size], [$size,0]], pos))[1] folding.settext(texts[-1], plus([-$size/12, $size+5], pos)) texts << "(" folding.settext(texts[-1], plus([-$size*1.75/16, $size-2.7], pos)) texts << "1)\rの\r折\rり\r目\rを\r一\rど\rき\rに\r折\rり\rま\rす" folding.settext(texts[-1], plus([-$size*0.5/8, $size/2+0], pos)); texts[-1].gsub!("\r",'') # texts << "そ\rし\rて\r三\r角\rに\rま\rと\rめ\rま\rす" # folding.settext(texts[-1], plus([$size*10.7/8, $size/2-0], pos)); texts[-1].gsub!("\r",'') # texts << "風\r船\rの\r基\r礎\rと\rい\rう\r折\r方\rで\rす" # folding.settext(texts[-1], plus([$size*10/8, $size/2-4], pos)); texts[-1].gsub!("\r",'') texts << "そ\rし\rて\r三\r角\rに" folding.settext(texts[-1], plus([$size*(10+0.7*2)/8, $size/2+7], pos)); texts[-1].gsub!("\r",'') texts << "ま\rと\rめ\rま\rす" folding.settext(texts[-1], plus([$size*(10+0.7*1)/8, $size/2+10.5], pos)); texts[-1].gsub!("\r",'') texts << "風\r船\rの\r基\r礎\rと" folding.settext(texts[-1], plus([$size*(10+0.7*0)/8, $size/2+7], pos)); texts[-1].gsub!("\r",'') texts << "い\rう\r折\r方\rで\rす" folding.settext(texts[-1], plus([$size*(10-0.7*1)/8, $size/2+7], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, num, texts, pos=[0,512]) def fourth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+5], pos)) b_base = closed_path(folding, plus(plus([[$size/2,$size/2], [0,0], [$size,0]] , [0,$size*15/32]) , pos)) center = folding.line(plus(plus([[$size/2,$size/2], [$size/2,0]] , [0,$size*15/32]) , pos))[1] center.StrokeDashes = $dimm # [0.5,3] texts << "風船の\r 基礎" folding.settext(texts[-1], plus([$size*13/16, $size*13/16], pos)); texts[-1].gsub!("\r",'') texts << " 模様の絵はもう書か\rない事にします" folding.settext(texts[-1], plus([$size*1/16, $size*14/16], pos)); texts[-1].gsub!("\r",'') from_d = closed_path(folding, plus(plus( [ [ 0,$size*(+1)/16], [$size/2,$size*(+(4-1))/64.0], [$size,$size*(+1)/16] , [$size*(16+1)/32,0] , [$size,$size*(-1)/16], [$size/2,$size*(-(4-1))/64.0], [ 0,$size*(-1)/16] , [$size*(16-1)/32,0] ] , [0,$size/4]) , pos)) from_d.Filled, from_d.FillColor = true, $colorgray texts << "下から見るとこんな感じ" folding.settext(texts[-1], plus([$size*7/16, $size*1/32], pos)) end # def n-th(folding, fspace, num, texts, pos=[0,512]) def fifth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+5-1], pos)) b_base = closed_path(folding, plus(plus([[$size/2,$size/2], [0,0], [$size,0]] , [-$size/4,$size*33/64]) , pos)) folding.lineV(plus(plus([[$size/4,$size/4], [$size/2,0], [$size*3/4,$size/4]] , [-$size/4,$size*33/64]) , pos)) ya_l = yako(folding, plus(plus([[$size*7/32,$size*3/64.0], [$size*13/32,$size*13/64]], [-$size/4,$size*33/64]) , pos) , [-$size*5/64.0,-$size*1.6/64.0], [-1,-1], -1) arrowize(folding, ya_l, '1') ya_r = yako(folding, plus(plus([[$size*(32-7)/32,$size*3/64.0], [$size*(32-13)/32,$size*13/64]], [-$size/4,$size*33/64]) , pos) , [-$size*5/64.0,+$size*1.6/64.0], [+1,+1], -1) arrowize(folding, ya_r, '1') texts << "両裾を斜めに\r折り上げます\r(上の1枚だけ)" folding.settext(texts[-1], plus([$size*2/16, $size*11/32], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def sixth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size*2/16, $size*7/8], pos)) b_base = closed_path(folding, plus(plus([[$size/2,$size/2], [0,0], [$size,0]] , [-$size/4,$size*19/32]) , pos)) l_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*1/4,$size/4], [$size/2-0.3,$size/2]] , [-$size/4,$size*19/32]) , pos)); l_side.Filled = true r_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*3/4,$size/4], [$size/2+0.3,$size/2]] , [-$size/4,$size*19/32]) , pos)); r_side.Filled = true texts << " 裏返して、\rそちら側も\r同様に折り\rます" folding.settext(texts[-1], plus([$size*8/16, $size*21/16], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def seventh(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+5-1], pos)) b_base = closed_path(folding, plus(plus([[$size/2,$size/2], [$size*(2-1)/4,$size/4], [$size/2,0], [$size*(2+1)/4,$size/4]] , [-$size*3/8,$size*33/64]) , pos)) l_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*1/4,$size/4], [$size/2,$size/2]] , [-$size*3/8,$size*33/64]) , pos)) l_side.Filled, l_side.StrokeJoin = true, Illu::AiBevelEndJoin r_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*3/4,$size/4], [$size/2,$size/2]] , [-$size*3/8,$size*33/64]) , pos)) r_side.Filled, r_side.StrokeJoin = true, Illu::AiBevelEndJoin folding.lineV(plus(plus([[$size*(4-1)/8,$size*1/8], [$size*(4-1)/8,$size*3/8]] , [-$size*3/8,$size*33/64]) , pos)) folding.lineV(plus(plus([[$size*(4+1)/8,$size*1/8], [$size*(4+1)/8,$size*3/8]] , [-$size*3/8,$size*33/64]) , pos)) l_ya = yako(folding, plus(plus([[$size*(8-3)/16,$size*2/8], [$size*(8-1)/16,$size*2/8]] , [-$size*3/8,$size*33/64]) , pos), [-$size*1.3/32,$size*1.3/64.0], [-1,+1]) arrowize(folding, l_ya, '1') r_ya = yako(folding, plus(plus([[$size*(8+3)/16,$size*2/8], [$size*(8+1)/16,$size*2/8]] , [-$size*3/8,$size*33/64]) , pos), [+$size*1.3/32,$size*1.3/64.0], [-1,+1]) arrowize(folding, r_ya, '1') texts << "真ん中向きに\r折り込みます" folding.settext(texts[-1], plus([$size*1/16, $size*13/32], pos)); texts[-1].gsub!("\r",'') texts << " 以下、裏も\r同様に折ります" folding.settext(texts[-1], plus([$size*11/16, $size*27/32], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def eighth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+5], pos)) both_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size*1/8], [$size*(4-1)/8,$size*3/8], [$size/2,$size/2], [$size*(4+1)/8,$size*3/8], [$size*(4+1)/8,$size*1/8] ] , [-$size*3/8,$size*19/32]) , pos)); both_side.Filled = true l_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.3,$size/2]] , [-$size*3/8,$size*19/32]) , pos)); l_side.Filled = true r_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.3,$size/2]] , [-$size*3/8,$size*19/32]) , pos)); r_side.Filled = true l_side = closed_path(folding, plus(plus( [[$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.2,$size/4]] , [-$size*3/8,$size*19/32]) , pos)) l_side.Filled, l_side.StrokeJoin = true, Illu::AiBevelEndJoin r_side = closed_path(folding, plus(plus( [[$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.2,$size/4]] , [-$size*3/8,$size*19/32]) , pos)) r_side.Filled, r_side.StrokeJoin = true, Illu::AiBevelEndJoin l_fold = folding.lineV(plus(plus([[$size*(4-1)/8,$size*3/8], [$size/2-0.1,$size*3/8]] , [-$size*3/8,$size*19/32]) , pos)) r_fold = folding.lineV(plus(plus([[$size*(4+1)/8,$size*3/8], [$size/2+0.1,$size*3/8]] , [-$size*3/8,$size*19/32]) , pos)) l_ya = yako(folding, plus(plus([[$size*(16-1.1)/32,$size*7.1/16], [$size*(16-1.1)/32,$size*10.8/32]] , [-$size*3/8,$size*19/32]) , pos), [-$size*1.3/64.0,+$size*1.3/32.0], [+1,-1]) arrowize(folding, l_ya, '1') r_ya = yako(folding, plus(plus([[$size*(16+1.1)/32,$size*7.1/16], [$size*(16+1.1)/32,$size*10.8/32]] , [-$size*3/8,$size*19/32]) , pos), [+$size*1.3/64.0,+$size*1.3/32.0], [+1,-1]) arrowize(folding, r_ya, '1') texts << "下向きに\r折ります" # folding.settext(texts[-1], plus([$size*(-1)/16, $size*20/32], pos)); texts[-1].gsub!("\r",'') # 迷う所。上行斜め下位置の方と下行左方下部の方と迷っている folding.settext(texts[-1], plus([$size*(-4.7)/32, $size*23/32], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def ninth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+5-1], pos)) both_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2,$size/2], [$size*(4+1)/8,$size*3/8], [$size*(4+1)/8,$size/8] ] , [-$size*3/8,$size*33/64]) , pos)); both_side.Filled = true l_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2,$size*3/8]] , [-$size*3/8,$size*33/64]) , pos)) l_side.Filled, l_side.StrokeJoin = true, Illu::AiBevelEndJoin r_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2,$size*3/8]] , [-$size*3/8,$size*33/64]) , pos)) r_side.Filled, r_side.StrokeJoin = true, Illu::AiBevelEndJoin l_side = closed_path(folding, plus(plus( [[$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.2,$size/4]] , [-$size*3/8,$size*33/64]) , pos)) l_side.Filled, l_side.StrokeJoin = true, Illu::AiBevelEndJoin r_side = closed_path(folding, plus(plus( [[$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.2,$size/4]] , [-$size*3/8,$size*33/64]) , pos)) r_side.Filled, r_side.StrokeJoin = true, Illu::AiBevelEndJoin l_tab = closed_path(folding, plus(plus( [[$size/2,$size*3/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.45,$size/4+0.9]] , # 0.45,0.9では印刷に出ないかも [-$size*3/8,$size*33/64]) , pos)); l_side.Filled = true r_tab = closed_path(folding, plus(plus( [[$size/2,$size*3/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.45,$size/4+0.9]] , # 0.5,1.0 くらいの方が良いかも [-$size*3/8,$size*33/64]) , pos)); r_side.Filled = true l = folding.lineV(plus(plus([[$size*(4-1)/8,$size*3/8], [$size/2-0.45,$size/4+0.9]] , [-$size*3/8,$size*33/64]) , pos))[1] l.StrokeColor = $pink r = folding.lineV(plus(plus([[$size*(4+1)/8,$size*3/8], [$size/2+0.45,$size/4+0.9]] , [-$size*3/8,$size*33/64]) , pos))[1] r.StrokeColor = $pink ya_l = yako(folding, plus(plus([[$size*(16-2.3)/32,$size*18/64.0], [$size*(16-1)/32,$size*21.5/64.0]], [-$size*3/8,$size*33/64]) , pos) , [-$size*5/150.0,-$size*1.6/150.0], [-1,-1], -1) arrowize(folding, ya_l, 'd') ya_r = yako(folding, plus(plus([[$size*(16+2.3)/32,$size*18/64.0], [$size*(16+1)/32,$size*21.5/64.0]], [-$size*3/8,$size*33/64]) , pos) , [-$size*5/150.0,+$size*1.6/150.0], [+1,+1], -1) arrowize(folding, ya_r, 'd') texts << "折り目を\r付けます" folding.settext(texts[-1], plus([$size*2/16, $size*13/32], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def tenth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+5], pos)) both_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2,$size/2], [$size*(4+1)/8,$size*3/8], [$size*(4+1)/8,$size/8] ] , [-$size*3/8,$size*19/32]) , pos)); both_side.Filled = true l_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2,$size*3/8]] , [-$size*3/8,$size*19/32]) , pos)) l_side.Filled, l_side.StrokeJoin = true, Illu::AiBevelEndJoin r_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2,$size*3/8]] , [-$size*3/8,$size*19/32]) , pos)) r_side.Filled, r_side.StrokeJoin = true, Illu::AiBevelEndJoin l_side = closed_path(folding, plus(plus( [[$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.2,$size/4]] , [-$size*3/8,$size*19/32]) , pos)) l_side.Filled, l_side.StrokeJoin = true, Illu::AiBevelEndJoin r_side = closed_path(folding, plus(plus( [[$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.2,$size/4]] , [-$size*3/8,$size*19/32]) , pos)) r_side.Filled, r_side.StrokeJoin = true, Illu::AiBevelEndJoin l_tab = closed_path(folding, plus(plus( [[$size/2,$size*3/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.45,$size/4+0.9]] , # 0.45,0.9では印刷に出ないかも [-$size*3/8,$size*19/32]) , pos)); l_side.Filled = true r_tab = closed_path(folding, plus(plus( [[$size/2,$size*3/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.45,$size/4+0.9]] , # 0.5,1.0 くらいの方が良いかも [-$size*3/8,$size*19/32]) , pos)); r_side.Filled = true l = folding.lineV(plus(plus([[$size*(4-1)/8,$size*3/8], [$size/2-0.45,$size/4+0.9]] , [-$size*3/8,$size*19/32]) , pos))[1] l.StrokeColor = $pink r = folding.lineV(plus(plus([[$size*(4+1)/8,$size*3/8], [$size/2+0.45,$size/4+0.9]] , [-$size*3/8,$size*19/32]) , pos))[1] r.StrokeColor = $pink # ここまでは矢印を除いて前段 9thと一緒 ya_l = yako(folding, plus(plus([[$size*(16-0.8)/32,$size*22.5/64.0], [$size*(16-2.3)/32,$size*20/64.0]], [-$size*3/8,$size*19/32]) , pos) , [+$size*3/150.0,+$size*1.5/150.0], [-1,-1], -1) arrow_white(folding, ya_l) ya_r = yako(folding, plus(plus([[$size*(16+0.7)/32,$size*22.5/64.0], [$size*(16+2.2)/32,$size*20.3/64.0]], [-$size*3/8,$size*19/32]) , pos) , [+$size*3/150.0,-$size*1.5/150.0], [+1,+1], -1) arrow_white(folding, ya_r) texts << "側方に出来て\rいるポケット\rに入れ込めて" folding.settext(texts[-1], plus([$size*(-7)/32, $size*20/32], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def eleventh(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+5], pos)) both_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2,$size/2], [$size*(4+1)/8,$size*3/8], [$size*(4+1)/8,$size/8] ] , [-$size*3/8,$size*33/64]) , pos)); both_side.Filled = true l_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.25,$size*2/8+0.6]] , [-$size*3/8,$size*33/64]) , pos)); l_side.Filled = true r_side = closed_path(folding, plus(plus( [[$size/2,0], [$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.25,$size*2/8+0.6]] , [-$size*3/8,$size*33/64]) , pos)); r_side.Filled = true l_side = closed_path(folding, plus(plus( [[$size*(4-1)/8,$size/8], [$size*(4-1)/8,$size*3/8], [$size/2-0.2,$size/4]] , [-$size*3/8,$size*33/64]) , pos)); l_side.Filled = true l_side.Filled, l_side.StrokeJoin = true, Illu::AiBevelEndJoin r_side = closed_path(folding, plus(plus( [[$size*(4+1)/8,$size/8], [$size*(4+1)/8,$size*3/8], [$size/2+0.2,$size/4]] , [-$size*3/8,$size*33/64]) , pos)); r_side.Filled = true r_side.Filled, r_side.StrokeJoin = true, Illu::AiBevelEndJoin center = folding.line(plus(plus([[$size/2,$size/2], [$size/2,$size/4]] , [-$size*3/8,$size*33/64]) , pos))[1] center.StrokeDashes = $dimm # [0.5,3] blow = folding.line(plus(plus( [[$size/2,-$size*1.3/16.0], [$size/2,-$size/32.0]] , [-$size*3/8,$size*33/64]) , pos))[1] arrow_blow(folding, blow) # 白抜き息吹矢印を描こう # 14-18/27 を後で白くするあたりでどうか? プリントアウトでは黒く潰れたり texts << " そして、\rまあるく\r 膨らます" folding.settext(texts[-1], plus([$size*2/16, $size*9/32], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def twelfth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+3], pos)) fname = 'C:\Smr\sf\GSeed\halo pdf\balloon\halo.2.4.jpg' w,h = $size*3/8, $size*3/8 p = plus(plus([$size*(6)/8,$size*(17)/8] , [-$size*3/8,$size*33/64]), pos) two4 = raster(folding, fname, w,h, p) end # def n-th(folding, fspace, num, texts, pos=[0,512]) def thirteenth(folding, fspace, num, texts, pos=[0,512]) texts << num.to_s lyr = fspace.Layers.Add; lyr.Name = texts[-1] folding.settext(texts[-1], plus([-$size/12, $size+3], pos)) fname = 'C:\Smr\sf\GSeed\halo pdf\balloon\halo.1.4.jpg' w,h = $size*3.26/8, $size*3.26/8 p = plus(plus([$size*(6)/8,$size*(17)/8] , [-$size*3/8,$size*33/64]), pos) one4 = raster(folding, fname, w,h, p) texts << "こんな感じに\rなるでしょう" folding.settext(texts[-1], plus([$size*2/16, $size*8.5/32], pos)); texts[-1].gsub!("\r",'') end # def n-th(folding, fspace, num, texts, pos=[0,512]) def zeroth(folding, num, texts, pos=[0,512]) h, s, w, r = 23, 25, 46, 183 # 垂直偏向, 水平開始位置, 水平間隔基準, 左右(山谷)間隔修正 # アウトラインと白縁は未 textitems = Array.new textitems << folding.settext( (texts << "「風船」")[-1], plus([256-22,h*1.45], pos), 0, 1.2)[1] textitems[-1].TextRange.FillColor = $pink textitems << folding.settext( (texts << "(伝承)")[-1], plus([256+22,h*1.45], pos), 0, 1.0)[1] textitems[-1].TextRange.FillColor = $pink textitems << folding.settext( (texts << "山折り")[-1], plus([s + 0*w,h], pos), 0, 0.7)[1] textitems[-1].TextRange.FillColor = $pink folding.lineM(plus([[s + 0.4*w,h], [s + 1.5*w,h]], pos))[1].StrokeColor = $pink textitems << folding.settext( (texts << "(二点鎖線)")[-1], plus([s + 2*w,h], pos), 0, 0.7)[1] textitems[-1].TextRange.FillColor = $pink textitems << folding.settext( (texts << "谷折り")[-1], plus([s+r + 4*w,h], pos), 0, 0.7)[1] textitems[-1].TextRange.FillColor = $pink folding.lineV(plus([[s+r + 4.4*w,h], [s+r + 5.8*w,h]], pos))[1].StrokeColor = $pink textitems << folding.settext( (texts << "(破線)")[-1], plus([s+r + 6.1*w,h], pos), 0, 0.7)[1] textitems[-1].TextRange.FillColor = $pink textitems << folding.settext( (texts << "折り方解説・作図 hs9587 http://www.geocities.co.jp/Technopolis/9587/rubyillustrator/halo/halo.html (2003/11/8)")[-1], [256+60+1,-32-2], 0, 0.7)[1] textitems[-1].TextRange.FillColor = $pink # そしてちょっと白縁ちをつける textitems.each{ |tart| tart = text_back(folding, tart) } end # def zeroth(folding, num, textx, pos=[0,512]) if $0 == __FILE__ or true then $size = 512 $haloStrokeWidth = 2 $bgcolor = [0,0,20,0] #$linecolor = [0,0,50,0] # ちょっと全然目立たないや、良く見ればあるけど殆ど折る手助けにはならないでしょう #$linecolor = [0,0,80,0] # こんなものか、でも結構目立つ $linecolor = [0,0,67,0] # 間を取ったこの辺では、この位かな # 緑ハロ $bgcolor = [0,15,0,15] $linecolor = [0,30,0,30] # 間を取ったこの辺では、この位かな $white = [0,0,0,0] folding = Illu.new( (Illu::A4[:width]-$size)/2.0, (Illu::A4[:height]-$size)/2.0 ) begin basic(folding) folding.paper.ActiveLayer.Name = 'Base' folding.paper.ActiveLayer.Visible = false folding.paper.ActiveLayer.Locked = true =begin =end l1 = folding.newlayer('Back') back(folding) l1.MoveToEnd(folding.paper) l1.Visible = true l1.Locked = true l2 = folding.newlayer('Halo') halo(folding) l2.Visible = true l2.Locked = true =begin =end # l3 = folding.newlayer('Titles') # titles(folding) # l3.Visible = false # l3.Locked = true l4 = folding.newlayer('Balloon') balloon(folding) l4.Visible = true l4.Locked = true l5 = folding.newlayer('Numbering') textarts = numbers(folding) nuki = nuki(folding, textarts) l5.Visible = true l5.Locked = true l6 = folding.newlayer('Tombo') tombo(folding) #l6.Visible = true l6.Locked = true =begin =end l2.ZOrder(Illu::AiBringToFront) # # l2. is Halo layer # Paper folding guidance for a balloon, a weter bomb or the Halo # $size = $size/(512/96.0) $haloStrokeWidth = 0.5 # original=2 $yawidth = 0.25 texts = Array.new() $colorpink = WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = $linecolor $colorpink.CMYK = cmyk; $pink = $colorpink $colorgray = WIN32OLE.new('Illustrator.Color') cmyk = WIN32OLE.new('Illustrator.CMYKColor') cmyk.Black, cmyk.Cyan, cmyk.Magenta, cmyk.Yellow = [20,0,0,0] $colorgray.CMYK = cmyk fld = folding.newlayer('Folding') zeroth(folding, '', texts, [0,512]) # 凡例 トンボの辺りに色文字で。アウトラインをとったり白縁したり。 fld.Visible, fld.Locked = true, true # ええとあとで色文字の色は変えてね $dimm = [0.4,3.2] # 折り目は無いけど何となく示すよう微かに徴す点線 fspace = folding.newlayer('FoldSpace') first(folding, fspace, '(1)-1', texts, pos=[0, 512+$size/2 - 2]) # print '1:'; p folding.paper.DefaultFilled second(folding,fspace, '(1)-2', texts, pos=[0+$size*1.3, 512+$size/2 - 2]) third(folding, fspace, '(1)-3', texts, pos=[0+$size*1.3*2, 512+$size/2 - 2]) fourth(folding, fspace, '(1)-4', texts, pos=[0+$size*1.3*3.4, 512+$size/2 - 2]) # Change the constants: Illu::Valley,Mountain StrokeDashes [2,1.2].each_with_index{ |dash,i| Illu::Valley[i] = dash } [3,1.5,0.5,1,0.5,1.5].each_with_index{ |dash,i| Illu::Mountain[i] = dash } fifth (folding, fspace, '(2)-1', texts, pos=[0+$size*1.3*0 ,0-$size*3/2 - 1]) sixth (folding, fspace, '(2)-2', texts, pos=[0+$size*1.3*0.53,0-$size*4/2 - 4]) seventh(folding, fspace, '(3)' , texts, pos=[0+$size*1.3*1.25,0-$size*3/2 - 1]) eighth (folding, fspace, '(4)' , texts, pos=[0+$size*1.3*1.70,0-$size*4/2 - 4 + 5]) $pink.cmyk.Black,$pink.cmyk.Cyan,$pink.cmyk.Magenta,$pink.cmyk.Yellow = $bgcolor ninth (folding, fspace, '(5)-1', texts, pos=[0+$size*1.3*2.10,0-$size*3/2 - 1]) tenth (folding, fspace, '(5)-2', texts, pos=[0+$size*1.3*2.70,0-$size*4/2 - 4 + 7]) eleventh(folding,fspace, '(vi)' , texts, pos=[0+$size*1.3*3.10,0-$size*3/2 - 2]) twelfth (folding, fspace,'(vii)', texts,pos=[0+$size*1.3*3.55 - 2,0-$size*4/2 - 4 + 7 + 7]) thirteenth(folding,fspace,'(viii)',texts,pos=[0+$size*1.3*3.90,0-$size*3/2 - 2]) fspace.ZOrder(Illu::AiSendToBack) fspace.Visible, fspace.Locked = true, true File.open('C:\Smr\sf\GSeed\halo pdf\balloon\balloon.txt', 'w'){ |f| texts.each{ |l| f.puts l.gsub(/\r/,"\n")+"\n\n" } } # folding.saveas('C:\Smr\dojin\GSeed\halo pdf\balloon\balloon.ai') require 'vr/vruby' VRLocalScreen.newform.messageBox('終ったよ', 'Illustruby', 0 + 64 + 0x40000) # MB_OK = 0, MB_ICONINFORMATION = 64, MB_TOPMOST = 0x40000 rescue raise ensure # folding.saveas('C:\Smr\dojin\GSeed\halo pdf\balloon\halo.ai') # folding.destroy end end # if $0 == __FILE__ then