https://github.com/mmalecki/openscad-squircle
OpenSCAD squircle
https://github.com/mmalecki/openscad-squircle
openscad squircle
Last synced: 5 months ago
JSON representation
OpenSCAD squircle
- Host: GitHub
- URL: https://github.com/mmalecki/openscad-squircle
- Owner: mmalecki
- License: mit
- Created: 2023-01-14T14:06:24.000Z (over 3 years ago)
- Default Branch: latest
- Last Pushed: 2023-01-14T14:14:01.000Z (over 3 years ago)
- Last Synced: 2024-10-18T06:21:05.676Z (over 1 year ago)
- Topics: openscad, squircle
- Language: OpenSCAD
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenSCAD squircle
The amount of slightly different [squircle](https://en.wikipedia.org/wiki/Squircle) implementations in my different OpenSCAD
projects was getting too damn high, so here's a pretty robust one.
## Installation
Add a git submodule to your project:
```sh
git submodule add https://github.com/mmalecki/openscad-squircle squircle
```
## Usage
```openscad
use ;
// Simple usage:
squircle([20, 25], 1, center = true);
// A bit more fancy:
translate([30, 0])
squircle([20, 25], [0, 5, 7.5, 10], center = true);
```
### API
#### `squricle(size, r, center = false)`
Draws a 2D squircle.
Arguments:
* `size` - size of the base square
* `r` (number, list of 4 numbers) - the radius or radii of the corner circles (0 for no corner circle)
* `center` (boolean) - whether to center the squircle