LoginSignup
1
1

More than 3 years have passed since last update.

sketchupでruby その3

Last updated at Posted at 2021-04-16

概要

sketchupでrubyやってみた。
sin波やってみた。
add_line使ってみた。

サンプルコード

def sin_ha
   model = Sketchup.active_model
   entities = model.active_entities
   px = -30
   py = 0
   -30.step(30, 0.01){ |i|
      x = i
      y = Math::sin(i) * 20
      line1 = entities.add_line [px, 0, py], [x, 0, y]
      px = x
      py = y
   }
end

実行結果

無題.png

以上。

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