# encoding: UTF-8 # ============================================================ # 500PRO-R 윈치 하우징 + 하부보강커버 제안 (20260918) # 창 > 루비 콘솔 에 전체 붙여넣기 후 Enter # 좌표 = 500PRO_R_20260917_REV.obj 모델좌표 (mm) # 위치가 안 맞으면 아래 DX/DY/DZ 만 고치거나, 생성된 그룹을 통째로 이동하세요. # ============================================================ DX = 0.0; DY = 0.0; DZ = 0.0 # <-- 필요시 mm 단위 오프셋 GNAME = "윈치하부보강_제안_20260918" def dwp(u,v,a,axis) case axis when "z" then Geom::Point3d.new((u+DX).mm,(v+DY).mm,(a+DZ).mm) when "y" then Geom::Point3d.new((u+DX).mm,(a+DY).mm,(v+DZ).mm) else Geom::Point3d.new((a+DX).mm,(u+DY).mm,(v+DZ).mm) end end def dwnrm(axis) case axis when "z" then Geom::Vector3d.new(0,0,1) when "y" then Geom::Vector3d.new(0,1,0) else Geom::Vector3d.new(1,0,0) end end def dwplate(parent, name, axis, a0, a1, u0, u1, v0, v1, holes, color) g = parent.entities.add_group g.name = name e = g.entities nrm = dwnrm(axis) e.add_face([dwp(u0,v0,a0,axis), dwp(u1,v0,a0,axis), dwp(u1,v1,a0,axis), dwp(u0,v1,a0,axis)]) holes.each { |h| e.add_circle(dwp(h[0],h[1],a0,axis), nrm, (h[2]/2.0).mm, 24) } e.grep(Sketchup::Face).each { |ff| ff.erase! if ff.valid? && ff.outer_loop.edges.length == 24 } f = e.grep(Sketchup::Face).first d = (a1 - a0).mm d = -d if f.normal.dot(nrm) < 0 f.pushpull(d) g.material = color if color g end def dwcyl(parent, name, axis, a0, a1, u, v, dia, color) g = parent.entities.add_group g.name = name e = g.entities nrm = dwnrm(axis) c = e.add_circle(dwp(u,v,a0,axis), nrm, (dia/2.0).mm, 16) f = e.add_face(c) d = (a1 - a0).mm d = -d if f.normal.dot(nrm) < 0 f.pushpull(d) g.material = color if color g end model = Sketchup.active_model if model.active_path && model.active_path.length > 0 UI.messagebox("편집 중인 그룹/컴포넌트가 열려 있습니다.\nEsc 로 모두 닫고(최상위 상태) 다시 실행하세요.") else model.start_operation("윈치하부보강_제안", true) root = model.entities.add_group root.name = GNAME s0 = root.entities.add_group; s0.name = "A_하우징셸_용접" s1 = root.entities.add_group; s1.name = "B_볼팅모듈_하우징" s2 = root.entities.add_group; s2.name = "C_하부보강커버" s3 = root.entities.add_group; s3.name = "D_볼트_하부메인_M16" s4 = root.entities.add_group; s4.name = "D_볼트_하부간살_M12" s5 = root.entities.add_group; s5.name = "D_볼트_하우징_M16" s6 = root.entities.add_group; s6.name = "D_볼트_후방웨브관통_M16" s7 = root.entities.add_group; s7.name = "E_용접선_8mm필렛" dwplate(s0, "A1_좌측판_12T", "y", 2766.00, 2778.00, 4060.00, 4419.60, 221.80, 445.00, [[4150.00,300.00,18.0], [4270.00,300.00,18.0], [4380.00,300.00,18.0]], "blue") dwplate(s0, "A2_우측판_12T", "y", 3555.00, 3567.00, 4060.00, 4419.60, 221.80, 445.00, [[4150.00,300.00,18.0], [4270.00,300.00,18.0], [4380.00,300.00,18.0]], "blue") dwplate(s0, "A3a_전면판_12T_하", "x", 4048.00, 4060.00, 2559.50, 3717.30, 221.80, 235.00, [[2900.00,300.00,18.0], [3400.00,300.00,18.0]], "blue") dwplate(s0, "A3b_전면판_12T_상", "x", 4048.00, 4060.00, 2559.50, 3717.30, 365.00, 445.00, [], nil) dwplate(s0, "A3c_전면판_12T_좌", "x", 4048.00, 4060.00, 2559.50, 3041.50, 235.00, 365.00, [], nil) dwplate(s0, "A3d_전면판_12T_우", "x", 4048.00, 4060.00, 3301.50, 3717.30, 235.00, 365.00, [], nil) dwplate(s1, "B1_상판_10T_M16볼팅", "z", 445.00, 455.00, 4048.00, 4419.60, 2766.00, 3567.00, [[4110.00,2800.00,18.0], [4110.00,3535.00,18.0], [4250.00,2800.00,18.0], [4250.00,3535.00,18.0], [4390.00,2800.00,18.0], [4390.00,3535.00,18.0]], "blue") dwplate(s2, "C1_커버판_6T", "z", 190.90, 196.90, 3865.00, 4419.00, 2700.00, 3620.00, [[3893.00,2745.00,18.0], [3893.00,3080.00,18.0], [3893.00,3390.00,18.0], [3893.00,3580.00,18.0], [4388.00,2745.00,18.0], [4388.00,3080.00,18.0], [4388.00,3390.00,18.0], [4388.00,3580.00,18.0], [4000.00,2995.00,14.0], [4000.00,3335.00,14.0], [4160.00,2995.00,14.0], [4160.00,3335.00,14.0], [4320.00,2995.00,14.0], [4320.00,3335.00,14.0]], nil) dwplate(s2, "C2_1_절곡채널_6T_웹a", "y", 2790.00, 2796.00, 3865.00, 4419.00, 169.90, 190.90, [], nil) dwplate(s2, "C2_1_절곡채널_6T_웹b", "y", 2844.00, 2850.00, 3865.00, 4419.00, 169.90, 190.90, [], nil) dwplate(s2, "C2_1_절곡채널_6T_바닥", "z", 169.90, 175.90, 3865.00, 4419.00, 2790.00, 2850.00, [], nil) dwplate(s2, "C2_2_절곡채널_6T_웹a", "y", 3140.00, 3146.00, 3865.00, 4419.00, 169.90, 190.90, [], nil) dwplate(s2, "C2_2_절곡채널_6T_웹b", "y", 3194.00, 3200.00, 3865.00, 4419.00, 169.90, 190.90, [], nil) dwplate(s2, "C2_2_절곡채널_6T_바닥", "z", 169.90, 175.90, 3865.00, 4419.00, 3140.00, 3200.00, [], nil) dwplate(s2, "C2_3_절곡채널_6T_웹a", "y", 3470.00, 3476.00, 3865.00, 4419.00, 169.90, 190.90, [], nil) dwplate(s2, "C2_3_절곡채널_6T_웹b", "y", 3524.00, 3530.00, 3865.00, 4419.00, 169.90, 190.90, [], nil) dwplate(s2, "C2_3_절곡채널_6T_바닥", "z", 169.90, 175.90, 3865.00, 4419.00, 3470.00, 3530.00, [], nil) dwcyl(s3, "M16_0", "z", 159.90, 229.80, 3893.00, 2745.00, 16.0, "red") dwcyl(s3, "M16_1", "z", 159.90, 229.80, 3893.00, 3080.00, 16.0, "red") dwcyl(s3, "M16_2", "z", 159.90, 229.80, 3893.00, 3390.00, 16.0, "red") dwcyl(s3, "M16_3", "z", 159.90, 229.80, 3893.00, 3580.00, 16.0, "red") dwcyl(s3, "M16_4", "z", 159.90, 229.80, 4388.00, 2745.00, 16.0, "red") dwcyl(s3, "M16_5", "z", 159.90, 229.80, 4388.00, 3080.00, 16.0, "red") dwcyl(s3, "M16_6", "z", 159.90, 229.80, 4388.00, 3390.00, 16.0, "red") dwcyl(s3, "M16_7", "z", 159.90, 229.80, 4388.00, 3580.00, 16.0, "red") dwcyl(s4, "M12_8", "z", 161.90, 229.80, 4000.00, 2995.00, 12.0, "yellow") dwcyl(s4, "M12_9", "z", 161.90, 229.80, 4000.00, 3335.00, 12.0, "yellow") dwcyl(s4, "M12_10", "z", 161.90, 229.80, 4160.00, 2995.00, 12.0, "yellow") dwcyl(s4, "M12_11", "z", 161.90, 229.80, 4160.00, 3335.00, 12.0, "yellow") dwcyl(s4, "M12_12", "z", 161.90, 229.80, 4320.00, 2995.00, 12.0, "yellow") dwcyl(s4, "M12_13", "z", 161.90, 229.80, 4320.00, 3335.00, 12.0, "yellow") dwcyl(s5, "M16_14", "z", 440.00, 473.00, 4110.00, 2800.00, 16.0, "blue") dwcyl(s5, "M16_15", "z", 440.00, 473.00, 4110.00, 3535.00, 16.0, "blue") dwcyl(s5, "M16_16", "z", 440.00, 473.00, 4250.00, 2800.00, 16.0, "blue") dwcyl(s5, "M16_17", "z", 440.00, 473.00, 4250.00, 3535.00, 16.0, "blue") dwcyl(s5, "M16_18", "z", 440.00, 473.00, 4390.00, 2800.00, 16.0, "blue") dwcyl(s5, "M16_19", "z", 440.00, 473.00, 4390.00, 3535.00, 16.0, "blue") dwcyl(s5, "M16H_0", "y", 2741.00, 2808.00, 4150.00, 300.00, 16.0, "blue") dwcyl(s5, "M16H_1", "y", 3530.00, 3597.00, 4150.00, 300.00, 16.0, "blue") dwcyl(s5, "M16H_2", "y", 2741.00, 2808.00, 4270.00, 300.00, 16.0, "blue") dwcyl(s5, "M16H_3", "y", 3530.00, 3597.00, 4270.00, 300.00, 16.0, "blue") dwcyl(s5, "M16H_4", "y", 2741.00, 2808.00, 4380.00, 300.00, 16.0, "blue") dwcyl(s5, "M16H_5", "y", 3530.00, 3597.00, 4380.00, 300.00, 16.0, "blue") dwcyl(s5, "M16H_6", "x", 4023.00, 4100.00, 2900.00, 300.00, 16.0, "blue") dwcyl(s5, "M16H_7", "x", 4023.00, 4100.00, 3400.00, 300.00, 16.0, "blue") dwcyl(s6, "M16H_8", "x", 4414.60, 4460.00, 2900.00, 300.00, 16.0, "blue") dwcyl(s6, "M16H_9", "x", 4414.60, 4460.00, 3400.00, 300.00, 16.0, "blue") dwplate(s7, "W1_전면판-좌레일_수직", "z", 221.80, 420.40, 4048.00, 4060.00, 2559.50, 2567.50, [], "green") dwplate(s7, "W2_전면판-우레일_수직", "z", 221.80, 420.40, 4048.00, 4060.00, 3709.30, 3717.30, [], "green") dwplate(s7, "W3_전면판-베이스판", "z", 221.80, 229.80, 4048.00, 4068.00, 2559.50, 3717.30, [], "green") dwplate(s7, "W4_좌측판-베이스판", "z", 221.80, 229.80, 4060.00, 4419.60, 2758.00, 2778.00, [], "green") dwplate(s7, "W5_우측판-베이스판", "z", 221.80, 229.80, 4060.00, 4419.60, 3547.00, 3567.00, [], "green") dwplate(s7, "W6_좌측판-빔웨브_수직", "z", 221.80, 420.40, 4411.60, 4419.60, 2766.00, 2778.00, [], "green") dwplate(s7, "W7_우측판-빔웨브_수직", "z", 221.80, 420.40, 4411.60, 4419.60, 3555.00, 3567.00, [], "green") dwplate(s7, "W8_좌측판-전면판_수직", "z", 221.80, 445.00, 4060.00, 4068.00, 2766.00, 2778.00, [], "green") dwplate(s7, "W9_우측판-전면판_수직", "z", 221.80, 445.00, 4060.00, 4068.00, 3555.00, 3567.00, [], "green") model.commit_operation bb = root.bounds f = 25.4 puts "[생성완료] #{GNAME}" puts " min(mm) = %.1f, %.1f, %.1f" % [bb.min.x*f, bb.min.y*f, bb.min.z*f] puts " max(mm) = %.1f, %.1f, %.1f" % [bb.max.x*f, bb.max.y*f, bb.max.z*f] puts " 기대값 min = 3865.0, 2559.5, 159.9 / max = 4460.0, 3717.3, 473.0" puts " * 값이 크게 다르면 DX/DY/DZ 조정 또는 그룹을 통째로 이동하세요." puts " * 반대쪽 프레임 사본에 넣으려면 DY = 5002.0 (실측 확인 필요)" end