code cleanup, rearrangement and documentation

This commit is contained in:
Edward Kisiel
2024-01-30 22:08:10 -05:00
parent b866bd73db
commit a33450ac21
10 changed files with 1068 additions and 802 deletions

View File

@@ -1,11 +1,43 @@
/*
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
add(type,loc_x,loc_y,loc_z,size_x,size_y,size_z,rotation,face,side,case_z,data_1,data_2,data_3,data_4)
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: add
DESCRIPTION: places additive objects
TODO: none
USAGE: add(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, data_1, data_2, data_3, data_4)
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
*/
/* addition module */
module add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
module 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(type == "rectangle") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);

View File

@@ -1,6 +1,29 @@
/*
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
// case bottom
NAME: case_bottom
DESCRIPTION: creates case bottom for supported designs
TODO: none
USAGE: case_bottom(case_design)
*/
module case_bottom(case_design) {
difference() {
@@ -314,15 +337,15 @@ module case_bottom(case_design) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0];
pcb_hole_pos = sbc_data[s[0]][i+10][4];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(class == "pcbhole" && id == pcb_id && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" ||
pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
translate([pcb_hole_x,pcb_hole_y,-1]) cylinder(d=6.5, h=bottom_height);
if(class == "pcbhole" && id == pcb_id && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=6.5, h=bottom_height);
}
}
}
@@ -356,15 +379,15 @@ module case_bottom(case_design) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0];
pcb_hole_pos = sbc_data[s[0]][i+10][4];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(class == "pcbhole" && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" ||
pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
if (pcb_hole_pos == "left_rear") {
if(class == "pcbhole" && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
if (pcbhole_pos == "left_rear") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left,
bottom_standoff[2],
@@ -376,9 +399,9 @@ module case_bottom(case_design) {
bottom_standoff[8],
bottom_standoff[9],
bottom_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
}
if (pcb_hole_pos == "left_front") {
if (pcbhole_pos == "left_front") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_front_left,
bottom_standoff[2],
@@ -390,9 +413,9 @@ module case_bottom(case_design) {
bottom_standoff[8],
bottom_standoff[9],
bottom_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
}
if (pcb_hole_pos == "right_rear") {
if (pcbhole_pos == "right_rear") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_right,
bottom_standoff[2],
@@ -404,9 +427,9 @@ module case_bottom(case_design) {
bottom_standoff[8],
bottom_standoff[9],
bottom_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
}
if (pcb_hole_pos == "right_front") {
if (pcbhole_pos == "right_front") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_front_right,
bottom_standoff[2],
@@ -418,7 +441,7 @@ module case_bottom(case_design) {
bottom_standoff[8],
bottom_standoff[9],
bottom_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
}
}
}
@@ -451,35 +474,35 @@ module case_bottom(case_design) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcb_side_pos = sbc_data[s[0]][i+10][2];
pcb_hole_pos = sbc_data[s[0]][i+10][4];
pcbhole_pos = sbc_data[s[0]][i+10][4];
ex_stand = 0;
if (class == "pcbhole" && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" ||
pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
ex_stand = pcb_hole_pos == "left_rear" ? bottom_rear_left :
pcb_hole_pos == "left_front" ? bottom_front_left :
pcb_hole_pos == "right_rear" ? bottom_rear_right :
pcb_hole_pos == "right_front" ? bottom_front_right : 0;
if (class == "pcbhole" && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
ex_stand = pcbhole_pos == "left_rear" ? bottom_rear_left :
pcbhole_pos == "left_front" ? bottom_front_left :
pcbhole_pos == "right_rear" ? bottom_rear_right :
pcbhole_pos == "right_front" ? bottom_front_right : 0;
if(pcb_side_pos == "rear") {
translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap-adj)-1.4, 0])
translate([pcbhole_x-1, pcbhole_y-(bottom_standoff[0]/2)-(gap-adj)-1.4, 0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
if(pcb_side_pos == "front") {
translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
translate([pcbhole_x-1, pcbhole_y+(bottom_standoff[0]/2)-.6+adj,0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
if(pcb_side_pos == "left") {
translate([pcb_hole_x-(bottom_standoff[0]/2)-2.4+adj,pcb_hole_y-1,0])
translate([pcbhole_x-(bottom_standoff[0]/2)-2.4+adj,pcbhole_y-1,0])
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
if(pcb_side_pos == "right") {
translate([pcb_hole_x+(bottom_standoff[0]/2)-.6+adj,pcb_hole_y-1,0])
translate([pcbhole_x+(bottom_standoff[0]/2)-.6+adj,pcbhole_y-1,0])
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
}

View File

@@ -1,7 +1,30 @@
/*
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
// case side
module case_side(case_design,case_style,side) {
NAME: case_side
DESCRIPTION: creates case side for supported designs and styles
TODO: none
USAGE: case_side(case_design, case_style, side)
*/
module case_side(case_design, case_style, side) {
difference() {
union() {

View File

@@ -1,6 +1,29 @@
/*
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
// case top
NAME: case_top
DESCRIPTION: creates case top for supported designs
TODO: none
USAGE: case_top(case_design)
*/
module case_top(case_design) {
difference() {
@@ -254,15 +277,15 @@ module case_top(case_design) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0];
pcb_hole_pos = sbc_data[s[0]][i+10][4];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if (class == "pcbhole" && id == pcb_id &&
(pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" || pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
translate([pcb_hole_x,pcb_hole_y,top_height+1]) cylinder(d=6.5, h=top_height);
(pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" || pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
translate([pcbhole_x,pcbhole_y,top_height+1]) cylinder(d=6.5, h=top_height);
}
}
}
@@ -296,15 +319,15 @@ module case_top(case_design) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0];
pcb_hole_pos = sbc_data[s[0]][i+10][4];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(class == "pcbhole" && id == pcb_id &&
(pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" || pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
if (pcb_hole_pos == "left_rear") {
(pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" || pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
if (pcbhole_pos == "left_rear") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_rear_left,
top_standoff[2],
@@ -316,9 +339,9 @@ module case_top(case_design) {
top_standoff[8],
top_standoff[9],
top_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
}
if (pcb_hole_pos == "left_front") {
if (pcbhole_pos == "left_front") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_front_left,
top_standoff[2],
@@ -330,9 +353,9 @@ module case_top(case_design) {
top_standoff[8],
top_standoff[9],
top_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
}
if (pcb_hole_pos == "right_rear") {
if (pcbhole_pos == "right_rear") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_rear_right,
top_standoff[2],
@@ -344,9 +367,9 @@ module case_top(case_design) {
top_standoff[8],
top_standoff[9],
top_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
}
if (pcb_hole_pos == "right_front") {
if (pcbhole_pos == "right_front") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_front_right,
top_standoff[2],
@@ -358,7 +381,7 @@ module case_top(case_design) {
top_standoff[8],
top_standoff[9],
top_standoff[10]];
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
}
}
}
@@ -392,34 +415,34 @@ module case_top(case_design) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcb_side_pos = sbc_data[s[0]][i+10][2];
pcb_hole_pos = sbc_data[s[0]][i+10][4];
pcbhole_pos = sbc_data[s[0]][i+10][4];
ex_stand = 0;
if (class == "pcbhole" && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" ||
pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
ex_stand = pcb_hole_pos == "left_rear" ? top_rear_left :
pcb_hole_pos == "left_front" ? top_front_left :
pcb_hole_pos == "right_rear" ? top_rear_right :
pcb_hole_pos == "right_front" ? top_front_right : 0;
if (class == "pcbhole" && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
ex_stand = pcbhole_pos == "left_rear" ? top_rear_left :
pcbhole_pos == "left_front" ? top_front_left :
pcbhole_pos == "right_rear" ? top_rear_right :
pcbhole_pos == "right_front" ? top_front_right : 0;
if(pcb_side_pos == "rear") {
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4, case_z-top_height-ex_stand])
translate([pcbhole_x-1, pcbhole_y-(top_standoff[0]/2)-(gap-adj)-1.4, case_z-top_height-ex_stand])
cube([2,gap+1.6,top_height+ex_stand]);
}
if(pcb_side_pos == "front") {
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-ex_stand])
translate([pcbhole_x-1, pcbhole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-ex_stand])
cube([2,gap+1.6,top_height+ex_stand]);
}
if(pcb_side_pos == "left") {
translate([pcb_hole_x-(top_standoff[0]/2)-2.4+adj,pcb_hole_y-1,case_z-top_height-ex_stand])
translate([pcbhole_x-(top_standoff[0]/2)-2.4+adj,pcbhole_y-1,case_z-top_height-ex_stand])
cube([gap+1.6,2,top_height+ex_stand]);
}
if(pcb_side_pos == "right") {
translate([pcb_hole_x+(top_standoff[0]/2)-.6+adj,pcb_hole_y-1,case_z-top_height-ex_stand])
translate([pcbhole_x+(top_standoff[0]/2)-.6+adj,pcbhole_y-1,case_z-top_height-ex_stand])
cube([gap+1.6,2,top_height+ex_stand]);
}
}

View File

@@ -1,4 +1,41 @@
/* indent module */
/*
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: indent
DESCRIPTION: creates case IO indents
TODO: none
USAGE: indent(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, data_1, data_2, data_3, data_4)
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
*/
module indent(loc_x,loc_y,loc_z,rotation,side,class,type,wallthick,gap,floorthick,pcb_z) {
adj = .01;

View File

@@ -1,5 +1,45 @@
module parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
/*
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: parametric_move_add
DESCRIPTION: places parametric additive objects
TODO: none
USAGE: parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric[], size_x, size_y, size_z, data_1, data_2, data_3, data_4)
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
parametric[] =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
data[3] =
*/
module parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric, size_x, size_y, size_z, data_1, data_2, data_3, data_4) {
// absolute no parametrics
if(parametric[1] == false && parametric[2] == false && parametric[3] == false) {
@@ -149,9 +189,31 @@ module parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
}
/*
NAME: parametric_move_sub
DESCRIPTION: places parametric subtractive objects
TODO: none
module parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
USAGE: parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric[], size_x, size_y, size_z, data_1, data_2, data_3, data_4)
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
parametric[] =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
data[3] =
*/
module parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric, size_x, size_y, size_z, data_1, data_2, data_3, data_4) {
// absolute no parametrics
if(parametric[1] == false && parametric[2] == false && parametric[3] == false) {

View File

@@ -1,11 +1,31 @@
/*
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
place(x,y,z,size_x,size_y,rotation,side)
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: place
DESCRIPTION: transformation to place objects on either side of a geometric plane of a given thickness
TODO: none
USAGE: place(x, y, z, size_x, size_y, rotation, side)
*/
/* placement module *must be first* for children() */
module place(x,y,z,size_x,size_y,rotation,side) {
module place(x, y, z, size_x, size_y, rotation, side) {
if (side == "top") {
if (rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270) {

View File

@@ -1,11 +1,43 @@
/*
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
sub(type,loc_x,loc_y,loc_z,size_x,size_y,size_z,rotation,face,side,case_z,data_1,data_2,data_3,data_4)
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: sub
DESCRIPTION: places subtractive objects
TODO: none
USAGE: sub(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, data_1, data_2, data_3, data_4)
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
*/
/* subtractive module */
module sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
module 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(type == "rectangle") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);