diff --git a/README.md b/README.md index fa9ee9c9..20e0d61c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Some modules may depend on other modules. For example, the `polyline2d` module d ## Documentation - 2D + - [rounded_square](https://openhome.cc/eGossip/OpenSCAD/lib-rounded_square.html) - [line2d](https://openhome.cc/eGossip/OpenSCAD/lib-line2d.html) - [polyline2d](https://openhome.cc/eGossip/OpenSCAD/lib-polyline2d.html) - [circular_sector](https://openhome.cc/eGossip/OpenSCAD/lib-circular_sector.html) diff --git a/docs/images/lib-rounded_square-1.JPG b/docs/images/lib-rounded_square-1.JPG new file mode 100644 index 00000000..25caa63a Binary files /dev/null and b/docs/images/lib-rounded_square-1.JPG differ diff --git a/docs/images/lib-rounded_square-2.JPG b/docs/images/lib-rounded_square-2.JPG new file mode 100644 index 00000000..e5b88495 Binary files /dev/null and b/docs/images/lib-rounded_square-2.JPG differ diff --git a/docs/images/lib-rounded_square-3.JPG b/docs/images/lib-rounded_square-3.JPG new file mode 100644 index 00000000..0774f733 Binary files /dev/null and b/docs/images/lib-rounded_square-3.JPG differ diff --git a/docs/lib-rounded_square.md b/docs/lib-rounded_square.md new file mode 100644 index 00000000..7349efc0 --- /dev/null +++ b/docs/lib-rounded_square.md @@ -0,0 +1,44 @@ +# rounded_square + +Creates a rounded square or rectangle in the first quadrant. When center is true the square is centered on the origin. + +## Parameters + +- `size` : Accepts single value, square with both sides this length. It also accepts 2 value array `[x, y]`, rectangle with dimensions `x` and `y`. +- `corner_r` : The corner is one-quarter of a circle (quadrant). The `corner_r` parameter determines the circle radius. +- `center` : `false` (default), 1st (positive) quadrant, one corner at (0,0). `true`, square is centered at (0,0). +- `$fa`, `$fs`, `$fn` : Used to control the four quadrants. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details. + + +## Examples + + include ; + + rounded_square(size = 50, corner_r = 5); + +![rounded_square](images/lib-rounded_square-1.JPG) + + include ; + + rounded_square( + size = [50, 25], + corner_r = 5, + center = true + ); + +![rounded_square](images/lib-rounded_square-2.JPG) + + include ; + + $fn = 4; + rounded_square( + size = [50, 25], + corner_r = 5, + center = true + ); + +![rounded_square](images/lib-rounded_square-3.JPG) + + + +