1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-03-14 02:59:42 +01:00

refactor out ptf_circle

This commit is contained in:
Justin Lin 2020-03-11 09:48:34 +08:00
parent 5033c415db
commit 4316b5dc61
2 changed files with 9 additions and 10 deletions

View File

@ -1,16 +1,7 @@
use <hull_polyline2d.scad>;
use <experimental/mz_blocks.scad>;
use <experimental/mz_walls.scad>;
function ptf_circle(point, offset) =
let(
p = [point[0] - offset, point[1] - offset],
n = max(abs(p[0]), abs(p[1])),
r = n * 1.414,
a = atan2(p[0], p[1])
)
[r * cos(a), r * sin(a)];
use <experimental/ptf_circle.scad>;
module circle_maze(start, r_blocks, block_width, wall_thickness, origin_offset) {
double_r_blocks = r_blocks * 2;

View File

@ -0,0 +1,8 @@
function ptf_circle(point, offset) =
let(
p = [point[0] - offset, point[1] - offset],
n = max(abs(p[0]), abs(p[1])),
r = n * 1.414,
a = atan2(p[0], p[1])
)
[r * cos(a), r * sin(a)];