mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 01:04:07 +02:00
provided supports for $fa, $fs, $fn
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* arc.scad
|
* arc.scad
|
||||||
*
|
*
|
||||||
* Create an arc. You can pass a 2 element vector to define the central angle.
|
* Create an arc. You can pass a 2 element vector to define the central angle.
|
||||||
* It provides a fn parameter consistent with the $fn parameter of the circle module.
|
* Its $fa, $fs and $fn parameters are consistent with the circle module.
|
||||||
* It depends on the circular_sector module so you have to include circular_sector.scad.
|
* It depends on the circular_sector module so you have to include circular_sector.scad.
|
||||||
*
|
*
|
||||||
* @copyright Justin Lin, 2017
|
* @copyright Justin Lin, 2017
|
||||||
@@ -12,13 +12,13 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
module arc(radius, angles, width, width_mode = "LINE_CROSS", fn = 24) {
|
module arc(radius, angles, width, width_mode = "LINE_CROSS") {
|
||||||
w_offset = width_mode == "LINE_CROSS" ? [width / 2, -width / 2] : (
|
w_offset = width_mode == "LINE_CROSS" ? [width / 2, -width / 2] : (
|
||||||
width_mode == "LINE_INWARD" ? [0, -width] : [width, 0]
|
width_mode == "LINE_INWARD" ? [0, -width] : [width, 0]
|
||||||
);
|
);
|
||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
circular_sector(radius + w_offset[0], angles, fn);
|
circular_sector(radius + w_offset[0], angles);
|
||||||
circular_sector(radius + w_offset[1], angles, fn);
|
circular_sector(radius + w_offset[1], angles);
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user