1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 10:14:41 +02:00

support depth

This commit is contained in:
Justin Lin
2020-02-20 10:22:24 +08:00
parent 1e1f4c7d65
commit e56c12f7a6

View File

@@ -6,13 +6,15 @@ use <experimental/tf_ring.scad>;
levels : A list of numbers (0 ~ 255). levels : A list of numbers (0 ~ 255).
radius: ring radius. radius: ring radius.
thickness: thickness thickness: thickness
depth: the depth of the image
angle: arc angle. angle: arc angle.
twist: The number of degrees of through which the rectangle is twisted. twist: The number of degrees of through which the rectangle is twisted.
invert: inverts how the gray levels are translated into height values. invert: inverts how the gray levels are translated into height values.
*/ */
module sf_ring(levels, radius, thickness, angle = 360, twist = 0, invert = false) { module sf_ring(levels, radius, thickness, depth, angle = 360, twist = 0, invert = false) {
surface = _sf_square_surfaces(levels, thickness, invert); dp = is_undef(depth) ? thickness / 2 : depth;
surface = _sf_square_surfaces(levels, thickness, dp, invert);
rows = len(levels); rows = len(levels);
columns = len(levels[0]); columns = len(levels[0]);
size = [columns - 1, rows - 1]; size = [columns - 1, rows - 1];