vibe-openscad

pdf-page/gemma-4-31b-it / tier-4-gp2y0a21yk

success tier 4

pdf-page (gemma 4 31b)

render
bare render of tier-4-gp2y0a21yk
loading STL…
success 144.6s · 349/5150t · $0
SCAD (66 lines)
// Sharp GP2Y0A21YK0F Distance Sensor Model
// Units: mm

// --- Parameters ---
body_width = 29.5;
total_width = 37.0;
body_depth = 13.0; // Estimated from side view
total_height = 13.5;
pwb_thickness = 1.2;
hole_dist = 20.0;
hole_dia = 3.2;
lens_case_width = 6.3;
lens_dist = 12.0; // Estimated distance between lens centers
connector_width = 10.1;

// Coordinate adjustment: Center of the body is origin
// Z-axis: PWB surface is at -total_height/2
z_offset = total_height / 2;

module gp2y0a21yk0f() {
    difference() {
        union() {
            // Main Body Case
            translate([0, 0, z_offset - (total_height - pwb_thickness)/2])
                cube([body_width, body_depth, total_height - pwb_thickness], center=true);
            
            // Mounting Ears (Tabs)
            translate([-(total_width/2 - (total_width-body_width)/4), 0, z_offset - (total_height - pwb_thickness)/2])
                cube([(total_width - body_width)/2, body_depth, total_height - pwb_thickness], center=true);
            
            translate([(total_width/2 - (total_width-body_width)/4), 0, z_offset - (total_height - pwb_thickness)/2])
                cube([(total_width - body_width)/2, body_depth, total_height - pwb_thickness], center=true);
            
            // PWB (Base Plate)
            translate([0, 0, -z_offset + pwb_thickness/2])
                cube([total_width, body_depth, pwb_thickness], center=true);
                
            // Lens Cases (Protrusions at the front)
            // Based on top view, lenses are placed symmetrically
            translate([lens_dist/2, body_depth/2 - 3.15, z_offset - (total_height - pwb_thickness)/2 + 2])
                cube([lens_case_width, 6.3, 8.0], center=true);
                
            translate([-lens_dist/2, body_depth/2 - 3.15, z_offset - (total_height - pwb_thickness)/2 + 2])
                cube([lens_case_width, 6.3, 8.0], center=true);
            
            // Connector (simplified)
            translate([0, -body_depth/2, -z_offset - 1.0])
                cube([connector_width, 4.0, 2.0], center=true);
        }
        
        // Mounting Holes
        translate([hole_dist/2, 0, 0])
            rotate([90, 0, 0])
                cylinder(d=hole_dia, h=total_width, center=true, $fn=20);
                
        translate([-hole_dist/2, 0, 0])
            rotate([90, 0, 0])
                cylinder(d=hole_dia, h=total_width, center=true, $fn=20);
    }
}

// Execute modeling
gp2y0a21yk0f();

// Reference markers (optional, for verification)
%translate([0,0,-z_offset]) cube([total_width, body_depth, 0.1], center=true); // Mounting Plane
パラメータ (10) —
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdpdf-page_gemma-4-31b-it-2c971ce8d6b7-2026-10-06T19-41-24-694Z
matrixIdpdf-page/gemma-4-31b-it
signature2c971ce8d6b7c49d…
providergoogle
modelgemma-4-31b-it
harnesspdf-page
statussuccess
duration144.64s (wallclock: load + prompt eval + generation + network)
tokens349 in / 5150 out
wallclock tok/s35.6 tok/s (end-to-end)
cost$0
createdAt2026-10-06T19:41:24.694Z
gitCommitf9f85ea20c03
openscadOpenSCAD version 2026.09.23

prompt

添付画像は Sharp 製測距センサ GP2Y0A21YK0F のデータシートのページです。
OpenSCAD でモデリングしてください。

座標系: 単位 mm、本体の中心を原点とし、取付面(PWB / コネクタ側)を -Z に向ける。

完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。