Created
October 19, 2015 05:25
-
-
Save dyama/43588a9fcd4ca28612d8 to your computer and use it in GitHub Desktop.
siren example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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