support for stl models with stl_model, start of library work, woek on adafruit model.

This commit is contained in:
Edward Kisiel
2024-02-22 15:14:08 -05:00
parent 7b9a18279d
commit 8c0e333450
8 changed files with 1559 additions and 1327 deletions

View File

@@ -17,18 +17,35 @@
NAME: art
DESCRIPTION: create artwork using dxf or svf
DESCRIPTION: create 2d artwork using dxf or svf
TODO: none
USAGE: art(scale_d1, size_z, type)
USAGE: art(scale_d1, size_z, filename)
scale_d1 = amount to scale file
size_z = floor thickness
type = file name
filename = file name
NAME: stl_model
DESCRIPTION: import 3d artwork using stl
TODO: none
USAGE: art(scale_d1, size_z, filename)
scale_d1 = amount to scale file
size_z = floor thickness
filename = file name
*/
module art(scale_d1, size_z, type) {
module art(scale_d1, size_z, filename) {
linear_extrude(height = size_z) import(file = type, scale=scale_d1);
linear_extrude(height = size_z) import(file = filename, scale=scale_d1);
}
module stl_model(scale_d1, filename) {
import(file = filename, scale=scale_d1);
}

View File

@@ -268,9 +268,9 @@ module capacitor(diameter, height) {
// ic
module ic(size) {
color("dimgray") cube(size);
}
//module ic(size) {
// color("dimgray") cube(size);
//}
// d-sub connector

85
lib/oem_adafruit.scad Normal file
View File

@@ -0,0 +1,85 @@
/*
This file is part of SBC Case Builder https://github.com/hominoids/SBC_Case_Builder
Copyright 2022,2023,2024 Edward A. Kisiel hominoid@cablemi.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
NAME: adafruit_lcd
DESCRIPTION: adafruit 4311 2in TFT IPS Display model
TODO: none
USAGE: adafruit_lcd(enablemask, mask[])
enablemask = true produces mask, false produces model
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module adafruit_lcd(enablemask=false, mask) {
size_x = 35.5;
size_y = 59;
size_z = 1.6;
size_xm = size_x+1;
size_ym = size_y+1;
lcd_size = [34.75,48,2];
corner_radius = 2;
hole_size = 2.5;
cmask = mask[0];
mlen = mask[1];
back = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true && cmask == true && mstyle == "default") {
translate([2.25, 11, size_z+2.5-back]) cube([lcd_size[0]-4, lcd_size[1]-7, mlen]);
storage("microsdcard", 11, 44, 0, "bottom", 180, [size_x, size_z, size_y], [0], size_z, enablemask, [true, 20, 0, "default"]);
fpc("fh19", .5, 22, 0, "bottom", 270, [18,0,0], ["smt","side","white","black"], size_z, enablemask, [true,10,2,"default"]);
}
if(enablemask == false) {
difference() {
union() {
color("#252525") slab([size_x, size_y, size_z], corner_radius);
color("black",1) translate([0.375, 5.75, size_z-adj]) cube([lcd_size[0], lcd_size[1], 2.5]);
color("#353535",1) translate([.375, 9.25, size_z+2.5-adj]) cube([lcd_size[0], lcd_size[1]-4, .1]);
color("dimgrey",1) translate([2.25, 11, size_z+2.5-adj]) cube([lcd_size[0]-4, lcd_size[1]-7, .2]);
}
color("#252525") translate([hole_size, size_y-hole_size, -adj]) cylinder(d=hole_size,h=6);
color("#252525") translate([size_x-hole_size, size_y-hole_size, -adj]) cylinder(d=hole_size, h=4);
for(i=[5:2.54:31]) {
color("#fee5a6",1) translate([i, 2.5, -adj]) cylinder(d=.8, h=6);
}
}
storage("microsdcard", 11, 44, 0, "bottom", 180, [size_x, size_z, size_y], [0], size_z, enablemask, [true, 20, 0, "default"]);
ic("generic", 13.25, 9, 0, "bottom", 0, [4, 10, 1.75], ["dimgrey"], size_z, enablemask, [false, 20, 0, "default"]);
fpc("fh19", .5, 22, 0, "bottom", 270, [18,0,0], ["smt","side","white","black"], size_z, enablemask, [true,10,2,"default"]);
for(i=[5:2.54:31]) {
pcbpad("round", i, 2.5, 0, "top", 0, [1, 1, 0], [.8, "#fee5a6", 1.2], size_z, enablemask, [false, 20, 0, "default"]);
}
pcbpad("round", hole_size, size_y-hole_size, 0, "top", 0, [1, 1, 0],
[hole_size, "#fee5a6", hole_size+1], size_z, enablemask, [false, 20, 0, "default"]);
pcbpad("round", size_x-hole_size, size_y-hole_size, 0, "top", 0, [1, 1, 0],
[hole_size, "#fee5a6", hole_size+1], size_z, enablemask, [false, 20, 0, "default"]);
}
}

View File

@@ -54,6 +54,9 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, da
if(type == "art") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data_1,data_2,data_3);
}
if(type == "stl_model") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) stl_model(data_1,data_2);
}
if(type == "button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data_3,[size_x,size_y,size_z],data_4,data_1);
}

View File

@@ -27405,6 +27405,97 @@
"view": "platter",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
},
"odroid-n2l_sensors": {
"$fn": "90",
"accessory_highlight": "false",
"accessory_name": "sensors",
"adj": "0.01",
"bend_allowance": "1",
"bottom_clearence": "3.5",
"bottom_ext_standoff": "[5.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
"bottom_front_left": "0",
"bottom_front_left_support": "front",
"bottom_front_right": "0",
"bottom_front_right_support": "front",
"bottom_rear_left": "0",
"bottom_rear_left_support": "rear",
"bottom_rear_right": "0",
"bottom_rear_right_support": "rear",
"bottom_sidewall_support": "true",
"bottom_standoff_diameter": "5.75",
"bottom_standoff_hole_size": "2.5",
"bottom_standoff_insert": "false",
"bottom_standoff_insert_dia": "4.5",
"bottom_standoff_insert_height": "5",
"bottom_standoff_pillar": "hex",
"bottom_standoff_reverse": "false",
"bottom_standoff_support_height": "4",
"bottom_standoff_support_size": "10",
"bottom_standoff_type": "countersunk",
"c_fillet": "3",
"case_design": "shell",
"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": "65",
"case_style": "none",
"cooling": "default",
"exhaust_vents": "vent",
"fan_size": "0",
"fillet": "0",
"flat_blank_section": "false",
"floorthick": "2",
"gap": "1",
"gpio_opening": "none",
"indents": "true",
"individual_part": "bottom",
"lip": "5",
"lower_bottom": "0",
"material_thickness": "0.5",
"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": "-1",
"sata_knockout": "false",
"sbc_bottom_standoffs": "true",
"sbc_highlight": "false",
"sbc_model": "n2l",
"sbc_off": "false",
"sbc_top_standoffs": "true",
"sidethick": "2",
"tol": "0.25",
"top_ext_standoff": "[5.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
"top_front_left": "0",
"top_front_left_support": "front",
"top_front_right": "0",
"top_front_right_support": "front",
"top_rear_left": "0",
"top_rear_left_support": "rear",
"top_rear_right": "0",
"top_rear_right_support": "rear",
"top_sidewall_support": "true",
"top_standoff_diameter": "5.75",
"top_standoff_hole_size": "2.5",
"top_standoff_insert": "false",
"top_standoff_insert_dia": "4.5",
"top_standoff_insert_height": "5",
"top_standoff_pillar": "hex",
"top_standoff_reverse": "true",
"top_standoff_support_height": "4",
"top_standoff_support_size": "10",
"top_standoff_type": "blind",
"uart_opening": "default",
"view": "model",
"vu_rotation": "[15, 0, 0]",
"wallthick": "2"
}
},
"fileFormatVersion": "1"

View File

@@ -177,7 +177,7 @@ indents = true;
// enable sata knockout
sata_knockout = false;
// case accessory group to load
accessory_name = "none"; // ["none", "hk_uart", "c1+_shell_boombox", "c1+_panel_boombox", "c1+_panel_lcd3.5", "c1+_desktop_lcd3.5", "c1+_deskboom_lcd3.5", "c1+_tray_boombox", "c1+_round", "c1+_hex", "c2_shell_boombox", "c2_panel_boombox", "c2_panel_lcd3.5", "c2_desktop_lcd3.5", "c2_deskboom_lcd3.5", "c2_tray_boombox", "c2_round", "c2_hex", "c4_shell_boombox", "c4_panel_lcd3.5", "c4_desktop_lcd3.5", "c4_deskboom_lcd3.5", "c4_panel_boombox", "c4_tray_boombox", "c4_round", "c4_hex", "xu4_keyhole", "hc4_tray_drivebox2.5", "hc4_shell_drivebox2.5", "hc4_shell_drivebox2.5v", "hc4_shell_drivebox3.5", "n2l_tray", "n2l_gpio", "n2+_tray_vu7_fan", "m1s_shell", "m1s_shell_nvme", "m1s_shell_ups", "m1s_panel", "m1s_tray_nvme", "m1s_snap", "m1s_fitted", "m1_panel", "m1_tray", "m1_tray_ssd", "m1_tray_sides", "m1_tray_vu5", "m1_tray_vu7", "m1_fitted_drivebox2.5", "m1_fitted_drivebox3.5", "m1_fitted_pizzabox", "m1_fitted_drivebox3.5v", "h2_shell", "h2_shell_router", "h2_shell_router-ssd", "h2_lowboy", "h2_lowboy_router", "h2_tray", "h2_tray_sides", "h2_tray_router", "h2_router_station", "h2_round", "h2_hex", "h3_shell", "h3_lowboy", "h3_lowboy_router", "h3_tallboy", "h3_tallboy-ssd", "h3_ultimate", "h3_ultimate2", "h3_shell_drivebox2.5v", "show2_shell", "jetsonnano_shell", "jetsonnano_panel", "jetsonnano_stacked", "jetsonnano_tray", "jetsonnano_tray_sides", "jetsonnano_round", "jetsonnano_hex", "jetsonnano_snap", "jetsonnano_fitted", "rock64_round", "rock64_hex", "rockpro64_shell", "rockpro64_panel", "rockpro64_stacked", "rockpro64_tray", "rockpro64_tray_sides", "rockpro64_round", "rockpro64_hex", "rockpro64_snap", "rockpro64_fitted", "star64_shell", "rpi1b+_round", "rpi1b+_hex", "rpi3b_round", "rpi3b_hex", "rpi3b+_round", "rpi3b+_hex", "rpi4b_round", "rpi4b_hex", "rpi4b_shell_geeekpi_poe_hat", "rpi5_round", "rpi5_hex", "rock4b+_round", "rock4b+_hex", "rock4c_round", "rock4c_hex", "rock4c+_round", "rock4c+_hex", "rock5b", "rock5b_shell", "rock5bq", "rock5bq_shell", "rock5bq_tray", "rock5bq_tray_sides", "rock5bq_snap", "rock5bq_fitted", "rock5b-v1.3", "tinkerboard_round", "tinkerboard_hex", "tinkerboard-s_round", "tinkerboard-s_hex", "tinkerboard-2_round", "tinkerboard-2_hex", "tinkerboard-r2_round", "tinkerboard-r2_hex", "visonfive2_shell", "visonfive2_panel", "visonfive2_stacked", "visonfive2_tray", "visonfive2_snap", "visonfive2_fitted", "visonfive2q_shell", "visonfive2q_panel", "visonfive2q_stacked", "visonfive2q_tray", "visonfive2q_snap", "visonfive2q_fitted"]
accessory_name = "none"; // ["none", "hk_uart", "sensors", "c1+_shell_boombox", "c1+_panel_boombox", "c1+_panel_lcd3.5", "c1+_desktop_lcd3.5", "c1+_deskboom_lcd3.5", "c1+_tray_boombox", "c1+_round", "c1+_hex", "c2_shell_boombox", "c2_panel_boombox", "c2_panel_lcd3.5", "c2_desktop_lcd3.5", "c2_deskboom_lcd3.5", "c2_tray_boombox", "c2_round", "c2_hex", "c4_shell_boombox", "c4_panel_lcd3.5", "c4_desktop_lcd3.5", "c4_deskboom_lcd3.5", "c4_panel_boombox", "c4_tray_boombox", "c4_round", "c4_hex", "xu4_keyhole", "hc4_tray_drivebox2.5", "hc4_shell_drivebox2.5", "hc4_shell_drivebox2.5v", "hc4_shell_drivebox3.5", "n2l_tray", "n2l_gpio", "n2+_tray_vu7_fan", "m1s_shell", "m1s_shell_nvme", "m1s_shell_ups", "m1s_panel", "m1s_tray_nvme", "m1s_snap", "m1s_fitted", "m1_panel", "m1_tray", "m1_tray_ssd", "m1_tray_sides", "m1_tray_vu5", "m1_tray_vu7", "m1_fitted_drivebox2.5", "m1_fitted_drivebox3.5", "m1_fitted_pizzabox", "m1_fitted_drivebox3.5v", "h2_shell", "h2_shell_router", "h2_shell_router-ssd", "h2_lowboy", "h2_lowboy_router", "h2_tray", "h2_tray_sides", "h2_tray_router", "h2_router_station", "h2_round", "h2_hex", "h3_shell", "h3_lowboy", "h3_lowboy_router", "h3_tallboy", "h3_tallboy-ssd", "h3_ultimate", "h3_ultimate2", "h3_shell_drivebox2.5v", "show2_shell", "jetsonnano_shell", "jetsonnano_panel", "jetsonnano_stacked", "jetsonnano_tray", "jetsonnano_tray_sides", "jetsonnano_round", "jetsonnano_hex", "jetsonnano_snap", "jetsonnano_fitted", "rock64_round", "rock64_hex", "rockpro64_shell", "rockpro64_panel", "rockpro64_stacked", "rockpro64_tray", "rockpro64_tray_sides", "rockpro64_round", "rockpro64_hex", "rockpro64_snap", "rockpro64_fitted", "star64_shell", "rpi1b+_round", "rpi1b+_hex", "rpi3b_round", "rpi3b_hex", "rpi3b+_round", "rpi3b+_hex", "rpi4b_round", "rpi4b_hex", "rpi4b_shell_geeekpi_poe_hat", "rpi5_round", "rpi5_hex", "rock4b+_round", "rock4b+_hex", "rock4c_round", "rock4c_hex", "rock4c+_round", "rock4c+_hex", "rock5b", "rock5b_shell", "rock5bq", "rock5bq_shell", "rock5bq_tray", "rock5bq_tray_sides", "rock5bq_snap", "rock5bq_fitted", "rock5b-v1.3", "tinkerboard_round", "tinkerboard_hex", "tinkerboard-s_round", "tinkerboard-s_hex", "tinkerboard-2_round", "tinkerboard-2_hex", "tinkerboard-r2_round", "tinkerboard-r2_hex", "visonfive2_shell", "visonfive2_panel", "visonfive2_stacked", "visonfive2_tray", "visonfive2_snap", "visonfive2_fitted", "visonfive2q_shell", "visonfive2q_panel", "visonfive2q_stacked", "visonfive2q_tray", "visonfive2q_snap", "visonfive2q_fitted"]
a = search([accessory_name],accessory_data);

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,8 @@
*/
use <./SBC_Model_Framework/sbc_models_library.scad>
include <./mod/add.scad>;
include <./mod/case_bottom.scad>;
include <./mod/case_side.scad>;
@@ -44,6 +46,7 @@ include <./lib/feet.scad>;
include <./lib/hd.scad>;
include <./lib/holder.scad>;
include <./lib/keyhole.scad>;
include <./lib/oem_adafruit.scad>;
include <./lib/oem_hk.scad>;
include <./lib/pcb_pad.scad>;
include <./lib/shape.scad>;