diff --git a/lib.scad b/lib.scad index dc5cc0c..4b31f33 100644 --- a/lib.scad +++ b/lib.scad @@ -28,6 +28,7 @@ include include include include +include include include include diff --git a/libtest.png b/libtest.png index 220bd04..937eff5 100644 Binary files a/libtest.png and b/libtest.png differ diff --git a/libtest.scad b/libtest.scad index b9b2c21..f215de6 100644 --- a/libtest.scad +++ b/libtest.scad @@ -46,6 +46,7 @@ use use use use +use use use use @@ -426,6 +427,7 @@ extrusion_brackets_y = rails_y + 250; sk_brackets_y = extrusion_brackets_y + 80; kp_pillow_blocks_y = sk_brackets_y + 50; scs_bearing_blocks_y = kp_pillow_blocks_y + 60; +box_sections_y = sheets_y; translate([x4 + 200, belts_y + 58]) { belt_test(); @@ -459,6 +461,8 @@ translate([x4 + 120, extrusion_brackets_y]) translate([x4, scs_bearing_blocks_y]) scs_bearing_blocks(); +translate([x4, box_sections_y]) + box_sections(); translate([x6, 125]) light_strips(); diff --git a/readme.md b/readme.md index 07caf38..f328072 100644 --- a/readme.md +++ b/readme.md @@ -20,32 +20,32 @@ A list of changes classified as breaking, additions or fixes is maintained in [C ## Table of Contents - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
Vitamins A-I Vitamins J-Q Vitamins R-Z Printed Utilities Core Utilities
Axials Jack Rails Box Annotation BOM
Ball_bearings LDRs Ring_terminals Butt_box Bezier Clip
Batteries LED_meters Rockers Cable_grommets Catenary Global
Bearing_blocks LEDs Rod Camera_housing Core_xy Polyholes
Belts Leadnuts SK_brackets Carriers Dogbones Rounded_rectangle
Blowers Light_strips SMDs Corner_block Fillet Sphere
Bulldogs Linear_bearings SSRs Door_hinge Gears Teardrops
Buttons Magnets Screws Door_latch Hanging_hole
Cable_strips Mains_sockets Sealing_strip Drag_chain Horiholes
Cameras Microswitches Shaft_couplings Fan_guard Layout
Circlips Microview Sheets Fixing_block Maths
Components Modules Spades Flat_hinge Offset
DIP Nuts Spools Foot Quadrant
D_connectors O_ring Springs Handle Round
Displays Opengrab Stepper_motors PCB_mount Rounded_cylinder
Extrusion_brackets PCB Swiss_clips PSU_shroud Rounded_polygon
Extrusions PCBs Toggles Pocket_handle Rounded_triangle
Fans PSUs Transformers Press_fit Sector
Fuseholder Panel_meters Tubings Printed_box Sweep
Geared_steppers Pillars Variacs Printed_pulleys Thread
Green_terminals Pillow_blocks Veroboard Ribbon_clamp Tube
Hot_ends Pin_headers Washers SSR_shroud
Hygrometer Pulleys Wire Screw_knob
IECs Zipties Socket_box
Inserts Strap_handle
Vitamins A-H Vitamins I-Q Vitamins R-Z Printed Utilities Core Utilities
Axials IECs Rails Box Annotation BOM
Ball_bearings Inserts Ring_terminals Butt_box Bezier Clip
Batteries Jack Rockers Cable_grommets Catenary Global
Bearing_blocks LDRs Rod Camera_housing Core_xy Polyholes
Belts LED_meters SK_brackets Carriers Dogbones Rounded_rectangle
Blowers LEDs SMDs Corner_block Fillet Sphere
Box_sections Leadnuts SSRs Door_hinge Gears Teardrops
Bulldogs Light_strips Screws Door_latch Hanging_hole
Buttons Linear_bearings Sealing_strip Drag_chain Horiholes
Cable_strips Magnets Shaft_couplings Fan_guard Layout
Cameras Mains_sockets Sheets Fixing_block Maths
Circlips Microswitches Spades Flat_hinge Offset
Components Microview Spools Foot Quadrant
DIP Modules Springs Handle Round
D_connectors Nuts Stepper_motors PCB_mount Rounded_cylinder
Displays O_ring Swiss_clips PSU_shroud Rounded_polygon
Extrusion_brackets Opengrab Toggles Pocket_handle Rounded_triangle
Extrusions PCB Transformers Press_fit Sector
Fans PCBs Tubings Printed_box Sweep
Fuseholder PSUs Variacs Printed_pulleys Thread
Geared_steppers Panel_meters Veroboard Ribbon_clamp Tube
Green_terminals Pillars Washers SSR_shroud
Hot_ends Pillow_blocks Wire Screw_knob
Hygrometer Pin_headers Zipties Socket_box
Pulleys Strap_handle
--- @@ -399,6 +399,44 @@ Models of radial blowers. | 2 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm | +
Top + +--- + +## Box_sections +Box sections. + +[vitamins/box_sections.scad](vitamins/box_sections.scad) Object definitions. + +[vitamins/box_section.scad](vitamins/box_section.scad) Implementation. + +[tests/box_sections.scad](tests/box_sections.scad) Code for this example. + +### Properties +| Function | Description | +|:--- |:--- | +| `box_section_colour(type)` | Colour | +| `box_section_colour2(type)` | Colour2, for woven box section | +| `box_section_fillet(type)` | Fillet | +| `box_section_material(type)` | Material description | +| `box_section_size(type)` | Size | +| `box_section_thickness(type)` | Wall thickness | + +### Functions +| Function | Description | +|:--- |:--- | +| `box_section_is_woven(type)` | Box section is woven, eg carbon fiber | + +![box_sections](tests/png/box_sections.png) + +### Vitamins +| Qty | Module call | BOM entry | +| ---:|:--- |:---| +| 1 | `box_section(AL12x8x1, 100)` | Aluminium rectangular box section 12mm x 8mm x 1mm, length 100mm | +| 1 | `box_section(AL20x20x2, 100)` | Aluminium rectangular box section 20mm x 20mm x 2mm, length 100mm | +| 1 | `box_section(CF10x10x1, 100)` | Carbon fiber rectangular box section 10mm x 10mm x 1mm, length 100mm | + + Top --- diff --git a/scripts/tests.py b/scripts/tests.py index 4b6b1d3..9a5140f 100755 --- a/scripts/tests.py +++ b/scripts/tests.py @@ -173,7 +173,7 @@ def tests(tests): impl_name = None if libtest: - vsplit = "AJR" + chr(ord('Z') + 1) + vsplit = "AIR" + chr(ord('Z') + 1) vtype = locations[0][1] types = [vtype + ' ' + vsplit[i] + '-' + chr(ord(vsplit[i + 1]) - 1) for i in range(len(vsplit) - 1)] + [loc[1] for loc in locations[1 :]] if type == vtype: diff --git a/tests/box_sections.scad b/tests/box_sections.scad new file mode 100644 index 0000000..8e1ca6e --- /dev/null +++ b/tests/box_sections.scad @@ -0,0 +1,30 @@ +// +// NopSCADlib Copyright Chris Palmer 2021 +// nop.head@gmail.com +// hydraraptor.blogspot.com +// +// This file is part of NopSCADlib. +// +// NopSCADlib 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. +// +// NopSCADlib is distributed in the hope that it will be useful, 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 NopSCADlib. +// If not, see . +// +include <../utils/core/core.scad> +use <../utils/layout.scad> + +include <../vitamins/box_sections.scad> + +module box_sections() { + layout([for(b = box_sections) box_section_size(b).x], 20) + box_section(box_sections[$i], 100); +} + +if($preview) + box_sections(); diff --git a/tests/png/box_sections.png b/tests/png/box_sections.png new file mode 100644 index 0000000..decf235 Binary files /dev/null and b/tests/png/box_sections.png differ diff --git a/vitamins/box_section.scad b/vitamins/box_section.scad new file mode 100644 index 0000000..6e01ed3 --- /dev/null +++ b/vitamins/box_section.scad @@ -0,0 +1,58 @@ +// +// NopSCADlib Copyright Chris Palmer 2021 +// nop.head@gmail.com +// hydraraptor.blogspot.com +// +// This file is part of NopSCADlib. +// +// NopSCADlib 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. +// +// NopSCADlib is distributed in the hope that it will be useful, 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 NopSCADlib. +// If not, see . +// + +// +//! Box sections. +// +include <../utils/core/core.scad> +include <../utils/tube.scad> + +include <../vitamins/sheets.scad> + +function box_section_material(type) = type[1]; //! Material description +function box_section_size(type) = type[2]; //! Size +function box_section_thickness(type) = type[3]; //! Wall thickness +function box_section_fillet(type) = type[4]; //! Fillet +function box_section_colour(type) = type[5]; //! Colour +function box_section_colour2(type) = type[6]; //! Colour2, for woven box section +function box_section_is_woven(type) = !is_undef(type[6]); //! Box section is woven, eg carbon fiber + +module box_section(type, length, center = true) { + vitamin(str("box_section(", type[0], arg(length, 15), "): ", box_section_material(type), ", length ", length, "mm")); + + size = box_section_size(type); + thickness = box_section_thickness(type); + + if (box_section_is_woven(type)) + translate_z(center ? 0 : length / 2) { + rotate([0, -90, 90]) + for (z = [-size.y / 2, size.y / 2 - thickness]) + translate_z(z) + woven_sheet(CF1, thickness, box_section_colour(type), box_section_colour2(type), length, size.x) + square([length, size.x], center=true); + rotate([0, -90, 0]) + for (z = [-size.x / 2, size.x / 2 - thickness]) + translate_z(z) + woven_sheet(CF1, thickness, box_section_colour(type), box_section_colour2(type), length, size.y) + square([length, size.y], center=true); + } + else + color(box_section_colour(type)) + rectangular_tube([size.x, size.y, length], center, thickness, box_section_fillet(type)); +} diff --git a/vitamins/box_sections.scad b/vitamins/box_sections.scad new file mode 100644 index 0000000..616d435 --- /dev/null +++ b/vitamins/box_sections.scad @@ -0,0 +1,30 @@ +// +// NopSCADlib Copyright Chris Palmer 2021 +// nop.head@gmail.com +// hydraraptor.blogspot.com +// +// This file is part of NopSCADlib. +// +// NopSCADlib 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. +// +// NopSCADlib is distributed in the hope that it will be useful, 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 NopSCADlib. +// If not, see . +// + +// +// Box sections +// +AL12x8x1 = ["AL12x8x1", "Aluminium rectangular box section 12mm x 8mm x 1mm", [12, 8], 1, 0.5, silver, undef]; +AL20x20x2 = ["AL20x20x2", "Aluminium rectangular box section 20mm x 20mm x 2mm", [20, 20], 2, 0.5, silver, undef]; +CF10x10x1 = ["CF10x10x1", "Carbon fiber rectangular box section 10mm x 10mm x 1mm", [10, 10], 1, 0.5, grey(35), grey(20)]; + + +box_sections = [AL12x8x1, AL20x20x2, CF10x10x1]; + +use