mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
use range
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user