2023年3月24日金曜日

円柱 xyz

aaa





import bpy
from math import radians

# Create a cylinder
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=2)

# Select rotation axis
zion_xyz = 'zana'

if zion_xyz == 'xana':
    # Rotate 90 degrees around X-axis
    bpy.context.object.rotation_euler[0] = radians(90)
    bpy.context.object.rotation_euler[1] = radians(0)
    bpy.context.object.rotation_euler[2] = radians(0)
    # Scale along X-axis
    bpy.context.object.scale[0] = 3
    bpy.context.object.scale[1] = 1
    bpy.context.object.scale[2] = 1
    
elif zion_xyz == 'yana':
    # Rotate 90 degrees around Y-axis
    bpy.context.object.rotation_euler[0] = radians(0)
    bpy.context.object.rotation_euler[1] = radians(90)
    bpy.context.object.rotation_euler[2] = radians(0)
    # Scale along Y-axis
    bpy.context.object.scale[0] = 1
    bpy.context.object.scale[1] = 3
    bpy.context.object.scale[2] = 1
    
elif zion_xyz == 'zana':
    # Rotate 90 degrees around Z-axis
    bpy.context.object.rotation_euler[0] = radians(0)
    bpy.context.object.rotation_euler[1] = radians(0)
    bpy.context.object.rotation_euler[2] = radians(90)
    # Scale along Z-axis
    bpy.context.object.scale[0] = 1
    bpy.context.object.scale[1] = 1
    bpy.context.object.scale[2] = 10
    
else:
    print('Invalid rotation axis selected.')

# Select the cylinder
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]






import bpy
from math import radians

# Create a cylinder
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=2)

# Select rotation axis
zion_xyz = 'zana'

if zion_xyz == 'xana':
    # Rotate 90 degrees around X-axis
    bpy.context.object.rotation_euler[0] = radians(90)
    bpy.context.object.rotation_euler[1] = radians(0)
    bpy.context.object.rotation_euler[2] = radians(0)
    # Scale along X-axis
    bpy.context.object.scale[0] = 3
    bpy.context.object.scale[1] = 1
    bpy.context.object.scale[2] = 1
    
elif zion_xyz == 'yana':
    # Rotate 90 degrees around Y-axis
    bpy.context.object.rotation_euler[0] = radians(0)
    bpy.context.object.rotation_euler[1] = radians(90)
    bpy.context.object.rotation_euler[2] = radians(0)
    # Scale along Y-axis
    bpy.context.object.scale[0] = 1
    bpy.context.object.scale[1] = 3
    bpy.context.object.scale[2] = 1
    
elif zion_xyz == 'zana':
    # Rotate 90 degrees around Z-axis
    bpy.context.object.rotation_euler[0] = radians(0)
    bpy.context.object.rotation_euler[1] = radians(0)
    bpy.context.object.rotation_euler[2] = radians(90)
    # Scale along Z-axis
    bpy.context.object.scale[0] = 1
    bpy.context.object.scale[1] = 1
    bpy.context.object.scale[2] = 10
    
else:
    print('Invalid rotation axis selected.')

# Select the cylinder
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]




























bbb

連番 007 未来光円錐 過去光円錐 円周中心からの球体放出

aaa 参考 2023年3月26日日曜日 製作 002b 未来光円錐の方向 線路レールで https://ia2023sha.blogspot.com/2023/03/002b.html import bpy import math zion_co...