vibe-openscad

bare-high/o3 / tier-2-offset-handle-mug

success tier 2

bare (o3)

render
bare render of tier-2-offset-handle-mug
loading STL…
success 188.1s · 273/15619t · $0.1255
SCAD (64 lines)
// Mug with oriented D-shaped handle ( +X direction )

$fn = 100;                        // resolution for round parts

// ------- Mug parameters -------
outer_d   = 80;                   // outer diameter
inner_d   = 70;                   // inner diameter
height    = 90;                   // total height
bottom_th = 6;                    // bottom thickness
wall_th   = (outer_d - inner_d)/2; // side wall thickness (5 mm)

// ------- Handle parameters -------
handle_inner_h = 30;              // inner height (Z)
handle_inner_w = 25;              // inner width (Y)
handle_wall    = wall_th;         // handle wall thickness

handle_h   = handle_inner_h + 2*handle_wall;            // total handle height
outer_r    = handle_inner_w/2 + handle_wall;            // outer semicircle radius
inner_r    = outer_r - handle_wall;                     // inner semicircle radius
offset_x   = handle_wall;                               // flat-side thickness

fudge = 0.01; // tiny overlap to guarantee union

// ------- 2D D-shape generator -------
module Dshape(r, off){
    union(){
        // flat-side rectangle
        translate([0, -r]) square([off, 2*r], center=false);
        // semicircle (only x >= 0 half)
        intersection(){
            translate([off, 0]) circle(r=r);
            translate([0, -r]) square([2*r + off, 2*r], center=false);
        }
    }
}

// ------- Mug body -------
module mug(){
    difference(){
        cylinder(d=outer_d, h=height);                           // outer shell
        translate([0, 0, bottom_th])
            cylinder(d=inner_d, h=height - bottom_th);           // inner cavity
    }
}

// ------- Handle -------
module handle(){
    difference(){
        // outer volume
        linear_extrude(height=handle_h, convexity=10)
            Dshape(outer_r, offset_x);
        // inner void
        translate([0, 0, handle_wall])
            linear_extrude(height=handle_inner_h, convexity=10)
                Dshape(inner_r, offset_x + handle_wall);
    }
}

// ------- Assembly -------
union(){
    mug();
    translate([outer_d/2 - fudge, 0, (height - handle_h)/2])
        handle();
}
パラメータ (7)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-high_o3-12b109a67864-2026-04-28T18-55-14-564Z
matrixIdbare-high/o3
signature12b109a67864341b…
provideropenai
modelo3-2025-04-16
harnessbare
statussuccess
duration188.11s (wallclock: load + prompt eval + generation + network)
tokens273 in / 15619 out
wallclock tok/s83.0 tok/s (end-to-end)
cost$0.1255
createdAt2026-04-28T18:55:14.564Z
gitCommit781e6c683dda
openscadOpenSCAD version 2026.04.27

prompt

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

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

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

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