1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
This commit is contained in:
Justin Lin 2021-10-28 08:20:03 +08:00
parent 9022cb731d
commit 3901e4f1ea
4 changed files with 38 additions and 12 deletions

View File

@ -381,4 +381,4 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
[**polyhedra/octahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_octahedron.html) | create a octahedron.
polyhedra/dodecahedron | create a dodecahedron.
polyhedra/icosahedron | create a icosahedron.
polyhedra/superellipsoid | create a superellipsoid.
[**polyhedra/superellipsoid**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_superellipsoid.html) | create a superellipsoid.

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -0,0 +1,27 @@
# superellipsoid
Creates a [superellipsoid](https://en.wikipedia.org/wiki/Superellipsoid).
**Since:** 3.2
## Parameters
- `e` : The east-west parameter.
- `n` : The north-south parameter.
## Examples
use <polyhedra/superellipsoid.scad>;
$fn = 24;
step = 0.5;
for(e = [0:step:4]) {
for(n = [0:step:4])
translate([e / step, n / step] * 3)
superellipsoid(e, n);
}
![superellipsoid](images/lib3x-polyhedra_superellipsoid-1.JPG)

View File

@ -1,17 +1,16 @@
/**
* superellipsoid.scad
*
* @copyright Justin Lin, 2021
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-superellipsoid.html
*
**/
use <../__comm__/__frags.scad>;
use <../sweep.scad>;
// use <polyhedra/superellipsoid.scad>;
// $fn = 24;
// for(e = [0:.5:4]) {
// for(n = [0:.5:3])
// translate([e / .5, n / .5] * 3)
// superellipsoid(e, n);
// }
module superellipsoid(e, n) {
function _sgn(x) =
x < 0 ? -1 :