diff --git a/README.md b/README.md index c7a1bd97..cf209207 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,7 @@ I've been using OpenSCAD for years and created some funny things. Some of them i - Path - [circle_path](https://openhome.cc/eGossip/OpenSCAD/lib-circle_path.html) - [bezier](https://openhome.cc/eGossip/OpenSCAD/lib-bezier.html) - - [cylinder_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-cylinder_spiral.html) \ No newline at end of file + - [cylinder_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-cylinder_spiral.html) + +- Other + - [box_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-box_extrude.html) \ No newline at end of file diff --git a/docs/images/lib-box_extrude-1.JPG b/docs/images/lib-box_extrude-1.JPG new file mode 100644 index 00000000..f5924902 Binary files /dev/null and b/docs/images/lib-box_extrude-1.JPG differ diff --git a/docs/images/lib-box_extrude-2.JPG b/docs/images/lib-box_extrude-2.JPG new file mode 100644 index 00000000..d551663b Binary files /dev/null and b/docs/images/lib-box_extrude-2.JPG differ diff --git a/docs/lib-box_extrude.md b/docs/lib-box_extrude.md new file mode 100644 index 00000000..6ec31b47 --- /dev/null +++ b/docs/lib-box_extrude.md @@ -0,0 +1,21 @@ +# box_extrude + +Create a box (container) from a 2D object. + +## Parameters + +- `height` : The box height. +- `shell_thickness` : The thickness between the exterior and interior.. + +## Examples + + box_extrude(height = 30, shell_thickness = 2) + circle(r = 30); + +![box_extrude](images/lib-box_extrude-1.JPG) + +box_extrude(height = 30, shell_thickness = 2) + text("XD", size = 40, font = "Cooper Black"); + +![box_extrude](images/lib-box_extrude-2.JPG) + diff --git a/src/box_extrude.scad b/src/box_extrude.scad new file mode 100644 index 00000000..29b619d7 --- /dev/null +++ b/src/box_extrude.scad @@ -0,0 +1,27 @@ +/** +* box_extrude.scad +* +* Create a box (container) from a 2D object. +* +* @copyright Justin Lin, 2017 +* @license https://opensource.org/licenses/lgpl-3.0.html +* +* @see https://openhome.cc/eGossip/OpenSCAD/lib-box_extrude.html +* +**/ + +module box_extrude(height, shell_thickness) { + linear_extrude(shell_thickness) + children(); + + linear_extrude(height) + difference() { + children(); + offset(delta = -shell_thickness) + children(); + } +} + +box_extrude(height = 30, shell_thickness = 2) + text("XD", size = 40, font = "Cooper Black"); + \ No newline at end of file