3D CG with SketchUp

Sketchup/Maxwell Render/ など3DCGについて
<< らせん階段を作る−3 | main | マテリアルをラッピングする >>
スポンサーサイト

一定期間更新がないため広告を表示しています

| スポンサードリンク | - | | - | - |
らせん階段を作る−4
以下の赤字部分のスクリプトをコピーし、メモ帳に貼り付けます。
”drawhelix13.rb”という名前で保存します。
c:¥Program Files¥@Last Software¥SketchUp 5¥Plugins
に移動します。(ドライブ名などのパスは適宜変更してください)


# DrawHelix13.rb Peter Brown 4/8/2004
# I've now opted to load it into 'Draw' as you use it to 'draw'
# a helix and the 'draw' menu is only short. Change it if you want.
# For a parallel helix make the end and start radii the same.
# version 12
# In this version the points are put into an array to create a curve
# rather than lines.
# version 13
# code tidied up a bit
# 2006/5/19 日本語

require 'sketchup.rb'

def drawhelix

prompts = ["開始半径","終了半径", "ピッチ", "回転数", "円の分割数"]
values = [300.mm, 300.mm, 100.mm, 5, 24]
results = inputbox prompts, values, "Helix Dimensions"
return if not results
eradius, sradius, pitch, rotations, sections = results

totalsec = sections * rotations
angle = 2*3.14159/sections
cosangle = Math.cos(angle)
sinangle = Math.sin(angle)

section = 1
z0 = pitch / sections

r1 = sradius
dr = (eradius - sradius) / totalsec

pts = []
x1 = r1
y1 = 0
z1 = 0
pts[pts.length] = [x1,y1,z1]

while section < (totalsec + 1)
x2 = (r1 + (dr * section)) * Math.cos(section * angle)
y2 = (r1 + (dr * section)) * Math.sin(section * angle)
z2 = section * z0
pts[pts.length] = [x2,y2,z2]
section += 1
end

model = Sketchup.active_model
entities = model.active_entities
group = entities.add_group
entities = group.entities
model.start_operation "DrawHelix"
entities.add_curve(pts)
model.commit_operation

end

if( not file_loaded?("DrawHelix13.rb") )
add_separator_to_menu("Draw")
UI.menu("Draw").add_item("DrawHelix13") { drawhelix }
end

#-----------------------------------------------------------------------------
file_loaded("DrawHelix13.rb")



このようなメニューが表示されます。
※サンドボックスはpro版です。




だいたい想像が付くと思いますが・・・

らせんの開始と終了の半径、ピッチ(一回転でどれだけ進むか)、回転数、円の分割数(細かくすると滑らかになります)を設定します。





初期設定のままOKを押すと、こんならせんが描かれます。
| 3dcg | - | 11:47 | comments(4) | trackbacks(0) |
スポンサーサイト
| スポンサードリンク | - | 11:47 | - | - |
http://www.nikeshoes.us.org/ Nike Shoes
http://www.nfl-jerseys.us.org/ NFL Jerseys
http://www.nikeoutletonlineshopping.us/ Nike Outlet Store
http://www.yeezyboost350.us.com/ Yeezy Boost 350
http://www.travisscottjordan1.us.com/ Travis Scott jordan 1
http://www.yeezy350.us.com/ Yeezy 350
http://www.yeezy-shoes.in.net/ Yeezy Shoes
http://www.yeezys.me.uk/ Yeezy
http://www.yeezy-350.org.uk/ Yeezy 350
http://www.yeezy350.org.uk/ Yeezy 350
http://www.yeezys.us.com/ Yeezy
http://www.yeezy.com.co/ Yeezy
http://www.adidasyeezy.us.com/ Adidas Yeezy
http://www.yeezy700.org.uk/ Yeezy 700
http://www.yeezyboost350v2.de/ Yeezy Boost 350 V2
http://www.nikeoutletstoreonlineshopping.us/ Nike Outlet
http://www.yeezy-shoes.in.net/ Yeezy Shoes
http://www.mlbshop.us.com/ MLB Shop
コメントする
http://www.adidasyeezy.de/ Adidas Yeezy
http://www.mlbjerseys.us.com/ MLB Jerseys
http://www.yeezy380.us/ Yeezy 380
http://www.yeezy380.us.com/ Yeezy 380
http://www.nikefactory.us.com/ Nike Outlet
http://www.humanraces.us.com/ Human Races
http://www.humanracesshoes.us/ Human Race Shoes
http://www.uggs-officialsite.org/ Uggs Official Site

| Human Races | 2019/12/24 6:25 PM |
http://www.pandorajewelryscharms.us.com/ pandora jewelry
http://www.adidasnmdrunnerr1.us.com/ adidas nmd
http://www.pandora-jewelrysale.us.com/ pandora
http://www.katespadepurses.us.com/ kate spade new york
http://www.yeezyboost350shoes.us.com/ adidas yeezy
http://www.louboutinredbottoms.us.com/ christian louboutin sneakers
http://www.curry4-shoes.us.com/ curry 2
http://www.fitflops-sale.us.com/ fitflops clearance
http://www.longchampbag.us.com/ longchamp le pliage
http://www.nikeairvapormaxflyknit.us.com/ nike air max
http://www.jordans11shoes.us.com/ jordan 11
http://www.kyrie-4.us.com/ nike kyrie
http://www.jordan11spacejams.us.com/ jordan retro
http://www.pumafentyrihannashoes.us.com/ puma sneakers
http://www.adidas-ultraboost.us.com/ ultra boost uncaged
http://www.fitflopsshoes.us.com/ fitflop sandals
http://www.lebron15-shoes.us.com/ kevin durant shoes
http://www.hermesbirkin-handbags.us.com/ hermes bag
http://www.adidasyeezy-350.us.com/ adidas yeezy
http://www.kd10-shoes.us.com/ lebron james shoes
http://www.pandorajewelryrings.us.com/ pandora rings
http://www.nikeairmax-90.us.com/ nike air force 1
http://www.birkenstocksandalssale.us.com/ birkenstock
http://www.airmax90shoes.us.com/ nike vapor max
http://www.salomonspeedcross3.us.com/ salomon xa pro 3d
ドリフトliuyuzhen
| kate spade | 2018/03/04 9:29 AM |
闔骭銜韆鱚!
http://www.youtube.com/watch?v=WkjTeN6jGTk


| devidblein | 2008/08/08 3:12 AM |
[url=http://privateshop.org]尤窶艾
| Neughimeirore | 2007/12/11 2:32 AM |









トラックバック機能は終了しました。
1234567
891011121314
15161718192021
22232425262728
293031    
<< December 2019 >>