LoginSignup
1
0

More than 3 years have passed since last update.

sketchupでruby その4

Posted at

概要

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

写真

cube.png

サンプルコード

def cube
   cube = Sketchup.active_model.definitions.add("Cube");
   unit = 10
   p = Array.new;
   p[0] = ORIGIN;
   p[1] = [unit, 0, 0];
   p[2] = [unit, unit, 0];
   p[3] = [0, unit, 0];
   face = cube.entities.add_face(p);
   face.reverse! if face.normal.z < 0;
   face.pushpull(unit);
   trans = Geom::Transformation.new([5, 5, 5]);
   Sketchup.active_model.active_entities.add_instance(cube, trans);
end


以上。

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