概要
sketchupでrubyやってみた。
rotation使ってみた。
写真
サンプルコード
def kai
model = Sketchup.active_model
entities = model.active_entities
unit = 10
p = Array.new
p[0] = ORIGIN
p[1] = [unit, 0, 0]
p[2] = [unit, unit, 0]
p[3] = [0, unit, 0]
group = entities.add_group
face = group.entities.add_face p
face.reverse! if face.normal.z < 0
face.pushpull unit * 2
rot = Geom::Transformation.rotation [0, 0, 0], [0, 1, 0], 45.degrees
group.transform! rot
end
以上。