mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-20 05:21:38 +02:00
support depth
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
function _sf_square_surfaces(levels, thickness, invert) =
|
function _sf_square_surfaces(levels, thickness, depth, invert) =
|
||||||
let(
|
let(
|
||||||
rows = len(levels),
|
rows = len(levels),
|
||||||
columns = len(levels[0]),
|
columns = len(levels[0]),
|
||||||
|
offset_z = invert ? 0 : thickness - depth,
|
||||||
surface1 = [
|
surface1 = [
|
||||||
for(r = [0:rows - 1])
|
for(r = [0:rows - 1])
|
||||||
[
|
[
|
||||||
for(c = [0:columns - 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
|
let(lv = invert ? 255 - levels[rows - r - 1][c] : levels[rows - r - 1][c])
|
||||||
[c, r, lv / 255 * thickness]
|
[c, r, lv / 255 * depth + offset_z]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
surface2 = [
|
surface2 = [
|
||||||
|
Reference in New Issue
Block a user