pdf-page/gemini-3.5-flash-lite / tier-4-gp2y0a21yk
success tier 4
pdf-page (gemini 3.5 flash-lite)
render
loading STL…
// Sharp GP2Y0A21YK0F 測距センサ OpenSCAD モデル
// 単位: mm
// 座標系: 本体中心を原点 (X:幅方向, Y:奥行き方向, Z:高さ方向)
// 取付面(PWB/コネクタ側)を -Z に向ける。
$fn = 50;
module gp2y0a21yk0f() {
// --- 1. メインケース (黒色樹脂部) ---
// 寸法: 幅 37mm, 奥行き 13mm, 高さ 21.6mm (全体高さ 18.9 + PWB厚 1.2 から推定)
// 原点基準で配置
color("#222222")
translate([-37/2, -13/2, 0])
cube([37, 13, 18.9]);
// --- 2. 取付耳 (両サイドの穴付きタブ) ---
// 全長 29.5mm 間隔の取付穴 (φ3.2)
color("#222222")
difference() {
// タブ全体のベース
translate([-37/2, -13/2, 0])
cube([37, 13, 2.0]);
// 左取付穴 (中心から -14.75の位置)
translate([-29.5/2, 0, -1])
cylinder(d=3.2, h=4);
// 右取付穴 (中心から +14.75の位置)
translate([29.5/2, 0, -1])
cylinder(d=3.2, h=4);
}
// --- 3. レンズ部 (前面の突出部分) ---
// 正面 (Y = +6.5) に突出
color("#111111")
translate([-29.5/2, 6.5, (18.9 - 7.2)/2])
cube([29.5, 2.0, 7.2]);
// 発光部・受光部レンズ (円柱表現)
// 20mm 間隔
color("#880000") {
// Light emitter (左)
translate([-20/2, 6.5 + 2.0, 18.9/2])
rotate([90, 0, 0])
cylinder(d=6, h=1);
// Light detector (右)
translate([20/2, 6.5 + 2.0, 18.9/2])
rotate([90, 0, 0])
cylinder(d=6, h=1);
}
// --- 4. 背面コネクタ (JST / 相当品) ---
// 背面 (Y = -13/2) に突き出し
color("#dddddd")
translate([-10.1/2, -13/2 - 6.3, 0])
cube([10.1, 6.3, 13]);
// --- 5. PWB (基板) ---
// 厚み 1.2mm, 下部に配置
color("#2b542c") // 基板グリーン
translate([-37/2, -13/2, -1.2])
cube([37, 13, 1.2]);
}
// プレビュー表示
gp2y0a21yk0f(); prompt
添付画像は Sharp 製測距センサ GP2Y0A21YK0F のデータシートのページです。 OpenSCAD でモデリングしてください。 座標系: 単位 mm、本体の中心を原点とし、取付面(PWB / コネクタ側)を -Z に向ける。 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。