1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 10:14:41 +02:00

changed to constant

This commit is contained in:
Justin Lin
2017-04-22 17:21:11 +08:00
parent 5a39e75ade
commit dec23f48e9
6 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ function circle_path(radius) =
let( let(
_frags = $fn > 0 ? _frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) : ($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, radius * 2 * 3.14159 / $fs), 5), max(min(360 / $fa, radius * 6.28318 / $fs), 5),
step_a = 360 / _frags step_a = 360 / _frags
) )
[ [

View File

@@ -14,7 +14,7 @@
module circular_sector(radius, angles) { module circular_sector(radius, angles) {
frags = $fn > 0 ? frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) : ($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, radius * 2 * 3.14159 / $fs), 5) max(min(360 / $fa, radius * 6.28318 / $fs), 5)
; ;
r = radius / cos(180 / frags); r = radius / cos(180 / frags);

View File

@@ -14,7 +14,7 @@
module ellipse(axes) { module ellipse(axes) {
frags = $fn > 0 ? frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) : ($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, axes[0] * 2 * 3.14159 / $fs), 5); max(min(360 / $fa, axes[0] * 6.28318 / $fs), 5);
step_a = 360 / frags; step_a = 360 / frags;
polygon( polygon(

View File

@@ -29,7 +29,7 @@ module line2d(p1, p2, width, p1Style = "CAP_SQUARE", p2Style = "CAP_SQUARE") {
frags = $fn > 0 ? frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) : ($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, half_width * 2 * 3.14159 / $fs), 5); max(min(360 / $fa, half_width * 6.28318 / $fs), 5);
remain = frags % 4; remain = frags % 4;
end_frags = (remain / 4) > 0.5 ? frags - remain + 4 : frags - remain; end_frags = (remain / 4) > 0.5 ? frags - remain + 4 : frags - remain;

View File

@@ -15,7 +15,7 @@ module line3d(p1, p2, thickness, p1Style = "CAP_CIRCLE", p2Style = "CAP_CIRCLE")
frags = $fn > 0 ? frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) : ($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, r * 2 * 3.14159 / $fs), 5) max(min(360 / $fa, r * 6.28318 / $fs), 5)
; ;
dx = p2[0] - p1[0]; dx = p2[0] - p1[0];

View File

@@ -14,7 +14,7 @@
module rounded_square(size, corner_r, center = false) { module rounded_square(size, corner_r, center = false) {
frags = $fn > 0 ? frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) : ($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, corner_r * 2 * 3.14159 / $fs), 5); max(min(360 / $fa, corner_r * 6.28318 / $fs), 5);
remain = frags % 4; remain = frags % 4;
corner_frags = (remain / 4) > 0.5 ? frags - remain + 4 : frags - remain; corner_frags = (remain / 4) > 0.5 ? frags - remain + 4 : frags - remain;