vibe-openscad

pdf-page/gemma-4-e4b / tier-4-gp2y0d413k

success tier 4

pdf-page (google/gemma-4-e4b)

render
bare render of tier-4-gp2y0d413k
loading STL…
success 33.3s · 610/2561t
SCAD (77 lines)
// Sharp GP2Y0D413K0F Distance Sensor Housing Model
// Coordinate System: +Z = Up (Connector direction), +Y = Front/Lenses direction
// Units: mm

// --- Global Parameters & Tolerances ---
tolerance = 0.3; // Unspecified tolerance
pwb_thickness = 1.5; // Assumed thickness for PWB
case_material = "Carbonic ABS";

// ==============================================
// 1. Main Body Case (Housing)
// Based on overall dimensions, the case must encompass all components.
// Dimensions: Approx 56.3 (X length) x ~20 (Z height estimate based on components) x 17 (Y depth).
// We will model a slightly over-sized block to contain everything.
// ==============================================
module main_case(x_length, z_height, y_depth) {
    color([0.6, 0.6, 0.7]) cube([x_length, y_depth, z_height]); // Light blue/gray for ABS plastic
}

// ==============================================
// 2. PWB (Printed Circuit Board) and Connector Base
// Dimensions: L=39.4mm, W=16.3mm. Located near the bottom of the case.
// ==============================================
module pwbcase() {
    // A slight recess/base for mounting
    translate([0, -2, 0]) // Positioning slightly lower than main body floor (Z axis)
    cube([39.4, 16.3, pwb_thickness]);

    // Connector (Simplified representation of JCTC 12001W90-3P-HF)
    translate([0, -pwb_thickness*2, -5]) // Positioned on the edge of the PWB base
    cylinder(r=4, h=6, center=true);

    // Note: The main case should integrate around this. We assume the bottom part is cut out for mounting/access.
}

// ==============================================
// 3. Lens Assembly (Front Protrusion)
// This assembly extends along +Y from the main body face.
// ==============================================
module lens_assembly() {
    // General Housing Block for lenses
    translate([0, -5, 0]) // Positioned slightly in front of the main case plane
    cube([62, 15, 8]);

    // --- A. Emitter Lens (Circular, Left Side) ---
    // Center position: X approx -24.8 mm. Window size estimated (e.g., 7mm diameter).
    translate([-24.8, 0, 3]) // Positioned on the left side of the protrusion housing
    color([1, 0, 0, 0.5]) cylinder(r=7, h=6); // Redish semi-transparent window

    // --- B. Detector Lens (Rectangular, Right Side) ---
    // Center position: X approx 24.8 mm. Visible dimensions estimated (~10mm width, ~5mm height).
    translate([24.8, 0, 3]) // Positioned on the right side of the protrusion housing
    color([0, 0, 1, 0.5]) cube([10, 5, 1]); // Blueish semi-transparent window (Cube approximation)

    // Add a simple bezel/rim around the lenses for structural integrity
}


// ==============================================
// 4. Final Composition and Assembly
// Estimate dimensions to encompass all parts:
// X Max: ~30 mm (Detector side)
// X Min: ~-28 mm (Emitter side) -> Total Length L_X = 58 mm
// Y Depth: ~17 mm (PWB depth + protrusion length)
// Z Height: ~14 mm (Case height estimate)
// ==============================================

union() {
    // Main Body Case (The large outer shell)
    main_case(x_length = 58, z_height = 14, y_depth = 20);

    // PWB and Connector Base (Placed inside/on the bottom of the case)
    pwbcase();

    // Lens Assembly (Protrusion) - This structure is complexly integrated into the main case volume.
    lens_assembly();
}
パラメータ (2)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdpdf-page_gemma-4-e4b-ac8f87995e01-2026-04-29T13-39-10-730Z
matrixIdpdf-page/gemma-4-e4b
signatureac8f87995e01fb87…
provideropenai-self-hosted
modelgoogle/gemma-4-e4b
harnesspdf-page
statussuccess
duration33.26s (wallclock: load + prompt eval + generation + network)
TTFT0.959s
generation time24.77s (pure decode, excludes load + prompt eval)
tokens610 in / 2561 out
generation tok/s103.4 tok/s (pure decode rate)
wallclock tok/s77.0 tok/s (end-to-end)
createdAt2026-04-29T13:39:10.730Z
gitCommit27221824780d
openscadOpenSCAD version 2026.04.27

model metadata (self-hosted)

セルフホスト LLM はクラウドの単一 provider と違い、 実質「(モデル開発者, weight publisher, 量子化)」の組で挙動が決まる。 run 時に LM Studio / Ollama から取得した値:

publishergoogle
typevlm
archgemma4
quantizationQ4_K_M
max ctx131,072 tok
capabilitiestool_use
host GPUNVIDIA GeForce RTX 3090 (Vulkan)
host VRAM24 GB
host CPU12th Gen Intel(R) Core(TM) i9-12900K
host RAM32 GB

prompt

添付の Sharp 製距離センサ GP2Y0D413K0F のデータシート 2 ページ目には、
本体の外形寸法図(Outline Dimensions)が描かれています。図を読み取り、
OpenSCAD でセンサの外形をモデリングしてください。

含めるべき部位:
- 本体ケース(Carbonic ABS、概形は直方体)
- 前面に飛び出すレンズケース(2 つの窓を持つ突起)
- 発光部レンズ(円形の窓、左側)と受光部レンズ(矩形の窓、右側)
- 下部に取り付けられる PWB(プリント基板、薄板)
- 底面の 3 ピンコネクタ(JCTC 12001W90-3P-HF、簡易表現で可)

寸法:
- 図中のミリメートル数値に従ってください
- "*" 印が付いた寸法はレンズ中心位置を示す参照寸法です
- 括弧 `( )` で囲まれた値は参考寸法
- "Unspecified tolerances shall be ± 0.3 mm" に従ってよい

座標系:
- 本体の中心が原点。+Z は上方向(コネクタが下、レンズが前面 +Y)
- 単位は mm

内部の IC や回路素子はモデリング不要、外形だけで十分です。
完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。