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

formatted code

This commit is contained in:
Justin Lin
2017-05-07 17:46:15 +08:00
parent 8f6baf623a
commit ce4b59e70f

View File

@@ -13,10 +13,8 @@
include <__private__/__frags.scad>; include <__private__/__frags.scad>;
module circular_sector(radius, angles) { module circular_sector(radius, angles) {
function unit_xy(a) = [cos(a), sin(a)];
frags = __frags(radius); frags = __frags(radius);
a_step = 360 / frags; a_step = 360 / frags;
m = floor(angles[0] / a_step) + 1; m = floor(angles[0] / a_step) + 1;
@@ -24,9 +22,11 @@ module circular_sector(radius, angles) {
half_a_step = a_step / 2; half_a_step = a_step / 2;
leng = radius * cos(half_a_step); leng = radius * cos(half_a_step);
function unit_xy(a) = [cos(a), sin(a)];
function edge_r_begin(a) = function edge_r_begin(a) =
leng / cos(m * a_step - half_a_step - a); leng / cos((m - 0.5) * a_step - a);
function edge_r_end(a) = function edge_r_end(a) =
leng / cos((n + 0.5) * a_step - a); leng / cos((n + 0.5) * a_step - a);