1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-28 17:00:00 +02:00

We don't need slices.

This commit is contained in:
Justin Lin
2017-05-12 19:56:30 +08:00
parent 82d75662d7
commit 7a1855893c
2 changed files with 2 additions and 4 deletions

View File

@@ -9,7 +9,6 @@ Creates a rounded cylinder.
- `round_r` : The sphere radius which fits the edges of the bottom and the top.
- `center` : `false` (default), z ranges from 0 to h. `true`, z ranges from -h/2 to +h/2
- `convexity` : See [Rotate Extrude](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#Rotate_Extrude) for details.
- `slices` : The fragments of the rounded edge.
- `$fa`, `$fs`, `$fn` : Used to control the eight quadrants. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details. The final fragments of a sphere will be a multiple of 4 to fit edges.
## Examples

View File

@@ -13,15 +13,14 @@
include <__private__/__is_vector.scad>;
include <__private__/__frags.scad>;
module rounded_cylinder(radius, h, round_r, convexity = 2, center = false, slices = undef) {
module rounded_cylinder(radius, h, round_r, convexity = 2, center = false) {
is_vt = __is_vector(radius);
r1 = is_vt ? radius[0] : radius;
r2 = is_vt ? radius[1] : radius;
function is_integer(n) = n % 1 == 0;
function round_frags(sector_angle) =
slices == undef ? __frags(round_r) * sector_angle / 360 : slices;
function round_frags(sector_angle) = __frags(round_r) * sector_angle / 360;
function step_a(sector_angle, round_frags) =
sector_angle / round_frags;