vibe-openscad

tier-2-offset-handle-mug / gpt-5.5-2026-04-23

7 run / 累計 632.3s / 累計 $0.2926

openai gpt 5.5 2026-04-23 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-offset-handle-mug
loading STL…
success 150.5s · 273/6721t · $0.0676
SCAD (86 lines)
$fn = 128;

outer_diameter = 80;
inner_diameter = 70;
mug_height = 90;
bottom_thickness = 6;

outer_radius = outer_diameter / 2;
inner_radius = inner_diameter / 2;

handle_opening_height = 30;
handle_opening_width = 25;
handle_wall = 7;
handle_depth = 16;
handle_center_z = mug_height / 2;
handle_opening_left_x = outer_radius + 5;
handle_attach_overlap = 2.5;

eps = 0.2;

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);

        translate([0, 0, bottom_thickness])
            cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
    }
}

module d_shape(x0, z0, h, w, segments = 72) {
    polygon(
        points = concat(
            [[x0, z0 - h / 2]],
            [
                for (i = [1 : segments - 1])
                    let (a = -90 + 180 * i / segments)
                        [x0 + w * cos(a), z0 + (h / 2) * sin(a)]
            ],
            [[x0, z0 + h / 2]]
        )
    );
}

module handle_profile() {
    difference() {
        offset(r = handle_wall)
            d_shape(
                handle_opening_left_x,
                handle_center_z,
                handle_opening_height,
                handle_opening_width
            );

        d_shape(
            handle_opening_left_x,
            handle_center_z,
            handle_opening_height,
            handle_opening_width
        );
    }
}

module handle() {
    union() {
        rotate([90, 0, 0])
            linear_extrude(height = handle_depth, center = true, convexity = 10)
                handle_profile();

        translate([
            outer_radius - handle_attach_overlap,
            -handle_depth / 2,
            handle_center_z - handle_opening_height / 2 - handle_wall
        ])
            cube([
                handle_opening_left_x - (outer_radius - handle_attach_overlap),
                handle_depth,
                handle_opening_height + 2 * handle_wall
            ]);
    }
}

render(convexity = 10)
union() {
    mug_body();
    handle();
}
パラメータ (10)
スライダを動かすと openscad-wasm で再レンダリング

prompt

OpenSCAD で、向きが指定されたマグカップを作ってください。

本体:
- 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ
- 底面の厚みは 6mm
- 内側は飲み物を入れられるよう中空

取手(handle):
- マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない)
- 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する
- 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る)
- 取手はマグの高さ方向の中央付近に付ける
- 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ

完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。

variant: effort

low success
low
35.6s · 273/1559t · $0.0159
SCAD (72 lines)
$fn = 128;

outer_d = 80;
inner_d = 70;
height = 90;
bottom_thickness = 6;

outer_r = outer_d / 2;
inner_r = inner_d / 2;

// Handle parameters
handle_depth = 16;          // Y方向の厚み
handle_wall = 8;
handle_center_z = height / 2;

inner_handle_h = 30;
inner_handle_w = 25;

inner_x0 = outer_r + 4;     // 取手内側の本体側直線位置
inner_rx = inner_handle_w;
inner_ry = inner_handle_h / 2;

outer_x0 = outer_r - 4;     // 本体外周へ確実に食い込ませて接続
outer_rx = inner_handle_w + handle_wall * 2;
outer_ry = inner_ry + handle_wall;

module d_shape_2d(x0, zc, rx, ry, steps = 64) {
    pts = concat(
        [[x0, zc - ry], [x0, zc + ry]],
        [for (i = [0 : steps])
            let(a = 90 - 180 * i / steps)
            [x0 + rx * cos(a), zc + ry * sin(a)]
        ]
    );
    polygon(points = pts);
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_depth, center = true, convexity = 10)
            difference() {
                d_shape_2d(
                    outer_x0,
                    handle_center_z,
                    outer_rx,
                    outer_ry
                );
                d_shape_2d(
                    inner_x0,
                    handle_center_z,
                    inner_rx,
                    inner_ry
                );
            }
}

module mug_body_outer() {
    cylinder(h = height, r = outer_r);
}

module mug_inner_void() {
    translate([0, 0, bottom_thickness])
        cylinder(h = height + 2, r = inner_r);
}

difference() {
    union() {
        mug_body_outer();
        handle();
    }
    mug_inner_void();
}
medium (default) success
medium
150.5s · 273/6721t · $0.0676
SCAD (86 lines)
$fn = 128;

outer_diameter = 80;
inner_diameter = 70;
mug_height = 90;
bottom_thickness = 6;

outer_radius = outer_diameter / 2;
inner_radius = inner_diameter / 2;

handle_opening_height = 30;
handle_opening_width = 25;
handle_wall = 7;
handle_depth = 16;
handle_center_z = mug_height / 2;
handle_opening_left_x = outer_radius + 5;
handle_attach_overlap = 2.5;

eps = 0.2;

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);

        translate([0, 0, bottom_thickness])
            cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
    }
}

module d_shape(x0, z0, h, w, segments = 72) {
    polygon(
        points = concat(
            [[x0, z0 - h / 2]],
            [
                for (i = [1 : segments - 1])
                    let (a = -90 + 180 * i / segments)
                        [x0 + w * cos(a), z0 + (h / 2) * sin(a)]
            ],
            [[x0, z0 + h / 2]]
        )
    );
}

module handle_profile() {
    difference() {
        offset(r = handle_wall)
            d_shape(
                handle_opening_left_x,
                handle_center_z,
                handle_opening_height,
                handle_opening_width
            );

        d_shape(
            handle_opening_left_x,
            handle_center_z,
            handle_opening_height,
            handle_opening_width
        );
    }
}

module handle() {
    union() {
        rotate([90, 0, 0])
            linear_extrude(height = handle_depth, center = true, convexity = 10)
                handle_profile();

        translate([
            outer_radius - handle_attach_overlap,
            -handle_depth / 2,
            handle_center_z - handle_opening_height / 2 - handle_wall
        ])
            cube([
                handle_opening_left_x - (outer_radius - handle_attach_overlap),
                handle_depth,
                handle_opening_height + 2 * handle_wall
            ]);
    }
}

render(convexity = 10)
union() {
    mug_body();
    handle();
}
high success
high
100.7s · 273/5061t · $0.0510
SCAD (58 lines)
$fn = 128;

mug_outer_d = 80;
mug_inner_d = 70;
mug_height  = 90;
bottom_th   = 6;

outer_r = mug_outer_d / 2;
inner_r = mug_inner_d / 2;

handle_inner_h = 30;
handle_inner_w = 25;
handle_th      = 8;
handle_depth   = 16;
handle_z       = mug_height / 2;
handle_attach_x = outer_r - 2;

handle_outer_h = handle_inner_h + handle_th * 2;
handle_outer_w = handle_inner_w + handle_th * 2;

function d_shape_points(w, h, n = 64) =
    let(r = h / 2, cx = w - r)
    concat(
        [[0, -r]],
        [for (i = [0:n])
            let(a = -90 + 180 * i / n)
            [cx + r * cos(a), r * sin(a)]
        ],
        [[0, r]]
    );

module d_shape_2d(w, h) {
    polygon(points = d_shape_points(w, h));
}

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = outer_r);
        translate([0, 0, bottom_th])
            cylinder(h = mug_height, r = inner_r);
    }
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_depth, center = true, convexity = 10)
            translate([handle_attach_x, handle_z])
                difference() {
                    d_shape_2d(handle_outer_w, handle_outer_h);
                    translate([handle_th, 0])
                        d_shape_2d(handle_inner_w, handle_inner_h);
                }
}

union() {
    mug_body();
    handle();
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
57.2s · 1451/2615t · $0.0280
diff vs bare: +16/-7
  $fn = 128;
  
  outer_diameter = 80;
  inner_diameter = 70;
  mug_height = 90;
  bottom_thickness = 6;
  
  outer_radius = outer_diameter / 2;
  inner_radius = inner_diameter / 2;
  
  handle_opening_height = 30;
  handle_opening_width = 25;
  handle_wall = 7;
  handle_depth = 16;
  handle_center_z = mug_height / 2;
+ 
  handle_opening_left_x = outer_radius + 5;
  handle_attach_overlap = 2.5;
  
  eps = 0.2;
  
  module mug_body() {
      difference() {
          cylinder(h = mug_height, r = outer_radius);
  
          translate([0, 0, bottom_thickness])
              cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
      }
  }
  
- module d_shape(x0, z0, h, w, segments = 72) {
+ module d_shape_2d(x0, z0, h, w, segments = 72) {
+     r = h / 2;
+     straight_len = max(w - r, 0);
+ 
      polygon(
          points = concat(
-             [[x0, z0 - h / 2]],
              [
-                 for (i = [1 : segments - 1])
+                 [x0, z0 - r],
+                 [x0 + straight_len, z0 - r]
+             ],
+             [
+                 for (i = [1 : segments])
                      let (a = -90 + 180 * i / segments)
-                         [x0 + w * cos(a), z0 + (h / 2) * sin(a)]
+                         [x0 + straight_len + r * cos(a), z0 + r * sin(a)]
              ],
-             [[x0, z0 + h / 2]]
+             [
+                 [x0, z0 + r]
+             ]
          )
      );
  }
  
  module handle_profile() {
      difference() {
          offset(r = handle_wall)
-             d_shape(
+             d_shape_2d(
                  handle_opening_left_x,
                  handle_center_z,
                  handle_opening_height,
                  handle_opening_width
              );
  
-         d_shape(
+         d_shape_2d(
              handle_opening_left_x,
              handle_center_z,
              handle_opening_height,
              handle_opening_width
          );
      }
  }
  
  module handle() {
      union() {
          rotate([90, 0, 0])
              linear_extrude(height = handle_depth, center = true, convexity = 10)
                  handle_profile();
  
          translate([
              outer_radius - handle_attach_overlap,
              -handle_depth / 2,
              handle_center_z - handle_opening_height / 2 - handle_wall
          ])
              cube([
                  handle_opening_left_x - (outer_radius - handle_attach_overlap),
                  handle_depth,
                  handle_opening_height + 2 * handle_wall
              ]);
      }
  }
  
  render(convexity = 10)
  union() {
      mug_body();
      handle();
  }
SCAD (95 lines)
$fn = 128;

outer_diameter = 80;
inner_diameter = 70;
mug_height = 90;
bottom_thickness = 6;

outer_radius = outer_diameter / 2;
inner_radius = inner_diameter / 2;

handle_opening_height = 30;
handle_opening_width = 25;
handle_wall = 7;
handle_depth = 16;
handle_center_z = mug_height / 2;

handle_opening_left_x = outer_radius + 5;
handle_attach_overlap = 2.5;

eps = 0.2;

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);

        translate([0, 0, bottom_thickness])
            cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
    }
}

module d_shape_2d(x0, z0, h, w, segments = 72) {
    r = h / 2;
    straight_len = max(w - r, 0);

    polygon(
        points = concat(
            [
                [x0, z0 - r],
                [x0 + straight_len, z0 - r]
            ],
            [
                for (i = [1 : segments])
                    let (a = -90 + 180 * i / segments)
                        [x0 + straight_len + r * cos(a), z0 + r * sin(a)]
            ],
            [
                [x0, z0 + r]
            ]
        )
    );
}

module handle_profile() {
    difference() {
        offset(r = handle_wall)
            d_shape_2d(
                handle_opening_left_x,
                handle_center_z,
                handle_opening_height,
                handle_opening_width
            );

        d_shape_2d(
            handle_opening_left_x,
            handle_center_z,
            handle_opening_height,
            handle_opening_width
        );
    }
}

module handle() {
    union() {
        rotate([90, 0, 0])
            linear_extrude(height = handle_depth, center = true, convexity = 10)
                handle_profile();

        translate([
            outer_radius - handle_attach_overlap,
            -handle_depth / 2,
            handle_center_z - handle_opening_height / 2 - handle_wall
        ])
            cube([
                handle_opening_left_x - (outer_radius - handle_attach_overlap),
                handle_depth,
                handle_opening_height + 2 * handle_wall
            ]);
    }
}

render(convexity = 10)
union() {
    mug_body();
    handle();
}
i2 success
iter 2
65.3s · 1490/2864t · $0.0305
diff vs i1: +0/-0
  $fn = 128;
  
  outer_diameter = 80;
  inner_diameter = 70;
  mug_height = 90;
  bottom_thickness = 6;
  
  outer_radius = outer_diameter / 2;
  inner_radius = inner_diameter / 2;
  
  handle_opening_height = 30;
  handle_opening_width = 25;
  handle_wall = 7;
  handle_depth = 16;
  handle_center_z = mug_height / 2;
  
  handle_opening_left_x = outer_radius + 5;
  handle_attach_overlap = 2.5;
  
  eps = 0.2;
  
  module mug_body() {
      difference() {
          cylinder(h = mug_height, r = outer_radius);
  
          translate([0, 0, bottom_thickness])
              cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
      }
  }
  
  module d_shape_2d(x0, z0, h, w, segments = 72) {
      r = h / 2;
      straight_len = max(w - r, 0);
  
      polygon(
          points = concat(
              [
                  [x0, z0 - r],
                  [x0 + straight_len, z0 - r]
              ],
              [
                  for (i = [1 : segments])
                      let (a = -90 + 180 * i / segments)
                          [x0 + straight_len + r * cos(a), z0 + r * sin(a)]
              ],
              [
                  [x0, z0 + r]
              ]
          )
      );
  }
  
  module handle_profile() {
      difference() {
          offset(r = handle_wall)
              d_shape_2d(
                  handle_opening_left_x,
                  handle_center_z,
                  handle_opening_height,
                  handle_opening_width
              );
  
          d_shape_2d(
              handle_opening_left_x,
              handle_center_z,
              handle_opening_height,
              handle_opening_width
          );
      }
  }
  
  module handle() {
      union() {
          rotate([90, 0, 0])
              linear_extrude(height = handle_depth, center = true, convexity = 10)
                  handle_profile();
  
          translate([
              outer_radius - handle_attach_overlap,
              -handle_depth / 2,
              handle_center_z - handle_opening_height / 2 - handle_wall
          ])
              cube([
                  handle_opening_left_x - (outer_radius - handle_attach_overlap),
                  handle_depth,
                  handle_opening_height + 2 * handle_wall
              ]);
      }
  }
  
  render(convexity = 10)
  union() {
      mug_body();
      handle();
  }
SCAD (95 lines)
$fn = 128;

outer_diameter = 80;
inner_diameter = 70;
mug_height = 90;
bottom_thickness = 6;

outer_radius = outer_diameter / 2;
inner_radius = inner_diameter / 2;

handle_opening_height = 30;
handle_opening_width = 25;
handle_wall = 7;
handle_depth = 16;
handle_center_z = mug_height / 2;

handle_opening_left_x = outer_radius + 5;
handle_attach_overlap = 2.5;

eps = 0.2;

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);

        translate([0, 0, bottom_thickness])
            cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
    }
}

module d_shape_2d(x0, z0, h, w, segments = 72) {
    r = h / 2;
    straight_len = max(w - r, 0);

    polygon(
        points = concat(
            [
                [x0, z0 - r],
                [x0 + straight_len, z0 - r]
            ],
            [
                for (i = [1 : segments])
                    let (a = -90 + 180 * i / segments)
                        [x0 + straight_len + r * cos(a), z0 + r * sin(a)]
            ],
            [
                [x0, z0 + r]
            ]
        )
    );
}

module handle_profile() {
    difference() {
        offset(r = handle_wall)
            d_shape_2d(
                handle_opening_left_x,
                handle_center_z,
                handle_opening_height,
                handle_opening_width
            );

        d_shape_2d(
            handle_opening_left_x,
            handle_center_z,
            handle_opening_height,
            handle_opening_width
        );
    }
}

module handle() {
    union() {
        rotate([90, 0, 0])
            linear_extrude(height = handle_depth, center = true, convexity = 10)
                handle_profile();

        translate([
            outer_radius - handle_attach_overlap,
            -handle_depth / 2,
            handle_center_z - handle_opening_height / 2 - handle_wall
        ])
            cube([
                handle_opening_left_x - (outer_radius - handle_attach_overlap),
                handle_depth,
                handle_opening_height + 2 * handle_wall
            ]);
    }
}

render(convexity = 10)
union() {
    mug_body();
    handle();
}
i3 success
iter 3
72.6s · 1490/3026t · $0.0321
diff vs i2: +7/-23
  $fn = 128;
  
  outer_diameter = 80;
  inner_diameter = 70;
  mug_height = 90;
  bottom_thickness = 6;
  
  outer_radius = outer_diameter / 2;
  inner_radius = inner_diameter / 2;
  
  handle_opening_height = 30;
  handle_opening_width = 25;
  handle_wall = 7;
  handle_depth = 16;
  handle_center_z = mug_height / 2;
  
  handle_opening_left_x = outer_radius + 5;
- handle_attach_overlap = 2.5;
  
  eps = 0.2;
  
  module mug_body() {
      difference() {
          cylinder(h = mug_height, r = outer_radius);
  
          translate([0, 0, bottom_thickness])
              cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
      }
  }
  
- module d_shape_2d(x0, z0, h, w, segments = 72) {
+ module d_shape_2d(x0, z0, h, w, segments = 96) {
      r = h / 2;
-     straight_len = max(w - r, 0);
  
      polygon(
          points = concat(
              [
-                 [x0, z0 - r],
-                 [x0 + straight_len, z0 - r]
+                 [x0, z0 - r]
              ],
              [
-                 for (i = [1 : segments])
+                 for (i = [0 : segments])
                      let (a = -90 + 180 * i / segments)
-                         [x0 + straight_len + r * cos(a), z0 + r * sin(a)]
+                         [x0 + w * cos(a), z0 + r * sin(a)]
              ],
              [
                  [x0, z0 + r]
              ]
          )
      );
  }
  
  module handle_profile() {
      difference() {
          offset(r = handle_wall)
              d_shape_2d(
                  handle_opening_left_x,
                  handle_center_z,
                  handle_opening_height,
                  handle_opening_width
              );
  
          d_shape_2d(
              handle_opening_left_x,
              handle_center_z,
              handle_opening_height,
              handle_opening_width
          );
      }
  }
  
  module handle() {
-     union() {
-         rotate([90, 0, 0])
-             linear_extrude(height = handle_depth, center = true, convexity = 10)
-                 handle_profile();
- 
-         translate([
-             outer_radius - handle_attach_overlap,
-             -handle_depth / 2,
-             handle_center_z - handle_opening_height / 2 - handle_wall
-         ])
-             cube([
-                 handle_opening_left_x - (outer_radius - handle_attach_overlap),
-                 handle_depth,
-                 handle_opening_height + 2 * handle_wall
-             ]);
-     }
+     rotate([90, 0, 0])
+         linear_extrude(height = handle_depth, center = true, convexity = 10)
+             handle_profile();
  }
  
  render(convexity = 10)
  union() {
      mug_body();
      handle();
  }
SCAD (79 lines)
$fn = 128;

outer_diameter = 80;
inner_diameter = 70;
mug_height = 90;
bottom_thickness = 6;

outer_radius = outer_diameter / 2;
inner_radius = inner_diameter / 2;

handle_opening_height = 30;
handle_opening_width = 25;
handle_wall = 7;
handle_depth = 16;
handle_center_z = mug_height / 2;

handle_opening_left_x = outer_radius + 5;

eps = 0.2;

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);

        translate([0, 0, bottom_thickness])
            cylinder(h = mug_height - bottom_thickness + eps, r = inner_radius);
    }
}

module d_shape_2d(x0, z0, h, w, segments = 96) {
    r = h / 2;

    polygon(
        points = concat(
            [
                [x0, z0 - r]
            ],
            [
                for (i = [0 : segments])
                    let (a = -90 + 180 * i / segments)
                        [x0 + w * cos(a), z0 + r * sin(a)]
            ],
            [
                [x0, z0 + r]
            ]
        )
    );
}

module handle_profile() {
    difference() {
        offset(r = handle_wall)
            d_shape_2d(
                handle_opening_left_x,
                handle_center_z,
                handle_opening_height,
                handle_opening_width
            );

        d_shape_2d(
            handle_opening_left_x,
            handle_center_z,
            handle_opening_height,
            handle_opening_width
        );
    }
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_depth, center = true, convexity = 10)
            handle_profile();
}

render(convexity = 10)
union() {
    mug_body();
    handle();
}