vibe-openscad

tier-4-gp2y0a21yk / claude-haiku-4-5-20251001

1 run / 累計 10.7s / 累計 $0.0065

claude haiku 4.5 2025-10-01 pdf-page

bare (provider default effort)

run detail →
render
bare render of tier-4-gp2y0a21yk
loading STL…
success 10.7s · 1683/972t · $0.0065
SCAD (69 lines)
// Sharp GP2Y0A21YK0F Distance Measuring Sensor
// Unit: mm
// Origin at center of device, -Z direction is mounting side (PWB/Connector)

module gp2y0a21yk0f() {
    // Main body dimensions
    body_length = 29.5;  // Total length
    body_width = 13;     // Total width
    body_height = 13.5;  // Total height
    
    // Position so mounting side is at -Z
    translate([0, 0, body_height/2]) {
        
        // Main case body
        cube([body_width, body_length, body_height], center=true);
        
        // Light emitter (left side)
        translate([-6.5, -7.5, 4]) {
            cylinder(h=3, r=2.8, center=true, $fn=32);
        }
        
        // Light detector (right side, center)
        translate([6.5, -0.5, 4]) {
            cylinder(h=3, r=1.9, center=true, $fn=32);
        }
        
        // Lens case (center front)
        translate([0, -7.5, 4.5]) {
            cylinder(h=4, r=3.8, center=true, $fn=32);
        }
        
        // Connector back (mounting side)
        translate([0, 10.5, -5.5]) {
            // Main connector body
            cube([16.3, 7.5, 3], center=true);
            
            // Connector pins area
            translate([0, -2, 0]) {
                cube([4.15, 2, 2.5], center=true);
            }
        }
        
        // PWB (circuit board)
        translate([0, 8, -4.5]) {
            cube([14.75, 18.1, 1.2], center=true);
        }
        
        // Mounting tabs/stamps
        translate([-8, 3.5, -1]) {
            cube([2, 3, 2], center=true);
        }
        translate([8, 3.5, -1]) {
            cube([2, 3, 2], center=true);
        }
        
        // Lens acrylic (front optical window)
        translate([0, -11.5, 5.5]) {
            sphere(r=3.2, $fn=32);
        }
    }
}

// Render the sensor
gp2y0a21yk0f();

// Optional: Add reference coordinate system
%translate([0, 0, 0]) {
    cylinder(h=20, r=0.5, center=true, $fn=16); // Z axis
}

prompt

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

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

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