# Y=0 平面の円錐4つ Y軸 マイナス無限大を見る円錐
import bpy
import math
zion_collection_name = "床面カメラ 光時計筒"
# コレクションを作成する
col = bpy.data.collections.new(zion_collection_name)
bpy.context.scene.collection.children.link(col)
import bpy
from math import radians
# 回転させる軸を選択する
zion_xyz = 'zana'
# 円錐を作成する
bpy.ops.mesh.primitive_cone_add(radius1=1, radius2=0, depth=2)
# 円錐の位置を変更する
bpy.context.object.location[0] = 30.0 # X座標
bpy.context.object.location[1] = 0.0 # Y座標
bpy.context.object.location[2] = 30.0 # Z座標
if zion_xyz == 'xana':
# 軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(90)
bpy.context.object.rotation_euler[2] = radians(0)
# X軸方向に伸ばす
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 1
elif zion_xyz == 'yana':
# 軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(-90)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Y軸方向に伸ばす
bpy.context.object.scale[0] = 3
bpy.context.object.scale[1] = 3
bpy.context.object.scale[2] = 3
elif zion_xyz == 'zana':
# Z軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Z軸方向に伸ばす
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 10
else:
print('Invalid rotation axis selected.')
# 円錐を選択する
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]
# オブジェクトに名前を付ける
bpy.context.object.name = "Zion Cone"
import bpy
from math import radians
# 円錐を作成する
bpy.ops.mesh.primitive_cone_add(radius1=1, radius2=0, depth=2)
# 円錐の位置を変更する
bpy.context.object.location[0] = 2.0 # X座標
bpy.context.object.location[1] = 1.5 # Y座標
bpy.context.object.location[2] = 3.0 # Z座標
# 回転させる軸を選択する
zion_xyz = 'zana'
if zion_xyz == 'xana':
# 軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(90)
bpy.context.object.rotation_euler[2] = radians(0)
# X軸方向に伸ばす
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 1
elif zion_xyz == 'yana':
# 軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(90)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Y軸方向に伸ばす
bpy.context.object.scale[0] = 3
bpy.context.object.scale[1] = 3
bpy.context.object.scale[2] = 3
elif zion_xyz == 'zana':
# Z軸を中心に90度回転させる
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Z軸方向に伸ばす
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 10
else:
print('Invalid rotation axis selected.')
# 円錐を選択する
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]
bbb