1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 18:24:28 +02:00

use range

This commit is contained in:
Justin Lin
2019-06-28 06:38:15 +08:00
parent 3b57412108
commit d9199bf9ed

View File

@@ -1,16 +1,17 @@
function px_sphere(radius, filled = true) =
let(range = [-radius: radius - 1])
filled ? [
for(x = -radius; x < radius; x = x + 1)
for(y = -radius; y < radius; y = y + 1)
for(z = -radius; z < radius; z = z + 1)
for(x = range)
for(y = range)
for(z = range)
let(v = [x, y, z])
if(norm(v) < radius) v
] :
let(ishell = radius * radius - 2 * radius)
[
for(z = -radius; z < radius; z = z + 1)
for(y = -radius; y < radius; y = y + 1)
for(x = -radius; x < radius; x = x + 1)
for(z = range)
for(y = range)
for(x = range)
let(
v = [x, y, z],
leng = norm(v)