2023年3月27日月曜日

円柱から 円板を作る 素体

aaa





import bpy
import math
from math import radians

radius = 15
depth = 0
vertices = 60
zion_number = 15
zion_x = 30.0
zion_y = 0.0
zion_z = 0.0

disk_locations = [(zion_x, zion_y, zion_z)]
object_names = ['えんばん']
rotation_enabled = {'z': True, 'y': True}

object_names = 'cylinder'
z_rotation_enabled = {'cylinder': True}
y_rotation_enabled = {'cylinder': False}

for i, location in enumerate(disk_locations):
    x, y, z = location
    bpy.ops.mesh.primitive_cylinder_add(radius=radius, depth=depth, vertices=vertices, enter_editmode=False, align='WORLD', location=(x, y, z))
    cylinder = bpy.context.object
    cylinder.name = object_names
    cylinder.rotation_euler = (radians(90), radians(0), radians(0))

    if z_rotation_enabled[object_names]:
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.select_all(action='SELECT')
        bpy.ops.transform.rotate(value=radians(90), orient_axis='Z', orient_type='GLOBAL')
        bpy.ops.object.mode_set(mode='OBJECT')
    
    cylinder.rotation_euler.y = radians(90) if y_rotation_enabled[object_names] else radians(0)


































bbb

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

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