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?

windows11で、sketchup6 その79

Posted at

概要

windows11に、sketchup6を入れてみた。
rubyで、3Dを書く。
練習問題、やってみた。

練習問題

パイプを描く、rubyスクリプトを書け。

写真

image.png

サンプルコード

def create_pipe
	model = Sketchup.active_model
	entities = model.entities
	radius1 = 4
	radius2 = 8
	center = ORIGIN
	normal = Z_AXIS
	segments = 24
	edges1 = entities.add_circle(center, normal, radius1, segments)
	edges2 = entities.add_circle(center, normal, radius2, segments)
	faces1 = (entities.collect { |ent|
		ent if ent.is_a? Sketchup::Face
	}).compact
	edges1[0].find_faces
	faces2 = (entities.collect { |ent|
		ent if ent.is_a? Sketchup::Face
	}).compact
	edges2[0].find_faces
	face_to_remove = faces2 - faces1
	face_to_remove[0].erase!
	face = entities.grep(Sketchup::Face)[0]
	face.pushpull -40
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?