LoginSignup
0
0

More than 3 years have passed since last update.

sketchupでruby その7

Posted at

概要

sketchupでrubyやってみた。
add_curve使ってみた。

写真

cos.png

サンプルコード

def cos
   xya = 1
   zza = xya * 8
   xys = 42
   zzs = 22
   cxy = 0
   czz = 0
   p = []
   while cxy < 360
      x = Math.cos(cxy * Math::PI / 180) * xys
      y = Math.sin(cxy * Math::PI / 180) * xys
      z = Math.sin(czz * Math::PI / 180) * zzs
      p[p.length] = [x, y, z]
      cxy += xya
      czz += zza
      if (czz >= 360)
         czz = 0
      end
   end
   p[p.length] = p[0]
   model = Sketchup.active_model
   entities = model.active_entities
   entities.add_curve(p)
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