1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-19 04:51:26 +02:00

support depth

This commit is contained in:
Justin Lin
2020-02-20 08:39:45 +08:00
parent 0dc533e681
commit fa71d252bf

View File

@@ -1,13 +1,14 @@
function _sf_square_surfaces(levels, thickness, invert) =
function _sf_square_surfaces(levels, thickness, depth, invert) =
let(
rows = len(levels),
columns = len(levels[0]),
offset_z = invert ? 0 : thickness - depth,
surface1 = [
for(r = [0:rows - 1])
[
for(c = [0:columns - 1])
let(lv = (invert ? 255 - levels[rows - r - 1][c] : levels[rows - r - 1][c]) + 1) // minimum level is 1
[c, r, lv / 255 * thickness]
let(lv = invert ? 255 - levels[rows - r - 1][c] : levels[rows - r - 1][c])
[c, r, lv / 255 * depth + offset_z]
]
],
surface2 = [