〇Raspberry Pi Zero WHのケース/フタ
〇ケースにRapberry Pi Zeroを収納した状態
作成手順
1. OpenSCADで以下のコードを実行して形状を調整し、STLファイルにエクスポートします。・ケース部分のOpenSCADコード
// Raspberry Pi Zeroのベースサイズ
PIZERO_W=65;
PIZERO_D=30;
PIZERO_H=9;
HOLE_OFFSET = 3.5;
// 四隅の穴の半径: ネジの大きさやプリンタの設定により適宜変更してください。
// HOLE_RADIUS = 1.4;
HOLE_RADIUS = 1.45;
// 底の厚さ
BOTTOM_THICK=2;
// 四隅のスペーサーの高さ
SPACER_H=3;
CAMERA_MARGIN=2;
WALL_THICK=2;
WALL_CONNECTOR_H=14;
WALL_CONNECTOR_HL=6;
MINI_HDMI_W=12;
WALL_BETWEEN_MINI_HDMI_AND_USB=18.5;
MICRO_USB_X2_W=20.5;
SDCARD_D=12;
module pizero_base()
{
difference(){
union(){
linear_extrude(height=BOTTOM_THICK){
square([PIZERO_W+CAMERA_MARGIN, PIZERO_D]);
}
translate([0, 0, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
translate([PIZERO_W-HOLE_OFFSET*2, 0, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
translate([0, PIZERO_D-HOLE_OFFSET*2, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
translate([PIZERO_W-HOLE_OFFSET*2, PIZERO_D-HOLE_OFFSET*2, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
}
translate([HOLE_OFFSET, HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
translate([PIZERO_W-HOLE_OFFSET, HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
translate([HOLE_OFFSET, PIZERO_D-HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
translate([PIZERO_W-HOLE_OFFSET, PIZERO_D-HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
}
}
module wall_connector()
{
translate([-WALL_THICK, -WALL_THICK, 0])
linear_extrude(height=WALL_CONNECTOR_H){
square([HOLE_OFFSET*2+WALL_THICK, WALL_THICK]);
}
translate([HOLE_OFFSET*2, -WALL_THICK, 0])
linear_extrude(height=WALL_CONNECTOR_HL){
square([MINI_HDMI_W, WALL_THICK]);
}
translate([HOLE_OFFSET*2+MINI_HDMI_W, -WALL_THICK, 0])
linear_extrude(height=WALL_CONNECTOR_H){
square([WALL_BETWEEN_MINI_HDMI_AND_USB, WALL_THICK]);
}
translate([HOLE_OFFSET*2+MINI_HDMI_W+WALL_BETWEEN_MINI_HDMI_AND_USB, -WALL_THICK, 0])
linear_extrude(height=WALL_CONNECTOR_HL){
square([MICRO_USB_X2_W, WALL_THICK]);
}
translate([HOLE_OFFSET*2+MINI_HDMI_W+WALL_BETWEEN_MINI_HDMI_AND_USB+MICRO_USB_X2_W, -WALL_THICK, 0])
linear_extrude(height=WALL_CONNECTOR_H){
square([HOLE_OFFSET*2+WALL_THICK+CAMERA_MARGIN, WALL_THICK]);
}
}
module wall_pins()
{
translate([-WALL_THICK, PIZERO_D, 0])
linear_extrude(height=WALL_CONNECTOR_H){
square([WALL_THICK*2+CAMERA_MARGIN+PIZERO_W, WALL_THICK]);
}
}
module wall_sdcard()
{
translate([-WALL_THICK, 0, 0])
linear_extrude(height=WALL_CONNECTOR_H){
square([WALL_THICK, PIZERO_D-HOLE_OFFSET*2-SDCARD_D]);
}
translate([-WALL_THICK, PIZERO_D-HOLE_OFFSET*2-SDCARD_D, 0])
linear_extrude(height=WALL_CONNECTOR_HL){
square([WALL_THICK, SDCARD_D]);
}
translate([-WALL_THICK, PIZERO_D-HOLE_OFFSET*2, 0])
linear_extrude(height=WALL_CONNECTOR_H){
square([WALL_THICK, HOLE_OFFSET*2]);
}
}
module wall_camera()
{
translate([PIZERO_W+CAMERA_MARGIN, 0, 0])
linear_extrude(height=WALL_CONNECTOR_H){
square([WALL_THICK, PIZERO_D]);
}
}
pizero_base();
wall_connector();
wall_pins();
wall_sdcard();
wall_camera();
・フタ部分のOpenSCADコード
// Raspberry Pi Zeroのベースサイズ
PIZERO_W=65;
PIZERO_D=30;
PIZERO_H=9;
HOLE_OFFSET = 3.5;
// 四隅の穴の半径: ネジの大きさやプリンタの設定により適宜変更してください。
// HOLE_RADIUS = 1.4;
HOLE_RADIUS = 1.45;
// 底(天井)の厚さ
BOTTOM_THICK=2;
SPACER_H=7;
CAMERA_MARGIN=2;
WALL_THICK=2;
LID_WALL_H=6;
WALL_CONNECTOR_H=12;
MINI_HDMI_W=12;
WALL_BETWEEN_MINI_HDMI_AND_USB=18.5;
MICRO_USB_X2_W=20.5;
SDCARD_D=12;
// 12 - 2 -2 -3 = 5
module pizero_lid()
{
difference(){
union(){
translate([-WALL_THICK, -WALL_THICK, 0])
linear_extrude(height=BOTTOM_THICK){
square([PIZERO_W+CAMERA_MARGIN+WALL_THICK*2, PIZERO_D+WALL_THICK*2]);
}
translate([0, 0, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
translate([PIZERO_W-HOLE_OFFSET*2, 0, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
translate([0, PIZERO_D-HOLE_OFFSET*2, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
translate([PIZERO_W-HOLE_OFFSET*2, PIZERO_D-HOLE_OFFSET*2, BOTTOM_THICK])
linear_extrude(height=SPACER_H){
square([HOLE_OFFSET*2, HOLE_OFFSET*2]);
}
}
translate([HOLE_OFFSET, HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
translate([PIZERO_W-HOLE_OFFSET, HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
translate([HOLE_OFFSET, PIZERO_D-HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
translate([PIZERO_W-HOLE_OFFSET, PIZERO_D-HOLE_OFFSET, 0])
linear_extrude(height=SPACER_H+BOTTOM_THICK){
circle(HOLE_RADIUS, $fn=50);
}
translate([HOLE_OFFSET*2, 0, 0])
linear_extrude(height=SPACER_H){
square([PIZERO_W-HOLE_OFFSET*4, HOLE_OFFSET*2]);
}
}
}
module lid_sdcard()
{
translate([-WALL_THICK, HOLE_OFFSET*2, 0])
linear_extrude(height=LID_WALL_H){
square([WALL_THICK, SDCARD_D]);
}
}
module lid_connector()
{
translate([HOLE_OFFSET*2, PIZERO_D, 0])
linear_extrude(height=LID_WALL_H){
square([MINI_HDMI_W, WALL_THICK]);
}
translate([HOLE_OFFSET*2+MINI_HDMI_W+WALL_BETWEEN_MINI_HDMI_AND_USB, PIZERO_D, 0])
linear_extrude(height=LID_WALL_H){
square([MICRO_USB_X2_W, WALL_THICK]);
}
}
pizero_lid();
lid_sdcard();
lid_connector();
〇OpenSCADの画面(ケース)
〇OpenSCADの画面(フタ)
2. Ultimaker CuraでSTLファイルを読み込み、スライスしてgcodeを保存します。
3. 3Dプリンターで印刷します
関連情報
・そのほかの3Dプリンターを活用した記事は以下を参照してください。OpenSCADまとめ
・Raspberry Pi Zeroと小型ターンテーブルをREST APIで制御する
0 件のコメント:
コメントを投稿