LoginSignup
0
0

More than 3 years have passed since last update.

sketchupでruby その13

Posted at

概要

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

練習問題

コップを描け。

写真

glass.png

サンプルコード

def glass
   model = Sketchup.active_model
   entities = model.active_entities
   x = 0
   y = 0
   z = 0
   r = 30
   n = 24
   pts = []
   pts[0] = [20, 0, 50]
   pts[1] = [15, 0, 5]
   pts[2] = [15, 0, 0]
   pts[3] = [13, 0, 0]
   pts[4] = [13, 0, 5]
   pts[5] = [18, 0, 50]
   base = entities.add_face pts
   circle1 = entities.add_circle(Geom::Point3d.new(x, y, z), Z_AXIS, r, n)
   status = base.followme(circle1)
   entities.erase_entities circle1
end



以上。

0
0
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
0