mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-23 23:52:50 +02:00
Butt_box now has a thin_blocks property to make it use 2screw_blocks instead of fixing blocks along the edges.
This commit is contained in:
@@ -31,7 +31,8 @@
|
||||
//! * An optional list of fixing blocks to be omitted can be given.
|
||||
//! * Star washers can be omitted by setting the 11th parameter to false.
|
||||
//!
|
||||
//! Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block).
|
||||
//! Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block) by default. Setting `thin_blocks` uses 2screw_blocks instead of
|
||||
//! fixing_blocks along the sides.
|
||||
//
|
||||
|
||||
use <fixing_block.scad>
|
||||
@@ -49,9 +50,10 @@ function bbox_height(type) = type[7]; //! Internal height
|
||||
function bbox_name(type) = type[8]; //! Optional name if there is more than one box in a project
|
||||
function bbox_skip_blocks(type)= type[9]; //! List of fixing blocks to skip, used to allow a hinged panel for example
|
||||
function bbox_star_washers(type)= type[10];//! Set to false to remove star washers.
|
||||
function bbox_thin_blocks(type) = type[11];//! Set for 2 screw blocks instead of three hole fixing blocks.
|
||||
|
||||
function bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true) = //! Construct the property list for a butt_box
|
||||
[ screw, sheets, base_sheet, top_sheet, span, size.x, size.y, size.z, name, skip_blocks, star_washers ];
|
||||
function bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true, thin_blocks = false) = //! Construct the property list for a butt_box
|
||||
[ screw, sheets, base_sheet, top_sheet, span, size.x, size.y, size.z, name, skip_blocks, star_washers, thin_blocks ];
|
||||
|
||||
function bbox_volume(type) = bbox_width(type) * bbox_depth(type) * bbox_height(type) / 1000000; //! Internal volume in litres
|
||||
function bbox_area(type) = let(w = bbox_width(type), d = bbox_depth(type), h = bbox_height(type)) //! Internal surface area in m^2
|
||||
@@ -108,7 +110,10 @@ function fixing_block_positions(type) = let(
|
||||
rotate([y > 0 ? 180 : 0, x * y * 90, 0]),
|
||||
];
|
||||
|
||||
function side_holes(type) = [for(p = fixing_block_positions(type), q = fixing_block_holes(bbox_screw(type))) p * q];
|
||||
function side_holes(type) = let(
|
||||
screw = bbox_screw(type),
|
||||
holes = bbox_thin_blocks(type) ? 2screw_block_holes(screw) : fixing_block_holes(screw))
|
||||
[for(p = fixing_block_positions(type), q = holes) p * q];
|
||||
|
||||
module bbox_drill_holes(type, t)
|
||||
position_children(concat(corner_holes(type), side_holes(type)), t)
|
||||
@@ -232,6 +237,7 @@ module _bbox_assembly(type, top = true, base = true, left = true, right = true,
|
||||
bt = sheet_thickness(bbox_base_sheet(type));
|
||||
tt = sheet_thickness(bbox_top_sheet(type));
|
||||
star_washers = bbox_star_washers(type);
|
||||
thin_blocks = bbox_thin_blocks(type);
|
||||
|
||||
function is_missing_screw(p) = p.y > depth / 2 - 1 ? !back : false;
|
||||
|
||||
@@ -247,6 +253,9 @@ module _bbox_assembly(type, top = true, base = true, left = true, right = true,
|
||||
for(p = fixing_block_positions(type))
|
||||
let(q = transform([0, 0, 0], p), thickness = q.z > h ? tt : q.z < -h ? bt : t)
|
||||
multmatrix(p)
|
||||
if(thin_blocks)
|
||||
fastened_2screw_block_assembly(is_missing_screw(q) ? 0 : t, bbox_screw(type), thickness_below = thickness, star_washers = star_washers);
|
||||
else
|
||||
fastened_fixing_block_assembly(is_missing_screw(q) ? 0 : t, bbox_screw(type), thickness2 = thickness, star_washers = star_washers);
|
||||
|
||||
for(x = [-1, 1])
|
||||
|
@@ -4568,7 +4568,8 @@ maximum spacing.
|
||||
* An optional list of fixing blocks to be omitted can be given.
|
||||
* Star washers can be omitted by setting the 11th parameter to false.
|
||||
|
||||
Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block).
|
||||
Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block) by default. Setting `thin_blocks` uses 2screw_blocks instead of
|
||||
fixing_blocks along the sides.
|
||||
|
||||
[printed/butt_box.scad](printed/butt_box.scad) Implementation.
|
||||
|
||||
@@ -4586,13 +4587,14 @@ Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block).
|
||||
| `bbox_skip_blocks(type)` | List of fixing blocks to skip, used to allow a hinged panel for example |
|
||||
| `bbox_span(type)` | Maximum span between fixing blocks |
|
||||
| `bbox_star_washers(type)` | Set to false to remove star washers. |
|
||||
| `bbox_thin_blocks(type)` | Set for 2 screw blocks instead of three hole fixing blocks. |
|
||||
| `bbox_top_sheet(type)` | Sheet type for the top |
|
||||
| `bbox_width(type)` | Internal width |
|
||||
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true)` | Construct the property list for a butt_box |
|
||||
| `bbox(screw, sheets, base_sheet, top_sheet, span, size, name = "bbox", skip_blocks = [], star_washers = true, thin_blocks = false)` | Construct the property list for a butt_box |
|
||||
| `bbox_area(type)` | Internal surface area in m^2 |
|
||||
| `bbox_volume(type)` | Internal volume in litres |
|
||||
|
||||
|
Reference in New Issue
Block a user