目次 blender 部品 2023 - zionad_mainのブログ
blender 使い方 目次 2023 - zionad_mainのブログ
円柱を作る
長さ 4
中心 000
半径 0.03
x軸
y軸
z軸
合計 3つの円柱を作る
import bpy
# Function to create a cylinder along the specified axis
def create_cylinder(axis, name):
bpy.ops.mesh.primitive_cylinder_add(vertices=32, radius=0.03, depth=4, location=(0, 0, 0))
cylinder = bpy.context.object
if axis == "x":
cylinder.rotation_euler = (1.5708, 0, 0) # 90 degrees in radians around X axis
elif axis == "y":
cylinder.rotation_euler = (0, 1.5708, 0) # 90 degrees in radians around Y axis
cylinder.name = name
# Create cylinders along each axis
create_cylinder("y", "名称X軸円柱")
create_cylinder("x", "名称y軸円柱")
create_cylinder("z", "Z軸円柱")