more work on mask integration and cleanup

This commit is contained in:
Edward Kisiel
2024-02-24 16:13:15 -05:00
parent 7b03aa1922
commit b6eb06f97c
8 changed files with 870 additions and 1058 deletions

250
README.md
View File

@@ -59,41 +59,23 @@ Variable height automated SBC standoffs, which can be individually adjusted, are
Multi-associative parametric positioning of accessories is implemented and allows each accessory to enable or disable parametric movement of the accessory for each axis. The XY and Z axis can be associated with the case offset (size), SBC positioning, multi-associated axises or absolute positioning. For instance, a SBC fan opening needs to follow the SBC in the X and Y axis but the case Z axis for the correct height.
```
p
a
r
r a
o m
t e s s s d d d d
c l l l a t i i i a a a a
l t o o o f t r z z z t t t t
a y c c c a i i e e e a a a a
s p c o c
s, e, x, y, z, e, n, s, x,y,z,1,2,3,4
p
a
r
r a s
o m e
t e s s s l t m
c l l l a t i i i e s
l t o o o f t r z z z d m n b t
a y c c c a i i e e e a a g a y
s p c o c t s t c l
s, e, x, y, z, e, n, s, x,y,z, a, k h k e
`"sub","fan",10,10,24.5,"top",[0,0,0],["sbc-case_z",true,true,true],40,0,6,2,0,"",0]`
"sub","fan",10,10,24.5,"top",[0,0,0],["sbc-case_z",true,true,true],[40,0,6],[0],[true,10,2,"default"],
```
An array holds a string and 3 Boolean that represent which association and axis are enabled for parametric movement. In the accessory example above, the 8th parameter `["sbc-case_z",true,true,true]` means all axises are enabled for multi-associative movement with the X and Y accessory axis following the SBC X and Y axis and the accessory Z axis following the case Z axis. The other currently supported associations are “sbc” and “case”. If other associations of objects are needed or are of value, they can be added in the future. All of the existing cases have been made parametric and can serve as further working examples.
### Accuracy
In the past there was been no way of validating whether a SBC Model Framework model and its components were dimensionaly accurate in their size and placement other then trial and error. Along with producing cases this project provides a much needed model validation tool to assure model accuracy thru the use of test cases. It works on the very simple premise that if the real SBC fits the test case then the virtual model is accurate or otherwise shows were corrections are needed. This will further increased the overall accuracy of models.
Some SBC in SBC Model Framework have not been validated or may be missing component data and may produce one or more aspects of a case incorrectly. SBC status is noted in sbc.png, the README.md file and at the beginning of the SBC entry defined in sbc_models.cfg, all a part of SBC Model Framework. The color coded indicator of an SBCs verification and completion as indicated in sbc.png is as follows:
- GREEN = verified, complete and passes SBC Case Builder
- YELLOW = unverified, mostlikely usable and/or missing minor information
- ORANGE = unverified, may be usable but missing component data
- RED = unverified, not usable due to incomplete component data
The SBC that I do not own have been created using manufacturer supplied mechanical drawings. Some of the drawings are missing information or have errors that effect all or part of the drawings and subsequent SBC models. If you own an SBC that is not represented or verified in SBC Model Framework, please consider adding it or helping to correct errors in existing SBC data. An SBC can be verified to be accurate if a printed shell case from SBC Case Builder fits. Any misalignment is corrected in the SBC Model Framework model data(sbc_models.cfg).
### Future Development
There are a few more ideas for base cases to be worked on as well as a host of supporting accessory models that need to be created. It would also be nice to have all of the OEM accessories for each SBC in the library as well. Im still looking for a better way to create accessory entries and groups, and continue to expand and verify as many SBC as possible. With that and the obvious benefit of autonomously making SBC cases, this project has also been helping fulfill another personal goal.
Computer aided design(CAD) has been around along time but I have been interested in exploring approaches to the next step, computer autonomous design. Regardless of the current or future object creation method, whether it be manufactured or materialized, I believe a universal approach to autonomous design will be needed to advance the human condition. This application has helped me explore and think about practical approaches that might be possible right now in autonomous design and I hope to continue this work by developing new tools and techniques for the new CAD, Computer Autonomous Design.
### Notes
Due to the number of possibilities, no pre-compiled case stls are included.
@@ -103,198 +85,43 @@ Due to the number of possibilities, no pre-compiled case stls are included.
### Case Designs and Styles
The case naming convention for standard cases in the configuration file follow the basic form of “sbc”_”design”_”style” e.g. c4_shell or c4_tray_vu5.
#### Last Case Count 457
##### Hardkernel - 194
**Odorid-C1+ cases** - 16 : c1+_shell, c1+_panel, c1+_panel_lcd3.5, c1+_desktop_lcd3.5, c1+_stacked, c1+_tray, c1+_tray_sides, c1+_tray_vu5,
c1+_tray_vu7, c1+_shell_boombox, c1+_panel_boombox, c1+_tray_boombox, c1+_round, c1+_hex, c1+_snap, c1+_fitted
**Odorid-C2 cases** - 17 : c2_shell, c2_panel, c2_panel_lcd3.5, c2_desktop_lcd3.5, c2_stacked, c2_tray, c2_tray_sides, c2_tray_vu5,
c2_tray_vu7, c2_shell_boombox, c2_panel_boombox, c2_deskboom_lcd3.5, c2_tray_boombox, c2_round, c2_hex, c2_snap, c2_fitted
**Odorid-C4 cases** - 17 : c4_shell, c4_panel, c4_panel_lcd3.5, c4_desktop_lcd3.5, c4_stacked, c4_tray, c4_tray_sides, c4_tray_vu5,
c4_tray_vu7, c4_shell_boombox, c4_panel_boombox, c4_deskboom_lcd3.5, c4_tray_boombox, c4_round, c4_hex, c4_snap, c4_fitted
**Odorid-HC4 cases** - 15 : hc4_shell, hc4_shell_drivebox2.5, hc4_shell_drivebox2.5v, hc4_shell_drivebox3.5, hc4_panel, hc4_stacked
, hc4_tray, hc4_tray_sides, hc4_tray_vu5, hc4_tray_vu7, hc4_tray_drivebox2.5, hc4_round, hc4_hex, hc4_snap, hc4_fitted
**Odorid-N1 cases** - 11 : n1_shell, n1_panel, n1_stacked, n1_tray, n1_tray_sides, n1_tray_vu5, n1_tray_vu7, n1_round, n1_hex, n1_snap, n1_fitted
**Odorid-N2 cases** - 9 : n2_panel, n2_tray, n2_tray_sides, n2_tray_vu5, n2_tray_vu7, n2_round, n2_hex, n2_snap, n2_fitted
**Odorid-N2+ cases** - 9 :n2+_panel, n2+_tray, n2+_tray_sides, n2+_tray_vu5, n2+_tray_vu7, n2+_round, n2+_hex, n2+_snap, n2+_fitted
**Odorid-N2L cases** - 9 :n2l_shell, n2l_panel, n2l_stacked, n2l_tray, n2l_tray_sides, n2l_tray_vu5, n2l_tray_vu7, n2l_snap, n2l_fitted
**Odorid-N2LQ cases** - 9 :n2lq_shell, n2lq_panel, n2lq_stacked, n2lq_tray, n2lq_tray_sides, n2lq_tray_vu5, n2lq_tray_vu7, n2lq_snap, n2lq_fitted
**Odorid-M1S cases** - 12 : m1s_shell, m1s_shell_nvme, m1s_shell_ups, m1s_panel, m1s_stacked, m1s_tray, m1s_tray_ups, m1s_tray_vu5, m1s_tray_vu7, m1s_tray_sides, m1s_snap, m1s_fitted
**Odorid-M1 cases** - 12 : m1_panel, m1_tray, m1_tray_drive, m1_tray_sides, m1_tray_vu5, m1_tray_vu7, m1_snap, m1_fitted, m1_fitted_drivebox2.5, m1_fitted_drivebox3.5, m1_fitted_pizzabox, m1_fitted_drivebox3.5v
**Odorid-XU4 cases** - 11 : xu4_shell, xu4_panel, xu4_stacked, xu4_tray, xu4_tray_sides, xu4_tray_vu5, xu4_tray_vu7, xu4_round, xu4_hex, xu4_snap, xu4_fitted
**Odorid-XU4Q cases** - 11 : xu4q_shell, xu4q_panel, xu4q_stacked, xu4q_tray, xu4q_tray_sides, xu4q_tray_vu5, xu4q_tray_vu7, xu4q_round, xu4q_hex, xu4q_snap, xu4q_fitted
**Odroid-H2 cases** - 17 : h2_shell, h2_lowboy, h2_lowboy_router, h2_shell_router, h2_shell_router-ssd, h2_panel, h2_stacked, h2_tray, h2_tray_sides, h2_tray_vu5, h2_tray_vu7, h2_tray_router, h2_router_station, h2_round, h2_hex, h2_snap, h2_fitted
**Odroid-H3 cases** - 18 : h3_shell, h3_shell-internalfan, h3_lowboy, h3_lowboy_router, h3_shell_router, h3_shell_router-ssd, h3_panel, h3_stacked, h3_tray, h3_tray_sides, h3_tray_vu5, h3_tray_vu7, h3_tray_router, h3_router_station, h3_round, h3_hex, h3_snap, h3_fitted
**Odroid-Show2** cases - 1 : show2_shell
##### Pine64 - 24
**Rock64** - 9 : rockp64_shell, rock64_panel, rock64_stacked, rock64_tray, rock64_tray_sides, rock64_round, rock64_hex, rock64_snap, rock64_fitted
**RockPro64** - 9 : rockpro64_shell, rockpro64_panel, rockpro64_stacked, rockpro64_tray, rockpro64_tray_sides, rockpro64_round, rockpro64_hex, rockpro64_snap, rockpro64_fitted
**Quartz64a** - 2 : quartz64a_shell, quartz64a_panel
**Quartz64b** - 2 : quartz64b_shell, quartz64b_panel
**h64b** - 2 : h64b_shell, h64b_panel
**star64** - 1 : star64_shell
##### Raspberry PI - 72
**RPIzero** - 9 : rpizero_shell, rpizero_panel, rpizero_stacked, rpizero_tray, rpizero_tray_sides, rpizero_round, rpizero_hex, rpizero_snap, rpizero_fitted
**RPIzero2w+** - 9 : rpizero2w_shell, rpizero2w_panel, rpizero2w_stacked, rpizero2w_tray, rpizero2w_tray_sides, rpizero2w_round, rpizero2w_hex, rpizero2w_snap, rpizero2w_fitted
**RPI1a+** - 9 : rpi1a+_shell, rpi1a+_panel, rpi1a+_stacked, rpi1a+_tray, rpi1a+_tray_sides, rpi1a+_round, rpi1a+_hex, rpi1a+_snap, rpi1a+_fitted
**RPI1b+** - 9 : rpi1b+_shell, rpi1b+_panel, rpi1b+_stacked, rpi1b+_tray, rpi1b+_tray_sides, rpi1b+_round, rpi1b+_hex, rpi1b+_snap, rpi1b+_fitted
**RPI3a+** - 9 : rpi3a+_shell, rpi3a+_panel, rpi3a+_stacked, rpi3a+_tray, rpi3a+_tray_sides, rpi3a+_round, rpi3a+_hex, rpi3a+_snap, rpi3a+_fitted
**RPI3b** - 9 : rpi3b_shell, rpi3b_panel, rpi3b_stacked, rpi3b_tray, rpi3b_tray_sides, rpi3b_round, rpi3b_hex, rpi3b_snap, rpi3b_fitted
**RPI3b+** - 9 : rpi3b+_shell, rpi3b+_panel, rpi3b+_stacked, rpi3b+_tray, rpi3b+_tray_sides, rpi3b+_round, rpi3b+_hex, rpi3b+_snap, rpi3b+_fitted
**RPI4b** - 9 : rpi4b_shell, rpi4b_panel, rpi4b_stacked, rpi4b_tray, rpi4b_tray_sides, rpi4b_round, rpi4b_hex, rpi4b_snap, rpi4b_fitted
##### Nivida - 1
**Jetson Nano** - 9 : jetsonnano_shell, jetsonnano_panel, jetsonnano_stacked, jetsonnano_tray, jetsonnano_tray_sides, jetsonnano_round, jetsonnano_hex, jetsonnano_snap, jetsonnano_fitted
##### Radxa - 37
**ROCK 4b+** - 9 : rock4b+_shell, rock4b+_panel, rock4b+_stacked, rock4b+_tray, rock4b+_tray_sides, rock4b+_round, rock4b+_hex, rock4b+_snap, rock4b+_fitted
**ROCK 4c** - 9 : rock4c_shell, rock4c_panel, rock4c_stacked, rock4c_tray, rock4c_tray_sides, rock4c_round, rock4c_hex, rock4c_snap, rock4c_fitted
**ROCK 4c+** - 9 : rock4c+_shell, rock4c+_panel, rock4c+_stacked, rock4c+_tray, rock4c+_tray_sides, rock4c+_round, rock4c+_hex, rock4c+_snap, rock4c+_fitted
**ROCK 5b** - 10 : rock5b_shell,rock5b_shell-v1.3, rock5b_panel, rock5b_stacked, rock5b_tray, rock5b_tray_sides, rock5b_round, rock5b_hex, rock5b_snap, rock5b_fitted
##### Khadas - 45
**Vim1** - 9 : vim1_shell, vim1_panel, vim1_stacked, vim1_tray, vim1_tray_sides, vim1_round, vim1_hex, vim1_snap, vim1_fitted
**Vim2** - 9 : vim2_shell, vim2_panel, vim2_stacked, vim2_tray, vim2_tray_sides, vim2_round, vim2_hex, vim2_snap, vim2_fitted
**Vim3** - 9 : vim3_shell, vim3_panel, vim3_stacked, vim3_tray, vim3_tray_sides, vim3_round, vim3_hex, vim3_snap, vim3_fitted
**Vim3l** - 9 : vim3l_shell, vim3l_panel, vim3l_stacked, vim3l_tray, vim3l_tray_sides, vim3l_round, vim3l_hex, vim3l_snap, vim3l_fitted
**Vim4** - 9 : vim4_shell, vim4_panel, vim4_stacked, vim4_tray, vim4_tray_sides, vim4_round, vim4_hex, vim4_snap, vim4_fitted
##### Asus - 36
**Tinkerboard** - 9 : tinkerboard_shell, tinkerboard_panel, tinkerboard_stacked, tinkerboard_tray, tinkerboard_tray_sides, tinkerboard_round, tinkerboard_hex, tinkerboard_snap, tinkerboard_fitted
**Tinkerboard S** - 9 : tinkerboard-s_shell, tinkerboard_panel, tinkerboard-s_stacked, tinkerboard-s_tray, tinkerboard-s_tray_sides, tinkerboard-s_round, tinkerboard-s_hex, tinkerboard-s_snap, tinkerboard-s_fitted
**Tinkerboard 2/2S** - 9 : tinkerboard-2_shell, tinkerboard-2_panel, tinkerboard-2_stacked, tinkerboard-2_tray, tinkerboard-2_tray_sides, tinkerboard-2_round, tinkerboard-2_hex, tinkerboard-2_snap, tinkerboard-2_fitted
**Tinkerboard R2/R2S** - 9 : tinkerboard-r2_shell, tinkerboard-r2_panel, tinkerboard-r2_stacked, tinkerboard-r2_tray, tinkerboard-r2_tray_sides, tinkerboard-r2_round, tinkerboard-r2_hex, tinkerboard-r2_snap, tinkerboard-r2_fitted
##### Orange PI - 34
**OPI 5** - 7 : opi5_shell, opi5_panel, opi5_stacked, opi5_tray, opi5_tray_sides, opi5_snap, opi5_fitted
**OPI Zero/ZeroPlus** - 9 : opizero_shell, opizero_panel, opizero_stacked, opizero_tray, opizero_tray_sides, opizero_round, opizero_hex, opizero_snap, opizero_fitted
**OPI Zero2** - 9 : opizero2_shell, opizero2_panel, opizero2_stacked, opizero2_tray, opizero2_tray_sides, opizero2_round, opizero2_hex, opizero2_snap, opizero2_fitted
**OPI R1** - 1 : opir1_shell
**OPI R1PlusLTS** - 9 : opir1plus_lts_shell, opir1plus_lts_panel, opir1plus_lts_stacked, opir1plus_lts_tray, opir1plus_lts_tray_sides, opir1plus_lts_round, opir1plus_lts_hex, opir1plus_lts_snap, opir1plus_lts_fitted
##### Libre Computer - 0
**lepotato** - 0:
**sweetpotato** - 0:
**tirtium-h2+** - 0:
**tritium-h3** - 0:
**tritium-h5** - 0:
**solitude** - 0:
**alta** - 0:
##### Sipeed - 1
**licheerv+dock** - 0 :
##### StarFive - 14
**visionfive2** - 7 : visionfive2_shell, visionfive2_panel, visionfive2_stacked, visionfive2_tray, visionfive2_tray_sides, visionfive2_snap, visionfive2_fitted
**visionfive2q** - 7 : visionfive2q_shell, visionfive2q_panel, visionfive2q_stacked, visionfive2q_tray, visionfive2q_tray_sides, visionfive2q_snap, visionfive2q_fitted
### Accessory Schema
The schema for case accessories is documented in the beginning of the file sbc_case_builder_accessories.cfg. There is one fixed entry that is the accessory set name followed by an unlimited number of accessory entries each containing 15 entries.
The schema for case accessories is documented in the beginning of the file sbc_case_builder_accessories.cfg. There is one fixed entry that is the accessory set name followed by an unlimited number of accessory entries each containing 11 entries.
```
schema:
"accessory_name",
"class","type",loc_x,loc_y,loc_z,face,rotation[x,y,z],parametrics[association,x,y,z],size_x,size_y,size_z,data_1,data_2,"data_3",data_4[]
"class","type",loc_x,loc_y,loc_z,face,rotation[x,y,z],parametrics[association,x,y,z],size[],data[],mask[]
```
### Accessories Entries
There are 6 classes, “add1”,“sub”,”suball”,”add2”,”model”,”platter” and all use the same command format for various “type”.
```
"class","type",loc_x,loc_y,loc_z,size_x,size_y,size_z,"face",rotation[],parametrics[],data_1,data_2,"data_3",data_4[]
"class","type",loc_x,loc_y,loc_z,face,rotation[x,y,z],parametrics[association,x,y,z],size[],data[],mask[]
```
e.g.
```
p
a
r
r a
o m
t e s s s d d d d
c l l l a t i i i a a a a
l t o o o f t r z z z t t t t
a y c c c a i i e e e a a a a
s p c o c
s, e, x, y, z, e, n, s, x,y,z,1,2,3,4
p
a
r
r a s
o m e
t e s s s l t m
c l l l a t i i i e s
l t o o o f t r z z z d m n b t
a y c c c a i i e e e a a g a y
s p c o c t s t c l
s, e, x, y, z, e, n, s, x,y,z, a, k h k e
"sub","fan",10,10,24.5,"top",[0,0,0],["sbc-case_z",true,true,true],40,0,6,2,0,"",0]
"sub","fan",10,10,24.5,"top",[0,0,0],["sbc-case_z",true,true,true],[40,0,6],[0],[true,10,2,"default"],
```
Every type, regardless of its class, uses a basic set of variables
`(loc_x,loc_y,loc_z,”face”,rotation[],parametrics[])`
but each type doesnt necessarily use all available data fields
`(size_x,size_y,size_z,data_1,data_2,”data_3”,data_4[])`
`(size[],data[])`
The parametric array specifies the axis to enable for associated parametric positoning. An accessory can be associated with the sbc position("sbc"), case offset("case"),multi-associated which use sbc xy postion and case z offset(sbc-case_z) or uses absolute values if all axises are false.
@@ -465,7 +292,7 @@ USES: data_3="flat", "dome", "frame"
```
DESCRIPTION: hk boom bonnet speaker friction holder
USES: data_1=tolorence
USES: data_1="friction","clamp", data_2=tolorence
```
**nut_holder**
@@ -727,3 +554,22 @@ USES: size_x=x, size_y=y, size_z=thick,
data1=cell_size, data2=cell_spacing,
data3="x", "y", "none", or "default", data4=border
```
### Accuracy
In the past there was been no way of validating whether a SBC Model Framework model and its components were dimensionaly accurate in their size and placement other then trial and error. Along with producing cases this project provides a much needed model validation tool to assure model accuracy thru the use of test cases. It works on the very simple premise that if the real SBC fits the test case then the virtual model is accurate or otherwise shows were corrections are needed. This will further increased the overall accuracy of models.
Some SBC in SBC Model Framework have not been validated or may be missing component data and may produce one or more aspects of a case incorrectly. SBC status is noted in sbc.png, the README.md file and at the beginning of the SBC entry defined in sbc_models.cfg, all a part of SBC Model Framework. The color coded indicator of an SBCs verification and completion as indicated in sbc.png is as follows:
- GREEN = verified, complete and passes SBC Case Builder
- YELLOW = unverified, mostlikely usable and/or missing minor information
- ORANGE = unverified, may be usable but missing component data
- RED = unverified, not usable due to incomplete component data
The SBC that I do not own have been created using manufacturer supplied mechanical drawings. Some of the drawings are missing information or have errors that effect all or part of the drawings and subsequent SBC models. If you own an SBC that is not represented or verified in SBC Model Framework, please consider adding it or helping to correct errors in existing SBC data. An SBC can be verified to be accurate if a printed shell case from SBC Case Builder fits. Any misalignment is corrected in the SBC Model Framework model data(sbc_models.cfg).
### Future Development
There are a few more ideas for base cases to be worked on as well as a host of supporting accessory models that need to be created. It would also be nice to have all of the OEM accessories for each SBC in the library as well. Im still looking for a better way to create accessory entries and groups, and continue to expand and verify as many SBC as possible. With that and the obvious benefit of autonomously making SBC cases, this project has also been helping fulfill another personal goal.
Computer aided design(CAD) has been around along time but I have been interested in exploring approaches to the next step, computer autonomous design. Regardless of the current or future object creation method, whether it be manufactured or materialized, I believe a universal approach to autonomous design will be needed to advance the human condition. This application has helped me explore and think about practical approaches that might be possible right now in autonomous design and I hope to continue this work by developing new tools and techniques for the new CAD, Computer Autonomous Design.

View File

@@ -1026,7 +1026,7 @@ module hk_boom_grill(style, thick) {
/*
NAME: hk_boom_grill
NAME: boom_speaker_holder
DESCRIPTION: hardkernel stereo boom bonnet speaker holder
TODO: none
@@ -1036,7 +1036,7 @@ module hk_boom_grill(style, thick) {
tolerance = friction adjustment
*/
module boom_speaker_holder(style, tolerance) {
module boom_speaker_holder(style, tolerance=0) {
adj = .01;
$fn = 90;

View File

@@ -30,6 +30,7 @@
rotation[] = object rotation
parametric[] = parametric movement array
size[] = size array x,y,z
data[] = data variable on type
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
@@ -42,17 +43,13 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
size_x = size[0];
size_y = size[1];
size_z = size[2];
data_1 = data[0];
data_2 = data[1];
data_3 = data[2];
data_4 = data[3];
enablemask = mask[0];
mlen = mask[1];
msetback = mask[2];
mstyle = mask[3];
if(type == "rectangle") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data[0]);
}
if(type == "round") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) cylinder(d=size_x,h=size_z);
@@ -61,25 +58,25 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slot(size_x,size_y,size_z);
}
if(type == "text") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_3, size=data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data[1], size=data[0]);
}
if(type == "art") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data_1,data_2,data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data[0],data[1],data[2]);
}
if(type == "stl_model") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) stl_model(data_1,data_2);
translate([loc_x,loc_y,loc_z]) rotate(rotation) stl_model(data[0],data[1]);
}
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);
translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data[1],[size_x,size_y,size_z],data[2],data[0]);
}
if(type == "button_top") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) button_assembly(data_3,size_x,size_z);
translate([loc_x,loc_y,loc_z]) rotate(rotation) button_assembly(data[0],size_x,size_z);
}
if(type == "pcb_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) pcb_holder([size_x,size_y,size_z],data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) pcb_holder([size_x,size_y,size_z],data[0]);
}
if(type == "batt_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) batt_holder(data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) batt_holder(data[0]);
}
if(type == "hk_uart_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart_holder();
@@ -88,19 +85,19 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart_strap();
}
if(type == "standoff") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data[0]);
}
if(type == "hd_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"horizontal","none");
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data[0],data[1],"horizontal","none");
}
if(type == "hd_vertleft") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"vertical","left");
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data[0],data[1],"vertical","left");
}
if(type == "hd_vertright") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"vertical","right");
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data[0],data[1],"vertical","right");
}
if(type == "hd25") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd25(data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd25(data[0]);
}
if(type == "hd35") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd35();
@@ -127,71 +124,71 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart();
}
if(type == "hk_vu7c") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_vu7c(data_1,data_2);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_vu7c(data[0],data[1]);
}
if(type == "hk_boom") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom(data_1,data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom(data[0],data[1]);
}
if(type == "boom_speaker") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_speaker(data_3,true,data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_speaker(data[1],true,data[0]);
}
if(type == "boom_grill") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_grill(data_3,size_z);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_grill(data[0],size_z);
}
if(type == "boom_speaker_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_speaker_holder(data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_speaker_holder(data[0],data[1]);
}
if(type == "hk_speaker") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_speaker();
}
if(type == "fan_cover") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_cover(size_x, size_z, data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_cover(size_x, size_z, data[0]);
}
if(type == "vent_panel_hex") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_panel_hex(x=size_x, y=size_y, thick=size_z,
cell_size=data_1, cell_spacing=data_2, border=data_4, borders=data_3);
cell_size=data[0], cell_spacing=data[1], border=data[3], borders=data[2]);
}
if(type == "feet") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) feet(size_x, size_z);
}
if(type == "access_port") {
if(rotation[2] == 180) {
translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data_3);
translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data[0]);
}
else {
translate([loc_x,loc_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data[0]);
}
}
if(type == "access_cover") {
if(rotation[2] == 180) {
color("grey",1) translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data_3);
color("grey",1) translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data[0]);
}
else {
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data_3);
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data[0]);
}
}
if(type == "boom_vring") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_vring(data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_vring(data[0]);
}
if(type == "h3_port_extender") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data[0]);
}
if(type == "h3_port_extender_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender_holder(data_3,data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender_holder(data[1],data[0]);
}
if(type == "hk_pwr_button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_pwr_button();
}
if(type == "keyhole") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data[0]);
}
if(type == "dsub") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data[0]);
}
if(type == "nut_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) nut_holder(data_1, data_2, size_x, size_y, size_z);
translate([loc_x,loc_y,loc_z]) rotate(rotation) nut_holder(data[0], data[1], size_x, size_y, size_z);
}
if(type == "standoff") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data[0]);
}
}

View File

@@ -548,94 +548,90 @@ module case_bottom(case_design) {
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data_1 = accessory_data[a[0]][i+9][0];
data_2 = accessory_data[a[0]][i+9][1];
data_3 = accessory_data[a[0]][i+9][2];
data_4 = accessory_data[a[0]][i+9][3];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == "bottom") || class == "suball") {
if(accessory_highlight == false) {
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], mask);
[size_x,size_y,size_z],data, mask);
}
else {
#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], mask);
[size_x,size_y,size_z],data, mask);
}
}
// create openings for additive
if (class == "add2" && face == "bottom" && type == "standoff") {
parametric_move_sub("round",loc_x,loc_y,loc_z-.1,face,rotation,parametric,
[6.5,size_y,floorthick+1],[data_1,data_2,data_3,data_4],mask);
[6.5,size_y,floorthick+1],data,mask);
}
if ((class == "add1" || class == "add2") && type == "uart_holder") {
if(accessory_highlight == false) {
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
[0,0,0],[data_1,data_2,data_3,data_4],mask);
[0,0,0],data,mask);
}
else {
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
[0,0,0],[data_1,data_2,data_3,data_4],mask);
[0,0,0],data,mask);
}
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,parametric,
[26.5,wallthick+gap+4,15],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
[26.5,wallthick+gap+4,15],[[.1,.1,.1,.1]],mask);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
if(data_3 == "landscape") {
if(data[0] == "landscape") {
if(rotation[2] == 180) {
parametric_move_sub("rectangle",loc_x-6+size_x,loc_y+.5+size_y,loc_z-adj,face,rotation,
parametric,[size_x-17,size_y-1,floorthick+1],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x-17,size_y-1,floorthick+1],[[.1,.1,.1,.1]],mask);
parametric_move_sub("rectangle",loc_x-size_x+12.5+size_x,loc_y-(size_y/2)+6+size_y,loc_z-adj,
face,rotation,parametric,[5.5,10.5,floorthick+.12],[data_1,data_2,data_3,[5.5,5.5,5.5,5.5]],mask);
face,rotation,parametric,[5.5,10.5,floorthick+.12],[[5.5,5.5,5.5,5.5]],mask);
}
else {
parametric_move_sub("rectangle",loc_x+6,loc_y-.5,loc_z-adj,face,rotation,
parametric,[size_x-17,size_y-1,floorthick+1],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x-17,size_y-1,floorthick+1],[[.1,.1,.1,.1]],mask);
parametric_move_sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adj,face,rotation,
parametric,[5.5,10.5,floorthick+.12],[data_1,data_2,data_3,[5.5,5.5,5.5,5.5]],mask);
parametric,[5.5,10.5,floorthick+.12],[[5.5,5.5,5.5,5.5]],mask);
}
}
else {
if(rotation[2] == 180) {
if(data_3 == "portrait") {
if(data[0] == "portrait") {
parametric_move_sub("rectangle",loc_x+size_x-.5,loc_y+size_y-5.75,loc_z-adj,face,
rotation,parametric,[size_x-1,size_y-17,floorthick+1],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
rotation,parametric,[size_x-1,size_y-17,floorthick+1],[[.1,.1,.1,.1]],mask);
parametric_move_sub("rectangle",loc_x-(size_x/2)+5+size_x,loc_y-size_y+12.5+size_y,
loc_z-adj,face,rotation,parametric,[10.5,5.5,floorthick+.12],[data_1,data_2,data_3,
[5.5,5.5,5.5,5.5]],mask);
loc_z-adj,face,rotation,parametric,[10.5,5.5,floorthick+.12],[[5.5,5.5,5.5,5.5]],mask);
}
else {
parametric_move_sub("rectangle",loc_x-.5,loc_y-5.75,loc_z-adj,face,rotation,
parametric,[size_x-1,size_y-17,floorthick+1],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x-1,size_y-17,floorthick+1],[[.1,.1,.1,.1]],mask);
parametric_move_sub("rectangle",loc_x-(size_x/2)+5,loc_y-size_y+12.5,loc_z-adj,face,
rotation,parametric,[10.5,5.5,floorthick+.12],[data_1,data_2,data_3,[5.5,5.5,5.5,5.5]],mask);
rotation,parametric,[10.5,5.5,floorthick+.12],[[5.5,5.5,5.5,5.5]],mask);
}
}
else {
parametric_move_sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adj,face,rotation,
parametric,[size_x-1,size_y-17,floorthick+1],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x-1,size_y-17,floorthick+1],[[.1,.1,.1,.1]],mask);
parametric_move_sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adj,face,rotation,
parametric,[10.5,5.5,floorthick+.12],[data_1,data_2,data_3,[5.5,5.5,5.5,5.5]],mask);
parametric,[10.5,5.5,floorthick+.12],[[5.5,5.5,5.5,5.5]],mask);
}
}
}
if ((class == "model") && face == "bottom" && type == "h2_netcard") {
parametric_move_sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
parametric,[68.5,wallthick+3,14.5],[data_1,data_2,data_3,[1,1,1,1]],mask);
parametric,[68.5,wallthick+3,14.5],[[1,1,1,1]],mask);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
if(data_3 == "recess") {
if(data[1] == "recess") {
#parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
parametric,[size_x-1,size_y,size_z],[data_1,data_2,data_3,0],mask);
parametric,[size_x-1,size_y,size_z],data,mask);
}
if(data_3 == "cutout") {
if(data[1] == "cutout") {
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
parametric,[size_x+2,size_y+1,size_z+2*adj],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x+2,size_y+1,size_z+2*adj],[[.1,.1,.1,.1]],mask);
}
}
}

View File

@@ -230,78 +230,75 @@ module case_side(case_design, case_style, side) {
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data_1 = accessory_data[a[0]][i+9][0];
data_2 = accessory_data[a[0]][i+9][1];
data_3 = accessory_data[a[0]][i+9][2];
data_4 = accessory_data[a[0]][i+9][3];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == side) || class == "suball") {
if(accessory_highlight == false) {
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],mask);
[size_x,size_y,size_z],data,mask);
}
else {
#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],mask);
[size_x,size_y,size_z],data,mask);
}
}
// create openings for additive
if ((class == "sub" && face == "bottom") || class == "suball") {
if(accessory_highlight == false) {
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],mask);
[size_x,size_y,size_z],data,mask);
}
else {
#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],mask);
[size_x,size_y,size_z],data,mask);
}
}
// create openings for additive
if (class == "add2" && face == "bottom" && type == "standoff") {
parametric_move_sub("round",loc_x,loc_y,-.1,face,rotation,parametric,
[6.5,size_y,floorthick+1],[data_1,data_2,data_3,data_4],mask);
[6.5,size_y,floorthick+1],data,mask);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
if(accessory_highlight == false) {
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
[0,0,0],[data_1,data_2,data_3,data_4],mask);
[0,0,0],data,mask);
}
else {
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
[0,0,0],[data_1,data_2,data_3,data_4],mask);
[0,0,0],data,mask);
}
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,
parametric,[26.5,wallthick+gap+4,15],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[26.5,wallthick+gap+4,15],[[.1,.1,.1,.1]],mask);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
if(data_3 == "landscape") {
if(data[0] == "landscape") {
parametric_move_sub("rectangle",loc_x+6,loc_y-.5,loc_z-adj,face,rotation,
parametric,[size_x-17,size_y-1,floorthick+1],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x-17,size_y-1,floorthick+1],[[.1,.1,.1,.1]],mask);
parametric_move_sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adj,face,rotation,
parametric,[5.5,10.5,floorthick+.12],[data_1,data_2,data_3,[5.5,5.5,5.5,5.5]],mask);
parametric,[5.5,10.5,floorthick+.12],[[5.5,5.5,5.5,5.5]],mask);
}
else {
parametric_move_sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adj,face,rotation,parametric,
[size_x-1,size_y-17,floorthick+1],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
[size_x-1,size_y-17,floorthick+1],[[.1,.1,.1,.1]],mask);
parametric_move_sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adj,face,rotation,
parametric,[10.5,5.5,floorthick+.12],[data_1,data_2,data_3,[5.5,5.5,5.5,5.5]],mask);
parametric,[10.5,5.5,floorthick+.12],[[5.5,5.5,5.5,5.5]],mask);
}
}
if ((class == "model") && face == "bottom" && type == "h2_netcard") {
parametric_move_sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
parametric,[68.5,wallthick+3,14.5],[data_1,data_2,data_3,[1,1,1,1]],mask);
parametric,[68.5,wallthick+3,14.5],[[1,1,1,1]],mask);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
if(data_3 == "recess") {
if(data[1] == "recess") {
parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
parametric,[size_x-1,size_y,size_z],[data_1,data_2,data_3,0],mask);
parametric,[size_x-1,size_y,size_z],data,mask);
}
if(data_3 == "cutout") {
if(data[1] == "cutout") {
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
parametric,[size_x+2,size_y+1,size_z+2*adj],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x+2,size_y+1,size_z+2*adj],[[.1,.1,.1,.1]],mask);
}
}
}

View File

@@ -488,57 +488,51 @@ module case_top(case_design) {
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data_1 = accessory_data[a[0]][i+9][0];
data_2 = accessory_data[a[0]][i+9][1];
data_3 = accessory_data[a[0]][i+9][2];
data_4 = accessory_data[a[0]][i+9][3];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == "top") || class == "suball") {
if(accessory_highlight == false) {
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],mask);
parametric,[size_x,size_y,size_z],data,mask);
}
else {
#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],mask);
parametric,[size_x,size_y,size_z],data,mask);
}
}
// create openings for additive
if (class == "add2" && face == "top" && type == "standoff") {
parametric_move_sub("round",loc_x,loc_y,loc_z,face,rotation,parametric,
[6.5,size_y,floorthick+1],[data_1,data_2,data_3,data_4],mask);
parametric_move_sub("round",loc_x,loc_y,loc_z,face,rotation,parametric,[6.5,size_y,floorthick+1],data,mask);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
if(accessory_highlight == false) {
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
[0,0,0],[data_1,data_2,data_3,data_4],mask);
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,[0,0,0],data,mask);
}
else {
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
[0,0,0],[data_1,data_2,data_3,data_4],mask);
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,[0,0,0],data,mask);
}
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+26,face,rotation,
parametric,[26.5,wallthick+gap+4,14.5],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[26.5,wallthick+gap+4,14.5],[[.1,.1,.1,.1]],mask);
}
if ((class == "add1" || class == "add2") && face == "top" && type == "button") {
if(data_3 == "recess") {
if(data[1] == "recess") {
parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
parametric,[size_x-1,size_y,size_z],[data_1,data_2,data_3,0],mask);
parametric,[size_x-1,size_y,size_z],data,mask);
}
if(data_3 == "cutout") {
if(data[1] == "cutout") {
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
parametric,[size_x+2,size_y+1,size_z+2*adj],[data_1,data_2,data_3,[.1,.1,.1,.1]],mask);
parametric,[size_x+2,size_y+1,size_z+2*adj],[[.1,.1,.1,.1]],mask);
}
}
if (class == "model" && face == "bottom" && type == "hk_boom" &&
rotation[0] == 90 && rotation[1] == 0 && rotation[2] == 0) {
parametric_move_sub("round",loc_x+11,loc_y-4,loc_z,face,[0,0,0],
parametric,[5,size_y,80],[data_1,data_2,data_3,data_4],mask);
parametric,[5,size_y,80],data,mask);
parametric_move_sub("slot",loc_x+37.5,loc_y-4.75,loc_z,face,[0,0,0],
parametric,[6,14,80],[data_1,data_2,data_3,data_4],mask);
parametric,[6,14,80],data,mask);
}
}
}

View File

@@ -30,6 +30,7 @@
rotation[] = object rotation
parametric[] = parametric movement array
size[] = size array x,y,z
data[] = data variable on type
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
@@ -42,17 +43,13 @@ module sub(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
size_x = size[0];
size_y = size[1];
size_z = size[2];
data_1 = data[0];
data_2 = data[1];
data_3 = data[2];
data_4 = data[3];
enablemask = mask[0];
mlen = mask[1];
msetback = mask[2];
mstyle = mask[3];
if(type == "rectangle") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data[0]);
}
if(type == "round") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) cylinder(d=size_x,h=size_z);
@@ -61,37 +58,37 @@ module sub(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slot(size_x,size_y,size_z);
}
if(type == "text") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_3, size=data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_2, size=data[0]);
}
if(type == "art") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data_1,data_2,data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data[0],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);
translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data[1],[size_x,size_y,size_z],data[2],data[0]);
}
if(type == "hd_holes") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"none","none",data_2);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data[0],data[2],"none","none",data[1]);
}
if(type == "hd_vertleft_holes") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"vertical","left",data_2);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data[0],data[2],"vertical","left",data[1]);
}
if(type == "hd_vertright_holes") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"vertical","right",data_2);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data[0],data[2],"vertical","right",data[1]);
}
if(type == "hk_fan_top") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_fan_top();
}
if(type == "knockout") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) knockout(size_x,size_y,data_1,size_z,data_2,data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) knockout(size_x,size_y,data[0],size_z,data[1],data[2]);
}
if(type == "fan") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_mask(size_x, size_z, data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_mask(size_x, size_z, data[0]);
}
if(type == "vent") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent(size_x,size_y,size_z,data_4,data_1,data_2,data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent(size_x,size_y,size_z,data[3],data[0],data[1],data[2]);
}
if(type == "vent_hex") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_hex(size_x,size_y,size_z,data_1,data_2,data_3);
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_hex(size_x,size_y,size_z,data[0],data[1],data[2]);
}
if(type == "microusb") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) microusb_open();
@@ -100,15 +97,15 @@ module sub(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
translate([loc_x,loc_y,loc_z]) rotate(rotation) sphere(d=size_x);
}
if(type == "keyhole") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data_4, true);
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data[0], true);
}
if(type == "h3_port_extender") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data_3, true);
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data[0], true);
}
if(type == "hk_pwr_button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_pwr_button(true);
}
if(type == "dsub") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data_4, true);
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data[0], true);
}
}

File diff suppressed because it is too large Load Diff