https://shion-no-yahiro.com/boolean/
import bpy
from math import radians
# Create outer circle
bpy.ops.mesh.primitive_circle_add(radius=2, vertices=32)
# Create inner circle
bpy.ops.mesh.primitive_circle_add(radius=1, vertices=32)
# Select the inner circle
inner_circle = bpy.context.object
# Move the inner circle to the center of the outer circle
inner_circle.location = (0, 0, 0)
# Add boolean modifier to the outer circle
modifier = bpy.context.object.modifiers.new(name="Boolean", type="BOOLEAN")
modifier.object = inner_circle
modifier.operation = 'DIFFERENCE'
# Apply the modifier to make the outer circle hollow
bpy.ops.object.modifier_apply(modifier='Boolean')
# Select rotation axis
zion_xyz = 'zana'
if zion_xyz == 'yana':
# 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] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 1
elif zion_xyz == 'xana':
# 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] = 1
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(0)
# Scale along Z-axis
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 1
else:
print('Invalid rotation axis selected.')
# Select the outer circle
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]
bbb