Skip to content

Instantly share code, notes, and snippets.

@dyama
Created October 19, 2015 05:25
Show Gist options
  • Save dyama/43588a9fcd4ca28612d8 to your computer and use it in GitHub Desktop.
Save dyama/43588a9fcd4ca28612d8 to your computer and use it in GitHub Desktop.
siren example
#!/usr/bin/siren
# coding: utf-8
# 箱を2つ作成
box1 = Prim::box [10, 10, 10]
box2 = Prim::box [10, 10, 10]
# 移動
box2.translate! [5, 5, 5]
# 組み合わせて生成
box3 = box1.fuse box2
# 容積を印字
p box3.volume # => 1875
# 構成要素を1面ずつ取り出す
box3.explore(ShapeType::FACE) do |face|
# 面積を印字
p face.area
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment