1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 01:04:07 +02:00
This commit is contained in:
Justin Lin
2017-05-07 20:13:13 +08:00
parent 52cbc3713a
commit 02ddec88c0
5 changed files with 27 additions and 27 deletions

View File

@@ -28,13 +28,13 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I
## Documentation
- 2D
- [ellipse](https://openhome.cc/eGossip/OpenSCAD/lib-ellipse.html)
- [pie](https://openhome.cc/eGossip/OpenSCAD/lib-pie.html)
- [arc](https://openhome.cc/eGossip/OpenSCAD/lib-arc.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)
- [hull_polyline2d](https://openhome.cc/eGossip/OpenSCAD/lib-hull_polyline2d.html)
- [circular_sector](https://openhome.cc/eGossip/OpenSCAD/lib-circular_sector.html)
- [arc](https://openhome.cc/eGossip/OpenSCAD/lib-arc.html)
- [hexagons](https://openhome.cc/eGossip/OpenSCAD/lib-hexagons.html)
- [polytransversals](https://openhome.cc/eGossip/OpenSCAD/lib-polytransversals.html)
- [path_extend](https://openhome.cc/eGossip/OpenSCAD/lib-path_extend.html)

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -1,20 +0,0 @@
# circular_sector
Creates a circular sector. You can pass a 2 element vector to define the central angle. Its `$fa`, `$fs` and `$fn` parameters are consistent with the `circle` module.
## Parameters
- `radius` : The radius of the circle.
- `angles` : A 2 element vector which defines the central angle. The first element of the vector is the beginning angle in degrees, and the second element is the ending angle.
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
## Examples
include <circular_sector.scad>;
circular_sector(radius = 20, angles = [210, 310]);
translate([-15, 0, 0]) circular_sector(radius = 20, angles = [45, 135]);
translate([15, 0, 0]) circular_sector(radius = 20, angles = [45, 135], $fn = 12);
![circular_sector](images/lib-circular_sector-1.JPG)

20
docs/lib-pie.md Normal file
View File

@@ -0,0 +1,20 @@
# pie
Creates a pie (circular sector). You can pass a 2 element vector to define the central angle. Its `$fa`, `$fs` and `$fn` parameters are consistent with the `circle` module.
## Parameters
- `radius` : The radius of the circle.
- `angles` : A 2 element vector which defines the central angle. The first element of the vector is the beginning angle in degrees, and the second element is the ending angle.
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
## Examples
include <pie.scad>;
pie(radius = 20, angles = [210, 310]);
translate([-15, 0, 0]) pie(radius = 20, angles = [45, 135]);
translate([15, 0, 0]) pie(radius = 20, angles = [45, 135], $fn = 12);
![pie](images/lib-pie-1.JPG)

View File

@@ -1,18 +1,18 @@
/**
* circular_sector.scad
* pie.scad
*
* Creates a circular sector. You can pass a 2 element vector to define the central angle. Its $fa, $fs and $fn parameters are consistent with the circle module.
* Creates a pie (circular sector). You can pass a 2 element vector to define the central angle. Its $fa, $fs and $fn parameters are consistent with the circle module.
*
* @copyright Justin Lin, 2017
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib-circular_sector.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib-pie.html
*
**/
include <__private__/__frags.scad>;
module circular_sector(radius, angles) {
module pie(radius, angles) {
frags = __frags(radius);
a_step = 360 / frags;