LoginSignup
0
1

More than 3 years have passed since last update.

sketchupでruby その17

Posted at

概要

sketchupでrubyやってみた。
練習問題やってみた。

練習問題

周りを囲め。

写真

ea.png

サンプルコード

def ga
   entities = Sketchup.active_model.entities
   pi = Math::PI
   (-24..24).each { |i|
      group = entities.add_group
      face = group.entities.add_face [0, 0, 60], [0, 20, 60], [1, 20, 60], [1, 0, 60]
      face.pushpull -1
      phi = i * pi / 24
      trn = Geom::Transformation.translation [0, 0, 100]
      rot = Geom::Transformation.rotation [0, 0, 0], [0, 1, 0], phi
      group.transform! trn
      group.transform! rot
   }
end

以上。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1