1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-02-24 17:42:44 +01: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(
[
for(r = [0:rows - 1])
[
for(c = [0:columns - 1])
let(
lv = invert ? 255 - levels[c][r] : levels[c][r],
offset_z = invert ? thickness : 0
)
let(lv = invert ? 255 - levels[c][r] : levels[c][r])
[c, r, lv / 255 * thickness + offset_z]
]
],