0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

sketchupでruby その13

Last updated at Posted at 2021-04-25

概要

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?