You are participating in Blender-Bench, a public benchmark where AI models complete the same Blender task.

Your result will be compared head-to-head with another model. Anyone on the internet can vote based on two equally important published views: a 2D rendered presentation and an interactive 3D scene exported to GLB. Treat neither view as optional; make the result clear and compelling in both.

Complete the request as well as you can. The benchmark does not prescribe a workflow or visual style; use whichever Blender techniques you consider appropriate. Make the important requirements evident in the published result, save a complete scene, and present the work clearly in every requested output.

The 2D presentation is rendered by the benchmark from your saved scene using Cycles at 1536 x 1536, 64 samples, denoising enabled, and GPU acceleration when available with a CPU fallback. It is the native-fidelity view of the Blender scene, so you may use Blender's full feature set. Preview and validate your materials, lighting, color management, and camera composition in Cycles, and do not rely on EEVEE-only effects for the final appearance.

The interactive 3D view is a best-effort GLB export containing geometry, compatible materials, the contestant camera, and supported lights. Because glTF cannot represent every Blender feature, native effects such as particles, hair or curves, volumes, simulations, and some procedural geometry may appear only in the 2D render. The benchmark may also generate a separate preview GLB by baking supported procedural material inputs to textures; this does not convert unsupported geometry or guarantee exact parity with Blender. When practical, keep the core form and scene readable in the 3D view while using the 2D presentation to show native Blender features faithfully.

## Harness Instructions

You are writing a single Python script for Blender 5.1 using the bpy API. The scene starts empty. Your script must build everything the user's prompt asks for.

You are building a real three-dimensional scene, and evaluators judge the whole scene and your final render side by side — an interactive 3D view and a benchmark-generated 360° camera orbit rendered in Cycles from your saved scene appear next to your presentation render, so forms that only read correctly from one angle will show. Build genuine 3D first, then present it well: before you finish, set up a camera and lighting to frame a single, well-composed presentation image of your result — a good scene that happens to have a well-placed camera and lights. The final benchmark capture overrides the scene render settings and renders in Cycles at 1536x1536, 64 samples, with denoising and GPU acceleration (CPU fallback). Preview and validate materials, lighting, color management, and composition in Cycles; do not rely on EEVEE-only effects. Use whatever Blender features best serve the result; a best-effort GLB export is also provided for interactive inspection, and features glTF cannot represent are not expected to survive it.

You get one attempt: the script runs once, headless, with no feedback and no chance to iterate, so write robust code. Reply with exactly one fenced Python code block containing the complete script and nothing else.


## Task

Complete the following Blender task:

<task>

A desk-mounted robotic arm with at least four articulated joints, posed mid-reach toward a small object on the desk — not a generic industrial catalog robot, but a refined experimental machine built from a combination of precision mechanical assemblies and selectively generative structural elements.

The arm’s main load-bearing struts are topology-optimized: organic metal members with smooth branching transitions, controlled lattice openings, and carefully shaped voids where material has been removed according to structural load. These parametric forms should appear only on the elongated structural links between joints. They must not continue into the base, rotary joints, wrist, actuators, or end effector. Each optimized strut should feel like a purpose-grown structural component installed within an otherwise conventional mechanical system.

All joints and connection points should be clearly assembled engineering components: machined cylindrical housings, bearings, rotary actuators, bolted flanges, hinge pins, compact gearboxes, brackets, covers, and replaceable interface plates. The base should be a clean, stable mechanical assembly with a visible rotating platform and mounting hardware. Avoid ornamental latticework in these areas. The contrast between the organic optimized struts and the precise modular joint assemblies is the design centerpiece.

Remove exposed corrugated pipes, aged tubing, rust, corrosion, or distressed materials. Cable routing should be minimal and controlled, using slim black electrical lines, internal channels, recessed cable guides, or compact articulated conduits integrated close to the structure. Nothing should appear improvised, draped, weathered, or steampunk.

Instead of heavy woven fabric, use a very restrained translucent technical membrane only where useful. Thin semi-transparent polymer panels or tensioned mesh can span selected openings within the optimized struts, lightly revealing the structure beneath. The material should resemble clear reinforced film, translucent TPU, or fine architectural mesh rather than carbon fiber or ballistic cloth. It should feel protective and lightweight, not decorative. This membrane may also be omitted from some segments so the metal structure remains visually dominant.

The manipulator should not use a three-clawed radial gripper. Replace it with a compact two-finger parallel gripper or a refined adaptive pincer mechanism. The fingers should be mechanically designed from solid machined components with small replaceable contact pads, visible pivots, and believable actuation. Do not use topology-optimized lattice geometry on the fingers. The end effector should look precise, stable, and suitable for picking up small desk objects rather than aggressive or creature-like.

The mechanics must remain fully believable: visible rotational axes at every joint, plausible actuator placement, clear mechanical interfaces between segments, realistic joint limits, and sensible tapering from the heavy base to the smaller wrist and gripper. The pose must respect the joint layout, with no intersecting parts, impossible bends, unsupported structures, or decorative mechanisms that do not explain their function.

Present the arm in a clean contemporary design studio or robotics lab, reaching toward a small machined object on a desk. Use premium product-design lighting, a neutral background, crisp material separation, and enough detail to show how the arm is assembled. The final design should feel like a functional research prototype combining generative engineering with disciplined industrial design.

</task>


[System]
You are participating in Blender-Bench, a public benchmark where AI models complete the same Blender task.

Your result will be compared head-to-head with another model. Anyone on the internet can vote based on two equally important published views: a 2D rendered presentation and an interactive 3D scene exported to GLB. Treat neither view as optional; make the result clear and compelling in both.

Complete the request as well as you can. The benchmark does not prescribe a workflow or visual style; use whichever Blender techniques you consider appropriate. Make the important requirements evident in the published result, save a complete scene, and present the work clearly in every requested output.

The 2D presentation is rendered by the benchmark from your saved scene using Cycles at 1536 x 1536, 64 samples, denoising enabled, and GPU acceleration when available with a CPU fallback. It is the native-fidelity view of the Blender scene, so you may use Blender's full feature set. Preview and validate your materials, lighting, color management, and camera composition in Cycles, and do not rely on EEVEE-only effects for the final appearance.

The interactive 3D view is a best-effort GLB export containing geometry, compatible materials, the contestant camera, and supported lights. Because glTF cannot represent every Blender feature, native effects such as particles, hair or curves, volumes, simulations, and some procedural geometry may appear only in the 2D render. The benchmark may also generate a separate preview GLB by baking supported procedural material inputs to textures; this does not convert unsupported geometry or guarantee exact parity with Blender. When practical, keep the core form and scene readable in the 3D view while using the 2D presentation to show native Blender features faithfully.

## Harness Instructions

You are writing a single Python script for Blender 5.1 using the bpy API. The scene starts empty. Your script must build everything the user's prompt asks for.

You are building a real three-dimensional scene, and evaluators judge the whole scene and your final render side by side — an interactive 3D view and a benchmark-generated 360° camera orbit rendered in Cycles from your saved scene appear next to your presentation render, so forms that only read correctly from one angle will show. Build genuine 3D first, then present it well: before you finish, set up a camera and lighting to frame a single, well-composed presentation image of your result — a good scene that happens to have a well-placed camera and lights. The final benchmark capture overrides the scene render settings and renders in Cycles at 1536x1536, 64 samples, with denoising and GPU acceleration (CPU fallback). Preview and validate materials, lighting, color management, and composition in Cycles; do not rely on EEVEE-only effects. Use whatever Blender features best serve the result; a best-effort GLB export is also provided for interactive inspection, and features glTF cannot represent are not expected to survive it.

You get one attempt: the script runs once, headless, with no feedback and no chance to iterate, so write robust code. Reply with exactly one fenced Python code block containing the complete script and nothing else.

[User]
## Task

Complete the following Blender task:

<task>

A desk-mounted robotic arm with at least four articulated joints, posed mid-reach toward a small object on the desk — not a generic industrial catalog robot, but a refined experimental machine built from a combination of precision mechanical assemblies and selectively generative structural elements.

The arm’s main load-bearing struts are topology-optimized: organic metal members with smooth branching transitions, controlled lattice openings, and carefully shaped voids where material has been removed according to structural load. These parametric forms should appear only on the elongated structural links between joints. They must not continue into the base, rotary joints, wrist, actuators, or end effector. Each optimized strut should feel like a purpose-grown structural component installed within an otherwise conventional mechanical system.

All joints and connection points should be clearly assembled engineering components: machined cylindrical housings, bearings, rotary actuators, bolted flanges, hinge pins, compact gearboxes, brackets, covers, and replaceable interface plates. The base should be a clean, stable mechanical assembly with a visible rotating platform and mounting hardware. Avoid ornamental latticework in these areas. The contrast between the organic optimized struts and the precise modular joint assemblies is the design centerpiece.

Remove exposed corrugated pipes, aged tubing, rust, corrosion, or distressed materials. Cable routing should be minimal and controlled, using slim black electrical lines, internal channels, recessed cable guides, or compact articulated conduits integrated close to the structure. Nothing should appear improvised, draped, weathered, or steampunk.

Instead of heavy woven fabric, use a very restrained translucent technical membrane only where useful. Thin semi-transparent polymer panels or tensioned mesh can span selected openings within the optimized struts, lightly revealing the structure beneath. The material should resemble clear reinforced film, translucent TPU, or fine architectural mesh rather than carbon fiber or ballistic cloth. It should feel protective and lightweight, not decorative. This membrane may also be omitted from some segments so the metal structure remains visually dominant.

The manipulator should not use a three-clawed radial gripper. Replace it with a compact two-finger parallel gripper or a refined adaptive pincer mechanism. The fingers should be mechanically designed from solid machined components with small replaceable contact pads, visible pivots, and believable actuation. Do not use topology-optimized lattice geometry on the fingers. The end effector should look precise, stable, and suitable for picking up small desk objects rather than aggressive or creature-like.

The mechanics must remain fully believable: visible rotational axes at every joint, plausible actuator placement, clear mechanical interfaces between segments, realistic joint limits, and sensible tapering from the heavy base to the smaller wrist and gripper. The pose must respect the joint layout, with no intersecting parts, impossible bends, unsupported structures, or decorative mechanisms that do not explain their function.

Present the arm in a clean contemporary design studio or robotics lab, reaching toward a small machined object on a desk. Use premium product-design lighting, a neutral background, crisp material separation, and enough detail to show how the arm is assembled. The final design should feel like a functional research prototype combining generative engineering with disciplined industrial design.

</task>

[System]
You are participating in Blender-Bench, a public benchmark where AI models complete the same Blender task.

Your result will be compared head-to-head with another model. Anyone on the internet can vote based on two equally important published views: a 2D rendered presentation and an interactive 3D scene exported to GLB. Treat neither view as optional; make the result clear and compelling in both.

Complete the request as well as you can. The benchmark does not prescribe a workflow or visual style; use whichever Blender techniques you consider appropriate. Make the important requirements evident in the published result, save a complete scene, and present the work clearly in every requested output.

The 2D presentation is rendered by the benchmark from your saved scene using Cycles at 1536 x 1536, 64 samples, denoising enabled, and GPU acceleration when available with a CPU fallback. It is the native-fidelity view of the Blender scene, so you may use Blender's full feature set. Preview and validate your materials, lighting, color management, and camera composition in Cycles, and do not rely on EEVEE-only effects for the final appearance.

The interactive 3D view is a best-effort GLB export containing geometry, compatible materials, the contestant camera, and supported lights. Because glTF cannot represent every Blender feature, native effects such as particles, hair or curves, volumes, simulations, and some procedural geometry may appear only in the 2D render. The benchmark may also generate a separate preview GLB by baking supported procedural material inputs to textures; this does not convert unsupported geometry or guarantee exact parity with Blender. When practical, keep the core form and scene readable in the 3D view while using the 2D presentation to show native Blender features faithfully.

## Harness Instructions

You are writing a single Python script for Blender 5.1 using the bpy API. The scene starts empty. Your script must build everything the user's prompt asks for.

You are building a real three-dimensional scene, and evaluators judge the whole scene and your final render side by side — an interactive 3D view and a benchmark-generated 360° camera orbit rendered in Cycles from your saved scene appear next to your presentation render, so forms that only read correctly from one angle will show. Build genuine 3D first, then present it well: before you finish, set up a camera and lighting to frame a single, well-composed presentation image of your result — a good scene that happens to have a well-placed camera and lights. The final benchmark capture overrides the scene render settings and renders in Cycles at 1536x1536, 64 samples, with denoising and GPU acceleration (CPU fallback). Preview and validate materials, lighting, color management, and composition in Cycles; do not rely on EEVEE-only effects. Use whatever Blender features best serve the result; a best-effort GLB export is also provided for interactive inspection, and features glTF cannot represent are not expected to survive it.

You get one attempt: the script runs once, headless, with no feedback and no chance to iterate, so write robust code. Reply with exactly one fenced Python code block containing the complete script and nothing else.

[User]
## Task

Complete the following Blender task:

<task>

A desk-mounted robotic arm with at least four articulated joints, posed mid-reach toward a small object on the desk — not a generic industrial catalog robot, but a refined experimental machine built from a combination of precision mechanical assemblies and selectively generative structural elements.

The arm’s main load-bearing struts are topology-optimized: organic metal members with smooth branching transitions, controlled lattice openings, and carefully shaped voids where material has been removed according to structural load. These parametric forms should appear only on the elongated structural links between joints. They must not continue into the base, rotary joints, wrist, actuators, or end effector. Each optimized strut should feel like a purpose-grown structural component installed within an otherwise conventional mechanical system.

All joints and connection points should be clearly assembled engineering components: machined cylindrical housings, bearings, rotary actuators, bolted flanges, hinge pins, compact gearboxes, brackets, covers, and replaceable interface plates. The base should be a clean, stable mechanical assembly with a visible rotating platform and mounting hardware. Avoid ornamental latticework in these areas. The contrast between the organic optimized struts and the precise modular joint assemblies is the design centerpiece.

Remove exposed corrugated pipes, aged tubing, rust, corrosion, or distressed materials. Cable routing should be minimal and controlled, using slim black electrical lines, internal channels, recessed cable guides, or compact articulated conduits integrated close to the structure. Nothing should appear improvised, draped, weathered, or steampunk.

Instead of heavy woven fabric, use a very restrained translucent technical membrane only where useful. Thin semi-transparent polymer panels or tensioned mesh can span selected openings within the optimized struts, lightly revealing the structure beneath. The material should resemble clear reinforced film, translucent TPU, or fine architectural mesh rather than carbon fiber or ballistic cloth. It should feel protective and lightweight, not decorative. This membrane may also be omitted from some segments so the metal structure remains visually dominant.

The manipulator should not use a three-clawed radial gripper. Replace it with a compact two-finger parallel gripper or a refined adaptive pincer mechanism. The fingers should be mechanically designed from solid machined components with small replaceable contact pads, visible pivots, and believable actuation. Do not use topology-optimized lattice geometry on the fingers. The end effector should look precise, stable, and suitable for picking up small desk objects rather than aggressive or creature-like.

The mechanics must remain fully believable: visible rotational axes at every joint, plausible actuator placement, clear mechanical interfaces between segments, realistic joint limits, and sensible tapering from the heavy base to the smaller wrist and gripper. The pose must respect the joint layout, with no intersecting parts, impossible bends, unsupported structures, or decorative mechanisms that do not explain their function.

Present the arm in a clean contemporary design studio or robotics lab, reaching toward a small machined object on a desk. Use premium product-design lighting, a neutral background, crisp material separation, and enough detail to show how the arm is assembled. The final design should feel like a functional research prototype combining generative engineering with disciplined industrial design.

</task>

payment=(self "https://checkout.stripe.com" "https://connect-js.stripe.com" "https://js.stripe.com" "https://*.js.stripe.com" "https://hooks.stripe.com")

{"id":"gen-1784307358-WTXBFnyLPby1UF0aLwQD","object":"chat.completion","created":1784307358,"model":"openai/gpt-5.6-luna","provider":"OpenAI","system_fingerprint":null,"service_tier":"default","choices":[{"index":0,"logprobs":null,"finish_reason":"stop","native_finish_reason":"completed","message":{"role":"assistant","content":"```python\nimport bpy, math\nfrom mathutils import Vector\nfrom math import sin, cos, pi\n\n# ------------------------------------------------------------\n# Clean scene\n# ------------------------------------------------------------\nbpy.ops.object.select_all(action='SELECT')\nbpy.ops.object.delete(use_global=False)\nfor datablocks in (bpy.data.meshes, bpy.data.curves, bpy.data.materials, bpy.data.cameras, bpy.data.lights):\n    pass\n\n# ------------------------------------------------------------\n# Materials\n# ------------------------------------------------------------\ndef mat(name, color, metallic=0.0, rough=0.4, transmission=0.0, alpha=1.0):\n    m = bpy.data.materials.new(name)\n    m.diffuse_color = (*color, alpha)\n    m.use_nodes = True\n    bs = m.node_tree.nodes.get(\"Principled BSDF\")\n    bs.inputs[\"Base Color\"].default_value = (*color, 1)\n    bs.inputs[\"Metallic\"].default_value = metallic\n    bs.inputs[\"Roughness\"].default_value = rough\n    if \"Transmission Weight\" in bs.inputs:\n        bs.inputs[\"Transmission Weight\"].default_value = transmission\n    if \"Coat Weight\" in bs.inputs:\n        bs.inputs[\"Coat Weight\"].default_value = 0.25\n    if alpha < 1:\n        bs.inputs[\"Alpha\"].default_value = alpha\n        m.surface_render_method = 'DITHERED'\n    return m\n\nmat_desk = mat(\"Warm neutral studio desk\", (0.16,0.18,0.20), 0.0, 0.28)\nmat_edge = mat(\"Desk edge\", (0.055,0.065,0.075), 0.25, 0.25)\nmat_titanium = mat(\"Brushed titanium struts\", (0.30,0.43,0.48), 0.82, 0.22)\nmat_titanium2 = mat(\"Machined light titanium\", (0.58,0.68,0.69), 0.88, 0.18)\nmat_dark = mat(\"Actuator graphite\", (0.025,0.035,0.045), 0.82, 0.2)\nmat_black = mat(\"Controlled cable\", (0.008,0.012,0.016), 0.15, 0.25)\nmat_blue = mat(\"Interface blue\", (0.035,0.22,0.34), 0.65, 0.23)\nmat_orange = mat(\"Replaceable contact pads\", (0.9,0.28,0.045), 0.45, 0.25)\nmat_object = mat(\"Test object anodized brass\", (0.55,0.22,0.055), 0.82, 0.2)\nmat_membrane = mat(\"Restrained technical membrane\", (0.20,0.65,0.72), 0.05, 0.18, 0.35, 0.32)\nmat_white = mat(\"Marking\", (0.75,0.82,0.83), 0.1, 0.3)\n\n# ------------------------------------------------------------\n# Helpers\n# ------------------------------------------------------------\ndef assign(obj, material):\n    if obj and material:\n        obj.data.materials.append(material)\n    return obj\n\ndef bevel(obj, amount=0.04, segments=3):\n    mod = obj.modifiers.new(\"Precision edge radii\", 'BEVEL')\n    mod.width = amount\n    mod.segments = segments\n    return obj\n\ndef cube(name, loc, scale, material, bevel_amt=0.03, rot=None):\n    bpy.ops.mesh.primitive_cube_add(size=1, location=loc)\n    o = bpy.context.object\n    o.name = name\n    o.dimensions = scale\n    if rot:\n        o.rotation_euler = rot\n    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)\n    assign(o, material)\n    if bevel_amt:\n        bevel(o, bevel_amt)\n    return o\n\ndef cyl(name, loc, radius, depth, material, axis='Z', vertices=48, bevel_amt=0.025):\n    bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, radius=radius, depth=depth, location=loc)\n    o = bpy.context.object\n    o.name = name\n    if axis == 'Y':\n        o.rotation_euler[0] = pi/2\n    elif axis == 'X':\n        o.rotation_euler[1] = pi/2\n    assign(o, material)\n    if bevel_amt:\n        bevel(o, bevel_amt, 3)\n    return o\n\ndef beam(name, a, b, radius, material, vertices=16):\n    a, b = Vector(a), Vector(b)\n    d = b-a\n    mid = (a+b)/2\n    bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, radius=radius, depth=d.length, location=mid)\n    o = bpy.context.object\n    o.name = name\n    o.rotation_mode = 'QUATERNION'\n    o.rotation_quaternion = d.to_track_quat('Z','Y')\n    assign(o, material)\n    bevel(o, radius*0.35, 2)\n    return o\n\ndef cable(name, points, material, radius=0.018):\n    cu = bpy.data.curves.new(name, 'CURVE')\n    cu.dimensions = '3D'\n    cu.resolution_u = 2\n    cu.bevel_depth = radius\n    cu.bevel_resolution = 3\n    spl = cu.splines.new('BEZIER')\n    spl.bezier_points.add(len(points)-1)\n    for p, co in zip(spl.bezier_points, points):\n        p.co = co\n        p.handle_left_type = 'AUTO'\n        p.handle_right_type = 'AUTO'\n    ob = bpy.data.objects.new(name, cu)\n    bpy.context.collection.objects.link(ob)\n    assign(ob, material)\n    return ob\n\ndef torus(name, loc, major, minor, material):\n    bpy.ops.mesh.primitive_torus_add(major_radius=major, minor_radius=minor, major_segments=48, minor_segments=12, location=loc, rotation=(pi/2,0,0))\n    o=bpy.context.object\n    o.name=name\n    assign(o, material)\n    return o\n\ndef joint(name, p, radius):\n    # Main rotary housing, axis through the page\n    cyl(name+\" housing\", p, radius, 0.34, mat_dark, 'Y', 64, 0.025)\n    cyl(name+\" silver flange\", (p[0],p[1]-0.19,p[2]), radius*0.78, 0.075, mat_titanium2, 'Y', 48, 0.015)\n    cyl(name+\" blue bearing face\", (p[0],p[1]-0.235,p[2]), radius*0.43, 0.035, mat_blue, 'Y', 48, 0.01)\n    torus(name+\" bearing ring\", (p[0],p[1]-0.255,p[2]), radius*0.52, 0.025, mat_titanium2)\n    for i in range(6):\n        ang=2*pi*i/6\n        bx=p[0]+cos(ang)*radius*0.68\n        bz=p[2]+sin(ang)*radius*0.68\n        cyl(name+\" flange bolt\", (bx,p[1]-0.28,bz), 0.027, 0.055, mat_titanium2, 'Y', 20, 0.006)\n\n# ------------------------------------------------------------\n# Desk and studio environment\n# ------------------------------------------------------------\ncube(\"Desk top\", (1.1,0,0.18), (5.8,3.0,0.36), mat_desk, 0.08)\ncube(\"Desk front fascia\", (1.1,-1.48,-0.18), (5.8,0.12,0.55), mat_edge, 0.025)\ncube(\"Rear studio wall\", (1.1,1.55,2.4), (5.8,0.12,4.8), mat_edge, 0.02)\n\n# ------------------------------------------------------------\n# Base mechanical assembly\n# ------------------------------------------------------------\nbase=(0,0,0.48)\ncyl(\"Base pedestal\", base, 0.56, 0.50, mat_dark, 'Z', 64, 0.04)\ncyl(\"Base lower foot\", (0,0,0.27), 0.73, 0.16, mat_titanium2, 'Z', 64, 0.03)\ncyl(\"Rotating platform\", (0,0,0.77), 0.48, 0.18, mat_blue, 'Z', 64, 0.025)\ncyl(\"Platform cap\", (0,0,0.89), 0.35, 0.10, mat_titanium2, 'Z', 64, 0.02)\nfor i in range(8):\n    ang=2*pi*i/8\n    cyl(\"Base mounting bolt\", (cos(ang)*0.58, sin(ang)*0.58, 0.39), 0.045, 0.08, mat_titanium2, 'Z', 20, 0.008)\n\n# upright shoulder bracket\ncube(\"Left shoulder bracket\", (-0.24,0,1.15), (0.18,0.55,0.62), mat_dark, 0.04)\ncube(\"Right shoulder bracket\", (0.24,0,1.15), (0.18,0.55,0.62), mat_dark, 0.04)\n\n# ------------------------------------------------------------\n# Posed articulated arm\n# ------------------------------------------------------------\np0=(0,0,1.02)\np1=(0.18,0,1.92)\np2=(1.22,0,1.64)\np3=(1.83,0,1.08)\np4=(2.20,0,0.78)\n\njoint(\"Shoulder joint\", p0, 0.30)\njoint(\"Elbow joint\", p1, 0.25)\njoint(\"Wrist joint\", p2, 0.20)\njoint(\"Tool rotary joint\", p3, 0.155)\n\n# actuator pods near joints, conventional and compact\ncube(\"Shoulder servo pod\", (-0.17,-0.02,1.48), (0.34,0.42,0.30), mat_dark, 0.055, (0,0.14,0))\ncube(\"Elbow servo pod\", (0.70,-0.02,1.83), (0.42,0.36,0.25), mat_dark, 0.045, (0,-0.18,0))\ncube(\"Wrist gearbox\", (1.52,-0.01,1.38), (0.30,0.32,0.22), mat_dark, 0.035, (0,0.35,0))\n\n# Topology-optimized style open structural link with controlled void\ndef optimized_link(name, a, b, width, color=mat_titanium):\n    a,b=Vector(a),Vector(b)\n    d=b-a\n    # perpendicular in XZ plane\n    perp=Vector((-d.z,0,d.x)).normalized()\n    # two smooth load paths, leaving a large central opening\n    aa=a+perp*width\n    ab=b+perp*(width*0.72)\n    ba=a-perp*width\n    bb=b-perp*(width*0.72)\n    beam(name+\" upper load path\", aa, ab, 0.105, color)\n    beam(name+\" lower load path\", ba, bb, 0.105, color)\n    # forked transitions near each joint\n    beam(name+\" upper root branch\", a+perp*0.10, aa, 0.085, color)\n    beam(name+\" lower root branch\", a-perp*0.10, ba, 0.085, color)\n    beam(name+\" upper terminal branch\", ab, b+perp*0.08, 0.075, color)\n    beam(name+\" lower terminal branch\", bb, b-perp*0.08, 0.075, color)\n    # sparse diagonal load ribs, not a full lattice\n    mid=(a+b)*0.5\n    beam(name+\" diagonal rib A\", aa, mid-perp*0.35, 0.055, color)\n    beam(name+\" diagonal rib B\", ba, mid+perp*0.35, 0.055, color)\n    # rounded node transitions\n    for q in (aa,ba,ab,bb):\n        bpy.ops.mesh.primitive_uv_sphere_add(segments=24, ring_count=12, radius=0.115, location=q)\n        s=bpy.context.object\n        s.name=name+\" organic transition node\"\n        assign(s,color)\n    # restrained membrane spanning only one opening\n    verts=[tuple(aa+Vector((0,-0.025,0))), tuple(ab+Vector((0,-0.025,0))),\n           tuple(bb+Vector((0,-0.025,0))), tuple(ba+Vector((0,-0.025,0)))]\n    mesh=bpy.data.meshes.new(name+\" membrane mesh\")\n    mesh.from_pydata(verts,[],[(0,1,2,3)])\n    mesh.update()\n    ob=bpy.data.objects.new(name+\" translucent structural membrane\",mesh)\n    bpy.context.collection.objects.link(ob)\n    assign(ob,mat_membrane)\n\noptimized_link(\"Optimized upper strut\", p0, p1, 0.19, mat_titanium)\noptimized_link(\"Optimized forearm strut\", p1, p2, 0.16, mat_titanium)\noptimized_link(\"Optimized wrist strut\", p2, p3, 0.115, mat_titanium2)\n\n# controlled internal cable routing\ncable(\"Shoulder cable\", [(-0.08,-0.25,1.13),(0.15,-0.25,1.48),(0.24,-0.25,1.83)], mat_black, 0.018)\ncable(\"Forearm cable\", [(0.28,-0.22,1.78),(0.78,-0.22,1.70),(1.25,-0.22,1.55)], mat_black, 0.016)\ncable(\"Wrist cable\", [(1.30,-0.20,1.55),(1.60,-0.20,1.32),(1.80,-0.20,1.13)], mat_black, 0.014)\n\n# ------------------------------------------------------------\n# Compact two-finger parallel gripper\n# ------------------------------------------------------------\n# wrist interface and palm\ncyl(\"End effector interface\", p4, 0.145, 0.20, mat_titanium2, 'X', 48, 0.018)\ncube(\"Gripper palm\", (2.28,0,0.78), (0.20,0.54,0.26), mat_dark, 0.04)\ncyl(\"Gripper drive spindle\", (2.32,0,0.78), 0.055, 0.58, mat_titanium2, 'Y', 32, 0.01)\n\n# two solid parallel fingers, separated in Y\nfor side in (-1,1):\n    y=side*0.19\n    cube(\"Parallel finger \"+str(side), (2.49,y,0.63), (0.48,0.12,0.16), mat_titanium2, 0.025)\n    cube(\"Replaceable contact pad \"+str(side), (2.75,y,0.60), (0.09,0.14,0.18), mat_orange, 0.018)\n    cyl(\"Finger pivot \"+str(side), (2.37,y,0.78), 0.055, 0.13, mat_blue, 'Y', 32, 0.008)\n# small visible actuator linkages\nbeam(\"Left gripper linkage\", (2.34,-0.18,0.78), (2.48,-0.19,0.70), 0.035, mat_dark)\nbeam(\"Right gripper linkage\", (2.34,0.18,0.78), (2.48,0.19,0.70), 0.035, mat_dark)\n\n# ------------------------------------------------------------\n# Small machined desk object being approached\n# ------------------------------------------------------------\ncyl(\"Small test object body\", (2.91,0.02,0.56), 0.16, 0.26, mat_object, 'Z', 48, 0.025)\ncyl(\"Small test object top\", (2.91,0.02,0.71), 0.115, 0.055, mat_titanium2, 'Z', 48, 0.012)\ncyl(\"Object top marker\", (2.91,0.02,0.748), 0.032, 0.018, mat_blue, 'Z', 32, 0.006)\n# small alignment plate beneath object\ncube(\"Object alignment plate\", (2.91,0.02,0.405), (0.55,0.50,0.035), mat_edge, 0.012)\n\n# subtle engraved-style design plaque\ncube(\"Design plaque\", (0.15,-1.12,0.38), (1.0,0.42,0.025), mat_dark, 0.008)\n# text\nfont_curve=bpy.data.curves.new(\"Prototype label\", type='FONT')\nfont_curve.body=\"O-04  /  STRUCTURAL RESEARCH\"\nfont_curve.align_x='CENTER'\nfont_curve.size=0.075\nfont_curve.extrude=0.002\ntext=bpy.data.objects.new(\"Prototype label\",font_curve)\nbpy.context.collection.objects.link(text)\ntext.location=(0.15,-1.335,0.405)\ntext.rotation_euler=(0,0,0)\nassign(text,mat_white)\n\n# ------------------------------------------------------------\n# Lighting and camera\n# ------------------------------------------------------------\nworld=bpy.context.scene.world\nworld.use_nodes=True\nworld.node_tree.nodes[\"Background\"].inputs[\"Color\"].default_value=(0.035,0.045,0.06,1)\nworld.node_tree.nodes[\"Background\"].inputs[\"Strength\"].default_value=0.32\n\ndef area(name, loc, energy, size, color):\n    data=bpy.data.lights.new(name,'AREA')\n    data.energy=energy\n    data.shape='DISK'\n    data.size=size\n    data.color=color\n    ob=bpy.data.objects.new(name,data)\n    bpy.context.collection.objects.link(ob)\n    ob.location=loc\n    return ob\n\nkey=area(\"Large softbox\", (1.0,-3.5,4.8), 1050, 4.0, (0.82,0.92,1.0))\nkey.rotation_euler=(math.radians(28),0,math.radians(12))\nfill=area(\"Cool rim light\", (3.8,1.5,3.0), 900, 3.0, (0.35,0.58,1.0))\nfill.rotation_euler=(math.radians(55),0,math.radians(150))\nwarm=area(\"Warm precision fill\", (-2.2,-1.5,2.0), 650, 2.3, (1.0,0.58,0.32))\nwarm.rotation_euler=(math.radians(70),0,math.radians(-45))\n\n# camera\ncam_data=bpy.data.cameras.new(\"Presentation camera\")\ncam=bpy.data.objects.new(\"Presentation camera\",cam_data)\nbpy.context.collection.objects.link(cam)\ncam.location=(4.35,-6.2,3.25)\ntarget=Vector((1.28,0,1.20))\ncam.rotation_euler=(target-Vector(cam.location)).to_track_quat('-Z','Y').to_euler()\ncam_data.lens=54\ncam_data.sensor_width=36\nbpy.context.scene.camera=cam\n\n# ------------------------------------------------------------\n# Render settings\n# ------------------------------------------------------------\nscene=bpy.context.scene\nscene.render.engine='BLENDER_EEVEE_NEXT'\nscene.render.resolution_x=1536\nscene.render.resolution_y=1536\nscene.render.resolution_percentage=100\nscene.render.image_settings.file_format='PNG'\nscene.render.film_transparent=False\nscene.render.filepath=\"/tmp/robotic_arm_presentation.png\"\nscene.view_settings.look='AgX - Medium High Contrast'\nscene.render.image_settings.color_mode='RGBA'\n\n# Ground contact shadows and organized naming\nscene.render.use_file_extension=True\n\n# Save\nbpy.ops.wm.save_as_mainfile(filepath=\"/tmp/experimental_robotic_arm.blend\")\n```","refusal":null,"reasoning":"**Planning Blender Script**\n\nI need to craft a specific script to build a scene in Blender with organic branching structures and meshes. This requires using robust Python scripting alongside Blender’s bpy library, involving cubes, cylinders, bevels, and materials. I'm considering the camera placement and need to create articulated arms with at least four joints for movement. The links should look organic with optimized structures—a combination of beams and tapered shapes with specific color schemes. Avoiding lattice joints is key for a more natural look.**Defining Arm Movement**\n\nI’m establishing connections for the robotic arm with link A from shoulder to elbow, link B from elbow to wrist, and a shorter link C from wrist to the tool. The arm needs to pose toward the object on the desk, which has specific coordinates. I need to set the desk height and make sure the camera view is positioned correctly. I’ll build the arm in the x-z plane with proper orientations for the cylinders and joints, ensuring everything is aligned correctly for movement.**Designing Organic Links**\n\nI'm thinking about how to create an organic link structure between points A and B. It involves having two side rails positioned perpendicularly in the xz plane. I want to ensure that they are offset from the main vector in the xz direction while keeping them slightly adjusted along the y-axis. This design aim should help create a more dynamic and functional connection between the two points, enhancing the overall structure of the arm.","reasoning_details":[{"type":"reasoning.summary","summary":"**Planning Blender Script**\n\nI need to craft a specific script to build a scene in Blender with organic branching structures and meshes. This requires using robust Python scripting alongside Blender’s bpy library, involving cubes, cylinders, bevels, and materials. I'm considering the camera placement and need to create articulated arms with at least four joints for movement. The links should look organic with optimized structures—a combination of beams and tapered shapes with specific color schemes. Avoiding lattice joints is key for a more natural look.**Defining Arm Movement**\n\nI’m establishing connections for the robotic arm with link A from shoulder to elbow, link B from elbow to wrist, and a shorter link C from wrist to the tool. The arm needs to pose toward the object on the desk, which has specific coordinates. I need to set the desk height and make sure the camera view is positioned correctly. I’ll build the arm in the x-z plane with proper orientations for the cylinders and joints, ensuring everything is aligned correctly for movement.**Designing Organic Links**\n\nI'm thinking about how to create an organic link structure between points A and B. It involves having two side rails positioned perpendicularly in the xz plane. I want to ensure that they are offset from the main vector in the xz direction while keeping them slightly adjusted along the y-axis. This design aim should help create a more dynamic and functional connection between the two points, enhancing the overall structure of the arm.","format":"openai-responses-v1","index":0},{"type":"reasoning.encrypted","data":"gAAAAABqWl6nd866D7C6qAEUIIYPZxqlkFkVbLdyfrjfTXd6B96XQObD5IDVDIP1R45M3kP5-3sbJEcVvwjwBhjC9J_4GPxgwZgdJ55JCjiQTkY2rsCmQfsy0RKq1EUoYUqtrnkmYWYDH1CEhaR9kaFgk_p4DJHa7_p1EsyWuFokWFh66CbtTitx4vw8ai6kVbPD_u_oFlvv1PuhVVVSPZMMg04_mJeLa8UTLIJfixp0Z6L0kOy1CuK_J0lI9UO_4OMIZ3F56AjUXTOwBd92rI6_xk6zSZRp-1D25tmRkgwJCOY0twyiJYW2cbQUV8Nt2OSIAtOvj-rdhAFDe3TZpVEZrCsZ4UAek7xRlSKyf2yRGW7iLbY4C4e_nC-IZybkMhwlAcD6XXyOngxjpPJXgB0ndZ029kQbbO6bKEaqNqfgeAt6Iaqy4WppYUG3eS9RiF-W-K3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reasoning.summary","summary":"**Designing rail structures**\n\nI’m considering how rails might be designed with beams on the sides, using specific measurements for connection and a diagonal branching pattern. I want to add some playful spherical openings and create four beams with a bevel. I'm thinking about a titanium color for the rails and a thin, transparent mesh panel in between. I'll include mechanical joints with dark cylinders and bolts arranged appropriately. Then, for movement, I'll need an actuator motor and some thin cables to connect everything smoothly.**Configuring arm mechanics**\n\nI'm determining the positioning of the arm's endpoint at p4, which will have fingers extending towards an object. For visual clarity, the gripper's palm is at p4, and the fingers will extend in the x-direction, separated in the y-direction. The arm will grasp a cup-like object, located at (2.5, 0, .45). I need to set up a script for rendering with Cycles and consider implementing a transparent mesh membrane. Oh, and I might include some text labels for context!**Designing bolts and objects**\n\nI'm planning to create bolts positioned around the y-axis, using trigonometry to determine their location with an angle for the cylinder's axis. For joint labels, I think a torus could work well with a 90-degree orientation and appropriate arguments. I also need to create a small machined object, like a metallic orange cylinder with a hexagonal top cap, placed on the desk at coordinates (2.45, 0.05, 0.55). I'll make sure the lighting in the area highlights this little object!","format":"openai-responses-v1","index":2},{"type":"reasoning.encrypted","data":"gAAAAABqWl6sj2uZSQGi4C3s9Rk17XlfztAZMxCG1yJNoDm1bGXHAPhJnGB2r6R5_uDTyjwGcFNF6gvUK2A-9ZTRzlkB4uhAbL_W-XkoWzI3ciylTlSJ7rEAyoedQpLynKebJC9G5qMM1qH568BdPyf2cWVRvlwyUus_QEac3QcS0efpq2Z6DhCnEYrFsS4xlo_vEcBs-XIFa2hHdWya24uE9JJfscWFhyv084GMigocLXA9wmJpH2k2_vv94CvTqeqFB6w-ewCM8HzqrNJfq5fT_qremIVaS6yjxFIItZo8ouNZwidWySoEEk95vRjKSs0fkCGE8SQB-YpE4pQbJGkC2zU14KmowmvEMJapeOJaF47lt_c9vkPmT6Fsp32MuDigXg0QJiv1FBya6OMSJ1ASOxIGyGPMSeLRrvG2TFimtFKIcUUA9r8pLIXvUuigJMhl5U0wbN3gQ66fQcvzUZmlRIyCAS07sVQuMpwANHR8346gkW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ri8WasLb2rumgUFT-dJ8K9A4BCE2VeI_hp1ugjQ23WiO7UUjQjYrIgSdbjul6W0mqnrK0EZb-HnYAuTudsrjhzMor4vCDWk-Cig==","format":"openai-responses-v1","id":"rs_04d7cbe3392e8844016a5a5ea701948193beeb41794eeb557a","index":3}]}}],"usage":{"prompt_tokens":1316,"completion_tokens":5555,"total_tokens":6871,"cost":0.03497425,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":1313,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.03497425,"upstream_inference_prompt_cost":0.00164425,"upstream_inference_completions_cost":0.03333},"completion_tokens_details":{"reasoning_tokens":1052,"image_tokens":0,"audio_tokens":0}}}

```python
import bpy, math
from mathutils import Vector
from math import sin, cos, pi

# ------------------------------------------------------------
# Clean scene
# ------------------------------------------------------------
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
for datablocks in (bpy.data.meshes, bpy.data.curves, bpy.data.materials, bpy.data.cameras, bpy.data.lights):
    pass

# ------------------------------------------------------------
# Materials
# ------------------------------------------------------------
def mat(name, color, metallic=0.0, rough=0.4, transmission=0.0, alpha=1.0):
    m = bpy.data.materials.new(name)
    m.diffuse_color = (*color, alpha)
    m.use_nodes = True
    bs = m.node_tree.nodes.get("Principled BSDF")
    bs.inputs["Base Color"].default_value = (*color, 1)
    bs.inputs["Metallic"].default_value = metallic
    bs.inputs["Roughness"].default_value = rough
    if "Transmission Weight" in bs.inputs:
        bs.inputs["Transmission Weight"].default_value = transmission
    if "Coat Weight" in bs.inputs:
        bs.inputs["Coat Weight"].default_value = 0.25
    if alpha < 1:
        bs.inputs["Alpha"].default_value = alpha
        m.surface_render_method = 'DITHERED'
    return m

mat_desk = mat("Warm neutral studio desk", (0.16,0.18,0.20), 0.0, 0.28)
mat_edge = mat("Desk edge", (0.055,0.065,0.075), 0.25, 0.25)
mat_titanium = mat("Brushed titanium struts", (0.30,0.43,0.48), 0.82, 0.22)
mat_titanium2 = mat("Machined light titanium", (0.58,0.68,0.69), 0.88, 0.18)
mat_dark = mat("Actuator graphite", (0.025,0.035,0.045), 0.82, 0.2)
mat_black = mat("Controlled cable", (0.008,0.012,0.016), 0.15, 0.25)
mat_blue = mat("Interface blue", (0.035,0.22,0.34), 0.65, 0.23)
mat_orange = mat("Replaceable contact pads", (0.9,0.28,0.045), 0.45, 0.25)
mat_object = mat("Test object anodized brass", (0.55,0.22,0.055), 0.82, 0.2)
mat_membrane = mat("Restrained technical membrane", (0.20,0.65,0.72), 0.05, 0.18, 0.35, 0.32)
mat_white = mat("Marking", (0.75,0.82,0.83), 0.1, 0.3)

# ------------------------------------------------------------
# Helpers
# ------------------------------------------------------------
def assign(obj, material):
    if obj and material:
        obj.data.materials.append(material)
    return obj

def bevel(obj, amount=0.04, segments=3):
    mod = obj.modifiers.new("Precision edge radii", 'BEVEL')
    mod.width = amount
    mod.segments = segments
    return obj

def cube(name, loc, scale, material, bevel_amt=0.03, rot=None):
    bpy.ops.mesh.primitive_cube_add(size=1, location=loc)
    o = bpy.context.object
    o.name = name
    o.dimensions = scale
    if rot:
        o.rotation_euler = rot
    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
    assign(o, material)
    if bevel_amt:
        bevel(o, bevel_amt)
    return o

def cyl(name, loc, radius, depth, material, axis='Z', vertices=48, bevel_amt=0.025):
    bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, radius=radius, depth=depth, location=loc)
    o = bpy.context.object
    o.name = name
    if axis == 'Y':
        o.rotation_euler[0] = pi/2
    elif axis == 'X':
        o.rotation_euler[1] = pi/2
    assign(o, material)
    if bevel_amt:
        bevel(o, bevel_amt, 3)
    return o

def beam(name, a, b, radius, material, vertices=16):
    a, b = Vector(a), Vector(b)
    d = b-a
    mid = (a+b)/2
    bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, 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')
    assign(o, material)
    bevel(o, radius*0.35, 2)
    return o

def cable(name, points, material, radius=0.018):
    cu = bpy.data.curves.new(name, 'CURVE')
    cu.dimensions = '3D'
    cu.resolution_u = 2
    cu.bevel_depth = radius
    cu.bevel_resolution = 3
    spl = cu.splines.new('BEZIER')
    spl.bezier_points.add(len(points)-1)
    for p, co in zip(spl.bezier_points, points):
        p.co = co
        p.handle_left_type = 'AUTO'
        p.handle_right_type = 'AUTO'
    ob = bpy.data.objects.new(name, cu)
    bpy.context.collection.objects.link(ob)
    assign(ob, material)
    return ob

def torus(name, loc, major, minor, material):
    bpy.ops.mesh.primitive_torus_add(major_radius=major, minor_radius=minor, major_segments=48, minor_segments=12, location=loc, rotation=(pi/2,0,0))
    o=bpy.context.object
    o.name=name
    assign(o, material)
    return o

def joint(name, p, radius):
    # Main rotary housing, axis through the page
    cyl(name+" housing", p, radius, 0.34, mat_dark, 'Y', 64, 0.025)
    cyl(name+" silver flange", (p[0],p[1]-0.19,p[2]), radius*0.78, 0.075, mat_titanium2, 'Y', 48, 0.015)
    cyl(name+" blue bearing face", (p[0],p[1]-0.235,p[2]), radius*0.43, 0.035, mat_blue, 'Y', 48, 0.01)
    torus(name+" bearing ring", (p[0],p[1]-0.255,p[2]), radius*0.52, 0.025, mat_titanium2)
    for i in range(6):
        ang=2*pi*i/6
        bx=p[0]+cos(ang)*radius*0.68
        bz=p[2]+sin(ang)*radius*0.68
        cyl(name+" flange bolt", (bx,p[1]-0.28,bz), 0.027, 0.055, mat_titanium2, 'Y', 20, 0.006)

# ------------------------------------------------------------
# Desk and studio environment
# ------------------------------------------------------------
cube("Desk top", (1.1,0,0.18), (5.8,3.0,0.36), mat_desk, 0.08)
cube("Desk front fascia", (1.1,-1.48,-0.18), (5.8,0.12,0.55), mat_edge, 0.025)
cube("Rear studio wall", (1.1,1.55,2.4), (5.8,0.12,4.8), mat_edge, 0.02)

# ------------------------------------------------------------
# Base mechanical assembly
# ------------------------------------------------------------
base=(0,0,0.48)
cyl("Base pedestal", base, 0.56, 0.50, mat_dark, 'Z', 64, 0.04)
cyl("Base lower foot", (0,0,0.27), 0.73, 0.16, mat_titanium2, 'Z', 64, 0.03)
cyl("Rotating platform", (0,0,0.77), 0.48, 0.18, mat_blue, 'Z', 64, 0.025)
cyl("Platform cap", (0,0,0.89), 0.35, 0.10, mat_titanium2, 'Z', 64, 0.02)
for i in range(8):
    ang=2*pi*i/8
    cyl("Base mounting bolt", (cos(ang)*0.58, sin(ang)*0.58, 0.39), 0.045, 0.08, mat_titanium2, 'Z', 20, 0.008)

# upright shoulder bracket
cube("Left shoulder bracket", (-0.24,0,1.15), (0.18,0.55,0.62), mat_dark, 0.04)
cube("Right shoulder bracket", (0.24,0,1.15), (0.18,0.55,0.62), mat_dark, 0.04)

# ------------------------------------------------------------
# Posed articulated arm
# ------------------------------------------------------------
p0=(0,0,1.02)
p1=(0.18,0,1.92)
p2=(1.22,0,1.64)
p3=(1.83,0,1.08)
p4=(2.20,0,0.78)

joint("Shoulder joint", p0, 0.30)
joint("Elbow joint", p1, 0.25)
joint("Wrist joint", p2, 0.20)
joint("Tool rotary joint", p3, 0.155)

# actuator pods near joints, conventional and compact
cube("Shoulder servo pod", (-0.17,-0.02,1.48), (0.34,0.42,0.30), mat_dark, 0.055, (0,0.14,0))
cube("Elbow servo pod", (0.70,-0.02,1.83), (0.42,0.36,0.25), mat_dark, 0.045, (0,-0.18,0))
cube("Wrist gearbox", (1.52,-0.01,1.38), (0.30,0.32,0.22), mat_dark, 0.035, (0,0.35,0))

# Topology-optimized style open structural link with controlled void
def optimized_link(name, a, b, width, color=mat_titanium):
    a,b=Vector(a),Vector(b)
    d=b-a
    # perpendicular in XZ plane
    perp=Vector((-d.z,0,d.x)).normalized()
    # two smooth load paths, leaving a large central opening
    aa=a+perp*width
    ab=b+perp*(width*0.72)
    ba=a-perp*width
    bb=b-perp*(width*0.72)
    beam(name+" upper load path", aa, ab, 0.105, color)
    beam(name+" lower load path", ba, bb, 0.105, color)
    # forked transitions near each joint
    beam(name+" upper root branch", a+perp*0.10, aa, 0.085, color)
    beam(name+" lower root branch", a-perp*0.10, ba, 0.085, color)
    beam(name+" upper terminal branch", ab, b+perp*0.08, 0.075, color)
    beam(name+" lower terminal branch", bb, b-perp*0.08, 0.075, color)
    # sparse diagonal load ribs, not a full lattice
    mid=(a+b)*0.5
    beam(name+" diagonal rib A", aa, mid-perp*0.35, 0.055, color)
    beam(name+" diagonal rib B", ba, mid+perp*0.35, 0.055, color)
    # rounded node transitions
    for q in (aa,ba,ab,bb):
        bpy.ops.mesh.primitive_uv_sphere_add(segments=24, ring_count=12, radius=0.115, location=q)
        s=bpy.context.object
        s.name=name+" organic transition node"
        assign(s,color)
    # restrained membrane spanning only one opening
    verts=[tuple(aa+Vector((0,-0.025,0))), tuple(ab+Vector((0,-0.025,0))),
           tuple(bb+Vector((0,-0.025,0))), tuple(ba+Vector((0,-0.025,0)))]
    mesh=bpy.data.meshes.new(name+" membrane mesh")
    mesh.from_pydata(verts,[],[(0,1,2,3)])
    mesh.update()
    ob=bpy.data.objects.new(name+" translucent structural membrane",mesh)
    bpy.context.collection.objects.link(ob)
    assign(ob,mat_membrane)

optimized_link("Optimized upper strut", p0, p1, 0.19, mat_titanium)
optimized_link("Optimized forearm strut", p1, p2, 0.16, mat_titanium)
optimized_link("Optimized wrist strut", p2, p3, 0.115, mat_titanium2)

# controlled internal cable routing
cable("Shoulder cable", [(-0.08,-0.25,1.13),(0.15,-0.25,1.48),(0.24,-0.25,1.83)], mat_black, 0.018)
cable("Forearm cable", [(0.28,-0.22,1.78),(0.78,-0.22,1.70),(1.25,-0.22,1.55)], mat_black, 0.016)
cable("Wrist cable", [(1.30,-0.20,1.55),(1.60,-0.20,1.32),(1.80,-0.20,1.13)], mat_black, 0.014)

# ------------------------------------------------------------
# Compact two-finger parallel gripper
# ------------------------------------------------------------
# wrist interface and palm
cyl("End effector interface", p4, 0.145, 0.20, mat_titanium2, 'X', 48, 0.018)
cube("Gripper palm", (2.28,0,0.78), (0.20,0.54,0.26), mat_dark, 0.04)
cyl("Gripper drive spindle", (2.32,0,0.78), 0.055, 0.58, mat_titanium2, 'Y', 32, 0.01)

# two solid parallel fingers, separated in Y
for side in (-1,1):
    y=side*0.19
    cube("Parallel finger "+str(side), (2.49,y,0.63), (0.48,0.12,0.16), mat_titanium2, 0.025)
    cube("Replaceable contact pad "+str(side), (2.75,y,0.60), (0.09,0.14,0.18), mat_orange, 0.018)
    cyl("Finger pivot "+str(side), (2.37,y,0.78), 0.055, 0.13, mat_blue, 'Y', 32, 0.008)
# small visible actuator linkages
beam("Left gripper linkage", (2.34,-0.18,0.78), (2.48,-0.19,0.70), 0.035, mat_dark)
beam("Right gripper linkage", (2.34,0.18,0.78), (2.48,0.19,0.70), 0.035, mat_dark)

# ------------------------------------------------------------
# Small machined desk object being approached
# ------------------------------------------------------------
cyl("Small test object body", (2.91,0.02,0.56), 0.16, 0.26, mat_object, 'Z', 48, 0.025)
cyl("Small test object top", (2.91,0.02,0.71), 0.115, 0.055, mat_titanium2, 'Z', 48, 0.012)
cyl("Object top marker", (2.91,0.02,0.748), 0.032, 0.018, mat_blue, 'Z', 32, 0.006)
# small alignment plate beneath object
cube("Object alignment plate", (2.91,0.02,0.405), (0.55,0.50,0.035), mat_edge, 0.012)

# subtle engraved-style design plaque
cube("Design plaque", (0.15,-1.12,0.38), (1.0,0.42,0.025), mat_dark, 0.008)
# text
font_curve=bpy.data.curves.new("Prototype label", type='FONT')
font_curve.body="O-04  /  STRUCTURAL RESEARCH"
font_curve.align_x='CENTER'
font_curve.size=0.075
font_curve.extrude=0.002
text=bpy.data.objects.new("Prototype label",font_curve)
bpy.context.collection.objects.link(text)
text.location=(0.15,-1.335,0.405)
text.rotation_euler=(0,0,0)
assign(text,mat_white)

# ------------------------------------------------------------
# Lighting and camera
# ------------------------------------------------------------
world=bpy.context.scene.world
world.use_nodes=True
world.node_tree.nodes["Background"].inputs["Color"].default_value=(0.035,0.045,0.06,1)
world.node_tree.nodes["Background"].inputs["Strength"].default_value=0.32

def area(name, loc, energy, size, color):
    data=bpy.data.lights.new(name,'AREA')
    data.energy=energy
    data.shape='DISK'
    data.size=size
    data.color=color
    ob=bpy.data.objects.new(name,data)
    bpy.context.collection.objects.link(ob)
    ob.location=loc
    return ob

key=area("Large softbox", (1.0,-3.5,4.8), 1050, 4.0, (0.82,0.92,1.0))
key.rotation_euler=(math.radians(28),0,math.radians(12))
fill=area("Cool rim light", (3.8,1.5,3.0), 900, 3.0, (0.35,0.58,1.0))
fill.rotation_euler=(math.radians(55),0,math.radians(150))
warm=area("Warm precision fill", (-2.2,-1.5,2.0), 650, 2.3, (1.0,0.58,0.32))
warm.rotation_euler=(math.radians(70),0,math.radians(-45))

# camera
cam_data=bpy.data.cameras.new("Presentation camera")
cam=bpy.data.objects.new("Presentation camera",cam_data)
bpy.context.collection.objects.link(cam)
cam.location=(4.35,-6.2,3.25)
target=Vector((1.28,0,1.20))
cam.rotation_euler=(target-Vector(cam.location)).to_track_quat('-Z','Y').to_euler()
cam_data.lens=54
cam_data.sensor_width=36
bpy.context.scene.camera=cam

# ------------------------------------------------------------
# Render 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.render.filepath="/tmp/robotic_arm_presentation.png"
scene.view_settings.look='AgX - Medium High Contrast'
scene.render.image_settings.color_mode='RGBA'

# Ground contact shadows and organized naming
scene.render.use_file_extension=True

# Save
bpy.ops.wm.save_as_mainfile(filepath="/tmp/experimental_robotic_arm.blend")
```


```python
import bpy, math
from mathutils import Vector
from math import sin, cos, pi

# ------------------------------------------------------------
# Clean scene
# ------------------------------------------------------------
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
for datablocks in (bpy.data.meshes, bpy.data.curves, bpy.data.materials, bpy.data.cameras, bpy.data.lights):
    pass

# ------------------------------------------------------------
# Materials
# ------------------------------------------------------------
def mat(name, color, metallic=0.0, rough=0.4, transmission=0.0, alpha=1.0):
    m = bpy.data.materials.new(name)
    m.diffuse_color = (*color, alpha)
    m.use_nodes = True
    bs = m.node_tree.nodes.get("Principled BSDF")
    bs.inputs["Base Color"].default_value = (*color, 1)
    bs.inputs["Metallic"].default_value = metallic
    bs.inputs["Roughness"].default_value = rough
    if "Transmission Weight" in bs.inputs:
        bs.inputs["Transmission Weight"].default_value = transmission
    if "Coat Weight" in bs.inputs:
        bs.inputs["Coat Weight"].default_value = 0.25
    if alpha < 1:
        bs.inputs["Alpha"].default_value = alpha
        m.surface_render_method = 'DITHERED'
    return m

mat_desk = mat("Warm neutral studio desk", (0.16,0.18,0.20), 0.0, 0.28)
mat_edge = mat("Desk edge", (0.055,0.065,0.075), 0.25, 0.25)
mat_titanium = mat("Brushed titanium struts", (0.30,0.43,0.48), 0.82, 0.22)
mat_titanium2 = mat("Machined light titanium", (0.58,0.68,0.69), 0.88, 0.18)
mat_dark = mat("Actuator graphite", (0.025,0.035,0.045), 0.82, 0.2)
mat_black = mat("Controlled cable", (0.008,0.012,0.016), 0.15, 0.25)
mat_blue = mat("Interface blue", (0.035,0.22,0.34), 0.65, 0.23)
mat_orange = mat("Replaceable contact pads", (0.9,0.28,0.045), 0.45, 0.25)
mat_object = mat("Test object anodized brass", (0.55,0.22,0.055), 0.82, 0.2)
mat_membrane = mat("Restrained technical membrane", (0.20,0.65,0.72), 0.05, 0.18, 0.35, 0.32)
mat_white = mat("Marking", (0.75,0.82,0.83), 0.1, 0.3)

# ------------------------------------------------------------
# Helpers
# ------------------------------------------------------------
def assign(obj, material):
    if obj and material:
        obj.data.materials.append(material)
    return obj

def bevel(obj, amount=0.04, segments=3):
    mod = obj.modifiers.new("Precision edge radii", 'BEVEL')
    mod.width = amount
    mod.segments = segments
    return obj

def cube(name, loc, scale, material, bevel_amt=0.03, rot=None):
    bpy.ops.mesh.primitive_cube_add(size=1, location=loc)
    o = bpy.context.object
    o.name = name
    o.dimensions = scale
    if rot:
        o.rotation_euler = rot
    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
    assign(o, material)
    if bevel_amt:
        bevel(o, bevel_amt)
    return o

def cyl(name, loc, radius, depth, material, axis='Z', vertices=48, bevel_amt=0.025):
    bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, radius=radius, depth=depth, location=loc)
    o = bpy.context.object
    o.name = name
    if axis == 'Y':
        o.rotation_euler[0] = pi/2
    elif axis == 'X':
        o.rotation_euler[1] = pi/2
    assign(o, material)
    if bevel_amt:
        bevel(o, bevel_amt, 3)
    return o

def beam(name, a, b, radius, material, vertices=16):
    a, b = Vector(a), Vector(b)
    d = b-a
    mid = (a+b)/2
    bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, 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')
    assign(o, material)
    bevel(o, radius*0.35, 2)
    return o

def cable(name, points, material, radius=0.018):
    cu = bpy.data.curves.new(name, 'CURVE')
    cu.dimensions = '3D'
    cu.resolution_u = 2
    cu.bevel_depth = radius
    cu.bevel_resolution = 3
    spl = cu.splines.new('BEZIER')
    spl.bezier_points.add(len(points)-1)
    for p, co in zip(spl.bezier_points, points):
        p.co = co
        p.handle_left_type = 'AUTO'
        p.handle_right_type = 'AUTO'
    ob = bpy.data.objects.new(name, cu)
    bpy.context.collection.objects.link(ob)
    assign(ob, material)
    return ob

def torus(name, loc, major, minor, material):
    bpy.ops.mesh.primitive_torus_add(major_radius=major, minor_radius=minor, major_segments=48, minor_segments=12, location=loc, rotation=(pi/2,0,0))
    o=bpy.context.object
    o.name=name
    assign(o, material)
    return o

def joint(name, p, radius):
    # Main rotary housing, axis through the page
    cyl(name+" housing", p, radius, 0.34, mat_dark, 'Y', 64, 0.025)
    cyl(name+" silver flange", (p[0],p[1]-0.19,p[2]), radius*0.78, 0.075, mat_titanium2, 'Y', 48, 0.015)
    cyl(name+" blue bearing face", (p[0],p[1]-0.235,p[2]), radius*0.43, 0.035, mat_blue, 'Y', 48, 0.01)
    torus(name+" bearing ring", (p[0],p[1]-0.255,p[2]), radius*0.52, 0.025, mat_titanium2)
    for i in range(6):
        ang=2*pi*i/6
        bx=p[0]+cos(ang)*radius*0.68
        bz=p[2]+sin(ang)*radius*0.68
        cyl(name+" flange bolt", (bx,p[1]-0.28,bz), 0.027, 0.055, mat_titanium2, 'Y', 20, 0.006)

# ------------------------------------------------------------
# Desk and studio environment
# ------------------------------------------------------------
cube("Desk top", (1.1,0,0.18), (5.8,3.0,0.36), mat_desk, 0.08)
cube("Desk front fascia", (1.1,-1.48,-0.18), (5.8,0.12,0.55), mat_edge, 0.025)
cube("Rear studio wall", (1.1,1.55,2.4), (5.8,0.12,4.8), mat_edge, 0.02)

# ------------------------------------------------------------
# Base mechanical assembly
# ------------------------------------------------------------
base=(0,0,0.48)
cyl("Base pedestal", base, 0.56, 0.50, mat_dark, 'Z', 64, 0.04)
cyl("Base lower foot", (0,0,0.27), 0.73, 0.16, mat_titanium2, 'Z', 64, 0.03)
cyl("Rotating platform", (0,0,0.77), 0.48, 0.18, mat_blue, 'Z', 64, 0.025)
cyl("Platform cap", (0,0,0.89), 0.35, 0.10, mat_titanium2, 'Z', 64, 0.02)
for i in range(8):
    ang=2*pi*i/8
    cyl("Base mounting bolt", (cos(ang)*0.58, sin(ang)*0.58, 0.39), 0.045, 0.08, mat_titanium2, 'Z', 20, 0.008)

# upright shoulder bracket
cube("Left shoulder bracket", (-0.24,0,1.15), (0.18,0.55,0.62), mat_dark, 0.04)
cube("Right shoulder bracket", (0.24,0,1.15), (0.18,0.55,0.62), mat_dark, 0.04)

# ------------------------------------------------------------
# Posed articulated arm
# ------------------------------------------------------------
p0=(0,0,1.02)
p1=(0.18,0,1.92)
p2=(1.22,0,1.64)
p3=(1.83,0,1.08)
p4=(2.20,0,0.78)

joint("Shoulder joint", p0, 0.30)
joint("Elbow joint", p1, 0.25)
joint("Wrist joint", p2, 0.20)
joint("Tool rotary joint", p3, 0.155)

# actuator pods near joints, conventional and compact
cube("Shoulder servo pod", (-0.17,-0.02,1.48), (0.34,0.42,0.30), mat_dark, 0.055, (0,0.14,0))
cube("Elbow servo pod", (0.70,-0.02,1.83), (0.42,0.36,0.25), mat_dark, 0.045, (0,-0.18,0))
cube("Wrist gearbox", (1.52,-0.01,1.38), (0.30,0.32,0.22), mat_dark, 0.035, (0,0.35,0))

# Topology-optimized style open structural link with controlled void
def optimized_link(name, a, b, width, color=mat_titanium):
    a,b=Vector(a),Vector(b)
    d=b-a
    # perpendicular in XZ plane
    perp=Vector((-d.z,0,d.x)).normalized()
    # two smooth load paths, leaving a large central opening
    aa=a+perp*width
    ab=b+perp*(width*0.72)
    ba=a-perp*width
    bb=b-perp*(width*0.72)
    beam(name+" upper load path", aa, ab, 0.105, color)
    beam(name+" lower load path", ba, bb, 0.105, color)
    # forked transitions near each joint
    beam(name+" upper root branch", a+perp*0.10, aa, 0.085, color)
    beam(name+" lower root branch", a-perp*0.10, ba, 0.085, color)
    beam(name+" upper terminal branch", ab, b+perp*0.08, 0.075, color)
    beam(name+" lower terminal branch", bb, b-perp*0.08, 0.075, color)
    # sparse diagonal load ribs, not a full lattice
    mid=(a+b)*0.5
    beam(name+" diagonal rib A", aa, mid-perp*0.35, 0.055, color)
    beam(name+" diagonal rib B", ba, mid+perp*0.35, 0.055, color)
    # rounded node transitions
    for q in (aa,ba,ab,bb):
        bpy.ops.mesh.primitive_uv_sphere_add(segments=24, ring_count=12, radius=0.115, location=q)
        s=bpy.context.object
        s.name=name+" organic transition node"
        assign(s,color)
    # restrained membrane spanning only one opening
    verts=[tuple(aa+Vector((0,-0.025,0))), tuple(ab+Vector((0,-0.025,0))),
           tuple(bb+Vector((0,-0.025,0))), tuple(ba+Vector((0,-0.025,0)))]
    mesh=bpy.data.meshes.new(name+" membrane mesh")
    mesh.from_pydata(verts,[],[(0,1,2,3)])
    mesh.update()
    ob=bpy.data.objects.new(name+" translucent structural membrane",mesh)
    bpy.context.collection.objects.link(ob)
    assign(ob,mat_membrane)

optimized_link("Optimized upper strut", p0, p1, 0.19, mat_titanium)
optimized_link("Optimized forearm strut", p1, p2, 0.16, mat_titanium)
optimized_link("Optimized wrist strut", p2, p3, 0.115, mat_titanium2)

# controlled internal cable routing
cable("Shoulder cable", [(-0.08,-0.25,1.13),(0.15,-0.25,1.48),(0.24,-0.25,1.83)], mat_black, 0.018)
cable("Forearm cable", [(0.28,-0.22,1.78),(0.78,-0.22,1.70),(1.25,-0.22,1.55)], mat_black, 0.016)
cable("Wrist cable", [(1.30,-0.20,1.55),(1.60,-0.20,1.32),(1.80,-0.20,1.13)], mat_black, 0.014)

# ------------------------------------------------------------
# Compact two-finger parallel gripper
# ------------------------------------------------------------
# wrist interface and palm
cyl("End effector interface", p4, 0.145, 0.20, mat_titanium2, 'X', 48, 0.018)
cube("Gripper palm", (2.28,0,0.78), (0.20,0.54,0.26), mat_dark, 0.04)
cyl("Gripper drive spindle", (2.32,0,0.78), 0.055, 0.58, mat_titanium2, 'Y', 32, 0.01)

# two solid parallel fingers, separated in Y
for side in (-1,1):
    y=side*0.19
    cube("Parallel finger "+str(side), (2.49,y,0.63), (0.48,0.12,0.16), mat_titanium2, 0.025)
    cube("Replaceable contact pad "+str(side), (2.75,y,0.60), (0.09,0.14,0.18), mat_orange, 0.018)
    cyl("Finger pivot "+str(side), (2.37,y,0.78), 0.055, 0.13, mat_blue, 'Y', 32, 0.008)
# small visible actuator linkages
beam("Left gripper linkage", (2.34,-0.18,0.78), (2.48,-0.19,0.70), 0.035, mat_dark)
beam("Right gripper linkage", (2.34,0.18,0.78), (2.48,0.19,0.70), 0.035, mat_dark)

# ------------------------------------------------------------
# Small machined desk object being approached
# ------------------------------------------------------------
cyl("Small test object body", (2.91,0.02,0.56), 0.16, 0.26, mat_object, 'Z', 48, 0.025)
cyl("Small test object top", (2.91,0.02,0.71), 0.115, 0.055, mat_titanium2, 'Z', 48, 0.012)
cyl("Object top marker", (2.91,0.02,0.748), 0.032, 0.018, mat_blue, 'Z', 32, 0.006)
# small alignment plate beneath object
cube("Object alignment plate", (2.91,0.02,0.405), (0.55,0.50,0.035), mat_edge, 0.012)

# subtle engraved-style design plaque
cube("Design plaque", (0.15,-1.12,0.38), (1.0,0.42,0.025), mat_dark, 0.008)
# text
font_curve=bpy.data.curves.new("Prototype label", type='FONT')
font_curve.body="O-04  /  STRUCTURAL RESEARCH"
font_curve.align_x='CENTER'
font_curve.size=0.075
font_curve.extrude=0.002
text=bpy.data.objects.new("Prototype label",font_curve)
bpy.context.collection.objects.link(text)
text.location=(0.15,-1.335,0.405)
text.rotation_euler=(0,0,0)
assign(text,mat_white)

# ------------------------------------------------------------
# Lighting and camera
# ------------------------------------------------------------
world=bpy.context.scene.world
world.use_nodes=True
world.node_tree.nodes["Background"].inputs["Color"].default_value=(0.035,0.045,0.06,1)
world.node_tree.nodes["Background"].inputs["Strength"].default_value=0.32

def area(name, loc, energy, size, color):
    data=bpy.data.lights.new(name,'AREA')
    data.energy=energy
    data.shape='DISK'
    data.size=size
    data.color=color
    ob=bpy.data.objects.new(name,data)
    bpy.context.collection.objects.link(ob)
    ob.location=loc
    return ob

key=area("Large softbox", (1.0,-3.5,4.8), 1050, 4.0, (0.82,0.92,1.0))
key.rotation_euler=(math.radians(28),0,math.radians(12))
fill=area("Cool rim light", (3.8,1.5,3.0), 900, 3.0, (0.35,0.58,1.0))
fill.rotation_euler=(math.radians(55),0,math.radians(150))
warm=area("Warm precision fill", (-2.2,-1.5,2.0), 650, 2.3, (1.0,0.58,0.32))
warm.rotation_euler=(math.radians(70),0,math.radians(-45))

# camera
cam_data=bpy.data.cameras.new("Presentation camera")
cam=bpy.data.objects.new("Presentation camera",cam_data)
bpy.context.collection.objects.link(cam)
cam.location=(4.35,-6.2,3.25)
target=Vector((1.28,0,1.20))
cam.rotation_euler=(target-Vector(cam.location)).to_track_quat('-Z','Y').to_euler()
cam_data.lens=54
cam_data.sensor_width=36
bpy.context.scene.camera=cam

# ------------------------------------------------------------
# Render 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.render.filepath="/tmp/robotic_arm_presentation.png"
scene.view_settings.look='AgX - Medium High Contrast'
scene.render.image_settings.color_mode='RGBA'

# Ground contact shadows and organized naming
scene.render.use_file_extension=True

# Save
bpy.ops.wm.save_as_mainfile(filepath="/tmp/experimental_robotic_arm.blend")
```