2010年8月22日 星期日

今天作了二個很複雜的

Building in Quilicura, Santiago, Chile
Modeled with Building Maker
Edit | Delete
Building in Quilicura, Santiago, Chile
Modeled with Building Maker
Edit | Delete

2010年8月14日 星期六

API

開始學習 SketchUp 的 ruby api

1. 文檔存於
c:\Program Files\Google\Google SketchUp [n]\Plugins


2. 畫3d
new_face = Sketchup.active_model.entities.add_face [0, 0, 0], [0, 4, 0], [2, 4, 0], [2, 0, 0]
new_face.pushpull 3

3. 設定模型的位置

Sketchup.active_model.shadow_info["Latitude"]=25.038958406398 Sketchup.active_model.shadow_info["Longitude "]=121.517620663266
3. 由 Latitude / Longitude 轉為 point

point = Sketchup.active_model.latlong_to_point  [-105.28300, 40.01700]

4. to build up use negative number
5. the number is in the unit of cm, not m, so x 100
6. Use () to group stuff


Sketchup.active_model.shadow_info["Longitude"]=121.51689405991
Sketchup.active_model.shadow_info["Latitude"]=25.041991523604


 (Sketchup.active_model.entities.add_face (Sketchup.active_model.latlong_to_point [121.51689405991,25.041991523604]),(Sketchup.active_model.latlong_to_point [121.516845753752,25.041817588114]) , (Sketchup.active_model.latlong_to_point [121.516887788275,25.041807954783]) , (Sketchup.active_model.latlong_to_point [121.516936094488,25.041981890259] )).pushpull -300

Convert from

121.51689405991,25.041991523604,3 121.516845753752,25.041817588114,3 121.516887788275,25.041807954783,3 121.516936094488,25.041981890259,3 121.51689405991,25.041991523604,3


to that

remember to discard the last point.

7. String split

a = "121.51689405991,25.041991523604,3 121.516845753752,25.041817588114,3 121.516887788275,25.041807954783,3 121.516936094488,25.041981890259,3 121.51689405991,25.041991523604,3".split(/ /)

["121.51689405991,25.041991523604,3", "121.516845753752,25.041817588114,3", "121.516887788275,25.041807954783,3", "121.516936094488,25.041981890259,3", "121.51689405991,25.041991523604,3"]

8. Iterate array

a.each {|i| k = i.split(/,/); puts k }


9. l to position model, d to draw a model


def l(s)
   # put the first log lat as the model log/lat
   a = s.split(/ /)
   b = a[0].split(/,/)
  Sketchup.active_model.shadow_info["Longitude"]=b[0].to_f
  Sketchup.active_model.shadow_info["Latitude"]=b[1].to_f
end
def d(s)
   a = s.split(/ /)
   pts =[]
  height = 0
  (a.length-1).times do |i|
      b = a[i].split(/,/)
      height = b[2].to_f * -100
     pts[i] = Sketchup.active_model.latlong_to_point [b[0].to_f, b[1].to_f]
  end
  (Sketchup.active_model.entities.add_face pts).pushpull height
end

def version()
  puts "1.7"
end

2010年8月8日 星期日

541 模型已收錄至「Google 地球」

顯示這位使用者的所有模型567模型已上載至「3D 模型庫」
顯示這位使用者收錄於「Google 地球」的模型541模型已收錄至「Google 地球」
SketchUp 建模者 建築模型製作工具建模者 
至少 1 個「Google 地球」收錄的模型 至少 5 個「Google 地球」收錄的模型 至少 10 個「Google 地球」收錄的模型 至少 25 個「Google 地球」收錄的模型 至少 50 個「Google 地球」收錄的模型 至少 100 個「Google 地球」收錄的模型 至少 500 個「Google 地球」收錄的模型


在不平地區以building maker 建模的小問題

有一個智利的模型被谷歌審閱團打了個回票, 理由是建型飄浮(floating), 在不平地區以building maker 建模的小問題, 例如說東南西北四邊地不同高, 在假設東角地較高, 而在building maker中模型可能會因我們在東角下方接地點加點而混淆, 這時要做的是:
1. 點在所有的東角接地點, 釋放其點
2. 在南西北角接地點點下固定
3. 以viewer 觀察是否修正成功.

希望我修正後的模型會過關:


Building in Quilicura, Santiago, ChileModeled with Building Maker
Edit  Delete