tier-4-gp2y0a21yk / google/gemma-4-e4b
1 run / 累計 21.3s / 累計 $0
google (self-hosted) gemma-4-e4b pdf-page
bare (provider default effort)
run detail → render
// Sharp GP2Y0A21YK0F Sensor Housing Model
// Units: millimeters (mm)
$fn = 64; // Increased detail for curved edges/cylinders
// --- Dimensions Definition (based on the drawing) ---
// Main Body Block dimensions (Approximate outer shell)
MAIN_W = 65; // X-axis width
MAIN_H = 27; // Z-axis height (Lens protrusion included)
MAIN_L = 40; // Y-axis length
// Connecting Bar dimensions
BAR_THICKNESS = 10; // Z-thickness of the connecting bar
BAR_LENGTH = MAIN_L + 15; // Extending past main block end for mounting points
// Lens/Window Dimensions (Simplified representation)
LENS_DEPTH = 2.0; // Depth of the lens recess feature on top
RECEIVING_WINDOW_W = 12;
RECEIVING_WINDOW_H = 4;
TRANSMITTING_WINDOW_D = 8;
TRANSMITTING_WINDOW_W = 6;
// Mounting Hole Dimensions
HOLE_DIAMETER = 3.0;
HOLE_Z_POS = -5; // Positioned near the end of the connecting bar
module sensor_housing() {
union() {
// 1. Main Body Housing (The primary rectangular block)
translate([0, 0, MAIN_H/2]) {
cube([MAIN_W, MAIN_L, MAIN_H]);
}
// 2. Connecting Bar Extension (Bottom extension)
// Note: This bar extends the overall length and provides mounting points.
translate([-MAIN_W/2, -15, BAR_THICKNESS/2]) {
cube([MAIN_W, BAR_LENGTH, BAR_THICKNESS]);
}
// 3. LENS WINDOWS (Features on the top face)
// These are modeled as recessed areas or visible windows in the upper surface.
// Receiving Lens Window (Left side, Rectangular)
translate([-15, 0, MAIN_H - 0.1]) { // Z slightly below top surface for recess effect
cube([RECEIVING_WINDOW_W, RECEIVING_WINDOW_H, LENS_DEPTH]);
}
// Transmitting Lens Window (Right side, Rectangular/Circular slot)
translate([5, 0, MAIN_H - 0.1]) { // Z slightly below top surface for recess effect
cube([TRANSMITTING_WINDOW_W, TRANSMITTING_WINDOW_D, LENS_DEPTH]);
}
// 4. MOUNTING HOLES (Subtracted from the Connecting Bar)
difference() {
// Start with a copy of the connecting bar volume to ensure accurate subtraction location
translate([-MAIN_W/2, -15, BAR_THICKNESS]) {
cube([MAIN_W, 0.1, BAR_THICKNESS]); // Thin slice where holes are placed
}
// Hole 1 (Left)
translate([-(MAIN_W/2) + 4, -10, 0]) {
cylinder(h=BAR_THICKNESS * 2, r=HOLE_DIAMETER/2);
}
// Hole 2 (Right)
translate([(MAIN_W/2) - 4, -10, 0]) {
cylinder(h=BAR_THICKNESS * 2, r=HOLE_DIAMETER/2);
}
}
}
}
// Final render call
sensor_housing(); パラメータ (11) —
スライダを動かすと openscad-wasm で再レンダリング
prompt
添付の Sharp 製測距センサ GP2Y0A21YK0F のデータシート 2 ページ目には 本体の外形寸法図(External dimensions)が描かれています。図を読み取り、 OpenSCAD でセンサの外形をモデリングしてください。 ※ 同じ Sharp の GP2Y0D413K0F とは別モデルです: - レンジ: 10〜80cm(アナログ電圧出力) - パッケージ: - 本体は横長(乗っているレンズ部 + 連結バー部分の2塊で構成) - 連結部にケーブル取り出し穴 + 取付穴2個 - 受光・発光のレンズが本体上部から飛び出している - コネクタはケーブル(JST PHR-3)で出る、本体下部に直付けではない 含めるべき部位: - レンズ部本体ケース(直方体に近い、上部にレンズ突起) - 発光側レンズと受光側レンズ(上面に並ぶ円形 / 矩形の窓) - 連結バー(レンズ部の下方向に伸びる薄い板状の延長部) - 連結バーにある取付穴 2 つ + ケーブル取り出しの切欠き - ケーブル(PCB / コネクタの代わりに丸棒で簡易表現で可) 寸法: - 図中のミリメートル数値に従ってください - "*" 印が付いた寸法はレンズ中心位置を示す参照寸法です - 括弧 `( )` で囲まれた値は参考寸法 - 未指定許容差 ±0.3 mm 座標系: - 本体の中心が原点。+Z は上方向(レンズが上面)、+Y は前方 - 単位は mm 内部の IC や回路素子はモデリング不要、外形だけで十分です。 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。 コードのみで、追加の説明は不要です。