mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-19 04:51:26 +02:00
shape_ellipse is enough
This commit is contained in:
@@ -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 |
@@ -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]);
|
||||
|
||||

|
||||
|
||||
include <ellipse.scad>;
|
||||
|
||||
$fn = 8;
|
||||
ellipse([20, 40]);
|
||||
|
||||

|
||||
|
@@ -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)]
|
||||
]
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user