mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-16 03:34:42 +02:00
refactor
This commit is contained in:
7
src/__private__/__edge_r.scad
Normal file
7
src/__private__/__edge_r.scad
Normal 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);
|
@@ -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] : (
|
||||
|
@@ -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") {
|
||||
|
@@ -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;
|
Reference in New Issue
Block a user