mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-01-17 21:48:43 +01:00
pbox_outer_shape() added and pbox_screw_positions() documented.
This commit is contained in:
parent
85b8ffbbc3
commit
02791c40ac
@ -78,7 +78,7 @@ function pbox_screw_inset(type) = //! How far the base screws are inset
|
|||||||
R = pbox_radius(type)
|
R = pbox_radius(type)
|
||||||
) max(r, R - (R - r) / sqrt(2));
|
) max(r, R - (R - r) / sqrt(2));
|
||||||
|
|
||||||
module pbox_screw_positions(type) {
|
module pbox_screw_positions(type) { //! Place children at base screw positions
|
||||||
foot = pbox_foot(type);
|
foot = pbox_foot(type);
|
||||||
inset = pbox_screw_inset(type);
|
inset = pbox_screw_inset(type);
|
||||||
for(x = [-1, 1], y = [-1, 1])
|
for(x = [-1, 1], y = [-1, 1])
|
||||||
@ -127,6 +127,9 @@ module pbox_inner_shape(type) {
|
|||||||
rounded_square([w, d], rad, center = true);
|
rounded_square([w, d], rad, center = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module pbox_outer_shape(type) //! 2D outer shape of the box
|
||||||
|
offset(pbox_wall(type) / 2) pbox_mid_shape(type);
|
||||||
|
|
||||||
module pbox_base(type) { //! Generate the STL for the base
|
module pbox_base(type) { //! Generate the STL for the base
|
||||||
stl(str(pbox_name(type),"_base"));
|
stl(str(pbox_name(type),"_base"));
|
||||||
t = pbox_base(type);
|
t = pbox_base(type);
|
||||||
@ -161,7 +164,7 @@ module pbox(type) { //! Generate the STL for the main case
|
|||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
linear_extrude(total_height)
|
linear_extrude(total_height)
|
||||||
offset(wall / 2) pbox_mid_shape(type);
|
pbox_outer_shape(type);
|
||||||
|
|
||||||
if($children > 2)
|
if($children > 2)
|
||||||
children(2);
|
children(2);
|
||||||
|
@ -4705,6 +4705,8 @@ It can also have printed feet on the base with the screws doubling up to hold th
|
|||||||
| ```pbox_base(type)``` | Generate the STL for the base |
|
| ```pbox_base(type)``` | Generate the STL for the base |
|
||||||
| ```pbox_base_screws(type, thickness = 0)``` | Place the screws and feet |
|
| ```pbox_base_screws(type, thickness = 0)``` | Place the screws and feet |
|
||||||
| ```pbox_inserts(type)``` | Place the inserts for the base screws |
|
| ```pbox_inserts(type)``` | Place the inserts for the base screws |
|
||||||
|
| ```pbox_outer_shape(type)``` | 2D outer shape of the box |
|
||||||
|
| ```pbox_screw_positions(type)``` | Place children at base screw positions |
|
||||||
|
|
||||||
![printed_box](tests/png/printed_box.png)
|
![printed_box](tests/png/printed_box.png)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user