fixed indent to adjust correctly based on wallthick, fixed standoff wall support placement,

more customizer integration work, removed case data from sbc_case_builder.cfg, additional
cases in json format.
This commit is contained in:
Edward Kisiel
2022-07-30 22:40:03 -04:00
parent 3c8abbdcd8
commit 2e9f05f8bd
3 changed files with 865 additions and 1619 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -48,6 +48,398 @@
"view": "model", "view": "model",
"vu_rotation": "[15, 0, 0]", "vu_rotation": "[15, 0, 0]",
"wallthick": "2" "wallthick": "2"
},
"c4_stacked": {
"$fn": "90",
"accessory_name": "none",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "3.5",
"case_design": "stacked",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "0",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "none",
"cooling": "fan",
"exhaust_vents": "none",
"fillet": "0",
"floorthick": "2",
"gap": "1.5",
"gpio_opening": "none",
"highlight": "false",
"indents": "false",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "true",
"sidethick": "1",
"sidewall_support": "false",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
},
"c4_panel": {
"$fn": "90",
"accessory_name": "none",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "0",
"case_design": "panel",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "0",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "none",
"cooling": "fan",
"exhaust_vents": "vent",
"fillet": "0",
"floorthick": "2",
"gap": "1.5",
"gpio_opening": "none",
"highlight": "false",
"indents": "true",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "false",
"sidethick": "1",
"sidewall_support": "false",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
},
"c4_tray": {
"$fn": "90",
"accessory_name": "none",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "3",
"case_design": "tray",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "4",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "none",
"cooling": "fan",
"exhaust_vents": "vent",
"fillet": "2",
"floorthick": "2",
"gap": "1",
"gpio_opening": "none",
"highlight": "false",
"indents": "true",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "false",
"sidethick": "2",
"sidewall_support": "false",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
},
"c4_tray_sides": {
"$fn": "90",
"accessory_name": "none",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "0",
"case_design": "tray",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "4",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "sides",
"cooling": "fan",
"exhaust_vents": "vent",
"fillet": "2",
"floorthick": "2",
"gap": "1",
"gpio_opening": "none",
"highlight": "false",
"indents": "true",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "false",
"sidethick": "2",
"sidewall_support": "false",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
},
"c4_round": {
"$fn": "90",
"accessory_name": "c4_round",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "0",
"case_design": "round",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "0",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "none",
"cooling": "fan",
"exhaust_vents": "none",
"fillet": "0",
"floorthick": "2",
"gap": "1.5",
"gpio_opening": "none",
"highlight": "false",
"indents": "false",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "false",
"sidethick": "1",
"sidewall_support": "false",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "3"
},
"c4_hex": {
"$fn": "90",
"accessory_name": "c4_hex",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "0",
"case_design": "hex",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "0",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "none",
"cooling": "fan",
"exhaust_vents": "none",
"fillet": "0",
"floorthick": "2",
"gap": "1.5",
"gpio_opening": "none",
"highlight": "false",
"indents": "false",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "false",
"sidethick": "1",
"sidewall_support": "false",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "3"
},
"c4_fitted": {
"$fn": "90",
"accessory_name": "none",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "3.5",
"case_design": "fitted",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "0",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "none",
"cooling": "fan",
"exhaust_vents": "vent",
"fillet": "0",
"floorthick": "2",
"gap": "1",
"gpio_opening": "none",
"highlight": "false",
"indents": "true",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "false",
"sidethick": "1",
"sidewall_support": "true",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
},
"c4_snap": {
"$fn": "90",
"accessory_name": "none",
"adjust": "0.01",
"bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"c_fillet": "3.5",
"case_design": "snap",
"case_ext_standoffs": "false",
"case_ffn": "90",
"case_fn": "360",
"case_offset_bz": "0",
"case_offset_tz": "0",
"case_offset_x": "0",
"case_offset_y": "0",
"case_style": "none",
"cooling": "fan",
"exhaust_vents": "vent",
"fillet": "0",
"floorthick": "2",
"gap": "1",
"gpio_opening": "none",
"highlight": "false",
"indents": "true",
"lip": "5",
"lower_bottom": "0",
"mode": "none",
"move_front": "0",
"move_leftside": "0",
"move_rear": "0",
"move_rightside": "0",
"pcb_loc_x": "0",
"pcb_loc_y": "0",
"pcb_loc_z": "0",
"raise_top": "0",
"sata_punchout": "false",
"sbc_bottom_standoffs": "true",
"sbc_model": "c4",
"sbc_off": "false",
"sbc_top_standoffs": "false",
"sidethick": "1",
"sidewall_support": "true",
"tol": "0.25",
"top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_standoff": "[6.75, 20, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
} }
}, },
"fileFormatVersion": "1" "fileFormatVersion": "1"

View File

@@ -33,8 +33,8 @@
20220406 Version 1.2.2 added vu7c, vu8m and weatherboard2 models, other additions, fixes and maintenance 20220406 Version 1.2.2 added vu7c, vu8m and weatherboard2 models, other additions, fixes and maintenance
20220515 Version 1.2.3 added odroid-m1, jetson nano, rockpro64, completed mask(), improved docs 20220515 Version 1.2.3 added odroid-m1, jetson nano, rockpro64, completed mask(), improved docs
changed tray top design changed tray top design
2022xxxx Version 2.0.x added round, hexagon, snap and fitted cases, customizer user interface, 2022xxxx Version 2.0.x added round, hexagon, snap and fitted cases, full customizer user interface,
configuration file changed to json case configuration file changed to json, accessories kept in sbc_case_builder.cfg
see https://github.com/hominoids/SBC_Case_Builder see https://github.com/hominoids/SBC_Case_Builder
*/ */
@@ -83,9 +83,9 @@ pcb_loc_z = 0; //[0:.25:50]
case_offset_x = 0; //[0:.5:200] case_offset_x = 0; //[0:.5:200]
// additional y axis case size // additional y axis case size
case_offset_y = 0; //[0:.5:200] case_offset_y = 0; //[0:.5:200]
// additional z axis case bottom size
case_offset_tz = 0; //[0:.5:50]
// additional z axis case top size // additional z axis case top size
case_offset_tz = 0; //[0:.5:50]
// additional z axis case bottom size
case_offset_bz = 0; //[0:.5:50] case_offset_bz = 0; //[0:.5:50]
// case wall thickness // case wall thickness
wallthick = 2; //[1:.5:5] wallthick = 2; //[1:.5:5]
@@ -130,11 +130,10 @@ top_ext_standoff = [6.75,18,2.5,10,4,4,0,1,0,4.5,5.1];
bottom_ext_standoff = [6.75,5,3.6,10,4,1,0,0,0,4.5,5.1]; bottom_ext_standoff = [6.75,5,3.6,10,4,1,0,0,0,4.5,5.1];
/* [Case Accessories] */ /* [Case Accessories] */
// case accessories to load // case accessory group to load
case_name = "c4_shell"; // [c1+_shell,c1+_shell_boombox,c1+_panel,c1+_panel_boombox,c1+_panel_lcd3.5,c1+_desktop_lcd3.5,c1+_stacked,c1+_tray,c1+_tray_sides,c1+_tray_boombox,c1+_tray_vu5,c1+_tray_vu7,c2_shell,c2_shell_boombox,c2_panel,c2_panel_boombox,c2_panel_lcd3.5,c2_desktop_lcd3.5,c2_deskboom_lcd3.5,c2_stacked,c2_tray,c2_tray_sides,c2_tray_boombox,c2_tray_vu5,c2_tray_vu7,c4_shell,c4_shell_boombox,c4_shell_vu7c,c4_panel,c4_panel_lcd3.5,c4_desktop_lcd3.5,c4_deskboom_lcd3.5,c4_panel_boombox,c4_stacked,c4_tray,c4_tray_sides,c4_tray_boombox,c4_tray_vu5,c4_tray_vu7,xu4_shell,xu4_panel,xu4_stacked,xu4_tray,xu4_tray_sides,xu4_tray_vu5,xu4_tray_vu7,xu4q_shell,xu4q_panel,xu4q_stacked,xu4q_tray,xu4q_tray_sides,xu4q_tray_vu5,xu4q_tray_vu7,n1_shell,n1_panel,n1_stacked,n1_tray,n1_tray_sides,n1_tray_vu5,n1_tray_vu7,n2_panel,n2_tray,n2_tray_sides,n2_tray_vu5,n2_tray_vu7,n2+_panel,n2+_tray,n2+_tray_sides,n2+_tray_vu5,n2+_tray_vu7,n2+_tray_vu7_fan,m1_panel,m1_tray,m1_tray_drive,m1_tray_sides,m1_tray_vu5,m1_tray_vu7,h2_shell,h2_panel,h2_stacked,h2_tray,h2_tray_sides,h2_tray_vu5,h2_tray_vu7,h2_tray_router,h2_router_station,h2_lowboy,h2_lowboy_router,h2_shell_router,h2_shell_router-ssd,hc4_shell,hc4_panel,hc4_stacked,hc4_tray,hc4_tray_sides,hc4_tray_vu5,hc4_tray_vu7,hc4_tray_drivebox2.5,hc4_shell_drivebox2.5,hc4_shell_drivebox2.5v,hc4_shell_drivebox3.5,jetsonnano_shell,jetsonnano_panel,jetsonnano_stacked,jetsonnano_tray,jetsonnano_tray_sides,rockpro64_shell,rockpro64_panel,rockpro64_stacked,rockpro64_tray,rockpro64_tray_sides,show2_shell,rpi3b+_shell,rpi3b+_panel,rpi3b+_stacked,rpi3b+_tray,test] accessory_name = "none"; // [none,c1+_shell_boombox,c1+_panel_boombox,c1+_panel_lcd3.5,c1+_desktop_lcd3.5,c1+_tray_boombox,c1+_tray_vu5,c1+_tray_vu7,c2_shell,c2_shell_boombox,c2_panel,c2_panel_boombox,c2_panel_lcd3.5,c2_desktop_lcd3.5,c2_deskboom_lcd3.5,c2_stacked,c2_tray,c2_tray_sides,c2_tray_boombox,c2_tray_vu5,c2_tray_vu7,c4_shell,c4_shell_boombox,c4_shell_vu7c,c4_panel,c4_panel_lcd3.5,c4_desktop_lcd3.5,c4_deskboom_lcd3.5,c4_panel_boombox,c4_stacked,c4_tray,c4_tray_sides,c4_tray_boombox,c4_tray_vu5,c4_tray_vu7,c4_round,c4_hex,xu4_tray_vu5,xu4_tray_vu7,xu4q_tray_vu5,xu4q_tray_vu7,n1_tray_vu5,n1_tray_vu7,n2_tray_vu5,n2_tray_vu7,n2+_tray_vu5,n2+_tray_vu7,n2+_tray_vu7_fan,m1_panel,m1_tray,m1_tray_drive,m1_tray_sides,m1_tray_vu5,m1_tray_vu7,h2_shell,h2_panel,h2_stacked,h2_tray,h2_tray_sides,h2_tray_vu5,h2_tray_vu7,h2_tray_router,h2_router_station,h2_lowboy,h2_lowboy_router,h2_shell_router,h2_shell_router-ssd,hc4_shell,hc4_panel,hc4_stacked,hc4_tray,hc4_tray_sides,hc4_tray_vu5,hc4_tray_vu7,hc4_tray_drivebox2.5,hc4_shell_drivebox2.5,hc4_shell_drivebox2.5v,hc4_shell_drivebox3.5,jetsonnano_shell,jetsonnano_panel,jetsonnano_stacked,jetsonnano_tray,jetsonnano_tray_sides,rockpro64_shell,rockpro64_panel,rockpro64_stacked,rockpro64_tray,rockpro64_tray_sides,show2_shell,test]
a = search([accessory_name],accessory_data);
c = search([case_name],case_data);
s = search([sbc_model],sbc_data); s = search([sbc_model],sbc_data);
pcb_width = sbc_data[s[0]][1]; pcb_width = sbc_data[s[0]][1];
@@ -143,8 +142,8 @@ pcb_z = sbc_data[s[0]][3];
pcb_tmaxz = sbc_data[s[0]][5]; pcb_tmaxz = sbc_data[s[0]][5];
pcb_bmaxz = sbc_data[s[0]][6]; pcb_bmaxz = sbc_data[s[0]][6];
width = pcb_width+(2*(wallthick+gap))+case_offset_x; width = pcb_width+2*(wallthick+gap)+case_offset_x;
depth = pcb_depth+(2*(wallthick+gap))+case_offset_y; depth = pcb_depth+2*(wallthick+gap)+case_offset_y;
top_height = pcb_tmaxz+floorthick+case_offset_tz; top_height = pcb_tmaxz+floorthick+case_offset_tz;
bottom_height = pcb_bmaxz+floorthick+case_offset_bz; bottom_height = pcb_bmaxz+floorthick+case_offset_bz;
case_z = bottom_height+top_height; case_z = bottom_height+top_height;
@@ -205,29 +204,31 @@ if (view == "platter") {
translate([0,(2*depth)+20,case_z]) rotate([180,0,0]) case_top(case_design); translate([0,(2*depth)+20,case_z]) rotate([180,0,0]) case_top(case_design);
} }
// platter accessories // platter accessories
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "platter" && type != "button_top") { if (class == "platter" && type != "button_top") {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
} }
if (class == "platter" && type == "button_top") { if (class == "platter" && type == "button_top") {
translate([loc_x,loc_y,loc_z+1.25]) rotate([-90,0,0]) button_plunger(data_3, size_x, size_z); translate([loc_x,loc_y,loc_z+1.25]) rotate([-90,0,0]) button_plunger(data_3, size_x, size_z);
translate([loc_x-20,loc_y-10,loc_z+3]) rotate([0,0,0]) button_top(data_3, size_x, size_z); translate([loc_x-20,loc_y-10,loc_z+3]) rotate([0,0,0]) button_top(data_3, size_x, size_z);
translate([loc_x-20,loc_y-20,loc_z]) rotate([0,0,0]) button_clip(data_3); translate([loc_x-20,loc_y-20,loc_z]) rotate([0,0,0]) button_clip(data_3);
}
} }
} }
} }
@@ -240,7 +241,7 @@ if (view == "model") {
color("dimgrey",1) translate([0,0,-lower_bottom]) case_bottom(case_design); color("dimgrey",1) translate([0,0,-lower_bottom]) case_bottom(case_design);
} }
if(sbc_off == false) { if(sbc_off == false) {
translate([pcb_loc_x ,pcb_loc_y,bottom_standoff[1]]) sbc(sbc_model); translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z]) sbc(sbc_model);
} }
if(raise_top >= 0) { if(raise_top >= 0) {
color("grey",1) translate([0,0,raise_top]) case_top(case_design); color("grey",1) translate([0,0,raise_top]) case_top(case_design);
@@ -251,7 +252,7 @@ if (view == "model") {
color("grey",1) translate([0,0,-lower_bottom]) case_bottom(case_design); color("grey",1) translate([0,0,-lower_bottom]) case_bottom(case_design);
} }
if(sbc_off == false) { if(sbc_off == false) {
translate([pcb_loc_x ,pcb_loc_y,bottom_standoff[1]]) sbc(sbc_model); translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z]) sbc(sbc_model);
} }
if(raise_top >= 0) { if(raise_top >= 0) {
color("grey",1) translate([0,0,raise_top])case_top(case_design); color("grey",1) translate([0,0,raise_top])case_top(case_design);
@@ -274,7 +275,7 @@ if (view == "model") {
color("grey",1) translate([0,0,-lower_bottom]) case_bottom(case_design); color("grey",1) translate([0,0,-lower_bottom]) case_bottom(case_design);
} }
if(sbc_off == false) { if(sbc_off == false) {
translate([pcb_loc_x ,pcb_loc_y,bottom_standoff[1]]) sbc(sbc_model); translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z]) sbc(sbc_model);
} }
if(raise_top >= 0) { if(raise_top >= 0) {
color("grey",1) translate([0,0,raise_top]) case_top(case_design); color("grey",1) translate([0,0,raise_top]) case_top(case_design);
@@ -337,10 +338,10 @@ if (view == "model") {
} }
if(case_design == "round" || case_design == "hex") { if(case_design == "round" || case_design == "hex") {
if(lower_bottom >= 0) { if(lower_bottom >= 0) {
color("grey",1) translate([0,0,-lower_bottom]) case_bottom(case_design); color("dimgrey",1) translate([0,0,-lower_bottom]) case_bottom(case_design);
} }
if(sbc_off == false) { if(sbc_off == false) {
translate([pcb_loc_x ,pcb_loc_y,bottom_standoff[1]]) sbc(sbc_model); translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z]) sbc(sbc_model);
} }
if(raise_top >= 0) { if(raise_top >= 0) {
color("grey",1) translate([0,0,raise_top]) case_top(case_design); color("grey",1) translate([0,0,raise_top]) case_top(case_design);
@@ -348,51 +349,52 @@ if (view == "model") {
} }
if(case_design == "snap" || case_design == "fitted") { if(case_design == "snap" || case_design == "fitted") {
if(lower_bottom >= 0) { if(lower_bottom >= 0) {
color("grey",1) translate([0,0,-lower_bottom]) case_bottom(case_design); color("dimgrey",1) translate([0,0,-lower_bottom]) case_bottom(case_design);
} }
if(sbc_off == false) { if(sbc_off == false) {
translate([pcb_loc_x ,pcb_loc_y,bottom_standoff[1]]) sbc(sbc_model); translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z]) sbc(sbc_model);
} }
if(raise_top >= 0) { if(raise_top >= 0) {
color("grey",1) translate([0,0,raise_top]) case_top(case_design); color("grey",1) translate([0,0,raise_top]) case_top(case_design);
} }
} }
// model accessories // model accessories
for (i=[30:14:len(case_data[c[0]])-1]) { echo(accessory_name,accessory_data[a[0]]);
class = case_data[c[0]][i]; if(accessory_name != "none") {
type = case_data[c[0]][i+1]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
loc_x = case_data[c[0]][i+2]; class = accessory_data[a[0]][i];
loc_y = case_data[c[0]][i+3]; type = accessory_data[a[0]][i+1];
loc_z = case_data[c[0]][i+4]; loc_x = accessory_data[a[0]][i+2];
face = case_data[c[0]][i+5]; loc_y = accessory_data[a[0]][i+3];
rotation = case_data[c[0]][i+6]; loc_z = accessory_data[a[0]][i+4];
size_x = case_data[c[0]][i+7]; face = accessory_data[a[0]][i+5];
size_y = case_data[c[0]][i+8]; rotation = accessory_data[a[0]][i+6];
size_z = case_data[c[0]][i+9]; size_x = accessory_data[a[0]][i+7];
data_1 = case_data[c[0]][i+10]; size_y = accessory_data[a[0]][i+8];
data_2 = case_data[c[0]][i+11]; size_z = accessory_data[a[0]][i+9];
data_3 = case_data[c[0]][i+12]; data_1 = accessory_data[a[0]][i+10];
data_4 = case_data[c[0]][i+13]; data_2 = accessory_data[a[0]][i+11];
data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "model" && face == "top" && raise_top > -1) { if (class == "model" && face == "top" && raise_top > -1) {
add(type,loc_x,loc_y,loc_z+raise_top,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z+raise_top,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
} }
else { else {
if (class == "model"&& face != "top" ) { if (class == "model"&& face != "top" ) {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} }
} }
if(case_design == "tray") {
echo(width=width+2*sidethick,depth=depth,top=top_height,bottom=bottom_height);
}
else {
echo(width=width,depth=depth,top=top_height,bottom=bottom_height);
}
} }
if(case_design == "tray") {
echo(width=width+2*sidethick,depth=depth,top=top_height,bottom=bottom_height);
}
else {
echo(width=width,depth=depth,top=top_height,bottom=bottom_height);
}
//}
// debug // debug
if (view == "debug") { if (view == "debug") {
case_top(case_design); case_top(case_design);
@@ -498,7 +500,6 @@ module case_bottom(case_design) {
cube([width,wallthick,top_height-floorthick]); cube([width,wallthick,top_height-floorthick]);
} }
if(case_design == "round") { if(case_design == "round") {
difference() { difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,30]) translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,30])
@@ -598,24 +599,26 @@ module case_bottom(case_design) {
} }
} }
// additive accessories // additive accessories
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "add1" && face == "bottom") { if (class == "add1" && face == "bottom") {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} }
} }
@@ -708,25 +711,40 @@ module case_bottom(case_design) {
pcb_hole_size = sbc_data[s[0]][i+2]; pcb_hole_size = sbc_data[s[0]][i+2];
if(sbc_model == "h2" && mode == "net_card" && (i == 7 || i ==13)) { if(sbc_model == "h2" && mode == "net_card" && (i == 7 || i ==13)) {
if (pcb_hole_x!=0 && pcb_hole_y!=0) { if (pcb_hole_x!=0 && pcb_hole_y!=0) {
bottom_standoff = [case_data[c[0]][27][0], // diameter netcard_standoff = [bottom_standoff[0], // diameter
bottom_height-pcb_z-4, // height bottom_height-pcb_z bottom_height-pcb_z-4, // height bottom_height-pcb_z
case_data[c[0]][27][2], // holesize bottom_standoff[2], // holesize
case_data[c[0]][27][3], // supportsize bottom_standoff[3], // supportsize
case_data[c[0]][27][4], // supportheight bottom_standoff[4], // supportheight
case_data[c[0]][27][5], // 1=countersink, 2=recessed hole, 3=nut holder, 4=blind bottom_standoff[5], // 1=countersink, 2=recessed hole, 3=nut holder, 4=blind
case_data[c[0]][27][6], // standoff style 0=hex, 1=cylinder bottom_standoff[6], // standoff style 0=hex, 1=cylinder
case_data[c[0]][27][7], // enable reverse standoff bottom_standoff[7], // enable reverse standoff
case_data[c[0]][27][8], // enable insert at top of standoff bottom_standoff[8], // enable insert at top of standoff
case_data[c[0]][27][9], // insert hole dia. mm bottom_standoff[9], // insert hole dia. mm
case_data[c[0]][27][10]]; // insert depth mm bottom_standoff[10]]; // insert depth mm
translate([pcb_hole_x,pcb_hole_y,0]) standoff(netcard_standoff);
translate([pcb_hole_x,pcb_hole_y,0]) standoff(bottom_standoff);
} }
} }
else { else {
if (pcb_hole_x!=0 && pcb_hole_y!=0) { if (pcb_hole_x!=0 && pcb_hole_y!=0 && case_design != "shell") {
translate([pcb_hole_x,pcb_hole_y,0]) standoff(bottom_standoff); translate([pcb_hole_x,pcb_hole_y,0]) standoff(bottom_standoff);
} }
else {
if (pcb_hole_x!=0 && pcb_hole_y!=0) {
shell_standoff = [bottom_standoff[0], // diameter
bottom_height-pcb_z, // height bottom_height-pcb_z
bottom_standoff[2], // holesize
bottom_standoff[3], // supportsize
bottom_standoff[4], // supportheight
bottom_standoff[5], // 1=countersink, 2=recessed hole, 3=nut holder, 4=blind
bottom_standoff[6], // standoff style 0=hex, 1=cylinder
bottom_standoff[7], // enable reverse standoff
bottom_standoff[8], // enable insert at top of standoff
bottom_standoff[9], // insert hole dia. mm
bottom_standoff[10]]; // insert depth mm
translate([pcb_hole_x,pcb_hole_y,0]) standoff(shell_standoff);
}
}
} }
} }
} }
@@ -775,19 +793,19 @@ module case_bottom(case_design) {
pcb_hole_size = sbc_data[s[0]][i+2]; pcb_hole_size = sbc_data[s[0]][i+2];
if (pcb_hole_x!=0 && pcb_hole_y!=0 && i == 7 || i == 10) { if (pcb_hole_x!=0 && pcb_hole_y!=0 && i == 7 || i == 10) {
if(sbc_model == "h2" && mode == "net_card" && i == 7) { if(sbc_model == "h2" && mode == "net_card" && i == 7) {
bottom_standoff = [case_data[c[0]][27][0], // diameter netcard_standoff = [bottom_standoff[0], // diameter
bottom_height-pcb_z-4, // height bottom_height-pcb_z bottom_height-pcb_z-4, // height bottom_height-pcb_z
case_data[c[0]][27][2], // holesize bottom_standoff[2], // holesize
case_data[c[0]][27][3], // supportsize bottom_standoff[3], // supportsize
case_data[c[0]][27][4], // supportheight bottom_standoff[4], // supportheight
case_data[c[0]][27][5], // 1=countersink, 2=recessed hole, 3=nut holder, 4=blind bottom_standoff[5], // 1=countersink, 2=recessed hole, 3=nut holder, 4=blind
case_data[c[0]][27][6], // standoff style 0=hex, 1=cylinder bottom_standoff[6], // standoff style 0=hex, 1=cylinder
case_data[c[0]][27][7], // enable reverse standoff bottom_standoff[7], // enable reverse standoff
case_data[c[0]][27][8], // enable insert at top of standoff bottom_standoff[8], // enable insert at top of standoff
case_data[c[0]][27][9], // insert hole dia. mm bottom_standoff[9], // insert hole dia. mm
case_data[c[0]][27][10]]; // insert depth mm bottom_standoff[10]]; // insert depth mm
translate([pcb_hole_x-(bottom_standoff[0]/2)-2.6+adjust, pcb_hole_y-gap,0]) translate([pcb_hole_x-(netcard_standoff[0]/2)-2.6+adjust, pcb_hole_y-gap,0])
cube([gap+1.6,2,bottom_standoff[1]]); cube([gap+1.6,2,netcard_standoff[1]]);
} }
else { else {
translate([pcb_hole_x-(bottom_standoff[0]/2)-2.6+adjust, pcb_hole_y-gap,0]) translate([pcb_hole_x-(bottom_standoff[0]/2)-2.6+adjust, pcb_hole_y-gap,0])
@@ -796,19 +814,19 @@ module case_bottom(case_design) {
} }
if (pcb_hole_x!=0 && pcb_hole_y!=0 && i == 13 || i == 16) { if (pcb_hole_x!=0 && pcb_hole_y!=0 && i == 13 || i == 16) {
if(sbc_model == "h2" && mode == "net_card" && i == 13) { if(sbc_model == "h2" && mode == "net_card" && i == 13) {
bottom_standoff = [case_data[c[0]][27][0], // diameter netcard_standoff = [bottom_standoff[0], // diameter
bottom_height-pcb_z-4, // height bottom_height-pcb_z bottom_height-pcb_z-4, // height bottom_height-pcb_z
case_data[c[0]][27][2], // holesize bottom_standoff[2], // holesize
case_data[c[0]][27][3], // supportsize bottom_standoff[3], // supportsize
case_data[c[0]][27][4], // supportheight bottom_standoff[4], // supportheight
case_data[c[0]][27][5], // 1=countersink, 2=recessed hole, 3=nut holder, 4=blind bottom_standoff[5], // 1=countersink, 2=recessed hole, 3=nut holder, 4=blind
case_data[c[0]][27][6], // standoff style 0=hex, 1=cylinder bottom_standoff[6], // standoff style 0=hex, 1=cylinder
case_data[c[0]][27][7], // enable reverse standoff bottom_standoff[7], // enable reverse standoff
case_data[c[0]][27][8], // enable insert at top of standoff bottom_standoff[8], // enable insert at top of standoff
case_data[c[0]][27][9], // insert hole dia. mm bottom_standoff[9], // insert hole dia. mm
case_data[c[0]][27][10]]; // insert depth mm bottom_standoff[10]]; // insert depth mm
translate([pcb_hole_x+(bottom_standoff[0]/2)-.5+adjust, pcb_hole_y-gap,0]) translate([pcb_hole_x+(netcard_standoff[0]/2)-.5+adjust, pcb_hole_y-gap,0])
cube([gap+1.5,2,bottom_standoff[1]]); cube([gap+1.5,2,netcard_standoff[1]]);
} }
else { else {
translate([pcb_hole_x+(bottom_standoff[0]/2)-.5+adjust, pcb_hole_y-gap,0]) translate([pcb_hole_x+(bottom_standoff[0]/2)-.5+adjust, pcb_hole_y-gap,0])
@@ -845,21 +863,22 @@ module case_bottom(case_design) {
} }
// subtractive accessories // subtractive accessories
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if ((class == "sub" && face == "bottom") || class == "suball") { if ((class == "sub" && face == "bottom") || class == "suball") {
if(highlight == false) { if(highlight == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
@@ -903,7 +922,6 @@ module case_bottom(case_design) {
} }
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") { if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
if(data_3 == "recess") { if(data_3 == "recess") {
// sub("round",loc_x,loc_y,loc_z-1,face,rotation,size_x,size_y,5,data_1,data_2,data_3,0);
#translate([loc_x,loc_y,loc_z]) sphere(d=size_x); #translate([loc_x,loc_y,loc_z]) sphere(d=size_x);
} }
if(data_3 == "cutout") { if(data_3 == "cutout") {
@@ -911,7 +929,7 @@ module case_bottom(case_design) {
} }
} }
} }
}
// sbc openings // sbc openings
open_io(); open_io();
// clean fillets // clean fillets
@@ -923,24 +941,26 @@ module case_bottom(case_design) {
} }
} }
// additive accessories // additive accessories
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "add2" && face == "bottom") { if (class == "add2" && face == "bottom") {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} }
} }
@@ -1025,7 +1045,7 @@ module case_top(case_design) {
cylinder(d=3, h=10+sidethick+(2*adjust)); cylinder(d=3, h=10+sidethick+(2*adjust));
} }
// left side bottom attachment holes // left side bottom attachment holes
translate([-2*wallthick-gap-2*adjust,wallthick+gap+10, translate([-2*(wallthick+gap)-sidethick-adjust,wallthick+gap+10,
((bottom_height+floorthick)/2)-1]) rotate([0,90,0]) ((bottom_height+floorthick)/2)-1]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adjust)); cylinder(d=3, h=10+sidethick+(2*adjust));
if(depth >= 75) { if(depth >= 75) {
@@ -1074,7 +1094,7 @@ module case_top(case_design) {
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90); vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
} }
translate([width-8.5+adjust,(depth/2)-32,bottom_height]) translate([width-8.5+adjust,(depth/2)-32,bottom_height])
cube([wallthick-.5,depth-3-2*(floorthick+gap),case_z-gap]); cube([wallthick-.5,depth-3-2*(floorthick+gap),top_height-floorthick-gap]);
} }
if(case_design == "snap") { if(case_design == "snap") {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z+floorthick]) translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z+floorthick])
@@ -1122,24 +1142,26 @@ module case_top(case_design) {
bottom=[0,0,0,0], $fn=90); bottom=[0,0,0,0], $fn=90);
} }
} }
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "add1" && face == "top") { if (class == "add1" && face == "top") {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} }
} }
@@ -1216,8 +1238,8 @@ module case_top(case_design) {
if(pcb_width/pcb_depth >= 1.4) { if(pcb_width/pcb_depth >= 1.4) {
translate([0,pcb_depth,0]) rotate([180,0,0]) { translate([0,pcb_depth,0]) rotate([180,0,0]) {
for (i=[7:3:16]) { for (i=[7:3:16]) {
pcb_hole_x = sbc_data[s[0]][i]+pcb_loc_x; pcb_hole_x = sbc_data[s[0]][i]-pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+1]+pcb_loc_y; pcb_hole_y = sbc_data[s[0]][i+1]-pcb_loc_y;
pcb_hole_size = sbc_data[s[0]][i+2]; pcb_hole_size = sbc_data[s[0]][i+2];
if (pcb_hole_x!=0 && pcb_hole_y!=0 && i == 7 || i == 13) { if (pcb_hole_x!=0 && pcb_hole_y!=0 && i == 7 || i == 13) {
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adjust)-1.4, translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adjust)-1.4,
@@ -1272,58 +1294,61 @@ module case_top(case_design) {
} }
} }
// subtractive accessories // subtractive accessories
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
if ((class == "sub" && face == "top") || class == "suball") { data_4 = accessory_data[a[0]][i+13];
if(highlight == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); if ((class == "sub" && face == "top") || class == "suball") {
if(highlight == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
else {
#sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
else { // create openings for additive
#sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); if (class == "add2" && face == "top" && type == "standoff") {
sub("round",loc_x,loc_y,-.1,face,rotation,6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
} }
} if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
// create openings for additive if(highlight == false) {
if (class == "add2" && face == "top" && type == "standoff") { translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open();
sub("round",loc_x,loc_y,-.1,face,rotation,6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4); }
} else {
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") { #translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open();
if(highlight == false) { }
translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open();
} }
else { if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
#translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open(); sub("rectangle",loc_x+1,loc_y+1.75,loc_z+26,face,rotation,26.5,wallthick+gap+4,14.5,
data_1,data_2,data_3,[.1,.1,.1,.1]);
} }
} if ((class == "add1" || class == "add2") && face == "top" && type == "button") {
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") { if(data_3 == "recess") {
sub("rectangle",loc_x+1,loc_y+1.75,loc_z+26,face,rotation,26.5,wallthick+gap+4,14.5, translate([loc_x,loc_y,loc_z]) sphere(d=size_x-1);
data_1,data_2,data_3,[.1,.1,.1,.1]); }
} if(data_3 == "cutout") {
if ((class == "add1" || class == "add2") && face == "top" && type == "button") { translate([loc_x-3,loc_y-4,loc_z-adjust]) slab([size_x,size_y+3,size_z+2*adjust],.1);
if(data_3 == "recess") { }
translate([loc_x,loc_y,loc_z]) sphere(d=size_x-1);
} }
if(data_3 == "cutout") { if (class == "model" && face == "bottom" && type == "hk_boom" &&
translate([loc_x-3,loc_y-4,loc_z-adjust]) slab([size_x,size_y+3,size_z+2*adjust],.1); rotation[0] == 90 && rotation[1] == 0 && rotation[2] == 0) {
sub("round",loc_x+11,loc_y-4,loc_z,face,[0,0,0],5,size_y,80,data_1,data_2,data_3,data_4);
sub("slot",loc_x+37.5,loc_y-4.75,loc_z,face,[0,0,0],6,14,80,data_1,data_2,data_3,data_4);
} }
} }
if (class == "model" && face == "bottom" && type == "hk_boom" &&
rotation[0] == 90 && rotation[1] == 0 && rotation[2] == 0) {
sub("round",loc_x+11,loc_y-4,loc_z,face,[0,0,0],5,size_y,80,data_1,data_2,data_3,data_4);
sub("slot",loc_x+37.5,loc_y-4.75,loc_z,face,[0,0,0],6,14,80,data_1,data_2,data_3,data_4);
}
} }
// sbc openings // sbc openings
open_io(); open_io();
@@ -1338,24 +1363,26 @@ module case_top(case_design) {
} }
} }
// additive accessories // additive accessories
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "add2" && face == "top") { if (class == "add2" && face == "top") {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} }
} }
@@ -1530,123 +1557,129 @@ module case_side(case_design,case_style,side) {
vu_holder(case_style,side,vesa,cheight); vu_holder(case_style,side,vesa,cheight);
} }
// additive accessories // additive accessories
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "add1" && face == side) { if (class == "add1" && face == side) {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} }
} }
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
if ((class == "sub" && face == side) || class == "suball") { data_4 = accessory_data[a[0]][i+13];
if(highlight == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); if ((class == "sub" && face == side) || class == "suball") {
if(highlight == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
else {
#sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
else { // create openings for additive
#sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); if ((class == "sub" && face == "bottom") || class == "suball") {
if(highlight == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
else {
#sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} // create openings for additive
// create openings for additive if (class == "add2" && face == "bottom" && type == "standoff") {
if ((class == "sub" && face == "bottom") || class == "suball") { sub("round",loc_x,loc_y,-.1,face,rotation,6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
if(highlight == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
} }
else { if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
#sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); if(highlight == false) {
translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open();
}
else {
#translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open();
}
} }
} if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
// create openings for additive sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,26.5,wallthick+gap+4,15,data_1,data_2,data_3,[.1,.1,.1,.1]);
if (class == "add2" && face == "bottom" && type == "standoff") {
sub("round",loc_x,loc_y,-.1,face,rotation,6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
if(highlight == false) {
translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open();
} }
else { if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
#translate([loc_x+5.25,loc_y-5,loc_z+4]) rotate(rotation) microusb_open(); if(data_3 == "landscape") {
sub("rectangle",loc_x+6,loc_y-.5,loc_z-adjust,face,rotation,size_x-17,size_y-1,floorthick+1,
data_1,data_2,data_3,[.1,.1,.1,.1]);
sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adjust,face,rotation,
5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
else {
sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adjust,face,rotation,size_x-1,size_y-17,floorthick+1,
data_1,data_2,data_3,[.1,.1,.1,.1]);
sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adjust,face,rotation,
10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
} }
} if ((class == "model") && face == "bottom" && type == "h2_netcard") {
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") { sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,26.5,wallthick+gap+4,15,data_1,data_2,data_3,[.1,.1,.1,.1]); 68.5,wallthick+3,14.5,data_1,data_2,data_3,[1,1,1,1]);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
if(data_3 == "landscape") {
sub("rectangle",loc_x+6,loc_y-.5,loc_z-adjust,face,rotation,size_x-17,size_y-1,floorthick+1,
data_1,data_2,data_3,[.1,.1,.1,.1]);
sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adjust,face,rotation,
5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
} }
else { if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adjust,face,rotation,size_x-1,size_y-17,floorthick+1, if(data_3 == "recess") {
data_1,data_2,data_3,[.1,.1,.1,.1]); #translate([loc_x,loc_y,loc_z]) sphere(d=size_x);
sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adjust,face,rotation, }
10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]); if(data_3 == "cutout") {
} #translate([loc_x,loc_y,loc_z]) slab([size_x,size_y,size_z],.1);
} }
if ((class == "model") && face == "bottom" && type == "h2_netcard") {
sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
68.5,wallthick+3,14.5,data_1,data_2,data_3,[1,1,1,1]);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
if(data_3 == "recess") {
// sub("round",loc_x,loc_y,loc_z-1,face,rotation,size_x,size_y,5,data_1,data_2,data_3,0);
#translate([loc_x,loc_y,loc_z]) sphere(d=size_x);
}
if(data_3 == "cutout") {
#translate([loc_x,loc_y,loc_z]) slab([size_x,size_y,size_z],.1);
} }
} }
} }
// sbc openings // sbc openings
open_io(); open_io();
} }
for (i=[30:14:len(case_data[c[0]])-1]) { if(accessory_name != "none") {
class = case_data[c[0]][i]; for (i=[1:14:len(accessory_data[a[0]])-1]) {
type = case_data[c[0]][i+1]; class = accessory_data[a[0]][i];
loc_x = case_data[c[0]][i+2]; type = accessory_data[a[0]][i+1];
loc_y = case_data[c[0]][i+3]; loc_x = accessory_data[a[0]][i+2];
loc_z = case_data[c[0]][i+4]; loc_y = accessory_data[a[0]][i+3];
face = case_data[c[0]][i+5]; loc_z = accessory_data[a[0]][i+4];
rotation = case_data[c[0]][i+6]; face = accessory_data[a[0]][i+5];
size_x = case_data[c[0]][i+7]; rotation = accessory_data[a[0]][i+6];
size_y = case_data[c[0]][i+8]; size_x = accessory_data[a[0]][i+7];
size_z = case_data[c[0]][i+9]; size_y = accessory_data[a[0]][i+8];
data_1 = case_data[c[0]][i+10]; size_z = accessory_data[a[0]][i+9];
data_2 = case_data[c[0]][i+11]; data_1 = accessory_data[a[0]][i+10];
data_3 = case_data[c[0]][i+12]; data_2 = accessory_data[a[0]][i+11];
data_4 = case_data[c[0]][i+13]; data_3 = accessory_data[a[0]][i+12];
data_4 = accessory_data[a[0]][i+13];
if (class == "add2" && face == side) { if (class == "add2" && face == side) {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4); add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
} }
} }
} }
@@ -1667,18 +1700,18 @@ module open_io() {
// indents // indents
if(indents == true) { if(indents == true) {
if(type == "micro") { if(type == "micro") {
translate([loc_x-.6,loc_y-gap,bottom_height+pcb_loc_z+1.9]) rotate([90,0,0]) slot(6,8,2.1); translate([loc_x-.6,loc_y-gap-wallthick/2+1,bottom_height+pcb_loc_z+1.9]) rotate([90,0,0]) slot(6,8,wallthick);
} }
if(type == "hdmi_a" && side == "top") { if(type == "hdmi_a" && side == "top") {
translate([loc_x+2.375,loc_y-gap,bottom_height+pcb_loc_z+3.75]) rotate([90,0,0]) slot(12,10,2.1); translate([loc_x+2.375,loc_y-gap-wallthick/2+1,bottom_height+pcb_loc_z+3.75]) rotate([90,0,0]) slot(12,10,wallthick);
} }
if(type == "pwr5.5_7.5x11.5") { if(type == "pwr5.5_7.5x11.5") {
translate([loc_x+3.5,loc_y-gap,bottom_height+pcb_loc_z+6.25]) translate([loc_x+3.5,loc_y-gap-wallthick/2+1,bottom_height+pcb_loc_z+6.25])
rotate([90,0,0]) cylinder(d=10, h=sidethick+(2*adjust)); rotate([90,0,0]) cylinder(d=10, h=wallthick+(2*adjust));
} }
if(type == "pwr2.5_5x7.5") { if(type == "pwr2.5_5x7.5") {
translate([loc_x+2.75,loc_y-gap-1,bottom_height+pcb_loc_z+2.1]) translate([loc_x+2.75,loc_y-gap-wallthick/2+1,bottom_height+pcb_loc_z+2.1])
rotate([90,0,0]) cylinder(d=6, h=sidethick+(2*adjust)); rotate([90,0,0]) cylinder(d=6, h=wallthick+(2*adjust));
} }
} }