1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-07 15:26:39 +02:00
This commit is contained in:
Justin Lin
2020-02-19 12:12:09 +08:00
parent 2ffe6b8e94
commit b08c2d482a

View File

@@ -28,15 +28,13 @@ module sf_square(levels, thickness, invert = false) {
] ]
]; ];
offset_z = invert ? thickness : 0;
sf_solidify( sf_solidify(
[ [
for(r = [0:rows - 1]) for(r = [0:rows - 1])
[ [
for(c = [0:columns - 1]) for(c = [0:columns - 1])
let( let(lv = invert ? 255 - levels[c][r] : levels[c][r])
lv = invert ? 255 - levels[c][r] : levels[c][r],
offset_z = invert ? thickness : 0
)
[c, r, lv / 255 * thickness + offset_z] [c, r, lv / 255 * thickness + offset_z]
] ]
], ],