1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-19 13:01:37 +02:00

shape_ellipse is enough

This commit is contained in:
Justin Lin
2017-05-14 13:59:48 +08:00
parent a6edd169c1
commit ea2b150fb5
5 changed files with 0 additions and 49 deletions

View File

@@ -32,7 +32,6 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I
- 2D
- [arc](https://openhome.cc/eGossip/OpenSCAD/lib-arc.html)
- [pie](https://openhome.cc/eGossip/OpenSCAD/lib-pie.html)
- [ellipse](https://openhome.cc/eGossip/OpenSCAD/lib-ellipse.html)
- [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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -1,24 +0,0 @@
# ellipse
Creates an ellipse.
## Parameters
- `axes` : 2 element vector `[x, y]` where x is the semi-major axis and y is the semi-minor axis.
- `$fa`, `$fs`, `$fn` : The shape created by this module can be viewd as `resize([x, y]) circle(r = x)` (but not the real implementation inside the module) so you can use these global variables to control it. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
## Examples
include <ellipse.scad>;
ellipse([40, 20]);
![ellipse](images/lib-ellipse-1.JPG)
include <ellipse.scad>;
$fn = 8;
ellipse([20, 40]);
![ellipse](images/lib-ellipse-2.JPG)

View File

@@ -1,24 +0,0 @@
/**
* ellipse.scad
*
* Creates an ellipse.
*
* @copyright Justin Lin, 2017
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib-ellipse.html
*
**/
include <__private__/__frags.scad>;
module ellipse(axes) {
step_a = 360 / __frags(axes[0]);
polygon(
[
for(a = [0:step_a:360 - step_a])
[axes[0] * cos(a), axes[1] * sin(a)]
]
);
}