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 その12

Last updated at Posted at 2021-04-25

概要

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

練習問題

ドーナッツを描け。

写真

donut.png

サンプルコード

def donut
   model = Sketchup.active_model
   model.start_operation('Create Donut', true)
   group = model.active_entities.add_group
   num_segments = 24
   center_radius = 1.m
   thickness = 0.5.m
   origin = Geom::Point3d.new(0, center_radius, 0)
   circle = group.entities.add_circle(origin, X_AXIS, thickness, num_segments)
   face = group.entities.add_face(circle)
   path = group.entities.add_circle(ORIGIN, Z_AXIS, center_radius, num_segments)
   face.followme(path)
   model.commit_operation
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?