import bpy
# Parameters for the square
size = 10
y_pos = 10
# Create the square
vertices = [
(-size/2, y_pos, -size/2),
(-size/2, y_pos, size/2),
(size/2, y_pos, size/2),
(size/2, y_pos, -size/2)
]
faces = [(0, 1, 2, 3)]
# Create the mesh
mesh = bpy.data.meshes.new(name="SquareMesh")
mesh.from_pydata(vertices, [], faces)
# Create the object and link it to the scene
obj = bpy.data.objects.new("Square", mesh)
bpy.context.scene.collection.objects.link(obj)
あああああああああああああ