mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-31 02:10:28 +02:00
format
This commit is contained in:
@@ -24,8 +24,9 @@ function hollow_out_square(size, width) =
|
||||
rows = size[1]
|
||||
)
|
||||
[
|
||||
for(y = [0:width:width * rows - width])
|
||||
for(x = [0:width:width * columns - width])
|
||||
for(line = h_lines_in_square(width))
|
||||
[for(p = line) p + [x, y]]
|
||||
for(y = [0:width:width * rows - width],
|
||||
x = [0:width:width * columns - width],
|
||||
line = h_lines_in_square(width)
|
||||
)
|
||||
[for(p = line) p + [x, y]]
|
||||
];
|
@@ -20,14 +20,12 @@ else {
|
||||
}
|
||||
|
||||
module hollow_out_torus_knot(shape, p, q, phi_step, thickness, line_style) {
|
||||
function angy_angz(p1, p2) =
|
||||
let(
|
||||
dx = p2[0] - p1[0],
|
||||
dy = p2[1] - p1[1],
|
||||
dz = p2[2] - p1[2],
|
||||
ya = atan2(dz, sqrt(dx * dx + dy * dy)),
|
||||
za = atan2(dy, dx)
|
||||
) [ya, za];
|
||||
function __angy_angz(p1, p2) =
|
||||
let(v = p2 - p1)
|
||||
[
|
||||
atan2(v.z, norm([v.x, v.y])),
|
||||
atan2(v.y, v.x)
|
||||
];
|
||||
|
||||
function sects_by_path(shape, path) =
|
||||
let(
|
||||
@@ -37,7 +35,7 @@ module hollow_out_torus_knot(shape, p, q, phi_step, thickness, line_style) {
|
||||
],
|
||||
angles = [
|
||||
for(line = lines)
|
||||
let(a = angy_angz(line[0], line[1]))
|
||||
let(a = __angy_angz(line[0], line[1]))
|
||||
[0, 90 - a[0], a[1]]
|
||||
]
|
||||
)
|
||||
|
Reference in New Issue
Block a user