summaryrefslogtreecommitdiff
path: root/body/radxa_zero_3e.scad
blob: 731f883afdd5d30c93bb9b68a6b05f1410327ca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
include <helpers.scad>

radxa_zero_3e_pcb_w = 30;
radxa_zero_3e_pcb_h = 65;
radxa_zero_3e_pcb_thickness = 1.6;

rpi_protoboard_connectors_h = 12;
rpi_protoboard_z_offset = 15;

function radxa_zero_3e_pcb_size() = [
    radxa_zero_3e_pcb_w,
    radxa_zero_3e_pcb_h,
    radxa_zero_3e_pcb_thickness];

module radxa_zero_3e()
{
    pcb_w = radxa_zero_3e_pcb_w;
    pcb_h = radxa_zero_3e_pcb_h;
    pcb_t = radxa_zero_3e_pcb_thickness;
    
    //rotate([90, 0, 0])
    //translate([-pcb_w / 2, -pcb_h / 2, veye_imx287_pcb_thickness])
    
    translate([-pcb_w / 2, 0, 0])
    rotate([0, 0, -90])
    translate([0, 0, pcb_t])
    import("rs109_pcba.stl");
    
    // sd card
    sd_card_z_offset = 3;
    sd_card_w = 11;
    
    translate([0, -pcb_h, -3])
    cube([sd_card_w, sd_card_z_offset * 2, 1], center = true);
}

module rpi_zero_protoboard()
{
    s = radxa_zero_3e_pcb_size();
    w = s[0];
    h = s[1];
    t = s[2] + rpi_protoboard_connectors_h;
    r = 2.5;
    //translate([0, -s[1] / 2, 0])
    //cube(s, center = true);
    translate([0, 0, rpi_protoboard_z_offset])
    hull()
    {
        for (x = [-(w / 2 - r), (w / 2 - r)], y = [-(h - r), -r])
        {
            translate([x, y, 0])
            cylinder($fn = diameterToFn(r * 2), h = t, r = r);
        }
    }
}

module radxa_zero_3e_with_protoboard()
{
    radxa_zero_3e();
    rpi_zero_protoboard();
}

module radxa_zero_3e_rj45_male()
{
    // outer z (scanner coords) size of rj45 connector is
    // 8 mm, including bended wires
    z_delta = 8;
    w = 11.6;
    h = 6.6;
    
    // apply outer z (scanner coords) size
    // put inside rj45 female
    translate([0, 10.45, 2.3])
    cube([w, z_delta, h], center = true);
}

module radxa_zero_3e_with_protoboard_and_connectors()
{
    radxa_zero_3e_with_protoboard();
    radxa_zero_3e_rj45_male();
}

//radxa_zero_3e();
//rpi_zero_protoboard();

//radxa_zero_3e_with_protoboard();
//%radxa_zero_3e_rj45_male();
//radxa_zero_3e_with_protoboard_and_connectors();