1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-16 03:34:42 +02:00
This commit is contained in:
Justin Lin
2018-06-10 13:29:13 +08:00
parent 3050bee1d1
commit 0ed717a260
4 changed files with 11 additions and 17 deletions

View File

@@ -0,0 +1,7 @@
function __edge_r_begin(orig_r, a, a_step, m) =
let(leng = orig_r * cos(a_step / 2))
leng / cos((m - 0.5) * a_step - a);
function __edge_r_end(orig_r, a, a_step, n) =
let(leng = orig_r * cos(a_step / 2))
leng / cos((n + 0.5) * a_step - a);

View File

@@ -1,11 +1,3 @@
function __edge_r_begin(orig_r, a, a_step, m) =
let(leng = orig_r * cos(a_step / 2))
leng / cos((m - 0.5) * a_step - a);
function __edge_r_end(orig_r, a, a_step, n) =
let(leng = orig_r * cos(a_step / 2))
leng / cos((n + 0.5) * a_step - a);
function __shape_arc(radius, angle, width, width_mode = "LINE_CROSS") =
let(
w_offset = width_mode == "LINE_CROSS" ? [width / 2, -width / 2] : (

View File

@@ -15,6 +15,7 @@
include <__private__/__frags.scad>;
include <__private__/__is_vector.scad>;
include <__private__/__ra_to_xy.scad>;
include <__private__/__edge_r.scad>;
include <__private__/__shape_arc.scad>;
module arc(radius, angle, width, width_mode = "LINE_CROSS") {

View File

@@ -15,14 +15,7 @@
include <__private__/__frags.scad>;
include <__private__/__is_vector.scad>;
include <__private__/__ra_to_xy.scad>;
function __edge_r_begin(orig_r, a, a_step, m) =
let(leng = orig_r * cos(a_step / 2))
leng / cos((m - 0.5) * a_step - a);
function __edge_r_end(orig_r, a, a_step, n) =
let(leng = orig_r * cos(a_step / 2))
leng / cos((n + 0.5) * a_step - a);
include <__private__/__edge_r.scad>;
function arc_path(radius, angle) =
let(
@@ -35,5 +28,6 @@ function arc_path(radius, angle) =
m > n ? [] : [
for(i = [m:n])
__ra_to_xy(radius, a_step * i)
])
],
angles[1] == a_step * n ? [] : [__ra_to_xy(__edge_r_end(radius, angles[1], a_step, n), angles[1])])
) points;