```python
import bpy, math, random
from mathutils import Vector

# Clear scene
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
random.seed(11)

# Materials
def mat(name, color, rough=0.45, metallic=0.0, spec=0.35):
    m = bpy.data.materials.new(name)
    m.diffuse_color = (*color, 1)
    m.use_nodes = True
    bs = m.node_tree.nodes.get("Principled BSDF")
    bs.inputs["Base Color"].default_value = (*color, 1)
    bs.inputs["Roughness"].default_value = rough
    bs.inputs["Metallic"].default_value = metallic
    bs.inputs["Specular IOR Level"].default_value = spec
    return m

sand = mat("warm golden beach sand", (0.78,0.50,0.24), .82)
sand_dark = mat("damp sand paw marks", (0.42,0.22,0.10), .95)
tan = mat("corgi fox red coat", (0.72,0.25,0.075), .62)
tan_light = mat("sunlit orange fur", (0.92,0.42,0.12), .65)
white = mat("warm white fur", (0.95,0.88,0.70), .72)
black = mat("nose and eyes", (0.015,0.008,0.005), .22)
mouthmat = mat("mouth shadow", (0.10,0.008,0.006), .35)
pink = mat("happy tongue", (0.95,0.18,0.25), .4)
blue = mat("sky blue", (0.07,0.38,0.72), .3)
ball_red = mat("ball coral red", (0.95,0.045,0.035), .24, spec=.7)
ball_yellow = mat("ball sunny yellow", (1.0,0.66,0.03), .24, spec=.7)
ball_blue = mat("ball ocean blue", (0.03,0.28,0.9), .24, spec=.7)
ball_seam = mat("ball seams", (0.96,0.93,0.78), .32)
green = mat("towel turquoise", (0.02,0.56,0.49), .8)
towelstripe = mat("towel stripe", (0.95,0.82,0.25), .8)
bucketmat = mat("plastic bucket", (0.95,0.12,0.08), .3, spec=.65)
sandalmat = mat("rubber sandal", (0.04,0.22,0.26), .55)
sandgrain = mat("flying sand", (0.93,0.68,0.31), .9)

def smooth(obj):
    if hasattr(obj.data, "polygons"):
        for p in obj.data.polygons: p.use_smooth = True
    return obj

def uv(name, loc, scale, material, seg=32, rings=20):
    bpy.ops.mesh.primitive_uv_sphere_add(segments=seg, ring_count=rings, location=loc)
    o=bpy.context.object; o.name=name; o.scale=scale
    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
    o.data.materials.append(material); smooth(o)
    return o

def cyl_between(name, a, b, radius, material, verts=16):
    a,b=Vector(a),Vector(b); d=b-a
    mid=(a+b)/2
    bpy.ops.mesh.primitive_cylinder_add(vertices=verts, radius=radius, depth=d.length, location=mid)
    o=bpy.context.object; o.name=name
    o.rotation_mode='QUATERNION'; o.rotation_quaternion=d.to_track_quat('Z','Y')
    o.data.materials.append(material); smooth(o)
    return o

def cone_between(name,a,b,r1,r2,material):
    a,b=Vector(a),Vector(b); d=b-a
    bpy.ops.mesh.primitive_cone_add(vertices=16, radius1=r1, radius2=r2, depth=d.length, location=(a+b)/2)
    o=bpy.context.object; o.name=name; o.rotation_mode='QUATERNION'; o.rotation_quaternion=d.to_track_quat('Z','Y')
    o.data.materials.append(material); smooth(o); return o

# Beach
bpy.ops.mesh.primitive_plane_add(size=40, location=(0,0,0))
ground=bpy.context.object; ground.name="endless beach"; ground.data.materials.append(sand)
# subtle sea horizon plane
bpy.ops.mesh.primitive_plane_add(size=30, location=(5,5,1.3), rotation=(math.pi/2,0,0))
sea=bpy.context.object; sea.name="soft distant sea"; sea.data.materials.append(blue)

# Corgi body: low, long, organic
body=uv("long low corgi body",(-1.15,0,3.18),(1.62,.72,.78),tan)
uv("rounded white chest",(.15,-.01,3.17),(.78,.69,.72),white)
uv("white belly highlight",(-.55,-.03,2.78),(1.0,.62,.28),white)
uv("big round rear haunch",(-2.02,.02,3.24),(.82,.7,.88),tan_light)
# back saddle overlay
uv("red saddle volume",(-1.45,.01,3.62),(1.15,.68,.47),tan_light)

# neck/head and muzzle
uv("neck",(.15,0,3.65),(.55,.58,.78),tan)
head=uv("determined corgi head",(1.02,-.01,4.10),(.74,.56,.69),tan_light)
uv("white facial blaze",(1.10,-.54,4.20),(.24,.035,.54),white,24,16)
# muzzle projects forward (+x)
uv("foxlike muzzle",(1.55,-.02,3.96),(.58,.45,.38),white)
uv("black nose",(2.02,-.02,4.02),(.18,.30,.18),black)
# open mouth cavity and lower jaw
uv("open panting mouth",(1.72,-.03,3.72),(.38,.30,.20),mouthmat)
uv("lower white jaw",(1.70,-.03,3.76),(.38,.28,.12),white)
# eyes visible near camera side y=-
for y in (-.49,.31):
    uv("shiny determined eye",(1.32,y,4.32),(.105,.065,.105),black,20,12)
    uv("eye glint",(1.35,y-.055 if y<0 else y+.055,4.37),(.027,.018,.027),white,12,8)
# tongue hangs out
tongue=uv("floppy pink tongue",(1.69,-.38,3.51),(.18,.27,.40),pink)
tongue.rotation_euler[0]=-.35
# ears as triangular folded-back meshes
def ear(name, y):
    verts=[(.72,y,4.52),(1.02,y,5.40),(1.53,y,4.62),
           (.72,y-.07,4.52),(1.02,y-.07,5.40),(1.53,y-.07,4.62)]
    faces=[(0,1,2),(3,5,4),(0,3,4,1),(1,4,5,2),(2,5,3,0)]
    me=bpy.data.meshes.new(name); me.from_pydata(verts,[],faces); me.materials.append(tan); me.update()
    ob=bpy.data.objects.new(name,me); bpy.context.collection.objects.link(ob)
    return ob
ear("left giant folded triangular ear",-0.40)
ear("right giant folded triangular ear",0.34)
# inner ear triangles
uv("near ear inner",(1.08,-.45,4.91),(.09,.025,.30),pink)

# legs in launched pose: front reaching forward, hind trailing
# far legs first
for side,y in [("far",.34),("near",-.42)]:
    # front arm angled forward/down
    hip=(.45,y,3.12); elbow=(1.05,y,2.72); paw=(1.88,y,2.67)
    cyl_between(side+" front upper",hip,elbow,.22,tan)
    cyl_between(side+" front foreleg",elbow,paw,.17,white)
    uv(side+" outstretched front paw",paw,(.34,.22,.16),white)
    # rear leg kicked behind
    hip=(-1.75,y,3.05); knee=(-2.35,y,2.52); foot=(-2.85,y,2.36)
    cyl_between(side+" rear thigh",hip,knee,.29,tan_light)
    cyl_between(side+" rear shin",knee,foot,.18,white)
    uv(side+" trailing rear paw",foot,(.32,.22,.16),white)

# tail nub lifted
uv("short fluffy corgi tail",(-2.55,.05,3.62),(.42,.38,.38),white)
uv("tail tan base",(-2.45,.05,3.50),(.32,.32,.32),tan)

# Ball segmented sphere at muzzle height
bc=Vector((3.05,0,4.62)); R=.78
# wedge panels by longitude
cols=[ball_red,ball_yellow,ball_blue,ball_red,ball_yellow,ball_blue]
for j in range(6):
    a0=-math.pi+2*math.pi*j/6+.008
    a1=-math.pi+2*math.pi*(j+1)/6-.008
    verts=[]
    nlat=16; nlon=4
    for i in range(nlat+1):
        ph=-math.pi/2+math.pi*i/nlat
        for k in range(nlon+1):
            la=a0+(a1-a0)*k/nlon
            verts.append((bc.x+R*math.cos(ph)*math.cos(la),bc.y+R*math.cos(ph)*math.sin(la),bc.z+R*math.sin(ph)))
    faces=[]
    for i in range(nlat):
        for k in range(nlon):
            q=i*(nlon+1)+k; faces.append((q,q+1,q+nlon+2,q+nlon+1))
    me=bpy.data.meshes.new("panel"); me.from_pydata(verts,[],faces); me.materials.append(cols[j])
    ob=bpy.data.objects.new("saturated beach ball panel",me); bpy.context.collection.objects.link(ob); smooth(ob)
# meridian seam curves as slim cylinders
for j in range(6):
    la=-math.pi+2*math.pi*j/6
    cyl_between("visible ball panel seam",
        (bc.x+R*math.cos(la),bc.y+R*math.sin(la),bc.z-.01),
        (bc.x+R*math.cos(la),bc.y+R*math.sin(la),bc.z+0.01),.018,ball_seam)
# top cap and valve
uv("white ball pole cap",(bc.x,bc.y,bc.z+R+.015),(.17,.17,.07),ball_seam)
uv("tiny ball valve nub",(bc.x+.06,bc.y-.03,bc.z+R+.09),(.045,.045,.08),black)

# Sand burst at launch behind dog
launch=(-2.65,-.05,.18)
for i in range(22):
    ang=random.uniform(-1.0,1.0); dist=random.uniform(.25,1.25)
    x=launch[0]-dist*random.uniform(.3,1.0)
    y=launch[1]+random.uniform(-.55,.55)
    z=random.uniform(.18,.75)*(1-dist*.25)
    uv("airborne sand grain",(x,y,z),(random.uniform(.025,.07),)*3,sandgrain,10,8)
for dx,dy in [(-.25,-.35),(-.25,.35),(.1,-.22),(.1,.22)]:
    cone_between("spray of kicked sand",launch,(launch[0]+dx,launch[1]+dy,random.uniform(.7,1.25)),.10,.025,sandgrain)

# Paw prints trail approaching launch
for i in range(5):
    x=-5.0+i*.52
    for y in (-.34,.34):
        uv("paw print",(x,y,.025),(.18,.13,.025),sand_dark,16,8)
        for q in range(3):
            uv("toe mark",(x+.12,y+(-.12+q*.12),.03),(.045,.035,.018),sand_dark,12,8)

# towel lifted corner: mesh plane with one corner up
verts=[(-.8,-2.15,.04),(1.15,-2.15,.04),(1.15,-1.15,.04),(-.25,-1.15,.62)]
faces=[(0,1,2,3)]
me=bpy.data.meshes.new("windblown towel"); me.from_pydata(verts,[],faces); me.materials.append(green)
ob=bpy.data.objects.new("corner lifting beach towel",me); bpy.context.collection.objects.link(ob)
# towel stripe
cyl_between("towel yellow stripe",(-.15,-2.16,.05),(.05,-1.2,.43),.035,towelstripe)

# tipped bucket
bpy.ops.mesh.primitive_cone_add(vertices=24,radius1=.42,radius2=.32,depth=.62,location=(-.2,1.65,.36),rotation=(0.25,0.35,-.55))
bucket=bpy.context.object; bucket.name="tipped red plastic bucket"; bucket.data.materials.append(bucketmat); smooth(bucket)
# rim
bpy.ops.mesh.primitive_torus_add(major_radius=.32,minor_radius=.035,major_segments=24,location=(-.2,1.65,.68),rotation=(0.25,.35,-.55))
bpy.context.object.data.materials.append(bucketmat)

# tumbling sandal
sandal=uv("loose tumbling sandal",(-1.1,1.55,1.0),(.65,.25,.10),sandalmat)
sandal.rotation_euler=(.5,.35,.8)
cyl_between("sandal strap",(-1.35,1.55,1.08),(-.9,1.55,1.28),.06,sandalmat)

# Lighting/world
world=bpy.context.scene.world
world.use_nodes=True
world.node_tree.nodes["Background"].inputs["Color"].default_value=(0.055,0.18,0.38,1)
world.node_tree.nodes["Background"].inputs["Strength"].default_value=.35
bpy.ops.object.light_add(type='AREA', location=(-2,-6,10))
key=bpy.context.object; key.name="strong midday sun"; key.data.energy=1500; key.data.shape='DISK'; key.data.size=5
key.rotation_euler=(math.radians(22),0,math.radians(-18))
bpy.ops.object.light_add(type='SUN', location=(0,0,8))
sun=bpy.context.object; sun.data.energy=3.0; sun.rotation_euler=(math.radians(25),math.radians(-25),math.radians(-30))

# Camera low eye-level, diagonal action
bpy.ops.object.camera_add(location=(8,-15,6.3))
cam=bpy.context.object; cam.name="low action presentation camera"
def track(obj, point):
    obj.rotation_euler=(Vector(point)-obj.location).to_track_quat('-Z','Y').to_euler()
track(cam,(-.05,0,3.25))
cam.data.lens=52
bpy.context.scene.camera=cam

# Render/color settings
scene=bpy.context.scene
scene.render.engine='BLENDER_EEVEE_NEXT'
scene.render.resolution_x=1536; scene.render.resolution_y=1536; scene.render.resolution_percentage=100
scene.render.image_settings.file_format='PNG'
scene.render.film_transparent=False
scene.view_settings.look='AgX - Medium High Contrast'
# contact shadows via ambient world and high contrast
scene.render.filepath="/tmp/corgi_beach.png"
```